Author Topic: Fixed Trains and Rollercoasters  (Read 5820 times)

Trains
By Chrisbot6 and Zeblote, with contributions from Demian and JakeBlade




Description
The trains mod is about trains - special types of vehicles that follow rail guides. Many of these vehicles are ridable, and have engines - but some are not. They can be used in a ridiculous amount of ways, from roller coasters to monorails. Aside from loops, banks and corkscrews, anything is possible.

I originally released this mod some time from 2013-2014. The aiConnection removal update broke it, and it's stayed that way for about a year because of me being busy with exams and such. Now it's fixed. It took me about 20 minutes.

Videos
http://www.youtube.com/watch?v=3RsRg6iEQOY&feature=youtu.be
http://www.youtube.com/watch?v=m3Nbku0M95o
http://www.youtube.com/watch?v=B-DPQrJa-d8 (Old)
http://www.youtube.com/watch?v=nJLsO9RBfsI (Old)
http://www.youtube.com/watch?v=7WTt-Ux38ms (Old)

In-Game Usage
The mod itself is a core - it doesn't add any trains to the game. Trains are downloaded seperately as Trains_ mods, and need Support_Trains to run. Once you've installed that stuff, however, you can set up a train by:
1. Placing a straight track guide (Don't start on a corner)
2. Placing a vehicle spawn on top and spawning any train.

If you hear a clank, your train has snapped to the rail and is now ready! If the train ever comes off the track afterwards you can respawn the vehicle and it will relocate itself. If a train is wonky on a track for some reason, or has veered far to the side, you can type /centertrain.

If you don't mind your train making impossible 90 degree turns in a phemtosecond, feel free to use sharp turns. Otherwise, other rotation bricks are provided. Stardard turns turn the train 45 degrees, which looks good with fast trains, and alternatively wide turns turn the train 22.5 degrees. Very wide turns turn the train 11.25 degrees. If you do the maths, you can work out how many you need to turn a train.

Filler rails can be used if you don't have space for a straight piece, and in corners. A train will simply run forward over them in whatever direction it's facing. Intersections are meant for use where two straight tracks cross, though in code they are basically just large filler rails.

To Control Trains
Set your shiny new "Train Control" key binds to whatever you wish. Players who do not have the mod can use the /trainmode command.

You can also use the "TrainMode" event to do this. (If you do not want your train to be controllable by the ways above, use the "setTrainLocked" event)

How do I build a good track?
step 1: no ugly unrealistic stuffty instant 90/45 degree teleportation turns

example of how NOT to do corners:


step 2: instead, build wide curves and use the wide turn guides

there's got to be an example image somewhere but I can't find it

step 3: for hills, you should really get the small ramps pack on rtb
step 4: give the rails depth
step 5: ease in hills and stuff, never do instant bumps in the track

example:


step 6: build modular tracks. it's extremely easy to assemble a track if you first build modules of the same size. for example, every module is 8x8 bricks large and the curves 16x16. that way you can just put them next to each other without much work. for example, the sort of hilly metal track you see in the background of the first picture uses only 6 different modules.

step 7: get creative. or use a reference picture when building track modules or assembling tracks.

Modding
Custom Trains must be bot vehicles. To add one to the mod, add these vars to your datablock:
Trainmod_isTrain - Must be true
Trainmod_engine - Set to true to allow the engine to be started and stopped
Trainmod_enginePower - Engine's power. Set according to your datablock.
Trainmod_engineMax - Your train's max engine speed. Set according to your datablock.
Trainmod_drag - Your train's engine drag. Set according to your datablock.
Trainmod_brakes - Whether your train has brakes or not.
Trainmod_startData - Your train's start sound datablock (in quotes)
Trainmod_runData - Your train's constant rev sound datablock (in quotes)
Trainmod_idleData - Your train's constant idle sound datablock (in quotes)
Trainmod_hornData - Your train's horn sound datablock (in quotes)
Trainmod_stopData - Your train's stop sound datablock (in quotes)
Trainmod_maxSpeed - The highest allowed speed of your train

That's it. If you can't figure out how to make a bot vehicle yourself, you will never be able to do it. (Hint: Look at the horse's code)

For animations, add the following .DSQs to your model:
Go Forward - run
Go Backward - back
Train Tilting - look
Static - root

Download(s)
The Mod
This mod is pretty well optimized, and as bugless as I can get it. Trains still derail sometimes, and sound issues pop up every now and then, but it's much better than what you had before with the beta and that's what matters.

Trains Pack 1
Contains Minecart, Coaster Car Single and Coaster Car Multi

Trains Pack 2
Contains Box Train.

Old Trains Pack
All of the old trains from the alpha. For nostalgia purposes only - don't use these in any proper builds, they're really stuff as train bots




I'll try it out again but there was a lot of issues the original train mod had that I had to stop using it.

Specifically like how trains can't kill people.


it's stayed that way for about a year because of me being busy with exams and such. Now it's fixed. It took me about 20 minutes.
gave me a laugh

lmao i thought that this was completely unfixable and was gonna be forgotten about forever, ty chris

Now I can finally make automatic trains again!

AND NOW I REALISED I COULD MAKE MY OWN TRAINS!   :cookieMonster:


I came.
Pie crust, I assume? Lol. I didn't know you're back. ( ͡° ͜ʖ ͡°)

Pie crust, I assume? Lol. I didn't know you're back. ( ͡° ͜ʖ ͡°)
he came



back

OH MY GOD. THANK YOU. THANK YOUUUUUUUUUUUUU. As you might know from Zealot, me and others greatly needed trains for halloweenfest. We made a hacky fix, but it doesn't compare to this. I have been waiting a great time for this.. so just.. thank you..

Someone make The Mitten.

Now. Anyone up to make more train packs?

Now. Anyone up to make more train packs?
Stop with the big text, we can read it just fine.