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

    SinCalChewy

    You might have the same problem/issue that I was having. When you spawn a train via a sign and don't set an owner, by default trains are globally owned (therefore everyone owns them and can claim them). The owners of the train can stop the train, so therefore everyone can stop the train. If you set the default train properties to a non-existant owner (I have mine set to "null"), it will then push players as well because the train isn't owned by that player. You can also do as berger said, and make it so the train pushes the owners as well via the config. If you do that however, you can't make it so it doesn't push owners if you don't want it to (I believe), whereas if you set it to a fake player, you can just set the owner to a real player via a property sign ingame and make it so it doesn't push them.

    Both collision and pushing were working fine on 1.71.2 with our large railway system before we moved to 1.3.1 on my server.
     
  3. Offline

    BomberBram

    Does the plugin for 1.3.1?
     
  4. Offline

    bergerkiller

    SinCalChewy ah yes, you are correct. Non-owned trains are owned by everyone, and thus everyone can stop the train. Forgot that this could be related to spawn signs.

    BomberBram Again, not yet.
     
  5. Offline

    BomberBram

    I mean, you do plan to make it for 1.3.1,
     
  6. Offline

    bergerkiller

  7. Offline

    BomberBram

    bergerkiller xD I do not think this is fine and nice plugin so am glad he is for 1.3.1, D
     
  8. Offline

    Leviathanss

    bergerkiller Nice to see you are gonna make it for 1.3.1
    its 1 of the nicest plugs out there :)
     
  9. Offline

    tfh dino

    hey bergerkiller... i love your traincarts plugin and i started to build an automatical chest/minecart storage system on our server with traincarts.
    now some of our players couldnt wait to update their minecraft client so i was forced to update our server, too...
    after i ve read the posting over mine i am glad to see that you re working on an update for mc 1.31 ...

    but do you know when you can finish your work?

    cause we cant go on without traincarts, our members are crying and i dont want to use an other plugin ... there was a lot of work in our storage system about hundrets of signs we placed there...
    thanks a lot and goodbye
     
  10. Offline

    panurg

    Hi Mr. Bergerkiller,
    i know I'm late but never the less i wanted to say happy anniversary to this grrrrrreat plugIn. ;)

    A little thing with your route finding algorithm might be buggy, best thing, you take a look at it yourself.
    Please contact me, if you want to see it (Bukkit 1.2.5-R5.0), also BKLib is installed as you can see on this pic:
    Bergerkiller.png
    Also i had some ideas combining station and destination signs, but i think this takes a little bit hard to explain.

    Yours, panurg
    (GER)
     
  11. Online

    timtower Administrator Administrator Moderator

  12. Offline

    SinCalChewy

    That would make the system harder for new users. Don't fix what isn't broken, if you ask me. :)
     
  13. Offline

    bergerkiller

    Don't worry about it, all 1.3.1 errors are already fixed and I can already use TrainCarts without problems on the 1.3.1 server. I am right now fixing some final issues people reported, like 90-degree placed signs sometimes failing.

    panurg Yeah it had it issues in the past, but most times if not always you can fix it using /train reroute. Any ghost nodes will then get erased. (I can't go and monitor every single block change to adjust the path finding, that would kill the server). I did want to merge destination and station together, but the problem is...well...it's only 4 lines to use lol. I guess I can, as an experimental version, add a 'deststation' sign action which does the following:

    What this would do is this:
    • Acts as a destination
    • Will automatically send trains into the direction to go to the destination
    • Will set the new destination like the other did
    It IS possible, the only issue is that there is no room to put a direction to launch to. (the continue/left/right/etc bit) I can rely on redstone and make that mark the direction. If no delay is set, it will not function as a station. No one has to be afraid of incompatibility.
     
  14. Offline

    panurg

    Hi there,
    my original plan was to make the "advanced" destinations dependent to the train's name, e.g.
    ICE 125 starting at

    Main station going to Airport via
    -Station A
    -Station B
    -Station C...

    so that it will take the named stations because of it's name.
    --> Procedural tracking dependent on train's name.

    Also what i saw possible to implement (am a bad coder and especially not in java) are several tracks in a station acting equal to each other with preference on a certain track (i'll explain...)

    For a new deststation sign i'd suggest:
    With tracknumbers the example you can see above might be:

    <Main station#7
    -Station A#2
    -Station B#2
    -Station C#1
    -...
    >Airport#4

    Ugh, i forgot to go closer...

    If for example track 2 at Station A is full, the train will take track 1 or 3 and so on, because they are equal.
    Suppose this might be more interesting for admins or ambitious train fanatics :D.
    Further those settings can be stored in a .txt or .yml file like the arrivaltimes. Also it could be linked to SignLink acting like display the trains name (2nd line) to final destination (3rd line) via interstation(s) (4th line).
    I'd leave the 1st line free in order to display the station's own name and track number...

    View attachment 10764
    (Has to be at first line of those signs; station created somewhen in Jan 2012 with successfully running TrainCarts)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 14, 2016
  15. Offline

    bergerkiller

    panurg So basically, upon entering a certain sign, it will look ahead at all possible 'next' destinations it can go, and pick the first destination that is not occupied? Basically a 'pick any next possible destination that matches this name'.

    I could add a destination switcher. You can place regular destination signs below the tracks named 'however you want', and I can add this sign to pick the next destination:
    It would then look ahead to find all destinations it can reach, filter the ones starting with 'MainStation#' (the * can be anything, it's how that format works) and then pick the closest (least cost) destination that is not already occupied by a train.

    Do note that this feature can already be achieved without destinations. Just line up a bunch of detectors at each platform. Wire the lever to the tracks to toggle them 'away' when the lever is down. When the train then arrives to reach a destination, it will first go along all the tracks that are turned on/off by the detectors, until it reaches the first lane that is not powered.

    (do note that I rather have people use the same features to do what they want instead of making hundreds of mini-features which can also be done using a combination of other features.)
     
  16. Offline

    sambot1115

    Sweet, the only plugins my server has left to update are this one and nolagg, and because you own both and are online, my server should be up to date soon. Thanks for your ongoing commitment to developing plugins!
     
  17. Offline

    bergerkiller

    sambot1115 haha no problem :)
    Initially I didn't even expect CraftBukkit would get updated to 1.3.1, just as surprised the team managed to cope with the massive updates...
     
  18. Offline

    rossyduck

    Bergerkiller,

    Some isues with the latest version of Bukkitcraft.

    11:16:35 [INFO] [Train Carts] Enabling Train Carts v1.71.2
    11:16:35 [SEVERE] java.lang.Exception: Field 'a' does not exist in class file 'EntityTracker'!
    11:16:35 [SEVERE] at com.bergerkiller.bukkit.common.SafeField.<init>(SafeField.java:25)
    11:16:35 [SEVERE] at com.bergerkiller.bukkit.tc.controller.MinecartMemberTrackerEntry.initFields(MinecartMemberTrackerEntry.java:27)
    11:16:35 [SEVERE] at com.bergerkiller.bukkit.tc.TrainCarts.enable(TrainCarts.java:325)
    etc etc

    and on shutdown

    [SEVERE] Error occurred while disabling Train Carts v1.71.2 (Is it up to date?)
    java.lang.VerifyError: (class: com/bergerkiller/bukkit/tc/controller/NativeMinecartMember, method: postUpdate signature: (D)V) Bad access to protected data
    at com.bergerkiller.bukkit.tc.storage.OfflineGroupManager.hideGroup(OfflineGroupManager.java:352)
    etc etc


    Keep up the great work !.

    Similar problem for traincartblocks although might be because I have removed traincarts until errors resolved.

    [INFO] This server is running CraftBukkit version git-Bukkit-1.3.1-R1.0-b2320jnks (MC: 1.3.1) (Implementing API version 1.3.1-R1.0)
    11:48:21 [SEVERE] Could not load 'plugins/TrainCartsBlocks.jar' in folder 'plugins'
    org.bukkit.plugin.UnknownDependencyException: Train Carts
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:195)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:222)
    at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:198)
    at net.minecraft.server.ServerConfigurationManagerAbstract.<init>(ServerConfigurationManagerAbstract.java:50)
    at net.minecraft.server.ServerConfigurationManager.<init>(SourceFile:11)
    at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:105)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:380)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
    11:48:21 [INFO] [bPermissionsWebGUI] Loading bPermissionsWebGUI v2.0

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 14, 2016
  19. Offline

    bergerkiller

    rossyduck I am working on 1.3.1 version still, the latest uploaded atm does not work with that version (for obvious reasons)

    EDIT

    I uploaded a test version for CB 1.3.1 so people can run TrainCarts at least. There may be some logic bugs I haven't spotted, at least it doesn't instantly crash once you place a minecart or move one. If you spot anything odd, report it :)
     
  20. Offline

    rossyduck

     
  21. Offline

    tfh dino

    i ve installed the test version ... it works but theres one problem in it... the switcher signs arent working correctly... in combination with destination signs the carts are following a wrong direktion... maybe it is cause the signs were on my map before i install the test version?
    i hope not cause then i have to place about hundret of signs again ...
     
  22. Offline

    bergerkiller

    tfh dino you never have to, switcher sign data isn't stored. You can use /train reroute to let TC recalculate the path nodes automatically, so you can try that first. That replacing bit is only the case for automatic train spawner signs and detector signs, as they store data off-site.
     
  23. Offline

    tfh dino

    i ve already tried to reroute several times ... maybe there is something wrong in my system i will check this out today evening...
     
  24. Offline

    SinCalChewy

    I'm running the 1.3.1 test version on my server and haven't noticed any big real bugs. The only thing I did notice, and I'm not sure if it's the plugin, me, my server, or what (but it just started happening since 1.3.1, so I'll put it out there), but sometimes going around the corners the carts will come out of it incorrectly turned. As in, you'll be going straight with the cart still sideways looking like it's turning. Seems to just be a visual bug as the train is still moving, and once again not sure if it's even related to the plugin and it normally will fix itself after a few seconds of being bugged, but it just started happening with this version. Never had it do that before.
     
  25. Offline

    bergerkiller

    SinCalChewy mhh yes I've seen this too. The entity tracker (which updates the train to the clients) sometimes gets out of synch and ends up derailing the cart...but on the server it's still correct though. I need to fix it...

    EDIT

    I think I have fixed the issue. It clearly had to do with the train unloading while driving, or when the server freezes for a split second. I removed a teleport call in the tracker constructor, and it seems to have fixed it thus far.

    Uploaded test version 2. It (attempts to) fix the client bugging issue, though it seems to be an issue in NoLagg. (it is not keeping enough chunks loaded...need to fix that). Also fixed a directional problem: certain signs after a corner weren't working.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 14, 2016
  26. Online

    timtower Administrator Administrator Moderator

    I want to prevent that my trains are turning left on a 4 way intersection, what do I need to put on the switcher sign?
     
  27. Offline

    bergerkiller

    timtower you can use the directionale for this. Place the sign facing into the direction the train comes from. Put this on the sign:
    It will send the train to the right. Forward (f) is also possible. If you want to prevent trains going left when path finding is involved, you can use the blocker sign to block that path. On the left side, put this sign attached to the rails:
    It will block all trains coming from the right. Place it so that this direction matches properly.
     
    timtower likes this.
  28. Online

    timtower Administrator Administrator Moderator

    bergerkiller now I can use it to create a railway between my towns and spawn, now waiting for wireless redstone to update and then my theme park is open again :D

    p.s. deze plugin is echt handig
     
  29. Offline

    rossyduck

    [quotergerkiller, post: 1269282, member: 96957"]Uploaded test version 2. It (attempts to) fix the client bugging issue, though it seems to be an issue in NoLagg. (it is not keeping enough chunks loaded...need to fix that). Also fixed a directional problem: certain signs after a corner weren't working.[/quote]

    It is still an issue but not so bad. The traincart seems to glide along its own path and then resyncs with the track. Am running Test2 version with the latest bukkit dev build. Not running nolagg.
     
  30. Offline

    likemike2

    its works fine. but when minecraft version 1.3.1 comes its doesn't work anymore, please help me.
    and the wiki page doesn't exist.
     
  31. Offline

    bergerkiller

    likemike2 You used the 1.3.1 test version? Also, you need to use the top link on this page. The other ones are outdated because of Bukkit WIKI deleting everything...
     

Share This Page