Inactive [MECH] TrainCarts v1.71.2 - Link minecarts of different types together to form trains [2222]

Discussion in 'Inactive/Unsupported Plugins' started by bergerkiller, Aug 3, 2011.

  1. Offline

    bergerkiller

    [​IMG]

    After a request from Marius A. Winsjansen I started to work on linked Minecarts. On the first day I already managed to make multiple carts move with the same speed, but a long list of bugs was to be expected. After fixing lots of bugs, adding lots of (complicated) Minecart handling functions and after hours of testing on my local server, this plugin is finally ready for a stable release! :D

    Also, special thanks go to @Shamebot for helping me out several times. :)

    Description:
    For a lot of information about TrainCarts see the WIKI page!

    Configuration and permissions

    All configuration nodes can be found in config.yml and contains a description with it. Permissions can be found in PermissionDefaults.yml, combined with a description.

    Media:

    Early development video (Photobucket)

    Video displaying version 0.6 of this plugin (YouTube)

    Video displaying version 1.0 of this plugin (YouTube)

    Video displaying version 1.1 of this plugin (YouTube)

    Video displaying version 1.2 of this plugin (holy...)


    A tutorial video in German explaining various sign-circuitry of TrainCarts


    PhotoBucket Sign system tutorial videos (also linked in the WIKI pages)
    Train spawner / Stations / Stations2 / Arrival signs / Train teleportation / Track switcher based on tags / Destinations / Blocker
    Video of how the switcher, station and destination signs work together

    Side information:

    It works best on straight lines with not too much elevation changes followed up by sharp corners. As long the cart gap can be adjusted, everything goes fine. It had some collision issues in the past, but I fixed all of that by manipulating the actual Minecraft server native code. I added links in the source where this was appropriate. Sharp 'U'-turns cause individual carts to lose perceptive of their direction. Keep at least one piece of track in between corner sections! Trains are stored on-disk when reloading and stopping the server, so expect trains to be there when you return.

    Important when updating: do one reload to save all trains, then replace traincarts.jar, and then do another reload. This next reload will probably cause a noClassDefFound exception (since the old jar got replaced), this is why a pre-reload is required. Replacing the jar without reloading is a very bad idea: it will cause a lot of runtime exceptions. Best is of course to stop the server and start again, but this is not always possible.

    This plugin is made compatible with Minecart Mania. If you notice a certain feature of Minecart Mania is not compatible with TrainCarts, notify me and I'll fix it. :)


    Known bugs:
    - None.

    TODO:
    - Train-sign message handling using SignLink (low priority)
    - Minecart use permissions (for individual carts?) such as Storage Minecarts

    Commenting

    If you encountered a bug, post exactly what you had done and in what order. Even a slight wobble can help fixing bugs. When posting (long) errors I recommend you to post everything, don't cut it off. I work with native methods, so in my case these lines are important. For comments on the media content see YouTube, it also contains a description with the music name when music is used.

    Bug reporting (extend)

    1. Post the Craftbukkit version you are using (the first info message in the console)
    2. Post the log from where the first plugin gets enabled to the 'done'.
    3. Post possible errors in this log too (don't cut them short)
    4. No error? Still post the log. Also explain how I can reproduce it, you can use screenshots
    5. Before reporting, remove ALL plugins other than TrainCarts and try again. If it works then, find out what plugin is interfering and post that here. I can add support.
    6. ALWAYS use the latest recommended Craftbukkit build with this, or my methods may just fail because of renamed functions.

    Important links:

    Request thread
    TrainCarts on BukkitDev for download and more
    TrainCarts source and more on GitHub
    TrainCartsBlocks add-on source and more on GitHub
    SignLink Bukkit page (required to use Arrival signs)
    MyWorlds Bukkit page (required to use Portal train teleportation)

    notice: try to keep SignLink/MyWorlds up-to-date to prevent compatibility issues.

    Installation for those that don't know how

    1. Download and install the latest craftbukkit version
    2. Download the latest TrainCarts version
    3. ^ Save the archive (zip file) to your computer
    4. ^ Open the archive you just downloaded
    5. In the folder your server sits in, create the plugins folder if it doesn't exist
    6. Open the plugins folder
    7. Move the TrainCarts.jar file found in the archive into the plugins folder
    8. Run your craftbukkit server and look in the console/log for possible errors, and/or if the plugin is enabled.

    Changelog

    Show your appreciation for my plugins by donating
    [​IMG]
     
  2. Offline

    robxu9

    :D
     
  3. Offline

    crosstalk

    I'm seeing some sort of dupe bug... when I added this to my server, and ran a test, my 3 minecarts (1 normal, 1 chest, and 1 powered cart) became ~20 carts (it seems random how they were duped, not always duping the whole train, bit it might've done so a couple of times).

    It was not client-side -- relogging did not solve it. Further, removing the plugin did not remove the minecarts.

    I'm running Spout, TrainCarts, CraftBukkitUpToDate, BigBrother, NoWeather, LagMeter, mobchange, SpoutCoords, ConsoleFilter, LogBlockQuestioner, PluginReloader, AnimalCompanion, LogBlock, and dynmap on my server. It is a standard CraftBukkit 1337 server.

    Is this a known issue?
     
  4. Offline

    bergerkiller

    @crosstalk It was a known issue, but it should have been fixed a long time ago. When does this duping happen exactly?

    Also, does removing Spout and/or SpoutCoords fix this issue, or not?
     
  5. Offline

    Sneaky420


    Updated, and the error is gone, but now all of my train spawners are spawning all the carts ontop of eachother on a single track rather then making a whole train... :( help please

    The config is new, and the distance between the carts doesnt really seem to be in "meters" but I corrected it. Just gotta adjust the stations a bit
     
  6. Mmmmh...... Loaded the 1.46... Ran ok, but suddently got disconnected, server went off... When restarting, 12721 minecarts were loaded... Can't start my map anymore actually... So I go back on 1.45
     
  7. Offline

    bergerkiller

    Sometimes I wonder how everyone manages to run into the same issue while it refuses to 'come up' on my test server...sigh EDIT
    Did get one 'spark' of what you meant, and yes, it suddenly added 183 minecarts and hidden the minecarts :confused:
    Weird stuff gets weirder every day...

    EDIT

    Only seems to happen at teleport signs for now...probably infinite teleport or something
     
  8. Yeah, that's what happened actually, while I was trying to reproduce the bug after getting the server up again. I sent a minecart toward a portal, and somehow it stopped on it, and a mate connected at this very moment and asked me why the hell I made a pill of hundred of cart in front of the portal. I could for myself not see them, I was sitting in a minecart in the middle of the darkness. So somehow it duplicates them managing to crash the server.
     
  9. Offline

    bergerkiller

    @Psychokiller1888 Yup, same here. Infinitely increasing pile of minecarts. It seems as if it is spawning a new minecart for every new minecart spawned...it's really weird. Now tracing it back to where it happens...

    I already know it is calling the vehicleCreate event, which is used replace a minecart. Weird is, that it has a check against already converted minecarts. Only possibility:
    - It is spawning regular minecarts for no apparent reason

    EDIT

    It is repeatedly unloading and loading groups, causing this. But why it keeps unloading is a mystery...

    EDIT2

    Ok I discovered what was going on:
    Now going to remove the create event and check against 'if a player is given' instead.
     
  10. Offline

    Sneaky420

    Yea, all the signs for the spawners were working before I updated, and they were facing the right way, but Now I have a different issue, the stations are not braking the train like it should. The train just coasts threw the station now :(

    Sign:

    [train]
    station

    there is redstone powering bother sides, and again it was working before I updated today, and all 12 stations are effected the same way


    Well found out that the powered carts work now without fuel in them... that is why it would not stop, still messing with the new config cause they are still not pushing ppl away and remaining in the station, so, fun times hehe
     
  11. Offline

    bergerkiller

    Weell stick to 1.45 for now then, I'll upload a newer version once these issues are resolved.

    EDIT

    I got that duplication issue resolved. What was going on, was actually too obvious to miss it. It was not exactly as described above:
    I had a global 'isDisabled' for it before...but it was kinda the wrong way to do it, I had to fix it at the source: prevent instant conversions after undoing replacement!

    ok fixed all known bugs and updated to v1.47. Also altered the pushing feature for a bit. Instead of having 'atStation', you can now set pushing for both normal and at stations.
    Only the default (first three) can be set through property signs, for station settings you'll have to use commands.
    etc.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  12. Offline

    Sneaky420

    Ok so this is driving me crazy.... could there be an option to make the powered cart just for looks? i changed its boost to 0.0, but the train doesnt lock to the station anymore, and i can just push it away, or with the powered cart, it slowly just tugs itself away.

    so, what am i missing? all i want is the train to stop at the station, and then stay there till the button is pressed to "release" the train in the direction that the input says... this is what i have:

    defaultflags:
    default:
    owners: &id001 []
    passengers: &id002 []
    allowMobsEnter: true
    allowPlayerEnter: true
    allowPlayerExit: true
    allowLinking: false
    requirePoweredMinecart: false
    trainCollision: true
    keepChunksLoaded: false
    tags: &id003 []
    speedLimit: 0.4
    slowDown: true
    destination: ''
    pushAway:
    mobs: true
    players: true
    misc: true
    atStation:
    mobs: true
    players: true
    misc: true
    admin:
    owners: *id001
    passengers: *id002
    allowMobsEnter: true
    allowPlayerEnter: true
    allowPlayerExit: true
    allowLinking: false
    requirePoweredMinecart: false
    trainCollision: true
    keepChunksLoaded: false
    tags: *id003
    speedLimit: 0.4
    slowDown: true
    destination: ''
    pushAway:
    mobs: true
    players: true
    misc: true
    atStation:
    mobs: true
    players: true
    misc: true

    Config:
    normal:
    cartDistance: 1.5
    cartDistanceForcer: 0.1
    turned:
    cartDistance: 1.6
    cartDistanceForcer: 0.2
    nearCartDistanceFactor: 1.2
    removeDerailedCarts: false
    maxCartDistance: 4.0
    breakCombinedCarts: false
    spawnItemDrops: true
    poweredCartBoost: 0.0
    exitOffset:
    x: 0.0
    y: 0.0
    z: 0.0
    pushAwayForce: 0.2
    pushAwayIgnoreGlobalOwners: true
    useCoalFromStorageCart: false
    setOwnerOnPlacement: false
    use: true

    Sorry for the same, but the code boxes don't work right for me it seems, but any help would be great, I love the plugin sooooo much, just really bummed that now that it just is not working the same way it was :( and I am sure it is something I am doing wrong (normally the case).

    I have the current CB of 1337.

    Thank you in advance for any assistance you may offer.
     
  13. Offline

    bergerkiller

    Actually...oops. Ok lemme just quickly re-upload 1.47. Forgot that 'ignoring forces' should also happen when the train is at a station, without a velocity target being active. As soon the train stopped...the powered cart would kick in.

    EDIT

    @Sneaky420 Ok re-uploaded it. Try again. (The GitHub version that is)
     
  14. Offline

    crosstalk

    Okay, 1.47 seems to have fixed the issue (unless it's rare, and just _happened_ to happen the first time... but it's probably fixed.

    I'll also confirm (for anybody looking at this in the future) that it appears to fix powered minecarts (which can't normally push east-west).

    Thank you!
     
  15. Offline

    bergerkiller

    @crosstalk lol they don't push east-west in vanilla? ... :rolleyes:
    And yeah, in this plugin minecarts are actually bound together, they influence each other. When one powered minecart decided to move east/west/north/south, it automatically reflects these changes in the other carts, since the forward force is shared.
     
  16. Offline

    crosstalk

    Cool... and yup, it's a bug in vanilla Minecraft. This bug is very annoying when you're building a 3km rail link that's mostly E/W...

    Thanks again.
     
  17. Offline

    Sneaky420


    K updated, and still able to push the train around (EDIT: push it as it is moving, before it would shove me out of the way), and at the station, the powered cart makes it wiggle, but stays till i push it. Also I will just report back as things happen, as you are rather active for an author and it wasnt me that caused the error :)

    O sure, i comment that you are active and it seems you went to bed... hope for a fix soon

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  18. He's human, not a machine either...

    Thanks for all the fixes, i'll give a try again for 1.47

    EDIT

    Tested, works fine, there's no teleport problems anymore, booster are ok etc etc, as always, good job. Now the little remaining bugs are:

    - On portal train teleports over long distances, you're not launched in the right direction, in the mean the side the sign faces. Can be fixed with a little rail loop on both sides.

    - Duplication of minecart over the spawn signs even though short ONE redstone signal. Might come from narrow space, but weird enough, it occurs only at my central station, and the construction is exactly the same on every other stations. Looks like the minecarts is not launched on the right direction, the direction the sign faces. Well, more than one, destroy signs also kills them all, so it's not so bad.

    - Seems like sometimes, over long distance train teleports, you're not spawned in the minecart actually, but simply on the ground, seeing helplessly your cart going away. Walking is healthy they say...
     
  19. Offline

    bergerkiller

    @Psychokiller1888 Both the teleport and spawn issue are due to trying to spawn a train upwards. After spawning the train, the yaw of the train is (re)set, causing it to go the opposite direction. I'll store and use the yaw correctly.

    Not sure about the 'not entering' thing, does it happen before or after teleportation? (Do you teleport to the other side, but don't enter?)
     
  20. Offline

    crosstalk

    I'm still learning how to use this, and am wondering if there is a way to activate and deactivate all the powered carts in a train, apart from manually starting each of them (I suspect that if this is possible, it can be done using the "station" system).

    Is there a way to do this?
     
  21. Offline

    bergerkiller

    @crosstalk no real way, no. How would you want to disable a powered minecart (=remove it's 'coal')?
     
  22. Offline

    crosstalk

    @bergerkiller
    Okay, not a big deal
    I don't get the question exactly -- are you asking how I think it should be set up from a UI standpoint if implemented?

    Thanks for the help.
     
  23. Happens seldom, hard to catch any constant on the problem, maybe client sided actually, I doesn't follow the quick change. But you sit in a cart, go through a portal, you're teleported to the other portal, somehow fall through your cart, stand on the rails and the cart goes away. Meaning maybe there's a synchro missing or synchronized methods?
     
  24. Offline

    bergerkiller

    @Psychokiller1888 spooky ...
    I'll just increase the tick delay between arriving at the new spot and entering the train, should solve that issue some way or the other. Could be a client issue yes.

    @crosstalk You want to disable powered minecarts, how would you want to do this? Through a command? A sign underneath the tracks? Clicking the powered minecart? - with a specific item in your hand? Other?
     
  25. Offline

    crosstalk

    A sign underneath the tracks would be nice.

    It probably puts too much into the station system (which is already packed to the brim with features), but maybe an option for stations to start and stop all powered carts in a train would be nice (they would be synchronized and run in the same direction as the commanded train motion).

    For example, if I understand the station system correctly, you could add another parameter to the third line, namely "P". If the third line contains "P" (it could contain a delay as well), then it will control powered minecarts automatically as well. Existing stations will retain their behavior, but if you were to make a sign reading the following:
    Code:
    [train]
    station
    5 P
    left
    then it would shut off the powered minecarts on the track, stop the train for 5 seconds, then start the powered minecarts up again, going to the left.

    Not having looked at your code or extensively used this system, I don't know how feasible this is -- feel free to take it or leave it.

    Thanks.
     
  26. Offline

    bergerkiller

    @crosstalk this should already be done to powered minecarts: as soon the train enters the station sign, it disables the powered minecarts in the train. As soon the train leaves it again, they are re-activated. So, what exactly do you want to happen then? Stop powered minecarts forever? It is possible to send fuel into all powered minecarts through a sign, if you mean that.

    Also, fixed the teleport and spawn issues, built a completely revised system for it: MinecartGroup.spawn(locs, types, force)
     
  27. I don't think it needs a parameter for that, I merely think that acording to the delay setting and my logic, poweredcarts should also be stopped as well, as everything that rolls on the rails, for the specified delay. And that's already working.

    If you want another idea: Find a solution to give coal to spawned poweredcart or fill the chestcarts at spawn. Maybe with a chest beside containing coal refilled by the users. You know, connect with redstone the spawn sign and the chest or something like that

    [train]
    spawn 10 5

    Would take five coal to power the poweredcart. It's just an idea, nothing I'm waiting on acually, I'm not using the poweredcarts.
     
  28. Offline

    Sneaky420


    Yes yes, i just thought it was funny that as I made the comment, he left... I do customer service for a living, and I understand that he is not a machine, just after refreshing the page for 3 hours to relize the time...

    Anyways, keep up the good work, and as far as the powered carts go, being able to disable the ones that are part of a train, threw the config would be nice. There really isnt a point for the powered cart with the powered rails now, so at lest for me, I just put in all powered rail (creative server), the powered cart for me is for looks.
     
  29. Offline

    bergerkiller

    @Psychokiller1888 That's a little over complicated...doesn't Minecart Mania have a way to deposit coal to powered minecarts from chests? Would be easier to have that after the spawner or something.

    @Sneaky420 another nice suggestion, I'll add a property to set if powered minecarts are active.
     
  30. Offline

    crosstalk

    Oh -- I guess there's been a miscommunication. This is what I was thinking when I said:
    I guess that I was right in thinking that your station system can do this.

    Cool, I'll try it out (I haven't had the opportunity yet to build a station. I'll have to set something up just for testing). Thanks!
     
  31. Offline

    Sneaky420

    Cool, thank you, and was there any suggestions as to why I am still able to push the train out of a station, or if I stand on the tracks with a train coming, it jsut bounces off me and sends it back, is there a permissions node to disable to pushaway? Also, i think I am using the trains in a not so intended way, and when the server is back up, I will show you a pic of the factory, there the trains are like robots :)

    But yea, the only things that I have not been able to fix is the push away on the trains doesnt seem to be working, and the powered carts that you have added the option for.

    Thank you for all of your work on the plugin.... and anyone that can program is part machine... hehehe ;)
     

Share This Page