To add a custom train to the mod (must be a bot vehicle) package:
function [DATABLOCKNAME]::onAdd(%this,%obj)
{
parent::onAdd(%this,%obj);
PrimeTrainPhysics(%obj,[ENABLEENGINE],[DRAG],[ENGINEPOWER],[ENGINEMAX],[BRAKES],[STARTSOUND],[RUNSOUND],[STOPSOUND],[IDLESOUND],[HORNSOUND]);
}
Replace "[DATABLOCKNAME]" with the name of your train's datablock. For the rest of the options:
- ENABLEENGINE determines whether or not the train has an engine that can be started/stopped via chat commands or keybinds.
- DRAG determines the slowdown force that acts on the train when it is coming to a stop.
- ENGINEPOWER determines how hard the train is being pushed forward, and plays a part in determining how fast it gets to full speed.
- ENGINEMAX determines how fast the engine is capable of going. Note that this is relitive to the max speed defined in your bot vehicle's datablock.
- BRAKES determines whether or not your train has brakes usable via keybind or chat commands.
- STARTSOUND, RUNSOUND and STOPSOUND, IDLESOUND and HORNSOUND are the sound datablocks that the train uses. Put "0" to not have sound.
Why not just Support_Trains automatically do that for all bot vehicles with
isTrain set to true in the datablock? In addition to that, it'd determine all the above values from the datablock fields.