0% found this document useful (0 votes)
25 views1 page

Signalling Function Reference - Train Simulator Developer Documentation

The document serves as a reference manual for scripting functions related to signaling in a train simulation environment. It details various signaling functions, including their syntax, purpose, arguments, and usage, such as SendSignalMessage, GetNextSignalState, and GetConsistSpeed. Additionally, it outlines how to manipulate signal states and interact with train consists within the simulation framework.

Uploaded by

TGS youtibe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

Signalling Function Reference - Train Simulator Developer Documentation

The document serves as a reference manual for scripting functions related to signaling in a train simulation environment. It details various signaling functions, including their syntax, purpose, arguments, and usage, such as SendSignalMessage, GetNextSignalState, and GetConsistSpeed. Additionally, it outlines how to manipulate signal states and interact with train consists within the simulation framework.

Uploaded by

TGS youtibe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

http://tscdevdocs.co.uk/reference-manual/scripting-function-reference/signalling-function-reference.

html Go DEC MAY MAR 👤 ⍰❎


5 captures 28 f🐦
3 Dec 2023 - 23 Mar 2025 2023 2024 2025 ▾ About this capture

Train
Simulator
Developer
Documentation
NAVIGATION
Reference Manual > Scripting Function Reference >
HOME

▼ REFERENCE MANUAL Signalling Function Reference


LEGAL ACKNOWLEDGEMENTS

▼ CONTENT BASICS

▼ THE BLUEPRINT EDITOR


CONTENTS
▼ SIGNALLING GUIDE
1 Function Names
▼ ART GUIDELINES 2 Signalling Function Reference
▼ WORLD EDITOR 2.1 SendSignalMessage
2.2 SendConsistMessage
SCENARIO EDITOR 2.3 GetNextSignalState
PACKAGE UTILITIES 2.4 Set2DMapSignalState
2.5 GetConnectedLink
AUDIO 2.6 GetLinkCount
2.7 GetConsistSpeed
▼ SCRIPTING FUNCTION REFERENCE
2.8 GetTrackSpeedLimit
ENGINE FUNCTION REFERENCE 2.9 GetConsistType
2.10 ActivateNode
SIGNALLING FUNCTION REFERENCE
2.11 AddTime
SCENARIO FUNCTION REFERENCE 2.12 Reset
2.13 BeginUpdate
▼ TS NEW FEATURES
2.14 EndUpdate
DOWNLOADS 2.15 GetSimulationTime
2.16 getNearPosition
2.17 setNearPosition

Function Names

Function names can be either:

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.

Signalling Function Reference

SendSignalMessage

Syntax: SendSignalMessage ( message, [argument], direction, link, index )


Function: Send a message along the track to the next/previous signal link on the track
(ignoring links of the same signal). See Signal Message Types for a
description of messages.
Arguments: message The message type
argument An optional string argument passed with the message
direction The direction the script sends the message relative to the link.
1 = forwards, -1 = backwards
link The direction of the link that the message should be sent to,
relative to the link
index The index of the link to send the message from
Return: Signal Found - was a signal found, End Of Track - was the end of the track
encountered (rather than a circuit)
Usage: Used to communicate between signals
Special Cases: Where argument is set to the special value "DoNotForward" the receiving
signal is expected not to pass forward the message.

SendConsistMessage

Syntax: SendConsistMessage ( message, [argument], direction )


Function: Send a message to passing consists. See consist message types for a list of
valid types
Arguments: message The message type
argument An optional string argument passed with the message
direction Not used
Return: N/A
Usage: Only safe to use from OnConsistPassed. Used to indicate SPADs, AWS,
TPWS, etc.
Special Cases: SIGMSG_CUSTOM - While the other message types are handled directly by
the app, custom messages are passed on to the engine script using the
script method OnCustomSignalMessage passing the argument to the engine
script.

GetNextSignalState

Syntax: GetNextSignalState ( [argument], direction, link, index )


Function: Get the signal state of the next/previous signal up/down the line.
Arguments: argument An optional string argument passed with the message (Not
used)
direction The direction from the link. 1 = forwards, -1 = backwards
link The direction of the signal link 0 to look for
index The index of the link to start the search from
Return: The state of the next signal along the line. Where no signal is found "Go" is
returned
Usage: Get the signal state of the next/previous signal up/down the line.

Set2DMapSignalState

Syntax: Set2DMapSignalState ( state )


Function: Sets the 2D map displayed state of the signal.
Arguments: state The state to set from (go, warning, stop)
Return: N/A
Usage: Sets the 2D map displayed state of the signal.

GetConnectedLink

Syntax: GetConnectedLink ( argument, direction, index )


Function: Get the index of the link currently connected by the track network to the
link. If no link is connected then -1 is returned. Only nds links owned by
the same signal
Arguments: argument Not used
direction Not used
index The link to start at when looking for the next connected link.
Usually 0.
Return: The index of the next link within the same signal connected via the track
network, if a converging junction set against the direction of the start link is
found or the end of track then -1 is returned.
Usage: This is used as a method for testing which path ahead is set, usually in
response to a junction change message or when initialising
Special Cases: For slips and crossings (where the junction has two simultaneous legal
paths) the dispatcher holds an internal state for the junction and as such a
signal will get -1 as with a converging junction. In Freeroam and for slips set
to the player's path, the state is always set for the player's route.

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

Syntax: GetTrackSpeedLimit ( index )


Function: Get the track speed limit at the link
Arguments: index The index of the signal link
Return: The speed in metres per second
Usage: Used to test for speeding conditions in TPWS like systems

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

Syntax: ActivateNode ( name, activate )


Function: Activate/Deactivate a node in a model
Arguments: name name of the node (use "all" for all nodes)
activate 1 = show, 0 = hide
Return: N/A

AddTime

Syntax: AddTime ( name, activate )


Function: Add time to an animation
Arguments: name name of the animation
activate the amount of time in seconds, either positive or negative
Return: The remaining time in the animation

Reset

Syntax: ActivateNode ( name, activate )


Function: Reset an animation
Arguments: name name of the animation
Return: N/A

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

Powered By Google Sites

You might also like