Chrisbot6's Trains

DescriptionThe 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.
Videoshttp://www.youtube.com/watch?v=3RsRg6iEQOY&feature=youtu.behttp://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 UsageThe mod itself is a core - it doesn't add any trains to the game. Trains are downloaded seperately as Train_ mods, and need Support_TrainsBeta 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)


ModdingCustom 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)Go to the topic in Add-Ons, dummy. This entire topic is from back in July 2013.