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

    bergerkiller

    Trains should go past corners without losing momentum. Only issue lies when taking very sharp U-turns, when the cart loses sight of their neighbouring carts. (a 180-degree turn difference).
     
  3. Offline

    exo[MRMC]

    Can you make the train move itself not using any powered rails , boosters or whatever becouse it's realy HARD and annoying to make the train move up the mountain. at the first time i set the powered rails it goes up correctly but second time it just stops and goes backwards. Mby there is some special way to make them move with powered rails, Please fix this or tell me something that i dont know
     
  4. Offline

    bergerkiller

    @exo[MRMC] It's not all that hard, just make sure you have 1-2 flat powered rails before going upwards.
     
  5. Heh, could've mentioned that before. I'm Dutch too :p
     
  6. Offline

    bergerkiller

    Expect an update in a little bit. Got to make the 'push away' features train properties, since it fits train-specific better.
    May remove the push allow/deny signs and replace them with the property signs.
     
  7. Offline

    AuZor

    About the trains, - My friend, Jc, tried the teleporting. It didn't work when I sat in it, or there was multiple carts. I'll try again tomorrow or later tonight to be sure.
     
  8. Offline

    exo[MRMC]

    soo not true. And if i have 2 flat powered rails before going upwards its sudenly stops on the way up and falls down :/
    Ouh man i have huge problem with them. mby you can come to my server and watch how it doesnt work and help me fix it.. please. ask for ip private
     
  9. Offline

    bergerkiller

    Status update:
    - PushAway feature fully transferred to the properties system
    - You can set if a train is pushing yes or no, and if stations trigger it to start pushing (temporarily)
    - Fixed ownership issues and non-owners not being able to enter
    - Mob enter system slightly improved

    Todo:
    - More property signs for newly added properties
    - Lots of testing (this'll take a while)

    I'll look into the powered rail issue too.
     
  10. Offline

    martial69320

  11. Offline

    bergerkiller

    How do you mean 'not work', are you sure you are an OP on the server? :)
    (or have the permission nodes)
     
  12. Offline

    martial69320

    Not plugin but video, but i have must refresh 5 times my page for loading it! thx

    I have take your video and have make it on Youtube, are you agree ???
     
  13. Offline

    bergerkiller

    @martial69320 I know, but it requires me to make it all 'flashy 'n edited', it doesn't really serve that purpose.
    Wish I could make one huge tutorial video...but it's a bit too long for that.

    EDIT

    Some more status updates:
    - Improved station system (targetting) so longer trains will fit in all stations
    - It no longer takes ages before a train is stopped in the station. (3-block slowdown)
    - Added proper permissions for the /train command (it was lacking)

    EDIT2

    Some new features will be added:
    - Train-specific pushing settings (no longer velocity related; owners are ignored) - Working
    - Train removal (individual, world, global) - being worked on
    - Player - train enter and exit properties
    - New train property signs to set lots of new train properties

    Took a lil longer, but it's finally updated!

    Lots of new things added, see the changelog and the (updated) WIKI page for more information.

    I know of the new build, but it would add too many compatibility issues for 1240 (new configuration call would make older version crash :( )

    EDIT

    Also, re-upload, some sort of odd bug with the sign action event listening.

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

    BadKarMa

    Hi!

    First of all: This is a great plugin! I have lots of fun building my own subway!
    However I have some problems/questions:

    1.) Our server had the mentioned bug of too many loaded trains (actually the numbers were 10 times higher than in your example). It occured several times.

    2.) It would be nice, if you could implement a command to see how many trains are currently loaded.

    3.) I've build a very long subway that takes about 11 mins for a roundtrip. I have some sort of starting station that spawns trains every 45 seconds and works as a destructor when the train comes back after 11 mins. So the full track is in use with dozens of trains (that spawn and destruct).
    This doesn't seem to work properly: Once an empty train enters a chunk that is not loaded (as no player is near it) it simply stops and gets stuck. When a player enters this chunk, all those stuck trains start moving (or just stand there) and the server gets extremely slow.
    Also: When you are at the other end of the track compared to the spawner, then no train will ever spawn to fetch you.

    4.) To get along with 3.) we did install the plugin "MineCartPermanence", that somebody in this thread mentioned before. All the trains worked fine for some hours but then the server began lagging and after a restart the problem 1.) occured.
    As it worked several hours and the track is at full capacity of trains only after 11 mins, it seems not to be a problem of the server power! It would be cool, if you can implement a similar option like MineCartPermanence that is more compatible with TrainCarts. Or at least something to deal with the problem of very long tracks. The KeepChunksAlive option is good, but not enough. The chunks don't only need to be kept alive, they also have to be loaded when an empty train enters!

    5.) I've spotted some weird behaviour with a spawner-sign. No matter which direction it was facing, the train always started moving one way. It was the WRONG way. As this only happened at one part of the train track, and I couldn't figure out, why that part was different, I'll leave a message here, when I find out something new.

    6.) An ingame update-notification would be great as I just realize our 1.39 is outdated! :)

    Sorry for the long post! That's only because I really like the trains/stations! ;)
     
  15. Offline

    bergerkiller

    @BadKarMa I hate chunks, 'nuff said. :)
    NoLagg has an 'chunkunloaddelay' system to reduce chunk loading and unloading, but as I see now:
    - It's not possible to keep chunks loaded near entities: too many issues
    - This will require a simple chunk persistence system which keeps chunks loaded ALWAYS (will increase RAM)
    - Once trains leave a chunk, I can't do anything with it. It gets de-linked, replaced, saved and removed. I simply have to load that chunk, how else can it read the tracks?
    - Train spawn sign has been a pain for a long time, see the old bugger didn't leave that sign yet :)
    - There are plugins to keep plugins up to date (or else they are being made), so don't feel like implementing cpu-heavy HTTP GET requests for github/this forum page, not really useful for any sort of plugin.
    - New version should fix the overload of train properties, fixed it a bit to remove ghost trains being left behind. (trains without carts...yes it was actually possible.)
     
  16. Offline

    AuZor

    Are you saying that empty carts stops when chunk are unloaded?
     
  17. Offline

    bergerkiller

    @AuZor if keepchunksloaded is disabled, yes. It saves the train, unlinks and replaces the train with individual Minecarts.
     
  18. Offline

    AuZor

    So if I keep the chunks loaded, the system will work, but it'll require more ram?

    /edit
    # keepChunksLoaded sets if chunks are loaded near minecart Trains
    setOwnerOnPlacement: true
    removeDerailedCarts: true
    normal:
    cartDistance: 1.5
    cartDistanceForcer: 1.5
    use: true
    maxCartDistance: 4.0
    spawnItemDrops: true
    keepChunksLoaded: true

    Yet they deny to come back when chunks are unloaded :-(
     
  19. Offline

    bergerkiller

    @AuZor are you using NoLagg with TrainCarts? Could be it is somewhat interfering...
     
  20. Offline

    AuZor

    No, I don't NoLagg. I'm using;
    AdminCmd
    ChatoicDrops - Will remove soon.
    HeroChat
    MagicCarpet
    mChat
    MultiInv
    MusicCraft - Will remove soon.
    My Worlds
    PermissionsEX
    SetRankPEX
    SignLift
    Train Carts
    WorldEdit
    WorldGuard
     
  21. Offline

    BadKarMa

    As far as I understand it, there is a difference between keeping active chunks and activating unloaded chunks!
    So if your train stays in the same chunk this option keeps everything working.
    ...if your train however accesses an already unloaded chunk, this option will NOT load that chunk, so the train will be saved/stopped/replaced/whatever until the chunk is loaded by an entering player

    @bergerkiller
    So I will probably better redesign my subway, so that a player has to call/spawn it at the station where he is. :(
    Then I might have another request:
    Can you create a property (that can be set via signs) for a train, that it should be completely destroyed when entering an unloaded chunk? I mean: Instead saving the train, it simply vanishes?

    Example: I have this long subway and as long as I sit in a train, the train may go around forever. But when I leave it and it is nowhere near any players sight, it just vanishes, so that no empty train is loaded when a player enters the chunk where it usually should have been saved. (I hope you understand what I mean)
     
  22. Offline

    bergerkiller

    @BadKarMa I'll consider it, isn't too hard to add. And actually, it checks the surrounding chunks for unloaded chunks and loads them if this is set, so it should actually survive driving into unloaded chunks. No idea why it is failing though...
     
  23. Offline

    AuZor

    That's exactly what's happening. The train just stops or continues when a player loads the chunk.

    /EDIT

    I support Bad's idea. Vanishing minecarts when stepping out.
     
  24. Offline

    BadKarMa

    Okay, then it sounds like I have the same problem as AuZor!

    If that helps, the plugins on our server:
    MailBox
    MinecraftViewer
    PermissionEx
    Permissions
    ModifyWorld
    SafeCreeper
    ChatBukkit
    RealTeleporter
    Essentials
    Tent
    TGM
    EssentialsChat
    MorningAnnounce
    ScrapBukkit
    EssentialsSpawn
    LWC
    Train Carts

    ...and keepChunksAlive is also set to true :(
     
  25. Offline

    AuZor

    May I see how you've set up the subway? - Send ip via pm..
     
  26. If I am not mistaken, chunks that have no players in/near them can (by default, at least...) be unloaded at any time if the server decides it needs the memory. So it is quite possible the server loads the chunk and then unloads it shortly after - before the train exits the chunk. Would that be causing this behaviour, perhaps? I believe you can capture chunk unload events and cancel them - maybe do so and cancel the unload if any trains are nearby it?

    You could use the PailStone plugin to activate a train spawner when players are near. Then activate train destroy signs when no players are near. Do this at every subway stop, and you should have a very nice system that only has trains going around when there are players nearby that want to ride them. No need for a full subway when nobody is using it, right? If done properly, players shouldn't notice any difference :)
     
  27. Offline

    bergerkiller

    @Thulinma that's kinda the problem, since I already handle the chunk unload event (thoroughly).
    During every chunk unload event, it checks for every train (group) on the server:
    - if keepchunksloaded is true
    - for every train on the server: |
    - if it's on the world the chunk is on
    - if any of the getSurroundingChunks() (both loaded and unloaded) match the chunk

    It pretty much handles it all. Can only think of increasing the surrounding chunk radius...but that could cause massive lag once a train changes chunks.
     
  28. Eh, that sucks.
    I'll see if I can do some debugging on this at some point, maybe - if I have the time.
    Who knows, four eyes see more than two and all that. :)
     
  29. Offline

    BadKarMa

    I have another feature request! :rolleyes:

    Can you implement a "null"-tag for the TrackSwitcher?

    I use a tag for each station. This tag gets removed after the corresponding station was visited. The train should switch to the track to the nearest destructor once there are no more tags left.

    So the TrackSwitcher should be able to recognize, that there are no tags on the train. I would choose something like "null", "[none]" or "[notags]" on the 3rd/4th line of the TrackSwitcher-sign.
     
  30. Offline

    MADHAWK

    Hi! Updated plugin to 1.40 (got latest bukkit), and trains are no more pushing anything! I saw that you redisigned push to signs. but signs dont work for me. Green message apperas that i created flag sign, but train dont push anyway. no errors in console.
     
  31. Offline

    bergerkiller

    @BadKarMa You can set the tag to 'null' (using property signs) and detect that instead. You can also set the 'null' tag in the property defaults.

    @MADHAWK Type /train info to get the information of the train. Use:
    To do other things. Using property signs you can set these properties too. You can also set them in the defaultflags.yml. See the WIKI page (redstone circuits, bottom) for more info about property signs. Pushing [true] sets if the the train is now pushing.
     

Share This Page