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

    Snipes01

    Well that is where I was...I'm not trying to be difficult.

    This link is broken: http://wiki.bukkit.org/TrainCarts-Plugin/Permissions I assume because it was moving to the mc wiki. So where is the section for permissions? I can't find it.

    Like here: http://www.minecraftwiki.net/wiki/Bukkit/TrainCarts/Commands
    I would think they would be there, but they were not. I didn't want to guess that they are something like traincarts.destroyall.

    Do you see what I mean? I've done this many times before so its not new, but with each plugin handling things differently. I can't just guess.
     
  3. Offline

    CommanderGizmo

    I posted the small changes to source that will resolve the issue with the logs some time ago. Were you also referring to the issue with the wrong data values? It just seems like a simple save/load issue with the flat files.
     
  4. Offline

    dibujaron

    bergerkiller normal as in not automatic? yes. when someone's in the train or someone's near the far station, it runs flawlessly. just to check I got a chunkload plugin that makes chunks of your choosing stay loaded and made that station always be loaded. hasn't failed yet.
     
  5. Offline

    Sveken

    Ok,
    When i stop the server. (with /stop so im doing it right) when the server starts again and i try to launch a train with a station sign. the train is broken apart with the front cart ghosting through the rest of the train.
     
  6. Offline

    bergerkiller

    Sveken could you still move the other carts of that broken up train? No glitched carts as in, you can't move them?
    It breaks apart like this if the rails between two carts no longer connect. Was this at a junction/T-split? Does this happen all the time when you stop the server, or was it rare?

    Of course, I will do a station check myself.

    CommanderGizmo no that was an error in BKCommonLib. It didn't set the data itemstack field when transfering between two IInventories, such as storage minecarts.

    dibujaron Problem with most of those plugins is that they keep a 7x7 area loaded, while only a 5x5 area is really needed. Problem with a smaller area is, of course, that you have less room for error...after the position changes, it HAS to check for chunks to load.
     
  7. Offline

    SinCalChewy

    1.69 is working great so far, however I can't seem to get Detectors working right. I have the permission for them, yet when I place one with just [train] detector, nothing happens. No confirmation like other signs, nor does it react to trains. Am I doing something wrong here, or did something change? Note: I do have two detectors set up, facing each other, with levers, yada yada. :)
     
  8. SinCalChewy
    Have you powered the sign if not use [!train]
     
  9. Offline

    bergerkiller

    SinCalChewy it is not your fault, there is a clear bug. I used mode == NONE instead of != NONE...sow yeah...that is a huge fail on my part. I'll fix it tomorrow in a 1.70, anything else that has been spotted?
     
  10. Offline

    SinCalChewy

    Ah, okay cool. :)
    Makes me feel better knowing I'm not missing something. haha

    Nah, not as of yet. So far so good, minus the detector problem. :)
    Thanks!

    Though, any chance of someone explaining the wait sign or updating the wait sign wiki page? I wanna test it out, but I'm not quite sure how to go about doing so. Lol
     
  11. Offline

    Snipes01

    Does anyone have an answer for my question about permissions? Are there any permission nodes? I can't find that information.
     
  12. Offline

    T3452

    When I reload the server, the trains all connect and stuff up
     
  13. Offline

    bergerkiller

    Snipes01 open up PermissionDefaults.yml in the plugins folder. All permission nodes are there with a description.
     
  14. Offline

    Snipes01

    I looked at that when I first loaded your plugin. Its might just be me being silly, but I don't fully understand.

    So this file
    Code:
    # Below are the default permissions set for plugin 'Train Carts'.
    # These permissions are ignored if the permission is set for a group or player.
    # Use the defaults as a base to keep the permissions file small
    train:
      command:
        rename:
          description: The player can rename his owned trains
          default: true
      build:
        announcer:
          description: The player can build a sign that sends a message to all the players in a train
          default: op
      place:
        minecart:
          description: The player can place minecarts
          default: true
      properties:
        admin:
          description: Carts placed by this player get the admin properties
          default: op
    
    Okay so either there are no permission nodes and you just use this file to tell who can use what or there are permission nodes and I have to guess what they are..(is it tc.admin or it could be traincart.admin or it could be train.admin). For the information provide I still have no idea how this plugin handles permissions.

    Please don't think I haven't done this before. I've been doing this since 1.6 so I understand it for most part, but this is either a lack of documentation or just me being stupid and not seeing it.
     
  15. Offline

    _frozen

    1) Does the detector signs work weird if you nested them inside each other? Example: D===D1===D1===D, or will the inner detector signs include the outside signs?

    2) THANK YOU FOR THE AUTOSPAWN TIMERS!!!

    3) Is there ANY way for me to have every train on the system stop at the next station and destroy themselves? I BELIEVE its possible through remote control, but I would like to brainstorm how to apply this... I do have magictorches enabled, so I could link every single station torches to a single switch.

    However, would be neater if there was a command to send to trains (even easier: ALL trains) to stop at the next station and commit seppuku. The reason I was thinking about this is ebcause my server has an automated restart schedule, and every time it restarts it messes up the whole automated system. And since I had an primitive timer signs installed (theyre now no longer needed), I end up with a server with 1500+ carts jammed up. So, would be nice to be able to "flush" all carts before the server restart and allow the server to renew itself.

    Honestly, if you want suggestions, I have so much to ask for yet I dont want to burden you :(
     
  16. Offline

    Sveken

    Out of a 16 Cart Train 12 of them buged out (as in couldn't move at all)
    When i hit the Go button the train well, implodes in on it self (the first cart goes backwards) It is a 50/50 chance when i restart the server.
     
  17. Offline

    bergerkiller

    Snipes01 you have to use the latest snapshot of CraftBukkit. Older versions have a bug in the configuration (which I reported and had been fixed). It caused it to only add a single key per node in the tree.

    _frozen No, it only works between two detectors. You will have to put two detectors at the same location (basically a wall sign to a block) tomake them detect each other. Although, it could be one detector sign can be added twice, but I doubt it will work without glitching.

    You can use remote control destroy signs to destroy all signs, but that is pretty unrealistic. You can use my plugin, Redstone Mania, to have a wireless redstone connection between the sign and a button. There are probably also other plugins out there that allow you to make wireless redstone. I think that is the easiest method. (then you can globally switch all switches)

    Of course, /train destroyall is also an option, but it is a drastic measurement. I can add a *-style system for the remote controlled signs so you can globally set all trains to have a certain destination. I think this would be the simplest and most elegant solution.
    Alright you can now remotely apply a sign on multiple trains. I initially wanted to do this, but never really implemented it. Was simpler than I thought. Basically, you can use the same tag expression pattern to set stuff on trains. For example:
    Would announce this message to all trains named inter<something>1. For example, interstate1 and intercity1 would both get this message. This should make it a lot easier to recall all trains, as long as you name your trains properly of course.

    About the naming: I think a counter would be useful. Right now there isn't even a way to rename trains through signs, so I will add that too so you can put that after the spawn signs(s). It will have a counter as follows:
    # would be filled in with a number. This number is the first number from 1 > which does not exist yet.

    EDIT

    All done. Remote control now affects multiple trains and you can rename trains using the name/rename/setname property. See the updated WIKI. This should make recalling all trains a lot simpler, because you can use naming conventions to recall groups easily.

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

    Sveken

  19. Offline

    bergerkiller

    Sveken ah so it is a very long train..I only tried with 3-cart long trains lol. I'll make a huge train at a station and check if I get any issues.

    Btw: When you use /reload, does it happen then too? Or not?
     
  20. Offline

    Sveken

    /reload doesn't seem to.

    also some more info it seems to start from the chest connected to the furnace chest, (i have it set to pull coal out of it)
     
  21. Offline

    bergerkiller

    Sveken Mhh I tried what you had, but I saw no difference or breaking up. Since you explained it happened when stopping the server, what comes to mind is plugins unloading worlds. What plugins do you use? Does this happen with only TrainCarts installed?

    Sveken also, just in case, make sure you have the latest version of BKCommonLib installed (is included in download, latest is 1.22)
    Someone else had an onDisable issue when using 1.21 for some reason. Could be a bukkit bug.

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

    Sveken

    I use the Following Plugins
    bpermisions
    chatlogging
    Coreprotect
    Craftipedia
    dynmap
    Essentials
    FakeOP
    iConomy
    MobBounty Reloaded
    MobCatcher
    MuddersMilk
    NoCheatPlus
    Orebfuscator
    RealPlugin
    RealShop2
    Repair Chest
    Residence
    SpoutPlugin
    Vault
    War
    Weed
    worldedit
    WormholeXtreme
    xauth

    The only plugin i have that effects the world is Orebfuscator. but that's only to players.
    I haven't tested with only Traincart (it is a bit hard to do in my case)
    Also after more testing it is consistently the furnace cart and the chest cart at the front

    I will redownload and give that ago

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

    _frozen

    Any Update for this? Im really looking forward to the train-specific naming system.

    Also: how would you "announce" the train's destination with something nicer than the destination code system? Is there a way to change the variable via Signlink with the upcoming train naming system?

    Example:
    Train with destination BX (in the Brookside Line) fires up an detector, detector fires up a sign that sets the new variable (for example: b01 = Brookside Station and g01 = Glenmont Station) In this case, it fires up an detector for b01, and b01 sets a "clean-looking" variable? Is this currently possible with your plugins, or do I have to incorporate something else?

    Also: whats the status on the waiter sign?
     
  24. Offline

    bergerkiller

    _frozen V1.70 has the naming system already. You can use property signs to rename trains.

    I believe you can obtain the destination using the trigger sign as well. SignLink can alter this. So two signs:

    Will first set the trigger to update for mainStation, altering %maiNStation%, %mainStationD% and %mainStationN%


    It is not possible to use SignLink in detector/switcher signs right now, but you can read the destination of a train and send to proper directions this way. That one does not use *-codes tho.

    Waiter sign is a bit of a problem right now, got no good-working solution for it. It can easily keep distance between two trains on one lane, but it is impossible to make trains wait at an intersection. For now, use detector signs + switcher sign to do this.
     
  25. Offline

    rcth

    Hi,

    I have a plugin request for you.
    My friends (and I) are using this plugin to create rollercoasters. Just using station, maxspeed and so on. We wanted to create a launch coaster, but we have a request for that.
    If a launched coaster launch too slow, it won't save it to the end and stall somewhere.
    If a launched coaster launch too fast, it has too low and too high G-forces.

    So what I want, a sign command like:
    [train]
    check
    maxspeed
    value

    and:
    [train]
    check
    minspeed
    value

    Maxspeed: If the actually speed of the train is LESS then the value, the sign will give redstone power (example: Activate a slowdown if speed is too high)
    Minspeed: If the actually speed of the train is HIGHER then the value, the sign will give redstone power (example: Activate a stop with station if speed is too slow.

    I hope you will add this, and I hope this will be done soon.
     
  26. Offline

    _frozen

    I meant:
    Code:
     
    [+train]
    announce
    Heading to
    %mainStationD%
    
    currently shows "b01" instead of "Brookside", the %b01% variable. I need something to translate station codes I use (because I cannot use "Brookside" as a destination at terminals; the end of the line has two platforms to get off/on, and each platform is B01 and B02 to ease up switching issues). I was hoping that since I already programmed the %b01% variable in signlink is "Brookside", how do I call that variable up INSTEAD of using the train's built-in destination? One easy way, I do not know how EASY it can be, is to add another field in the train properties to allow this such scenario via signlink with triggers? It can be used in many scenarios, etc. Example: having a cart with "iron" in the "other" or "misc" and have it read on signlink without worrying about duplicating its name or destination?

    Here is the scenario I want to see: I have a single metro link, with 2 branches. People cant really KNOW which station it goes by looking at codes listed on the triggered sign, I just want them to look up at a sign and know where the current cart is going. Trigger signs works perfectly, I just want to pretty it up better.
     
  27. Offline

    _frozen

    Sorry for double-posting, but I wanted to keep this seperate from above. Is it supposed to happen that the trains' momentum is erased after a server restart? I always have to do /train destroyall every time I come back online after a restart.
     
  28. Offline

    bergerkiller

    rcth I can add the 'velocity' to the switcher statement list. It would look like this:
    It would then turn the lever on if the velocity > 0.3. Do note that you can set a max speed setting on trains as well, if 0.4 is too fast for your tastes.

    _frozen train velocity is stored and when the server starts, trains should continue with the same velocity. Some people are having issues with saving, though, so I am not sure if that is all working out.

    So in short: You want to be able to basically set values on the train, which can be showed by SignLink. But I suppose that you actually need a 'destination name converter'. Basically a 'display name' for destinations. Trigger sign would set that to '%triggernameD%' so you can display full names on the sign.

    It is possible, but the question is: How to keep it simple. I think a command like this is the easiest:
    Which would basically map b01 to 'Bridge Area 1'. Is that what you need?
     
  29. bergerkiller

    When we updated to TC v1.70 non of our detector signs would work with statements on them

    [!train]
    detector
    passenger

    [!train]
    detector
    items

    if i just used it on its own it worked

    [!train]
    detector

    I remade the detectors and tried some other statements but none worked, we rolled back to v1.68 and all the detector signs were working again

    Thanks
     
  30. Offline

    isaacng1997

    Em... Hi...
    I am making a subway system in my friends server with your plugin and redstone. Everything works fine but just with one big problem.
    I designed my system like real-life subway, so player have to wait for the train to come, and the train will leave automatically. For some reason, trains will just stop in the middle of the rails if no one is in the train, and i couldn't make it move forward.
    I have no idea why this is happening, so please help.

    By the way, if someone is on the train, it wont stop.
     
  31. Offline

    _frozen

    Yes, but that command is too long. Instead of making it "related" to destination. name it with a generic moniker so people can use that for their own purposes instead of destination-related. "ExtraInfo" with %triggernameX%? (X for "eXtra"
     

Share This Page