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

    CommanderGizmo

    bergerkiller
    But what if redstone is turned off between carts? For example, if I build an intersection with different rules controlled by redstone. Thus there are four switcher signs in a column for one track switch. I then enable or disable the redstone current to them to choose which set of rules apply. Presumably, if the first sign is disabled or comes up with all false evaluations, then the next sign in the column will get tested.

    If, however, a train goes through and the track is switched, what happens if the signs are then disabled?

    Another example to clarify when this might matter:
    I have a bidirectional track with diversion sidings for oncoming traffic. In such a case you would put detectors around the shared track segment, which generates a redstone current when activated. This current is then applied to a sign to switch the track so that one train is sent (via direction testing) to the siding. All is well. However, when the detector region is cleared and the current is released, what is that state of the track? As it stands now, it is undefined; meaning you cannot assume a particular setting as it depends on the last train that passed through.

    Perhaps I'm just missing something and you can point me in the right direction.
     
  3. Offline

    bergerkiller

    CommanderGizmo you can add a second switcher sign with alternative options then. There is no rule that only one switcher sign can toggle track; you can add hundreds of them. Then you invert the power of one of them and there ya go: Redstone based alternatives as well. You can give the last sign a simple l:true to make it switch to one side permanently.
     
  4. Offline

    CommanderGizmo

    bergerkiller

    Ok, that oughta work. So a switcher/detector sign does not send out any redstone current without a switch placed for it's output, correct?
     
  5. Offline

    bergerkiller

  6. Offline

    reeZZer

    Hello,
    i got a problem, i've created a long track with tunnels and all and on the first Station a Train Spawner and the end Station a Signlink trigger to see when the Train arrives.

    When i power the Spawner the Train will spawn and start moving but once i am outside the chunk region the cart will just dissappear and won't move anymore, only if i go back the the chunk (station) he starts moving.

    So my question, is there a way that the train will move/drive no matter is no players is near or not ? so i can make like 4 trains which r automaticly drives to the stations and passenger can enter.

    One more thing: Why stops/slows down the train on "Gravel" ? i couldn't find any info that your Plugin uses blocks.

    Thanks in advance.
     
  7. Offline

    bergerkiller

    reeZZer yup, that is what 'keepChunksLoaded' is for. See the WIKI to set it, you can also set it true by default in DefaultTrainProperties.yml, or add a property sign after the spawner to set it.

    I don't know about gravel, AFAIK I didn't add slowing-down systems for blocks (yet).
     
  8. Offline

    CommanderGizmo

    I'm running into some more confusion. Perhaps you can clear it up for me?

    I've got a station that is in a loop off of the main track:
    Code:
    T = Track
    P = Platform (Station)
    S = Switch
     
            This Switch
                v
    TTTTSTTTTTTTTSTTTTTTT
        T        T
        TTTTTTTPTT
    
    I want all trains to enter the station from the same direction. If I place a directional sign for the switch for incoming trains to always go right when passing the first switch into the station coming from the right in the diagram above, any train leaving the station will read the sign as parallel and also follow the statements on the sign. How do I get around this conflict?


    Also a feature request or two:
    1. Can you set an option in the config to only allow engines to pull coal from storage carts directly connected to them?
    2. Can you prevent the engines from taking coal from the storage cart unless they need to be moving? As it is now, they appear to take coal continuously when waiting at a station. It'd be much better on our coal supply if they took the coal when it was time to get underway, or basically only when they are moving.

    bergerkiller
    That makes sense to me. So now the signs will not be directional at all? That would make this system much for flexible. If, then, we don't put any directions in the [train] on the first line, does it default to all directions? Can we use all of the directions on the first line?
    Code:
    l = left
    r = right
    f = forward
    b = backward
    n = north
    s = south
    e = east
    w = west
    
    Do I have that right?

    How do we determine what does and does not override the pathing when a destination is set? For example, what if I want all carts to turn right unless they have a (any) destination set? Can I use r:[email protected]* ?

    I'll see if I can find a few minutes to put together a screen shot of the sideways sign problem.

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

    Skyve

    Is it possible to use a conditional eject on a single track?
    It seems I only have an option of building an extra track and then using switchers to eject players at a station...

    While we're at it, is it possible to have a conditional destroyer as well?

    And is it possible to get coal from another linked cart (as in the post above)? Is this behavior described somewhere?
     
  10. Offline

    bergerkiller

    Skyve yes you can use redstone to add conditionals to ANY sign. That is what the switcher is for: use it with other signs to add conditional removal, ejection, transfer, elevator, property setting and others.

    CommanderGizmo You will need two switcher signs underneath there, that's for sure. One to send trains from the left towards the station, one to send them back to the right from the station. Powered minecarts already only take coal from carts connected. (neighbouring). And yeah, when they are not moving it should not subtract fuel, right now it takes fuel away even when waiting.
     
  11. Offline

    CommanderGizmo

    The trouble I'm having is that a sign set for a certain direction in a switcher (ie, facing the direction the train is coming from) is perceived by a train coming from the side as being parallel to the tracks. Thus, it seems impossible to use direction based signs that are only read from that direction. What am I missing?
     
  12. Offline

    Skyve

    But when I try a setup like this http://www.minecraftwiki.net/wiki/File:Track_switcher_example_1.png , nothing happens (even the lever is not switched).

    Has anything changed since this screenshot was placed there?

    And how can an unpowered switcher cause any effect at all? On another page I've seen a rule that there can be no empty blocks between a sign and rails - how would blocker work in that case?
     
  13. Offline

    bergerkiller

    CommanderGizmo ow in that case that is wrong, it should not trigger the sign when looking at it 'sideways'. The main idea is that it only triggers it when looking at the FRONT. I'll look into this then.

    Skyve Mh yes that got changed, switcher signs now HAVE to face the train. (this to ensure directional systems work correctly). Lever placement can be a bit tricky, especially if you have two signs facing the same way. You can try to fix it using some redstone wire. I am considering to add additional sign parameters on the sign to set the directions the sign activates. It's full as is, so I'll have to see what I can do...

    CommanderGizmo Skyve I have attached an example new syntax for the switcher sign. As you can see, you can set on the first line what directions this sign is activated by (first line is basically general settings in this case), second line sets the type of sign system to create, third and fourth are optional arguments. As you can see, empty trains are sent forwards (into the screen) and otherwise the backwards version is used. (out of the screen)
    View attachment 9343

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

    Skyve

    Ok, that definitely works better. But what about T-intersection switchers facing AWAY from the train (as in the second picture from the wiki). Will their support be phased out or is that an acceptable deviation?

    Also, your video there is now obsolete as well.

    The latest screenshot system is a bit confusing. What would the syntax be like if we want to activate on left and forward incoming and send powered to right and empty to back?
    Like that?
    Code:
    [!train:lf]
    switcher
    r:powered
    b:empty
    Where will all the other cases be directed?
    Is it possible to specify all 4 incoming directions? Or stack switchers vertically with separate configs for each direction?
     
  15. Offline

    bergerkiller

    Skyve if there is no track piece above the sign, there is no 'from' facing available, and the facing is inverted. That is why the 1:1 switcher still works like that. Will probably keep that in there.

    And yes, you can extend the amount of statements by adding another sign underneath. Every line starting with lrfbnesw: will be read and handled. To set the default, end with a f:true line to always use that as alternative.

    CommanderGizmo I guess I will add a 'd' direction to make the destination system set the direction to use. After switcher you can define what others to default to.
     
  16. Offline

    reeZZer

    Hello,

    about the Money /Switcher Sign we've talked about a few days ago , when could u add this feature?

    Thank you in advance.

    I can wait btw :p
     
  17. Offline

    bergerkiller

    reeZZer working on the things <around> this feature first. Remember I said that I made statements subclasses of the 'Statement' class? Well, this was a first step to add a single StatementMoney extends Statement class.

    First need to fix up the actual formatting though. Value evaluation is already working, tested using the newly added 'trainsize' statement. For example:
    Would make all trains with size greater or equal to 2 go left. Money will work the exact same way, if you have any other comparison-with-value requests, feel free to reply.
     
  18. Offline

    CommanderGizmo

    bergerkiller

    How about these?
    1. passengers (passenger count)
    2. mobs (mob count)
    3. players (player count)
    4. minecarts (minecart count)
    5. storagecarts (storage cart count)
    6. engines (furnace cart count)
    7. [email protected]>=xx (number of specific items on the train/cart)
     
  19. Offline

    Skyve

    I can think of a "distance to nearest set destination sign" (distance between a train and closest sign that has the same destination and where the train would be going on a regular switcher) comparison in blocks. Since the pathfinding system appears to check for destination only within loaded area where the train is, it shouldn't be too taxing.
     
  20. Offline

    bergerkiller

    CommanderGizmo good idea, I'll add all of them which currently only has contains :)

    Though items is a bit tricky, I'll see what I can do about that.
     
  21. Offline

    _frozen

    1) So let me clarify this: all unpowered switchers are now required to face the trains at all costs?

    2) I am looking into remote control to run the system, but it seems that since I placed those trains down in order to rename them and set them, it does not "launch" the carts when I power a sign away from it with maxspeed .4 or speedlimit .4 is there a way for them to launch with a single sign?

    IDEA: have the sign parse the remote signal sign (for example: [t train0-10]) will enable/disable trains 0 to 10 without having 10 signs at all times.
     
  22. Offline

    bergerkiller

    _frozen no, I am now implementing (partly implemented) a full new syntax system. It works as follows:
    This way you can still use the 'detect both directions' system, but if there is some sort of 3/4-way or curved track above, it will not do this. Alternatively you can define the directions to watch on the first line.

    Somewhat hard to do, but I guess I can try rebuilding the station sign to do that. I will make it act as if it is at the train front cart position, launching accordingly.

    Though I like the parsing system, it is kind of impossible as people can name the train like that too. However, I could try and use *-tags around it. For example:
     
  23. Offline

    _frozen

    Thats doable. All I care is those unpowered, dummy switches keep doing what it has been doing since in the same places. (Most of them are just handling destination-based switching; no power needed)

    Perhaps a "remote launch" command? [train]/launch will act like how the station launches. 3rd and 4th line can be used for special conditions. I just dont know how to properly handle it within the current system, hence my question.

    That works well-- I personally name trains according to their respective lines.
     
  24. Offline

    false_chicken

    I love this mod! Great job! The cart physics are awesome I just have one issue. My friend and I wanted to create a train system to go between our towns on a schedule automatically. It works fine when we are both logged in and at our towns but has problems if only one of us is logged in or the other is off somewhere else. The carts never return! I am assuming it is because they are hitting unloaded chunks during transit. To solve that I tried using ForeverALoad but it doesn't work. It reports that the chunks are stopped from being unloaded but the carts still don't return. I have to fly over near the other station and see if the train even made it to the station. It didn't lol. When I see the area load the carts are almost there and continue moving as usual. If I follow the carts they work fine. I do not know if it is a problem with ForeverALoad or what. Or if ForeverALoad works with the carts. The dev mentioned that crops do not grow, maybe carts don't move as well. Any suggestions on achieving my goal would be greatly appreciated :) Thankyou.

    Running Bukkit-1.2.5-R1.0-b2149
     
  25. Offline

    bergerkiller

    false_chicken No need to get another plugin for that, TrainCarts can automatically keep nearby chunks loaded. See the 'keepChunksLoaded' property for trains, and the command:
    You can also set this to true in the default train properties.
     
  26. Offline

    false_chicken

    Hmm... It was set to true but my trains never made it back. I ended up installing RollingMinecarts and it started working lol. That in conjunction with your plugin has allowed me to set up a pretty awesome train system. Much better than I could have ever expected :).
     
  27. Offline

    bergerkiller

    false_chicken what size of train failed to function using the built-in system? (only need to know if it was one cart or multiple)

    EDIT

    Actually, I found out why it failed...lol. It was doing the chunks check before the actual movement, so after the movement was done it failed to load the chunks as there is no next physics run. Feel free to test the chunk loaded feature in the next version.
     
  28. Offline

    false_chicken

    I most certainly will lol. I would much rather one plugin to do the job.
     
  29. Offline

    bergerkiller

    Aaand updated to 1.66. Now time to update the WIKI pages (especially the train format and statements), as those got changed quite heavily.

    Wooh boy where do I get started...the switcher format is almost like a programming language. :eek:
    I tried to put it up as simple as possible, but all is so versatile. Hopefully the statement examples help people understand operators and @ arrays...

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

    _Alf

    Could it be a coincidence that it's slowing down "just" on gravel? Tried another block than gravel?

    Maybe defining a trainflag might help: "slowDown: false" :)
     
  31. Offline

    reeZZer

    At the moment i tried Sand and other blocks which r not "fixed" like stone, every blocks works but on Gravel the Cart starts throttling and after the max speed it will go slower slower slower and then he stops.

    Settings are: Maxspeed 0.8 - Slowdown: false - Push->Players:true,Mobs:true,Misc:true

    Maybe i got other Plugin which uses this Blocks for something special (i got Boatmania as example).

    But except the Problem with Gravel i must say this is the best Plugin i ever saw for Minecarts , it rocks :D
     

Share This Page