plugin.h |
plugin.cpp |
plugin.def |
int | 32-bit signed integer ranging from -2147483648 to 2147483647 |
float | 32-bit floating point number according to the IEEE 754 binary32 standard |
double | 64-bit floating point number according to the IEEE 754 binary64 standard |
● | Load |
● | GetPluginVersion |
● | SetVehicleSpec |
● | Initialize |
● | SetPower |
● | SetBrake |
● | SetReverser |
● | SetSignal |
● | SetPower |
● | SetBrake |
● | SetReverser |
● | KeyDown |
● | KeyUp |
● | HornBlow |
● | DoorOpen |
● | DoorClose |
● | SetSignal |
● | SetBeaconData |
● | Dispose |
ATS_VERSION | 0x20000 (131072) | Valid plugin version |
int BrakeNotches | The amount of brake notches the train has. This does not include the emergency brake, but it does include the hold brake if the train has one. For trains with automatic air brakes, 2 is returned. |
int PowerNotches | The amount of power notches the train has. |
int AtsNotch | The brake notch index corresponding to the first real brake notch. For trains with automatic air brakes, this returns 1. For other trains, this returns 2 if the train has a hold brake, and 1 otherwise. |
int B67Notch | The brake notch index corresponding to 70% of the brake notches, i.e. round(0.7 * BrakeNotches). |
int Cars | The number of cars the train has. |
ATS_INIT_ON_SRV | -1 | The plugin should start in an active state. The service brakes are applied on startup. |
ATS_INIT_ON_EMG | 0 | The plugin should start in an active state. The emergency brakes are applied on startup. |
ATS_INIT_OFF_EMG | 1 | The plugin should start in an inactive state. The emergency brakes are applied on startup. |
double Location | The current track position of the front of the train in meters. |
float Speed | The current signed speed of the train in km/h. Negative values represent a backward movement, positive ones a forward movement. |
int Time | The current time in milliseconds since midnight of day one. Please note that the time wraps round after 24 days, thus values are between 0 and 2073599999. |
float BcPressure | The current pressure in the brake cylinder in pascal. |
float MrPressure | The current pressure in the main reservoir in pascal. |
float ErPressure | The current pressure in the equalizing reservoir in pascal. |
float BpPressure | The current pressure in the brake pipe in pascal. |
float SapPressure | The current pressure in the straight air brake in pascal. |
float Current | This value always returns 0 and should be ignored. |
ATS_SOUND_STOP | -10000 | Stops the sound. |
-9999 through -1 | Plays the sound in a loop with a given volume. -9999 corresponds to 0.01% volume and -1 corresponds to 99.99% volume. If the sound is already playing (looping or not), only the volume is changed. | |
ATS_SOUND_PLAYLOOPING | 0 | Plays the sound in a loop with 100% volume. If the sound is already playing (looping or not), only the volume is changed. |
ATS_SOUND_PLAY | 1 | Plays the sound once. If the sound is already playing, a new instance of the sound starts playing. Subsequently, stopping or changing volume only affects the new sound. The host application will set the sound instruction to ATS_SOUND_CONTINUE after having processed it. |
ATS_SOUND_CONTINUE | 2 | Does not execute any command. You should set to this value if you don't want to change anything. |
int Brake | The brake notch to apply. See SetBrake() below for more information. |
int Power | The power notch to apply. Must be within the range from 0 to PowerNotches. |
int Reverser | The reverser to apply. -1 is backward, 0 is neutral and 1 is forward. |
int ConstantSpeed | The operation mode of the constant speed system. ATS_CONSTANTSPEED_CONTINUE (0) uses the driver's setting, ATS_CONSTANTSPEED_ENABLE (1) forces the system on and ATS_CONSTANTSPEED_DISABLE (2) forces the system off. |
⚠ | Please note that if you want the driver's settings to take effect, you need to respond to the SetPower(), SetBrake() and SetReverse() calls, save the values that are passed in this those calls, and reapply them here. |
ATS_HORN_PRIMARY | 0 | The function is called only when the horn starts playing. |
ATS_HORN_SECONDARY | 1 | The function is called only when the horn starts playing. |
ATS_HORN_MUSIC | 2 | The function is called both when the horn starts playing and when it stops playing. |
⚠ | Please note that the SetSignal call assumes that the player's train is not inside the section for which the SetSignal call is raised. Otherwise, the reported aspect would always be red, which would not be very meaningful to work with. |
int Type | The type of the beacon. In CSV routes, this corresponds to Type in Track.Beacon(Type; BeaconStructureIndex; Section; Data). |
int Signal | The aspect number currently shown on the associated section. In CSV routes, this corresponds to any of the values in Track.Section(Aspect0, Aspect1, ..., Aspectn) |
float Distance | The distance from the front of the train to the signal in meters. This can be negative if the associated section is behind the front of the train. |
int Data | The data of the beacon. In CSV routes, this corresponds to Data in Track.Beacon(Type; BeaconStructureIndex; Section; Data). |