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

    Riven

    i already a a hunch of that the carts braked a little to slow/fast technically missing the station when it stopped.
    oh well. upon reading i lowered the speedlimit from 0.4 to 0.1 to test and indeed. the trains now stop and can be launched properly. for now i suppose the workaround is to slow the trains down before they reach a station.


    Thanks for the help and after some toying around i got to say that this is one heck of a awesome plug.ever since MinecartMania went on hiatus ive been searching for a replacement and somehow always looked past traincarts(i thought it only linked carts, nothing else). now i can actually build working trains that make a hiss when they stop/leave. thank you very much for creating this and keeping it updated.
     
  3. Offline

    bergerkiller

    Riven I already fixed it here, but need to look at an odd train-break-apart bug first.

    A 'little' edit: check moving ;)
    http://pastie.org/3440341

    EDIT

    Uploaded beta 26, which fixes that non-responsiveness-issue and a random cart-break-apart issue when trains just got out of a curve and end up affected by a station. (I know, it's weird)
     
  4. Offline

    akrieger

    The 'new minecart's location should serve to communicate where the minecart will end up. You can assume there will be rails underneath where it ends up, but that's up to the user who built the rails.

    Also, I highly recommend figuring out a way to allow the teleport to succeed using Nethrar's methods. I've spent a lot of time getting the mechanics to work as smoothly as possible for the user and the server, and crossworld teleports get very tricky when there are people riding inside of the minecart. If you'll need more from me, let me know and we can work it out.
     
  5. Offline

    bergerkiller

    akrieger I see...
    Just in case I can drop the directional bit, does the yaw equal the direction of the minecart? Is the yaw 0 when it is supposed to continue north after teleporting? (you can expect the train to continue traveling at the same speed as it entered the portal)
     
  6. Offline

    akrieger

    I'd have to take in-game measurements to tell you what value it should be, sorry. I'll try to do that tonight. That yaw does equal the horizontal direction. I wish I'd written that code cleaner :/

    Also note, as I mentioned in the comments, that I actually teleport minecarts to slightly above the destination tracks, because otherwise they might fall through the floor due to Notch's code being silly with collision detection. So minecarts actually float for a fraction of a second after teleporting.

    If I've done my math right, with a pitch of 0, a yaw of 0 means West. A yaw of 90 means North, a yaw of 180 means East, and a yaw of 270 means South.

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

    bergerkiller

    akrieger ok, then I can use the FaceUtil.yawToFace(yaw - 90) on it to get the direction to spawn the train at.
     
  8. Offline

    akrieger

    Woah, FaceUtil exists? I should compare my math to that - the two should agree. Or is that one of your classes?
     
  9. Offline

    bergerkiller

    akrieger one of my many classes in BKCommonLib.

    Uploaded beta 27, which fixes the long loading times. (was an issue in the path finding, it now stores the nodes raw, not yml, and stores all connections, instead of only the neighbours, saving processing time)

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

    SupaYoshi

    Hey tiergerkiller! Just wondering are people able to stop a train by standing infront of it? Because I can see this happenign on my server, I just would love if it would override / kill / ignore them is that possible?

    Hey tiergerkiller! Just wondering are people able to stop a train by standing infront of it? Because I can see this happenign on my server, I just would love if it would override / kill / ignore them is that possible?

    Also is there a sort of check that would get a max amount of trains on the go, if you make use of a trainspawner.
    So it checks how many trains are riding there, so users can spawn trains themself, every reboot?
    I mean I do not want to keep chunks loaded because I use multiverse and my stations (trainspawn stations) are going to be close to spawn point of multiverse. and multiverse has a setting called keep spawn loaded, if i do that it lacks out my server.

    Im afraid this will happen if i use keepchunksloaded with TrainCarts so please tell me, is its possible to set the max spawned trains on track or something. :)
    This way trollers do not get the change to put 100 trains on it.

    Besides that I love your plugin so far! I keep saying wow wow wow !

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

    andrewpo

    Got the plugin to work again without crash on start/reload :)

    Thanks very much for your help.

    Edit your default properties YML file and set pushplayers/pushmobs to 'true'

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

    SupaYoshi

    Another question I have, are players able to spawn trains with the train spawner or do they need a permission?
    I do not want them to be able too, I just want them to wait on the train ;)

    is there a max train amount check though on the track? or not? if not its okay I will just spawn the trains.

    Say if I reboot my server, will the trains be removed?
    Thanks!
     
  13. Offline

    bergerkiller

    SupaYoshi
    - Trains are permanent and won't be removed (GroupData file)
    - Spawner sign checks if another train is present (can't interfere) before spawning
    - There is no spawn 'count' check (use redstone clock?)
    - You can use the detector sign to check if trains are on a set piece of track
    - You can use world permission plugins to block placement/interaction with the button
    - You need permissions to build spawner (all types of) signs.
     
  14. Offline

    Don Redhorse

    hmm wonder if it would be possible to block placement of minecarts...

    well of course globally sure, but more on official tracks... hmm...
     
  15. Offline

    bergerkiller

    Don Redhorse easily possible, just deny the interaction on those blocks in certain regions. Ask / look at the documentation of plugins.
     
  16. Offline

    Don Redhorse

    bah... I know that you could do regions, but do you want to configure those regions manually ?

    On the other side storing all the "official" minecraft tracks and looking them up would be crazy I guess.

    But I think you should integrate a global denyManualPlacingOfMinecarts , and have a perm which overrides it.
     
  17. Offline

    WongBoi

    I downloaded the plugin... and when i test it out , i make two minecarts collide , it doesnt even work....
     
  18. Offline

    bergerkiller

    WongBoi And what do you want me to do about it? (...........)
    Just post the TC version you used, What craftbukkit version you used and check if you have the required permissions. Simplest: make yourself OP and test it out that way.

    EDIT

    Crafter signs have been made :p
    You can now craft MULTIPLE ITEMS at a time, in a set order!
    First converts all logs to wood, then converts all wood to sticks, then converts all sticks and coal into torches. It is amazing as how well it works :D
     
  19. Offline

    JensDeMey

    How can I stop the train from TrainCarts with a "Hold for x" sign from MinecartMania?

    I tried the way below:
    I put a rail on an obsidian block and put a sign under it.
    "[train]"
    "station"
    "[Hold for 5]

    The countdown started but the train didn't stop.
    ---------------------------------------------------------
    Then the next question: How can I configure that the trains are deleted on black wool? I saw it in the german tutorial but it doesn't work.
     
  20. Offline

    bergerkiller

    JensDeMey do check the TrainCarts WIKI next time :)

    Don't power anything. Then trains will wait on the station for 5 seconds and continue in the same direction.

    And, I no longer use 'block type x does this'. Instead, place the required signs below the tracks. To remove a train:
     
  21. Offline

    andrewpo

    A bug you may or may not be aware of:

    (1) Spawn a cart with a sign
    Code:
    [train]
    spawn 0.5
    m
    [/train]
    (2) Cart stops on a station
    (3) Unload that chunk (go far away from it for a long period of time/logout for a bit)
    (4) Return.
    (5) The station doesn't seem to know it has a cart on it and will not launch it when you un-power one of the torches.

    worldguard, set a global flag of vehicle-place to deny.

    Loads of servers use worldguard, but very few exploit its full potential D:
    http://wiki.sk89q.com/wiki/WorldGuard/Regions/Flags

    If you don't have WG, I highly recommend it; just like I'd recommend TrainCarts to anyone wanting to make their own train network.

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

    bergerkiller

    andrewpo thanks for reporting, I'll look into that weird issue. I found that it didn't replace the minecart with a MinecartMember, so it is unable to find the cart at all. (when you break it, it drops two items, that proves my point)

    Must be something in the chunk load refresh event failing.
     
  23. Offline

    SupaYoshi

    Is there a reload command to reload the config? I dont want to reload my whole server

    thanks
     
  24. Offline

    bergerkiller

    SupaYoshi mmh not yet, but I'll add one in the next beta build.

    EDIT

    Reload what files exactly? It will reload the config.yml and DefaultTrainProperties.yml, but I have doubts with the Trainproperties.yml file.
     
  25. Offline

    andrewpo

    Thanks for the reply,

    Did you have any luck getting the pitch/yaw working on the player ejector sign?
     
  26. Offline

    bergerkiller

    andrewpo not yet, but thanks for reminding me. Need to add a max eject distance as well...
     
  27. Offline

    Blake380

    Hello, I was wondering if you would be able to solve the incompatibility between your Traincarts mod and Minecart Speed+. Our server would greatly appreciate it if you could.
     
  28. Offline

    bergerkiller

    Blake380 just use the TrainCarts version. After right-clicking a train, type:
    Then it will go at 0.7 blocks/tick. There is virtually no speed limit. I can't add support for that mod, since I have one speed limit for entire trains, while that mod affects a single minecart only.

    You can also use property signs to make only a certain track region have this property. (set to 0.7 and back to 0.4 afterwards)

    Use /train slowdown false to make them run infinitely without slowing down. (except when blocked by a block, booster rail or entity of course)
     
  29. Offline

    Blake380

    Ah, I didn't notice that before, thank you. c:
     
  30. Offline

    Don Redhorse

    I know that one.. but think about it... if you have straight lines it is fine... I personally prefer to let the minecart take the scenic route... similar to indiana jones ;-)

    but yeah.. probably together with direction signs the only real way..
     
  31. Offline

    SupaYoshi

    Hi my train carts are sticking together into 1 cart? Its not looking really nice :) What can I do to prevent this? Thanks!
     

Share This Page