Get Trains

Response Body

Name Type Description

ID

String

Unique ID of the Train.

Name

String

Name of the Train.

ClassName

String

ClassName of the Train.

location

Object

Location details of the Train.

  x

Float

X Location in the World.

  y

Float

Y Location in the World.

  z

Float

Z Location in the World.

  rotation

Float

Rotation of the Actor (0 - 359, 0 = North, 90 = East, 180 = South, 270 = West).

TotalMass

Float

Total mass of Train

PayloadMass

Float

Payload Mass for Train

MaxPayloadMass

Float

Maximium Payload Mass for Train

ForwardSpeed

Float

Speed in km/h

ThrottlePercent

Float

Train’s Throttle Setting

TrainStation

String

Current or Next Stop for Train

Derailed

Boolean

Is Derailed

PendingDerail

Boolean

Has Pending Collision (Name taken from the Object in Unreal)

Status

String

Status of Train

TimeTable

Object[]

JSON Object for Train Consists of for Attached Train Cars/Engines

  StationName

String

Name of the Train Station in Timetable

TimeTableIndex

Integer

Next Stop Index of TimeTable Object

SelfDriving

String

Error codes for the self driving locomotives
- SDLE_NoError: No Error
- SDLE_NoPower: No Power
- SDLE_NoTimeTable: No Time Table
- SDLE_InvalidNextStop: Invalid Next Stop
- SDLE_InvalidLocomotivePlacement: Invalid Locomotive Placement
- SDLE_NoPath: No Path
- SDLE_StationUnreachable: Station Unreachable
- SDLE_StationUnreachableWithSignals: Station Unreachable With Signals
- SDLE_LongWaitAtSignal: Long Wait At Signal

Docking

String

Docked state (See below ETrainDockingState)
- TDS_None: None
- TDS_ReadyToDock: Ready To Dock
- TDS_Docked: Docked

Path

String

Error codes for the extended path finding diagnostics
- PDE_NoError: No Error
- PDE_StationUnreachable: Station Unreachable
- PDE_StationUnreachableWithSignals: Station Unreachable With Signals

Vehicles

Object

JSON Object for Attached Train Cars/Engines

  Name

String

Name of the FGRailroadVehicle

  ClassName

String

UE Class Name

  TotalMass

Float

Total mass of FGRailroadVehicle

  PayloadMass

Float

Payload Mass for FGRailroadVehicle

  MaxPayloadMass

Float

Maximium Payload Mass for FGRailroadVehicle

PowerInfo

Object

Power Information Object.

  CircuitGroupID

Integer

The group this circuit belongs too. (-1 = not connected)

  CircuitID

Integer

This circuit’s unique identifier. (-1 = not connected)

  FuseTriggered

Boolean

Has the fuse tripped?

  PowerConsumed

Float

Current power consumption.

  MaxPowerConsumed

Float

Current maximum power consumption.

features

Object

An object with actor coordinates and name information.

  properties

Object

Name information about the actor.

    name

String

Display Name of the Actor.

    type

String

Type of the Object.

  geometry

Object

Geometry information about the Actor.

    coordinates

Object

The Actor coordinates.

      x

Float

X Location of the Actor.

      y

Float

Y Location of the Actor.

      z

Float

Z Location of the Actor.

    type

String

It’s always "Point".

Example Response

[
  {
    "ID": "BP_Train_C_2147339037",
    "Name": "Train",
    "ClassName": "BP_Train_C",
    "location": {
      "x": -92400,
      "y": 231600.211763382,
      "z": 21100.01171875,
      "rotation": 0
    },
    "TotalMass": 330000,
    "PayloadMass": 0,
    "MaxPayloadMass": 70000,
    "ForwardSpeed": 0,
    "ThrottlePercent": 0,
    "TrainStation": "No Station",
    "Derailed": false,
    "PendingDerail": false,
    "Status": "Self-Driving",
    "TimeTable": [],
    "TimeTableIndex": 0,
    "SelfDriving": "SDLE_NoError",
    "Docking": "TDS_Docked",
    "Path": "PDE_NoError",
    "Vehicles": [
      {
        "Name": "Electric Locomotive",
        "ClassName": "BP_Locomotive_C",
        "TotalMass": 300000,
        "PayloadMass": 0,
        "MaxPayloadMass": 0,
        "Inventory": []
      },
      {
        "Name": "Freight Car",
        "ClassName": "BP_FreightWagon_C",
        "TotalMass": 30000,
        "PayloadMass": 0,
        "MaxPayloadMass": 70000,
        "Inventory": []
      }
    ],
    "features": {
      "properties": {
        "name": "Train",
        "type": "Train"
      },
      "geometry": {
        "coordinates": {
          "x": 0,
          "y": 0,
          "z": 0
        },
        "type": "Point"
      }
    },
    "PowerInfo": {
      "CircuitGroupID": -1,
      "CircuitID": -1,
      "FuseTriggered": false,
      "PowerConsumed": 0,
      "MaxPowerConsumed": 0
    }
  },
  {
    "ID": "BP_Train_C_2147308631",
    "Name": "Auto Movable Train",
    "ClassName": "BP_Train_C",
    "location": {
      "x": -97000,
      "y": 240073.151762784,
      "z": 21100.0035679349,
      "rotation": 0
    },
    "TotalMass": 330000,
    "PayloadMass": 0,
    "MaxPayloadMass": 70000,
    "ForwardSpeed": 14.3403563232422,
    "ThrottlePercent": 52.4868354797363,
    "TrainStation": "Unloading",
    "Derailed": false,
    "PendingDerail": false,
    "Status": "Self-Driving",
    "TimeTable": [
      {
        "StationName": "Unloading"
      },
      {
        "StationName": "Loading"
      }
    ],
    "TimeTableIndex": 0,
    "SelfDriving": "SDLE_NoError",
    "Docking": "TDS_None",
    "Path": "PDE_NoError",
    "Vehicles": [
      {
        "Name": "Electric Locomotive",
        "ClassName": "BP_Locomotive_C",
        "TotalMass": 300000,
        "PayloadMass": 0,
        "MaxPayloadMass": 0,
        "Inventory": []
      },
      {
        "Name": "Freight Car",
        "ClassName": "BP_FreightWagon_C",
        "TotalMass": 30000,
        "PayloadMass": 0,
        "MaxPayloadMass": 70000,
        "Inventory": []
      }
    ],
    "features": {
      "properties": {
        "name": "Auto Movable Train",
        "type": "Train"
      },
      "geometry": {
        "coordinates": {
          "x": 0,
          "y": 0,
          "z": 0
        },
        "type": "Point"
      }
    },
    "PowerInfo": {
      "CircuitGroupID": 16,
      "CircuitID": 9,
      "FuseTriggered": false,
      "PowerConsumed": 69.3305740356445,
      "MaxPowerConsumed": 110
    }
  }
]