LUA Script Function Call List

RSadam's picture

For all you budding scripters out there having a play with Rail Simulator, you mnay have notuiced that the recent Upgrade Mk2 demonstrates what significant functionality changes can be made, purely through updates and changes made via the LUA scripting system.

To assist further with aiding developers with the production of 3rd party signal and rolliing stock script functions, here is a list of all the LUA Script calls that can be made to the RailSim engine via the Signal or Engine scripts (as appropriately indicated)

  • Signal Script Related
    • AddTime
    • Reset
    • ActivateNode
    • SendSignalMessage
    • SendConsistMessage
    • GetNextSignalState
    • Set2DMapSignalState
    • SetSignalState
    • GetConnectedLink
    • GetLinkCount
    • GetConsistSpeed
    • GetTrackSpeedLimit
    • GetConsistType
    • BeginUpdate
    • EndUpdate
    • SetStateName
  • Engine(Locomotive) Script Related
    • ControlExists
    • GetControlValue
    • SetControlValue
    • GetControlMinimum
    • GetControlMaximum
    • SubComponentUpdate
    • ApplyTorque
    • SetFailureValue
    • GetFromArray
    • GetInitValue
  • Additional Calls
    • SetParameter
    • GetSimulationTime
    • GetTargetPos
    • getNearPosition
    • setNearPosition

For more information on using these functions within the LUA scripts with Rail Simulator, please see the RSDevDocs number 3.01 Signal Setup and Scripting

My apologies that I cannot provide more information at this time, and that I do have on my schedule to produce a finished document detailing the use of these functions, but I thought that some would still appreciate knowing these details

RSadam