Signalling Function Reference - Train Simulator Developer Documentation
Signalling Function Reference - Train Simulator Developer Documentation
Train
Simulator
Developer
Documentation
NAVIGATION
Reference Manual > Scripting Function Reference >
HOME
▼ CONTENT BASICS
Function Names
a. function
b. *:function
c. name:function
Function is the function to call; name is a name of an entity/child entity and * means entity and
all child entities for (a) just the owning entity is searched for a matching function, (b) the
owning entity and all descendants are searched, function is called the rst component that
implements the function and (c) A search is made of the owning entity and all
descendants for the rst called 'name' which implements function.
SendSignalMessage
SendConsistMessage
GetNextSignalState
Set2DMapSignalState
GetConnectedLink
GetLinkCount
Syntax: GetLinkCount ()
Function: Get the number of links in the signal. Blueprint::NumberOfTrackLinks
Arguments: N/A
Return: The number of links the signal has in the range of 1 to 10
Usage: To nd the number of links in the signal
GetConsistSpeed
Syntax: GetConsistSpeed ()
Function: Get the speed in metres per second of the consist currently passing the
signal link
Arguments: N/A
Return: The speed in metres per second
Usage: Only safe to use from OnConsistPassed. Typically used for TPWS like
systems
GetTrackSpeedLimit
GetConsistType
Syntax: GetConsistType ()
Function: Get the class of the consist currently passing the signal link
Arguments: N/A
Return: 0 = eTrainTypeSpecial,
1 = eTrainTypeLightEngine,
2 = eTrainTypeExpressPassenger,
3 = eTrainTypeStoppingPassenger,
4 = eTrainTypeHighSpeedFreight,
5 = eTrainTypeExpressFreight,
6 = eTrainTypeStandardFreight,
7 = eTrainTypeLowSpeedFreight,
8 = eTrainTypeOtherFreight,
9 = eTrainTypeEmptyStock,
10 = eTrainTypeInternational
Usage: Only safe to use from OnConsistPassed. Typically used for TPWS like
systems
ActivateNode
AddTime
Reset
BeginUpdate
Syntax: BeginUpdate ()
Function: Request script to get update call once per frame
Arguments: N/A
Return: N/A
EndUpdate
Syntax: EndUpdate ()
Function: Request script to end update call once per frame
Arguments: N/A
Return: N/A
GetSimulationTime
Syntax: GetSimulationTime ()
Function: Get the simulation time in seconds
Arguments: N/A
Return: Integer of the simulation time in seconds
getNearPosition
Syntax: getNearPosition()
Function: Get the position in the current world frame of the object (local coordinates
are local to a moving origin centred on the camera's current tile)
Arguments: N/A
Return: The position x, y, z in metres relative to the origin
setNearPosition
Syntax: setNearPosition ( x, y, z )
Function: Set the position in the current world frame of the object (local coordinates
are local to a moving origin centred on the camera's current tile)
Arguments: x The x coordinate
y The y coordinate
z The z coordinate
Return: N/A