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

    mugekun

  3. Offline

    PDemon

    well the idea for the stick using minecart would be in the "i can have it go just the range i wanted say like from my house the the main house .."sorry i know you really do not know the real range of this " but using one lump of coal is insane "sorry" since it is insane of me to use a minecart for the trip ...but being lazy is more then for me to sit by the PC it is a ingame brain-disorder aswell ;-)
    and for the not linked ...it seems the carts run over a unpowered rail , but it matters less since i just setup some useful stations (which takes up less space) :) Win Win but info i could use none the less ;-)
     
  4. Offline

    bergerkiller

    @mugekun
    1 Will be a bit hard to solve, since it is all in-memory and hard to bind to something when loading. Will probably not add persistence here...you can always trigger the station once more. (toggle lever)

    2. You can use ejection signs to eject the passengers, it also allows you to set an offset.

    3. Weird issue, I know, no idea what it is that causes it. I always go like 'wut?'. xd
     
    mugekun likes this.
  5. Offline

    mugekun

    1.) Damn, I was afraid you might say that. The setup I am trying to do has trains auto-launching, so there is normally not user intervention. I guess I'll have to work on an emergency switch to fix the stations after a server cycle. Or maybe I will just destroyall, cause the system will auto-recreate the trains in that case.

    2.) Yea, I do use ejectors in places, but the issue I get is that if a player gets in a train, then tries to get back out, sometimes the push code pushes them against the wall and they can't escape. It's really a matter of allowing graceful exit upon the players timing.

    3.) I think it might be related to speed. Now that you added the speedlimit sign, I think I'll try putting one in to slow the train. Should make the drop more suspensful too.

    Thanks again!

    @bergerkiller
    Is there something easier that could be done to solve the trains in station on server restart issue? I don't mind so much if they don't save their time.

    Just, if you could make it so on load it would check stations, and if there was a train in the station and the station has a timer, it starts the timer.

    For now, I can prolly get away with doing /train destroyall after a server restart. Though that kinda sucks...

    Thanks again.

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

    MatrixJ21

    @bergerkiller

    Hey there. I set up a [train] - trigger - test - 00:20, yet when I type %test% on a sign, nothing happens, and it does not display the time when a cart goes over the rail. Does the sign have to say anything in particular for it to work? Please help, I'm trying to get a fully functioning train system. Thanks :)
     
  7. Offline

    bergerkiller

    @mugekun I see...I'll add some more code so, when the plugin starts, it generates the signs underneath. Note that this may increase loading times...

    @MatrixJ21 You need to power the trigger sign too, or it won't work.
     
    mugekun likes this.
  8. Offline

    MatrixJ21

    Thank you for telling me, I feel so stupid :D
     
  9. Offline

    bergerkiller

    @mugekun I got to say: thank you for requesting that. Without your impulse I would have never noticed groups being made with dead carts. It's not really an issue, but it saves CPU when the cleanup task has to do this the hard way. Also, when the plugin starts (when a group is made) it will update the signs, so stations work now. Note that, if used with continue/reverse, this will fail. (it does not know what direction the train came from before). It works excellently with the simple one-way launching system.

    EDIT

    Updated it.
     
    mugekun likes this.
  10. Offline

    MPKaboose

    for some odd reasons every time I reload the server all the trains are gone (plugins I got: eMobLite, Residence, dynmap + this) CB 1317, TC 1.42 1.44
     
  11. Offline

    bergerkiller

    @MPKaboose try re-download it, latest version is 1.44, you got 1.42 :)

    @mugekun It will always launch the train, except if it is set at brake mode. Continue/reverse are the only modes that could fail, where they launch in the wrong direction. It should still launch though. Not sure what happens there, perhaps a detailed 'what I did and when it fails' could help so I can debug on my side. All I know is that the 'GROUP_ENTER' event is not received by the station.

    @MPKaboose From that log I saw it didn't even find the 'trains.groupdata' file, so it is obvious that trains disappear. Can I see the part of the log where you stop the server/reload, to see the messages before disabling?
    (BTW: I expect that the OS is bugging you, the disable log could clarify that)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Sep 9, 2018
  12. Offline

    MPKaboose

    did but same result
     
  13. Offline

    bergerkiller

    @MPKaboose could you post the log output from the server? (Code block please)
     
    MPKaboose likes this.
  14. Offline

    mugekun

    Awesome! Thank you very much. Though, I am not sure if it is working. Is it supposed to work on stations that are powered on both sides, but that have right or left specified? (which is the scenario I'm using)

    3Q!
     
  15. Offline

    MPKaboose

    Code:
    2011-10-22 18:57:33 [INFO] Starting minecraft server version Beta 1.8.1
    2011-10-22 18:57:33 [INFO] Loading properties
    2011-10-22 18:57:33 [INFO] Starting Minecraft server on *:25565
    2011-10-22 18:57:33 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-1126-g35eac7a-b1317jnks (MC: 1.8.1)
    2011-10-22 18:57:33 [INFO] Preparing level "world"
    2011-10-22 18:57:33 [INFO] Default game type: 0
    2011-10-22 18:57:33 [INFO] Preparing start region for level 0 (Seed: 4542207252272496756)
    2011-10-22 18:57:34 [INFO] Preparing start region for level 1 (Seed: 4542207252272496756)
    2011-10-22 18:57:34 [INFO] Preparing spawn area: 28%
    2011-10-22 18:57:35 [INFO] [eMob Lite] v0.5.3 - Enabled
    2011-10-22 18:57:35 [INFO] [Residence] Loaded...
    2011-10-22 18:57:35 [INFO] [Residence] Enabled! Version 2.4.2 by bekvon
    2011-10-22 18:57:35 [INFO] [dynmap] Using Bukkit Permissions (superperms) for access control
    2011-10-22 18:57:35 [INFO] [dynmap] Loaded 12 shaders.
    2011-10-22 18:57:35 [INFO] [dynmap] Loaded 56 perspectives.
    2011-10-22 18:57:35 [INFO] [dynmap] Loaded 7 lightings.
    2011-10-22 18:57:35 [INFO] [dynmap] Loaded 2 maps of world 'world'.
    2011-10-22 18:57:35 [INFO] [dynmap] Loaded 2 maps of world 'world_nether'.
    2011-10-22 18:57:35 [INFO] [dynmap] Dynmap WebServer started on null:8123
    2011-10-22 18:57:35 [INFO] [dynmap] version 0.23 is enabled
    2011-10-22 18:57:35 [INFO] [TrainCarts] File not found, it is not loaded: plugins\Train Carts\arrivaltimes.txt
    2011-10-22 18:57:35 [INFO] [TrainCarts] version 1.44 is enabled!
    2011-10-22 18:57:35 [INFO] Server permissions file permissions.yml is empty, ignoring it
    2011-10-22 18:57:35 [INFO] Done (0.224s)! For help, type "help" or "?"
     
  16. Offline

    mugekun

    Very odd. It is working on 3 stations.
    But there is at least 1, maybe 2, I can not get it to work on.

    Testing by waiting for train to enter station.
    Stopping server with stop
    Starting server back up
    Logging in and waiting.

    At least 3 stations very consistently start the train back up.
    One however very consistently never start the train back up.

    I even tried moving the sign over by one, and also putting it facing the opposite side of the track and switching the launch direction accordingly, still no.

    Is there anything I can do to help debug this? Would access to the server help?

    Thanks again for all of your time and efforts.
     
  17. Offline

    MPKaboose

    that was the full log (from new start to end) also I'm using Windows 7 (x64) if that might be a problem
     
  18. Offline

    bergerkiller

    @MPKaboose aaah that explains. You need to perform /stop in the console and then close the window, or nothing gets saved. (using /stop is a golden server rule, unfortunately not all gui wrappers/services do this when you stop the server. Instead it kills the process, which is very VERY bad)
     
    MPKaboose likes this.
  19. Offline

    MPKaboose

    works now... and will keep that golden rule in my head from now on, I didn't even know it existed, thanks allot :)
     
  20. Offline

    HajdaM

    First, thanks for this great plugin. I sorry if I'm asking for something, which was already discuses here.

    I came to the problem, that I don't want on SMP server, that carts would form the train every time they will collide, especially when two players in single cart will collide unintentionally. Therefore I would like you to add option for "locomotive mode", which would be using Powered Cart as some kind of locomotive.

    As I'm sure you might not have much time to work on this, for the most simple task, it would just modify single rule, where two single carts form the train only when at least one of them is powered cart.

    If you would be willing to go beyond that, I think it would be useful to have ability to lock train simply by adding even number of powered carts (including destroying single locomotive from train) to set train to fixed state. You would have to add locomotive to allow to extend train again, if needed. This would allow trains to collide without forming joined train, but I'm sure this task would require additional work to store count of powered carts in train and I'm also aware, that there are now some commands to make trains fixed.

    You might also be able to come up with some other solution to given problem, so let me know, if there is better solution.
     
  21. Offline

    bergerkiller

    @HajdaM Ow it's not too hard, good suggestion. I 'know' everything of the train: the carts, properties, location, velocity, direction, signs underneath, everything. Adding this check is very simple: simply use the train properties to find out if either of the trains have the 'requirelocomotive' property set, and if so, check if either of the train have a powered minecart. Good suggestion, don't be shy to ask! :)

    EDIT

    Made, I'll update it.

    EDIT

    updated. See the new 'requirePoweredMinecart' property -and- commands on the WIKI. You can set it to true in the defaultflags.yml file to make newly-made trains have this property.

    (also re-upload, forgot to properly set properties on the removed separate bits of the train)
     
  22. Offline

    HajdaM

    It seems to be working. Thank you very much. Only when I destroy powered cart, the rest of the train produces sound like relinking, but it doesn't seem to have impact on its functionality.

    I guess, for the request on even number of powered carts to prevent linking, I should use /train link instead. I was considering to come up with request to allow linking with powered cart only from the side there it pulls to avoid joining two trains, but that is also covered by that command and I also like to have empty cart on the front of the train for the best view ;-) But you might reconsider something like that if you are going to provide plugin for single player mode, where issuing commands is not available feature by default.
     
  23. Offline

    MatrixJ21

    Hey, I have another problem or two. How do I stop people pushing the train when it is at a station? It causes the train to mess up and leave early or even just stop altogether. Another thing, when the plugin is started again, is there a way the dev can make it resume it's journey, or perhaps just go back to the station it last visited and it restarts automatically. Thanks for listening to my stupid questions :)
     
  24. Offline

    bergerkiller

    @MatrixJ21 You have to set 'atStation' to true, see the WIKI. You can also use the property signs to set the 'pushing' state manually, and set it to true when heading towards the station and to false when going away from it. Or set it to true all the time. You can use the 'directional' sign feature for that.

    The second one is probably a bit hard, but train tags (used to find the destination) are persistent, so no problems there. It also auto-starts the train up. However, it can be that the train stops because the chunk it is in, is not loaded.
     
  25. Offline

    EliteASH_11

    You sir ... Are amazing.
     
  26. Offline

    DamienMine

    Thanks! You're right. Everything fine as it is supposed to be. Keep up the good work!
     
  27. Offline

    glarter

    @bergerkiller
    I'm having some trouble with the TrainSpawner sign.

    I've a north-south track which leads into a station. I've placed a sign facing north with

    [train]​
    spawn 10​
    m​
    on it. When I use a button to activate redstone to call a mine cart, the minecart is spawned heading south instead of north.

    This happens whether the sign is facing north or south, regardless of whether the sign is powered from the north or south. Any ideas?

    (I've added you to my Skype btw and I can give you access to the server if you want to take a look at the setup).
     
  28. Offline

    bergerkiller

    I am not sure if spawner signs under corner sections work, my guess is that this is not the case. It's because of the fixed NWSE system, it has no north-west etc.
     
  29. Offline

    glarter

    That's the thing, it isn't on a corner at all. It's sitting under a straight piece of track.
    The only way I've been able to make it work in the direction I want (i.e.North) is to place a powered rail next to a block to force the minecart to 'bounce' out.
     
  30. Offline

    glarter

    Hey @bergerkiller

    Just for your reference, here's the layout of my test station.
    [​IMG]
    As well as the main problem where the spawner sign is spawning the cart southwards despite the position and facing of the sign/redstone; I've got something else which is puzzling me.

    There's a station sign with redstone on each side. In order to launch the cart from the station, I have to flick a switch. Ideally I'd prefer to use a button to switch off the left hand torch but when I do, it seems to cause the cart to travel backwards about half a block.
     
  31. Offline

    bergerkiller

    @glarter update on the spawn signs issue:
    - Minecarts that spawn on south-aligned tracks face south, never north
    - I use the minecart's initial yaw when launching (setForwardForce)
    - The initial yaw does not appear to be changed when initing the train *is happening
    - Result: yaw is always south, so always launches there (?)
    I'll see if I can make it use a set yaw when making the minecart.
    Might just use the station launching mechanics to achieve the same.

    You can set a minor delay if you have issues with redstone and timing. Then it will wait for, for example, 1 second. And if in that time the direction changes, it will use the new direction. Can be very useful.
     

Share This Page