Module api.type
Contains game command objects and related utilities.
Account |
Contains financial data. |
Aircraft |
Data attached to aircraft. |
Animal |
Data attached to animals. |
AssetGroup |
Data attached to assets, in particular trees. |
AssetGroupAutoRemove |
Data attached to assets entities to enable automatic removal when it collides with newly built objects. |
AudioEmitter |
An entity with an AudioEmitter emits a sound source |
BaseEdge |
Type attached to strets and tracks, specifying the street type and other details. |
BaseEdgeStreet |
Contains details about a base edge when it is a street. |
BaseEdgeTrack |
Contains details about a base edge when it is a track. |
BaseNode |
A node in a street graph, e.g. |
BaseNodeTrafficLight |
Additional traffic light data for a base node. |
BoundingVolume |
Contains the bounding box of an entity. |
Bridge |
Contains the full information and the entire spline of a bridge, if
this was configured to do so. |
BuildCost |
Stores the costs of an entity (e.g. |
BulldozerInfo |
Allows to set certain entities to be not bulldozable. |
Color |
Specifies the color of an entity |
Construction |
A construction: usually contains stations, depots, town buildings or industries. |
EmissionGrid |
The grid containing the emission data |
Field |
Contains data representing a farm field on the terrain |
GameSpeed |
Information about the current game simulation and calendar speed. |
GameTime |
Information about the current ingame time. |
Line |
An line with stops and configurations |
LogBook |
A LogBook contains information about the evolution of a variable (e.g. |
LotList |
Information about ground textures that are paining the terrain |
MaintenanceCost |
Contains the maintenance cost of objects |
ModelInstanceList |
Contains all models rendered by the entity |
ModelPerson |
Additional data for persons walking in the world |
ModelPersonIdle |
Additional data for idle person |
MovePath |
Represents a path a vehicle is currently following |
MovePathAircraft |
Additional data for aircraft |
Name |
Specifies the name of an entity |
Parcel |
A parcel is a region of space near a road where a town building can be built. |
ParcelData |
Entities attached to a segment |
ParticleSystem |
A particle emitted as graphical effect |
PersonCapacity |
Contains information about a workplace of household. |
Player |
Represent a player |
PlayerOwned |
An entity with player owner is property of the owner and can be bulldozed only by him. |
RailVehicle |
Represents a single waggon of a train (a single carriage or engine) |
RailroadCrossing |
A railroad crossing |
RoadVehicle |
Represents a vehicle travelling on roads (either bus or truck) |
RunwayList |
All runways for the entity transport network. |
Shape |
Contains a procedurally generated shape. |
ShapeList |
Contains a list procedurally generated shapes. |
Ship |
Contains information about pathing and extra data of ships. |
SignalList |
Contains a list of signals for the entity. |
SimBuilding |
Contains information about industries. |
SimCargo |
Additional data for cargo. |
SimCargoAtTerminal |
Additional data for cargo waiting at the terminal |
SimEntityAtBuilding |
Additional data for entities waiting at buildings. |
SimEntityAtStock |
Additional data for entities waiting at industries. |
SimEntityAtTerminal |
Additional data for entities waiting at terminals. |
SimEntityAtVehicle |
Additional data for entities travelling on a vehicle. |
SimEntityIdle |
Additional data for entities that are idle. |
SimEntityMoving |
Additional data for entities that are moving. |
SimPerson |
Additional data for persons. |
SimPersonAtTerminal |
Additional data for a person waiting at the terminal |
SimPersonAtVehicle |
Additional data for a person travelling on a vehicle |
Station |
Defines a station, i.e. |
StationGroup |
Defines a group of stations, can group together stations with very different transport modes |
SubShape |
Contains a procedurally generated sub-shape. |
Terrain |
Contains information about the map. |
TerrainTile |
Contains information about a single tile of the map. |
TerrainTileBrush |
Contains information about the brush layer of a tile of the map. |
TerrainTileHeightmap |
Contains information about the geometry of the tile. |
TickEpoch |
Tracks information about the last time an entity was modified or added. |
Town |
Contains information about a single town. |
TownBuilding |
Contains information about a town building. |
TownConnection |
Defines a connection between towns. |
TpNetLink |
Represents a link between transport networks. |
Train |
Represents an entire train |
Tram |
Represents a tram |
TransportHistory |
Contains the history of transported cargo for the entity. |
TransportNetwork |
Contains the graph of edges and nodes onto which vehicles and person move. |
TransportVehicle |
Represents a single transport vehicle |
VehicleDepot |
Defines a vehicle depot |
VehicleOrder |
Contains information about precedence and breaking. |
WaterMesh |
Contains the geometry information for a single tile of water. |
Pool |
Defines a common pool in a station for overflowing terminal capacities |
Asset |
A single asset |
Industry |
Data about industry |
Map |
Information about the map, for map generation purposes. |
MapAsset |
Information about assets to be placed on the map |
MapIndustry |
Information about industries on a map |
MapTown |
Information about towns on a map |
MapTree |
Information about trees to be placed on the map |
Town |
Data about town |
TownInfo |
Information about towns for map generation. |
Tree |
A single tree |
ScriptRef.fileName |
The script path, toghether with the lua path inside the function
For example, this is the reference for a Crane flock function:
"models/model/animal/animal.flock.crane"
* the tokens separated by '/' before '.' are taken as part of the the path: "models/model/animal/animal"
* the tokens after the second '.' represent the lua path (in this case "flock.crane") |
ScriptRef.params |
A lua table of closure parameters that will be added at the end of the parameter list when the script is called. |
Tables
-
AircraftInfo
-
Information about the aircraft.
-
ComponentType
-
Represents a single component that can be attached to an entity.
Fields:
- ACCOUNT
= 0
- AIRCRAFT
= 1
- ANIMAL
= 2
- ASSET_GROUP
= 3
- ASSET_GROUP_AUTOREMOVE
= 4
- AUDIO_EMITTER
= 73
- BASE_EDGE
= 5
- BASE_EDGE_STREET
= 6
- BASE_EDGE_TRACK
= 7
- BASE_NODE
= 8
- BASE_NODE_TRAFFIC_LIGHT
= 9
- BASE_PARALLEL_STRIP
= 10
- BOUNDING_VOLUME
= 56
- BRIDGE
= 76
- BUILD_COST
= 11
- COLLIDER_LIST
= 12
- COLOR
= 64
- CONSTRUCTION
= 13
- EMISSION_GRID
= 14
- FIELD
= 57
- GAME_SPEED
= 15
- GAME_TIME
= 16
- LINE
= 65
- LOG_BOOK
= 74
- LOT_LIST
= 17
- MAINTENANCE_COST
= 18
- MODEL_INSTANCE_LIST
= 58
- MODEL_PERSON
= 19
- MOVE_PATH
= 66
- MOVE_PATH_AIRCRAFT
= 20
- NAME
= 63
- PARCEL
= 71
- PARTICLE_SYSTEM
= 72
- PERSON_CAPACITY
= 47
- PLAYER
= 21
- PLAYER_OWNED
= 75
- RAIL_VEHICLE
= 68
- RAILROAD_CROSSING
= 22
- ROAD_VEHICLE
= 67
- RUNWAY_LIST
= 23
- SCAFFOLD
= 48
- SHAPE_LIST
= 24
- SHIP
= 25
- SIGNAL_LIST
= 26
- SIM_BUILDING
= 27
- SIM_CARGO
= 29
- SIM_CARGO_AT_TERMINAL
= 38
- SIM_ENTITY_AT_BUILDING
= 30
- SIM_ENTITY_AT_STOCK
= 31
- SIM_ENTITY_AT_TERMINAL
= 32
- SIM_ENTITY_AT_VEHICLE
= 33
- SIM_ENTITY_IDLE
= 34
- SIM_ENTITY_MOVING
= 35
- SIM_PERSON
= 28
- SIM_PERSON_AT_TERMINAL
= 36
- SIM_PERSON_AT_VEHICLE
= 37
- STATION
= 59
- STATION_GROUP
= 60
- STOCK_LIST
= 39
- TERRAIN
= 40
- TERRAIN_ALIGNMENT_LIST
= 41
- TERRAIN_TILE
= 42
- TERRAIN_TILE_BRUSH
= 43
- TERRAIN_TILE_HEIGHTMAP
= 44
- TICK_EPOCH
= 45
- TOWN
= 46
- TOWN_BUILDING
= 49
- TOWN_CONNECTION
= 61
- TRAIN
= 69
- TRANSPORT_HISTORY
= 51
- TRANSPORT_NETWORK
= 52
- TRANSPORT_VEHICLE
= 70
- TP_NET_LINK
= 50
- VEHICLE_DEPOT
= 62
- VEHICLE_ORDER
= 53
- WATER_MESH
= 54
- WORLD
= 55
-
ConstructionEntity
-
A structure holding information to add construction entities together with a type.SimpleProposal.
It uses the data contained in a ".con" file (or added via api.res.constructionRep) to specify a construction.
Fields:
- fileName
string
A fileName (or identifier in the case of dynamic constructions)
- params
Table
the parameters, as received by the
updateFn
- transf
type.Mat4f
the local transformation in the world, used also as local transformation for models and modules.
- name
string
a name to give to the final resulting entity
- playerEntity
Entity
the player entity who will own the construction
- headquarters
Entity
can be set to -1 to specify no headquarter owenership, or it can be a playerEntity if the construction
is the headquarter.
-
EdgeObject
-
A structure that holds information about new edgeobjects added to the streets
Fields:
- edgeEntity
Entity
must be a new edge in type.SimpleStreetProposal.edgesToAdd, starting from -1 and decreasing.
- param
double
the position between 0.0 and 1.0 within said edge.
- oneWay
bool
a flag specifying if one way or not.
- left
bool
a flag specifying the side of the road
- model
int
the model id of the edge object
- playerEntity
Entity
the owner of the object
- name
string
the name to give the object
-
Interval
-
A subsection of a bridge.
-
LineLoadMode
-
Type of loading/waiting for the line.
Fields:
- LOAD_IF_AVAILABLE
0
- FULL_LOAD_ANY
1
- FULL_LOAD_ALL
2
-
LogBook.Log
-
A Log is an entry into a LogBook and keeps track of the evolution of data in time.
Fields:
- times
{int,...}
- values
{int,...}
-
Lot
-
Actual information of a type.LotList
Fields:
- vertices
{type.Vec2f,...}
list vertices of the lot
- texCoords
{type.Vec2f,...}
list of texture coordinates for the lot (same length as vertices)
- triangles
{type.Vec2f,...}
alternative to vertices, a list of triangles can be specified instead (must be a multiple of 3)
- texKey
string
the ground texture key to use
- solid
bool
-
Model
-
Information about a single model file: metadata and bounding information
Fields:
-
MovePath.DynState
-
The fast-changing component of the position on a path.
This portion will be interpolated between simulation frames.
Fields:
- pathPos
PathPos
the position on the path
- pathPos0
PathPos
(deprecated) Always nil, use MovePath.dyn0.pathPos instead
- speed
float
- speed0
float
(deprecated) Always nil, use MovePath.dyn0.speed instead
- brakeDecel
float
- accel
float
- timeUntilAccel
int
- timeStanding
int
- timeToIgnore
int
- approachingStation
bool
-
RailroadCrossingState
-
Animation state of a railroad crossing
Fields:
- OPEN
0
- CLOSED
1
- WAITING
2
-
RoadVehicle.DynState
-
The fast-changing component of a RoadVehicle.
Fields:
- brakingTimer
float
time in seconds that counts down. When positive, braking lights are on
- turnLeft
bool
true if the vehicle is turning left
- turnRight
bool
true if the vehicle is turning right
-
ShipInfo
-
Information about the ship.
-
SimpleProposal
-
A structure holding information to build/remove and update constructions and streets.
It offers much more functionality than a simple ".con" file. See also build_street.lua for an example.
The most important operations that can be performed with a Simple Proposal is adding/removing and modifying
the following objects: constructions (stations, depots, ), (base) edges and (base) nodes, and edgeobjects (signals,
street terminals, waypoints).
In general, there are a few rules concerning this proposal. First, old entities are reference with the usual non-negative
id, whilst new entities are assigned a decreasing negative number starting at -1.
The general rule is that the modification/upgrade of a construction entails removing it and adding it
anew. The same rule applies to streets and edgeobjects.
The proposal will take care of updating lines, stop, people and cargo.
Fields:
- streetProposal
SimpleStreetProposal
a block defining modification and addition of streets
- constructionsToAdd
Vector[type.ConstructionEntity]
a list of constructions to add (the entity id for constructions
in this vector are an decreasing starting from -1)
- constructionsToRemove
Vector[Entity]
a list of construction entities to remove
- old2new
Table[Entity,int]
a mapping from old construction entities to new construction entities
(must be an index in
constructionsToAdd}
.
-
SimpleStreetProposal
-
A structure holding information to add street and track entities together with a type.SimpleProposal.
A street proposal can add, remove and modify street, tracks, nodes and edge objects. To modify a street, you
need to remove all appropriate entities and add them with the correct information.
Fields:
- nodesToAdd
Vector[NodeAndEntity]
a list of base nodes to add (entity id will be decreasing starting from -1 for all new entities).
- edgesToAdd
Vector[SegmentAndEntity]
a list of base edges to add (includes edge object reference which must match the content of
edgeObjectsToRemove).
- nodesToRemove
Vector[Entity]
a list of entities with component type.BaseNode to remove.
- edgesToRemove
Vector[Entity]
list of entities with component type.BaseEdge to remove.
- edgeObjectsToAdd
Vector[EdgeObject]
a list of type.EdgeObject to add (must be compatible with
edgesToAdd
).
- edgeObjectsToRemove
Vector[Entity]
a list of entities to be removed.
-
TrainMoveInfo
-
Information about the train.
-
Tram.DynState
-
The fast-changing component of a Tram.
Fields:
- brakingTimer
number
time in seconds that counts down. When positive, braking lights are on
- turnLeft
bool
true if the vehicle is turning left
- turnRight
bool
true if the vehicle is turning right
-
TransportVehicle.Config
-
Contatins additional data for the transport vehicle
Fields:
- capacities
{int,...}
all cargo capacities of the vehicle
-
TransportVehicleConfig
-
Vehicles and data for a single transport vehicle.
Fields:
- vehicles
{TransportVehiclePart,...}
- vehicleGroups
{int,...}
Vehicles can be composed into groups, each entry is the size of the group. The sum of all entries
must be the total of vehicles. Example: for a train made of a multiple unit with three cars and 1 extra waggon would be
{3, 1}
.
-
TransportVehicleInfo
-
Information about all cargo of a transport vehicle
Fields:
-
TransportVehiclePart
-
A subsection of a transport Vehicle.
Fields:
- part
VehiclePart
- purchaseTime
number
- maintenanceState
number
- targetMaintenanceState
number
- autoLoadConfig
{number,...}
-
TransportationStats
-
A structure that holds information about the transportation data statistics.
Fields:
- cargoTransported
int
- passengersTransported
int
-
VehicleCargoInfo
-
Information about cargo of a single compartment of a transport vehicle
Fields:
- capacity
number
capacity of this vehicle
- offset
number
sum of the cargo capacities up to this vehicle
-
VehicleInfo
-
Infomation about train carriages
-
VehiclePart
-
Infomation about a single vehicle in a transport vehicle
Fields:
- modelId
int
- reversed
bool
- loadConfig
{int,...}
Cargo configuration for the model. One entry per compartment. -1 means automatic selection
of load config.
- color
Vec3f
- logo
string
-
VehiclePartInfo.Seat
-
A single seat in a vehicle.
-
VehiclePartInfo.VehiclePartInfo
-
Details about a vehicle part.
-
WaterMesh.Contour
-
Represents the boundary of a water mesh.
Fields:
Util
-
AppConfig
-
Game settings
-
AppConfig.AudioEffectSettings
-
Specification for audio settings
Fields:
- bulldozer
bool
sound effects
- construction
bool
sound effects
-
AppConfig.NewGameMenuState
-
Specification for new game settings
Fields:
- industryFrequency
int
(deprecated) the number of industries, use AppConfig.modParams instead
-
ModId
-
Mod identifier
Fields:
- name
string
of the mod
- version
int
of the mod
-
Value
-
A Value
Fields:
-
ValuesMap
-
A map of string to Value
Fields:
Class Vec2i
A 2d vector of integers.
Available in every Lua state
Supports array subscript with vec[i]
access. Supports addition +
, subtraction -
.
-
Vec2i.new()
-
Creates a new vector.
Returns:
Vec2i(0,0)
-
Vec2i.new(v)
-
Creates a new vector.
Parameters:
Returns:
Vec2i(v,v)
-
Vec2i.new(x, y)
-
Creates a new vector.
Parameters:
Returns:
Vec2i(x,y)
-
Vec2i.x
-
x
-
Vec2i.y
-
y
Class Vec2f
A 2d vector of floats
Available in every Lua state
Supports array subscript with vec[i]
access. Supports addition +
, subtraction -
and dot product *
.
-
Vec2f.new()
-
Creates a new vector.
Returns:
Vec2f(0,0)
-
Vec2f.new(v)
-
Creates a new vector.
Parameters:
Returns:
Vec2f(v,v)
-
Vec2f.new(x, y)
-
Creates a new vector.
Parameters:
Returns:
Vec2f(x,y)
-
Vec2f.x
-
x
-
Vec2f.y
-
y
Class Vec3f
A 3d vector of floats
Supports array subscript with vec[i]
access. Supports addition +
, subtraction -
and dot product *
.
-
Vec3f.new()
-
Creates a new vector.
Returns:
Vec3f(0,0,0)
-
Vec3f.new(v)
-
Creates a new vector.
Parameters:
Returns:
Vec3f(v,v,v)
-
Vec3f.new(x, y, z)
-
Creates a new vector.
Parameters:
Returns:
Vec3f(x,y,z)
-
Vec3f.x
-
x
-
Vec3f.y
-
y
-
Vec3f.z
-
z
Class Vec4f
A 4d vector of floats
Supports array subscript with vec[i]
access. Supports addition +
, subtraction -
and dot product *
.
-
Vec4f.new()
-
Creates a new vector.
Returns:
Vec4f(0,0,0,0)
-
Vec4f.new(v)
-
Creates a new vector.
Parameters:
Returns:
Vec4f(v,v,v,v)
-
Vec4f.new(x, y, z, w)
-
Creates a new vector.
Parameters:
- x
float
- y
float
- z
float
- w
float
Returns:
Vec4f(x,y,z,w)
-
Vec4f.w
-
w
-
Vec4f.x
-
x
-
Vec4f.y
-
y
-
Vec4f.z
-
z
Class Mat4f
A 4x4 matrix of floats
Supports array subscript with mat[i]
access. Supports addition +
, subtraction -
and matrix-matrix multiplication *
.
-
Mat4f.new()
-
Creates a new matrix.
Returns:
Mat4f()
-
Mat4f.new(col0, col1, col2, col3)
-
Creates a new matrix.
Parameters:
Returns:
Mat4f(col0, col1, col2, col3)
-
Mat4f.new(v)
-
Creates a new matrix.
Parameters:
Returns:
diagonal Mat4f matrix
-
Mat4f:col()
-
Return i-th column as reference
Class Date
A date for the Gregorian calendar.
-
Date.day
-
Day
-
Date.month
-
Month
-
Date.year
-
Year
Class Connection
An object used to disconnect callbacks.
-
Connection:disconnect()
-
The callback will be no longer called
Class Box2
A 2d bounding Box.
-
Box2.max
-
Max
-
Box2.min
-
Min
-
Box2.new(min, max)
-
Creates a new Box2.
Parameters:
Returns:
Box2(min,max)
-
Box2.new()
-
Creates a new Box2.
Returns:
Box2
Class Box3
A 3d bounding Box.
-
Box3.max
-
Max
-
Box3.min
-
Min
-
Box3.new(min, max)
-
Creates a new Box3.
Parameters:
Returns:
Box3(min,max)
-
Box3.new()
-
Creates a new Box3.
Returns:
Box3
Commands
-
Book
-
Command to add a new entry to the Player Journal.
Fields:
-
BuildProposal
-
Command to build a proposal, use cmd.make.buildProposal to generate this command.
Fields:
- proposal
Proposal
The definition of the proposal
- context
type.Context
A context with extra options for the build
- withCostRep
bool
tells to ingore costs if set to true
- ignoreErrors
bool
tells to ingore soft errors
- resultProposalData
ProposalData
The resulting data generated by the proposal
- resultEntities
Vector[Entity]
only relevant when obtained in callback result, after command has been ran
-
BuyVehicle
-
Command to buy a vehicle, in a given depot
Fields:
- playerEntity
Entity
the entity id of the player
- depotEntity
Entity
the entity id of the depot
- config
type.TransportVehicleConfig
data containing information about the vehicle being purchased
- resultVehicleEntity
Entity
the entity id of the new vehicle, used only as output when the command is successful
(optional)
-
ConnectTownsAndIndustries
-
Command to automatically connect all towns and industries with roads.
Fields:
- townEntities
{Entity,...}
the entity ids of the towns to connect
- connections
{type.Vec2i,...}
list with pairs of entity ids for start and end destinations
- keep
bool
set to true if existing street connections should be kept
-
CreateLine
-
Command to create a new line entity, with stop configuration, owner, color and name.
Fields:
- line
type.Line
the configuration data of the line
- name
string
the name of the line
- color
type.Vec3f
the line color
- playerOwned
bool
Sets the line to be owned by the player entity.
(optional)
- resultEntity
Entity
the entity id of the created line, used only as output whenever the command is successful.
(optional)
-
CreateTowns
-
Command to build create a set of new towns
Fields:
-
DeleteLine
-
Command to delete a single line.
Fields:
- lineEntity
Entity
the line that should be removed
-
DevelopTown
-
Command to trigger town developement at the given position.
Fields:
- position
type.Vec2f
the position where development should happen
-
InstantlyUpdateTownCargoNeeds
-
Command to change the cargo need of a town immediately and for all buildings.
Fields:
- townEntity
Entity
the entity id of the town that should be updated
- cargoNeeds
{{int,...},{int,...},{int,...}}
a list of cargo type ids for the needs of each of the three town districts residential, commercial and industrial.
-
RemoveField
-
Command to remove a field
Fields:
- fieldEntity
Entity
the entity id of the field that should be removed
-
RemoveTown
-
Command to remove a single town.
Fields:
- townEntity
Entity
the entity id of the town that should be removed
-
ReplaceTerrain
-
Command to redo the map generation.
This command imports a new map from a given configuration which includes: the heightmap, towns, indudstries,
assets and trees.
Fields:
- map
type.Map
- config
type.Terrain
- seedText
string
a seed for randomization purposes
- worldEntity
Entity
the entity id of the world, usually 0
- keepAssets
bool
if set to true, existing landscape assets are conserved
-
ReplaceVehicle
-
Command to replace a vehicle
Fields:
- vehicleEntity
Entity
the entity id of the vehicle that should be replaced
- config
type.TransportVehicleConfig
data containing information about the new vehicle being purchased
-
Reverse
-
Command to reverse a vehicle
Fields:
- vehicleEntity
Entity
the entity id of the vehicle that should be reversed
-
SellVehicle
-
Command to sell a vehicle immediately
Fields:
- vehicleEntity
Entity
the entity id of the vehicle that should be sold
-
SendScriptEvent
-
Command to send and event from the gui state to the engine state.
See also GUI State for more information.
Fields:
- fileName
string
the filename of the game_script that should be the pretended origin of the event
- id
string
identifier of the element that caused the event
- name
string
identifier of the event type
- param
bool, number, string, table or nil
parameters that depend on the context of the event
-
SendToDepot
-
Command to send a vehicle to the nearest depot
Fields:
- vehicleEntity
Entity
the entity id of the vehicle that should be sent to the depot
- sellOnArrival
bool
if set to true, the vehicle will be sold upon arrival at the depot
-
SetAnimalState
-
Sends a command object to be executed later or immediately depending on the context.
Fields:
- animalEntity
Entity
the entity id of the animal that should be updated
- movementType
int
the index of the configuration in the animals metadata movementTypes list
- targetChangedElapsed
float
time since the current target destination was selected
- invalidTileElapsed
float
time since the animal got into an invalid area
- movementSpeed
float
speed that should be used
- angularSpeed
float
angular speed that should be used
-
SetCalendarSpeed
-
Command to set the calendar speed (does affect only availability of objects).
Fields:
- millisPerDay
int
day length in milliseconds
-
SetColor
-
Changes the color of an entity.
This will set the value of api.type.ComponentType.COLOR.
Fields:
- entity
Entity
the entity id of the entity that should be colored
- color
type.Vec3f
the rgb color
-
SetDate
-
Changes the current in-game date.
Fields:
-
SetGameSpeed
-
Command to set the game speed (does affect simulation speed).
Fields:
- speedup
double
the positive speed that should be set
-
SetLine
-
Command to set a vehicle to a given line and stop
Fields:
- vehicleEntity
Entity
the entity id of the vehicle that should be sent to the depot
- lineEntity
Entity
the entity id of the line on which the vehicle should be sent
- stopIndex
int
the position of the stop on the line to which the vehicle should be sent
-
SetName
-
Command to change the name of an entity.
Fields:
- entity
Entity
the entity id of the entity that should be renamed
- name
string
the name that should be set
-
SetSimBuildingClosureTimeStamp
-
Command to change the closureTimeStamp of a building entity.
Fields:
- entity
Entity
the entityId of the building entity of which the closureTimeStamp should change
- closureTimeStamp
int
time after which the building should be closed
-
SetSimBuildingManualDevelopment
-
Command to change the development mode of a building entity.
Fields:
- entity
Entity
the entity Id of the building entity of which the manual mode should change
- manual
bool
whether the entity should manually be developed
-
SetTownInfo
-
Command to set the town information.
Fields:
- townEntity
Entity
the entity id of the town that should be updated
- initialLandUseCapacities
{int,int,int}
initial capacities for the residential, commercial and industrial district of the town
-
SetUserStopped
-
Command to stop the vehicle
Fields:
- vehicleEntity
Entity
the entity id of the vehicle that should be stopped or started
- userStopped
bool
true if the vehicle should be stopped
-
SetVehicleManualDeparture
-
Command to change the departure mode of a vehicle entity.
Fields:
- entity
Entity
the entity Id of the vehicle entity of which the departure mode should change
- manual
bool
whether the entity should wait at the terminal or not
-
SetVehicleShouldDepart
-
Command to force the vehicle to depart immediately, after closing the doors
Fields:
-
SetVehicleTargetMaintenanceState
-
Command to stop the vehicle
Fields:
- vehicleEntity
Entity
the entity id of the vehicle that should be stopped or started
- value
float
the maintenance level state that should be achieved
-
SpawnAnimal
-
Command to spawn animals.
Fields:
- modelId
string
reference to the animal model that should be spawned
- position
type.Vec2f
coordinates of the position where the animal should be spawned
- lookAt
type.Vec2f
the direction the animal is looking
- resultEntity
Entity
The entity id of the spawned animal, used as a result only
(optional)
-
UpdateLine
-
Command to modify a single line.
Fields:
- lineEntity
Entity
the entity id of the line which should be updated
- line
type.Line
the new line configuration
Enum
-
enum.Carrier
-
Defines the carrier.
Fields:
- ROAD
int
= 0
- RAIL
int
= 1
- TRAM
int
= 2
- AIR
int
= 3
- WATER
int
= 4
-
enum.DistanceUnit
-
DistanceUnit represents the unit of measurement used for distance.
Fields:
- KM
0
- M
1
- Mile
2
- Yard
3
- Feet
4
-
enum.EdgeObjectType
-
Defines the type of an edge object.
Fields:
- STOP_LEFT
int
= 0
- STOP_RIGHT
int
= 1
- SIGNAL
int
= 2
-
enum.ForceUnit
-
ForceUnit represents the unit of measurement used for force.
Fields:
-
enum.InputMode
-
InputMode represents the current input mode.
Fields:
- Undefined
0
- KeyboardMouse
1
- Gamepad
2
-
enum.MoneyMode
-
MoneyMode represents the money mode.
Fields:
-
enum.MultisamplingMode
-
MultisamplingMode for anti aliasing.
Fields:
-
enum.PowerUnit
-
PowerUnit represents the unit of measurement used for power.
Fields:
-
enum.RendererBackend
-
RendererBackend represents the backend used for rendering.
Fields:
-
enum.SpeedUnit
-
SpeedUnit represents the unit of measurement used for speed.
Fields:
-
enum.TransportMode
-
Defines the transport mode (this is used to blacklist/whitelist vehicles onto transport network edges).
These values are mosly used in a bit field to influence the pathfinding for vehicles and people.
Fields:
- PERSON
int
= 0
- CARGO
int
= 1
- CAR
int
= 2
- BUS
int
= 3
- TRUCK
int
= 4
- TRAM
int
= 5
- ELECTRIC_TRAM
int
= 6
- TRAIN
int
= 7
- ELECTRIC_TRAIN
int
= 8
- AIRCRAFT
int
= 9
- SHIP
int
= 10
- SMALL_AIRCRAFT
int
= 11
- SMALL_SHIP
int
= 12
-
enum.TransportVehicleState
-
TransportVehicleState represents the state the vehicle is currently at.
Fields:
- IN_DEPOT
0
- EN_ROUTE
1
- AT_TERMINAL
2
- GOING_TO_DEPOT
3
-
enum.UiMode
-
UiMode represents the current UI visualization mode.
Fields:
-
enum.WeightUnit
-
WeightUnit represents the unit of measurement used for power.
Fields:
Journal
-
enum.JournalEntry
-
Configuration of vehicles that can use the line
Fields:
- time
number
the in-game time when the entry was logged
- amount
number
Amount logged
- position
Vec3f
(deprecated) the position in the world (returns invalid value)
- category
JournalEntryCategory
The category
-
enum.JournalEntryCarrier
-
Journal entry Carrier Category
Fields:
- ROAD
0
- RAIL
1
- TRAM
2
- OTHER
3
- AIR
4
- WATER
5
-
enum.JournalEntryCategory
-
Details about the classification of the journal entry
Fields:
- type
JournalEntry.Type
The principal category
- construction
JournalEntry.Construction
The construction subcategory, only if type == Construction
- maintenance
JournalEntry.Maintenance
The construction subcategory, only if type == Construction
- other
JournalEntry.Other
The other subcategory, only if type == Other
- carrier
JournalEntry.Carrier
The carrier subcategory, only if type == Carrier
-
enum.JournalEntryConstruction
-
Journal entry Construction Category
Fields:
- STREET
0
- TRACK
1
- SIGNAL
2
- STATION
3
- DEPOT
4
- BULLDOZER
5
- OTHER
6
-
enum.JournalEntryMaintenance
-
Journal entry Maintenance Category
Fields:
- VEHICLE
0
- INFRASTRUCTURE
1
- OTHER
2
-
enum.JournalEntryOther
-
Journal entry Other Category
Fields:
-
enum.JournalEntryType
-
Journal entry Type Category
Fields:
- LOAN
0
- INTEREST
1
- CONSTRUCTION
2
- ACQUISITION
3
- MAINTENANCE
4
- INCOME
5
- OTHER
6
Model
-
ModelInstance
-
A model in the world, with complete information
Fields:
- modelId
int
the model id, referenced in modelRep
- transf0
Mat4f
the model transform at the previous frame
- transf
Mat4f
the model transform
- transformator
int
-1 or the index of the transformator for the model
-
ThinModelInstance
-
A model in the world, with very light information
Fields:
- modelId
int
the model id, referenced in modelRep
- pos
Vec3f
the position in the world
- rot
number
the rotation angle (in radians)
- scale
number
the scale in all directions
Line
-
Line.Stop
-
Configuration for a line stop
Fields:
- stationGroup
Entity
the station group entity to which the line stop belongs
- station
int
the station (within the station group)
- terminal
int
the terminal (within the station) for the stop
- alternativeTerminals
{type.StationTerminal,...}
Alternative terminals for the stop
- loadMode
Line.LoadMode
the configuration of what to load and not to load
- minWaitingTime
float
minimum waiting time at this stop
- maxWaitingTime
float
maximum waiting time at this stop
- waypoints
{Entity,...}
all waypoints after the stop
- how
{StopConfig,...}
much to load and unload
-
Line.StopConfig
-
Configuration details for a line stop
Fields:
- load
{int,...}
for each cargo type, if it should be loaded
- unload
{int,...}
for each cargo type, if it should be unloaded
- maxLoad
{int,...}
for each cargo type, its max allowed fraction of total capacity (from 0 to 1)
-
LineVehicleInfo
-
Configuration of vehicles that can use the line
Fields:
- transportModes
{int,...}
Type of tranport modes that can use the line
- defaultPrice
float
Default Ticket price for the line
Entity Components
-
Account
-
Contains financial data. Usually attached to the player Entity.
Fields:
- number
minimumLoan
minimum load that is possible to repay
- Vec3f
position
,...} Ledger containing the positions of the last journal entries
- JournalEntry
journal
,...} Ledger containing all categorized transactions
- number
minimumLoan
minimum load that is possible to repay
- number
minimumLoan
minimum load that is possible to repay
- number
minimumLoan
minimum load that is possible to repay
-
Aircraft
-
Data attached to aircraft.
Fields:
- bool
reservedLandingRunway
Has the runway been reserved for landing
- bool
reservedLandingRunway
Has the runway been reserved for landing
- number
reservedTo
Edge index on the path on which the reservation stops
- number
reservedTo
Edge index on the path on which the reservation stops
- number
reservedTo
Edge index on the path on which the reservation stops
- particleSystems
{Entity,...}
a list of particles emitted by the aircraft
-
Animal
-
Data attached to animals. Contains information about position and movement.
Fields:
- worldPosition
Vec3f
current location in the game world
- lookingAt
Vec2f
direction in which the animal is oriented
- targetCoord
Vec2f
destination where the animal is heading
- movementSpeed
float
the forward speed
- angularSpeed
float
the turn speed
- terrainHeightOffset
float
the offset to the terrain surface
- lastUpdateElapsed
float
time since the last update of the animal
- targetChangedElapsed
float
time since the last reorientation of the animal
- invalidTileElapsed
float
time since the animal is in an invalid location
- movementType
int
index of the current movementType
- roll
float
current roll value
- scaling
float
scale of the animal
- flock
{type.Vec3f,...}
offset for each of the flock animals relative to the worldPosition
-
AssetGroup
-
Data attached to assets, in particular trees.
Assets are grouped together when built together
in order to speed up rendering performance. Usually comes together with a type.ModelInstanceList.
-
AssetGroupAutoRemove
-
Data attached to assets entities to enable automatic removal when it collides with newly built objects.
-
AudioEmitter
-
An entity with an AudioEmitter emits a sound source
Fields:
-
BaseEdge
-
Type attached to strets and tracks, specifying the street type and other details. A BaseEdge usually
also has a type.BaseEdgeStreet or type.BaseEdgeTrack and a type.TransportNetwork.
-
BaseEdgeStreet
-
Contains details about a base edge when it is a street.
-
BaseEdgeTrack
-
Contains details about a base edge when it is a track.
-
BaseNode
-
A node in a street graph, e.g. a railroad crossing, a switch, or street crossing.
-
BaseNodeTrafficLight
-
Additional traffic light data for a base node.
-
BoundingVolume
-
Contains the bounding box of an entity.
Fields:
- bbox
Box3
The axis aligned bounding box
-
Bridge
-
Contains the full information and the entire spline of a bridge, if
this was configured to do so.
-
BuildCost
-
Stores the costs of an entity (e.g. Constructions or Edges)
-
BulldozerInfo
-
Allows to set certain entities to be not bulldozable.
-
Color
-
Specifies the color of an entity
Fields:
- color
Vec3f
the color of the entity
-
Construction
-
A construction: usually contains stations, depots, town buildings or industries.
Fields:
- fileName
string
the name of the construction (or the id in case of dynamic constructions)
- params
Table
the parameters, passed to the
updateFn
.
- transf
type.Mat4f
the world transformation of the construction
- timeBuild
int
the in-game time when the construction was first placed
- frozenNodes
{Entity,...}
nodes that belong to the construction and cannot be moved
- frozenEdges
{Entity,...}
edges that belong to the construction and cannot be moved
- depots
{Entity,...}
depots that belong to the construction
- stations
{Entity,...}
stations that belong to the construction
- simBuildings
{Entity,...}
industries that belong to the construction
- townBuilding
{Entity,...}
town building that belong to the construction
- particleSystems
{Entity,...}
all particles generated by the construction
-
EmissionGrid
-
The grid containing the emission data
Fields:
- X0
int
the bottom left corner x coordinate
- Y0
int
the bottom left corner y coordinate
- height
int
- width
int
- gridPointSize
Vec2f
the resolution of the grid
-
Field
-
Contains data representing a farm field on the terrain
Fields:
- indices
{int,...}
Indices to define triangles over vertices
- vertices
{Vec3f,...}
A list of positions on the terrain
-
GameSpeed
-
Information about the current game simulation and calendar speed.
Fields:
- millisPerDay
int
length of an in-game calendar day in milliseconds (affected by speedup, 0 = paused)
- speedup
int
multiplier for game simulation speed (non-negative, 0 = paused)
-
GameTime
-
Information about the current ingame time.
Fields:
- gameTime
int
the current ingame time
- gameTime0
int
the ingame time when the last update occured
- tickCount
int
number of simulation ticks, ticks also when the game is paused (once per frame)
- updateCount
int
number of simulation updates, does not tick when the simulation is paused
-
Line
-
An line with stops and configurations
Fields:
- stops
{Stop,...}
all line stops in order
- waitingTime
number
(deprecated) the waiting time for the line
- vehicleInfo
LineVehicleInfo
information about vehicles of the line
-
LogBook
-
A LogBook contains information about the evolution of a variable (e.g. amounts of money) over time.
Fields:
-
LotList
-
Information about ground textures that are paining the terrain
Fields:
-
MaintenanceCost
-
Contains the maintenance cost of objects
Fields:
- maintenanceCost
int
the maintenance cost of an object
-
ModelInstanceList
-
Contains all models rendered by the entity
Fields:
-
ModelPerson
-
Additional data for persons walking in the world
Fields:
- path
Path
the current path of the person
- pathPos
PathPos
the current position on the path
- stopped
bool
whether a person is currently not walking
- topSpeed
number
the maximal speed of a person
- speed
number
the current speed of a person
- brakeDecel
number
the current deceleration speed of persons
- offset
number
an offset perpendicular to the path
- position
type.Vec3f
the position in the world
- movementType
int
the animation used to move the person
- dist
number
distance from the target
- dist0
number
distance from the target (last frame)
- stateTime
number
the animation timer
-
ModelPersonIdle
-
Additional data for idle person
Fields:
- arrivalTime
number
the time since the person stopped
-
MovePath
-
Represents a path a vehicle is currently following
Fields:
- path
Path
a series of edges the vehicle is following
- endParam
int
- endPos
float
- state
int
- blocked
int
- allowEarlyArrival
bool
- reverse
bool
- dyn
MovePath.DynState
the fast-changing component of the position on the path
- dyn0
MovePath.DynState
the dyn state at the beginning of the simulation frame (optional)
-
MovePathAircraft
-
Additional data for aircraft
Fields:
- speed
number
the current speed of the aircraft
-
Name
-
Specifies the name of an entity
Fields:
- name
string
the name of the entity
-
Parcel
-
A parcel is a region of space near a road where a town building can be built.
Fields:
- streetSegment
Entity
the street edge to which the parcel belongs
- left
bool
- curveParam
float
- offset
int
- faces
{Face,...}
-
ParcelData
-
Entities attached to a segment
Fields:
- leftParcels
{Entity,...}
parcels on the left of the segment
- rightParcels
{Entity,...}
parcels on the right of the segment
-
ParticleSystem
-
A particle emitted as graphical effect
Fields:
- color
Vec3f
the color of the particle
-
PersonCapacity
-
Contains information about a workplace of household.
Fields:
- type
int
the type of capacity (1 = residential, 2 = commercial, 3 = industrial)
- capacity
int
total capacity (tenants or workers) of the Entity
-
Player
-
Represent a player
Fields:
- logo
string
the players logo
- headquarters
Entity
the current headquarters construction
-
PlayerOwned
-
An entity with player owner is property of the owner and can be bulldozed only by him.
Fields:
- player
Entity
the owner of the entity
-
RailVehicle
-
Represents a single waggon of a train (a single carriage or engine)
Fields:
- reversed
bool
true if the train travels reversed
- particleSystems
{Entity,...}
list of particles emitted by the train
-
RailroadCrossing
-
A railroad crossing
Fields:
- nodes
{Entity,...}
nodes belonging to the railroad crossing
- edges
{Entity,...}
edges belonging to the railroad crossing
- typeIndex
int
the type of crossing, as an index in api.res.railroadCrossingTypeRep.
- state
int
the current animation
- stateTime
int
the animation timer
-
RoadVehicle
-
Represents a vehicle travelling on roads (either bus or truck)
Fields:
- particleSystems
{Entity,...}
a list of particles emitted by the vehicle
- dyn
RoadVehicle.DynState
the fast-changing component of the RoadVehicle
- brakingTimer
float
(deprecated) time in seconds that counts down. When positive, braking lights are on
- turnLeft
bool
(deprecated) true if the vehicle is turning left
- turnRight
bool
(deprecated) true if the vehicle is turning right
-
RunwayList
-
All runways for the entity transport network.
Fields:
-
Shape
-
Contains a procedurally generated shape.
Fields:
- subShapes
{SubShape,...}
list of subshapes for the shape
- generator
int
procedural generator (index) used to generate the shape
-
ShapeList
-
Contains a list procedurally generated shapes.
Fields:
-
Ship
-
Contains information about pathing and extra data of ships.
Fields:
- pathIndex
int
the current position on the path
- reservedFrom
int
the starting edge reserved by the ship
- reservedTo
int
the ending edge reserved by the ship
- particleSystems
{Entity,...}
a list of particles emitted by the ship
-
SignalList
-
Contains a list of signals for the entity.
Fields:
-
SimBuilding
-
Contains information about industries.
Fields:
- stockList
{Entity,...}
a list of stocks
- level
int
the current level of the construction
- closureTimeStamp
int
time after which the building will be closed
- upgradeProgress
number
the progress towards upgrade/downgrade
- manualDevelopment
bool
set to true if industries do not start to close/stop countdown and do not level up or down
-
SimCargo
-
Additional data for cargo.
Fields:
- cargoType
int
The cargo type of the cargo (never 0)
- targetEntity
Entity
the entity of the target where the cargo item heads to
- sourceEntity
Entity
the entity of the source where the cargo item came from
- speed
float
- vehicleUsed
bool
- startTime
int
the timestamp when the cargo item was produced
-
SimCargoAtTerminal
-
Additional data for cargo waiting at the terminal
Fields:
- edgeId
EdgeId
the edge the cargo is currently using
- place
int
the place the cargo is occupying
-
SimEntityAtBuilding
-
Additional data for entities waiting at buildings.
Fields:
- waitingTime
int
How long the entity has been waiting
-
SimEntityAtStock
-
Additional data for entities waiting at industries.
Fields:
- stock
Entity
The industry the entity is waiting at
- arrivalTime
int
the timestamp when the item arrived at the industry
-
SimEntityAtTerminal
-
Additional data for entities waiting at terminals.
Fields:
- line
Entity
The line the entity is waiting for
- lineStop0
int
The stop the entity is waiting at
- lineStop1
int
The stop the entity will get off the vehicle
- arrivalTime
int
the timestamp when the item arrived at the station terminal
- vehicle
Entity
the vehicle the entity is currently waiting for
-
SimEntityAtVehicle
-
Additional data for entities travelling on a vehicle.
Fields:
- line
Entity
The line the entity is currently using
- lineStop0
int
The stop the entity waited at
- lineStop1
int
The stop the entity will get off the vehicle
- vehicle
Entity
the vehicle the entity is currently in
-
SimEntityIdle
-
Additional data for entities that are idle.
Fields:
- input
PathFactoryInput
- output
PathFactoryOutput
-
SimEntityMoving
-
Additional data for entities that are moving.
Fields:
- line
Entity
The line the entity is currently using
- lineStop0
int
The stop the entity waited at
- lineStop1
int
- partialPath
bool
true if the path complete until the destination
-
SimPerson
-
Additional data for persons.
Fields:
- cargoType
int
the cargo type of the person (always 0)
- destinations
{Entity,Entity,Entity}
the destinations for residence, shopping and work
- moveModes
{int,int,int}
- travelTimes
{int,int,int}
- targetOrAtEntity
Entity
the entity where the person is or where the person heads to
- lastNonResType
int
- lastMoveMode
int
the last used move mode
- speed
float
- modelIdPerson
int
the model that is used for the person
- colorConfigPerson
int
the color config for the clothes of the person
- modelIdCar
int
the model that is used as a car
- colorConfigCar
int
the color config for the car
- lastDestinationUpdate
int
the timestamp of the latest destination recalculation
- landUse2ReachableWalkDrive
{int,int}
- landUse2ReachableLines
{int,int}
-
SimPersonAtTerminal
-
Additional data for a person waiting at the terminal
Fields:
- edgeId
EdgeID
the edge of the transport network the entity is waiting at
- place
int
the place on the edge
-
SimPersonAtVehicle
-
Additional data for a person travelling on a vehicle
Fields:
- vehicle
Entity
the vehicle the entity is using
- part
int
the vehicle part (carriage) the entity is using
- place
int
the place (seat) in the vehicle
-
Station
-
Defines a station, i.e. a group of terminals (places where a vehicle stops and loads cargo)
Fields:
- cargo
bool
True if all edges of all terminals are set to accept cargo, a station cannot have mixed cargo and non-cargo terminals
- terminals
{Terminal,...}
A list of all terminals withing a station
- tag
string
A tag for identifying station between upgrades
- pool
Pool
A station pool for overflowing terminals
-
StationGroup
-
Defines a group of stations, can group together stations with very different transport modes
Fields:
- stations
{Entity,...}
A list of stations that are grouped together
-
SubShape
-
Contains a procedurally generated sub-shape.
Fields:
- faces
{{Vec3f,...},...}
- height0
Number
min height for collision purposes
- height1
Number
max height for collision purposes
-
Terrain
-
Contains information about the map.
Fields:
- size
Vec2i
the number of tiles of the terrain
- baseLevels
int
number of base levels
- baseResolution
Vec3i
resolution for all three dimensions
- highLevels
int
- offsetZ
float
- waterLevel
float
level for the surface of the navigatable water
-
TerrainTile
-
Contains information about a single tile of the map.
A tile is a 256m x 256m chunk of the map.
Fields:
- terrainEntity
Entity
a reference to the entity with Terrain information
- position
Vec2i
the position of the tile in the tile grid
-
TerrainTileBrush
-
Contains information about the brush layer of a tile of the map.
Fields:
- materialIndexBrush
Entity
contains the material id of the brush layer
-
TerrainTileHeightmap
-
Contains information about the geometry of the tile.
Fields:
- vertices
{int,...}
contains the heightmap information for the tile. Each value is for a position in the heightmap grid of the tile with a 4m resolution
-
TickEpoch
-
Tracks information about the last time an entity was modified or added.
Fields:
- time
int
a unique index incrementing each simulation update step
- commandIndex
int
a unique index counting commands within a frame
- subIndex
int
a unique increasing index within a command
-
Town
-
Contains information about a single town.
Fields:
- initialLandUseCapacities
{int,int,int}
initial capacities for the residential, commercial and industrial district of the town
- sizeFactor
float
a base size of the town
- growthTendency
float
- cargoNeeds
{{int,...},{int,...},{int,...}}
list of cargo type ids for the needs of each of the three town districts residential, commercial and industrial
- customCargoNeeds
bool
true: all cargoNeeds will be required per building, false: cargoNeeds are based on the building level and the cargoNeedsPerTown setting
- developmentActive
bool
- emission
float
- trafficSpeed
float
-
TownBuilding
-
Contains information about a town building.
Fields:
- personCapacity
int
- stockList
int
- level
int
- parcels
{Entity,...}
parcels occupied by the building
- depth
int
- height
float
the height of the building
- town
Entity
the town entity
- timeBuilt
int
the timestamp when the building was built
-
TownConnection
-
Defines a connection between towns.
Fields:
- entity0
Entity
first town
- entity1
Entity
second town
- position0
Vec2f
position of the first town
- position1
Vec2f
position of the second town
- time
number
approximate time taken to travel the connection
- lastUpgradeYear
int
- currentTime
int
- valid
bool
-
TpNetLink
-
Represents a link between transport networks.
A link is an automatic pedestrian connection.
Fields:
- from
EdgePos
link starting edge position
- to
EdgePos
link end edge position
-
Train
-
Represents an entire train
Fields:
- vehicles
{Entity,...}
all waggons and engines of the train
- reservedFrom
- reservedTo
-
Tram
-
Represents a tram
Fields:
- particleSystems
{Entity,...}
a list of particles emitted by the tram
- dyn
Tram.DynState
the fast-changing component of the Tram
- leftStationSince
number
(deprecated) counts time since station was left
-
TransportHistory
-
Contains the history of transported cargo for the entity.
A link is an automatic pedestrian connection.
Fields:
-
TransportNetwork
-
Contains the graph of edges and nodes onto which vehicles and person move.
Fields:
- nodes
{Node,...}
The list of nodes of the transport network
- edges
{Edge,...}
The list of edges of the transport network
- for
{int,...}
each edge, the index of the first edge on the opposite lane
-
TransportVehicle
-
Represents a single transport vehicle
Fields:
- carrier
Carrier
the type of transport vehicle
- transportVehicleConfig
type.TransportVehicleConfig
the configuration of vehicle models in this vehicle
- config
TransportVehicle.Config
various configuration properties for the vehicle
- state
TransportVehicleState
current state of the vehicle
- userStopped
bool
whether or not the user stopped the vehicle
- depot
Entity
if in depot, the Entity Id of the depot
- sellOnArrival
bool
whether or not the vehicle will be sold on arrival
- line
Entity
the entity of the line (if assigned to one)
- stopIndex
int
the stop index of the line (if assigned to one)
- arrivalStationTerminal
type.StationTerminal
The terminal to which the vehicle currently tries to go
- arrivalStationTerminalLocked
bool
If the arrivalStationTerminal is the final decision
- timeUntilLoad
number
how much time is left until the vehicle will start loading cargo
- timeUntilCloseDoors
number
how much time is left until the vehicle starts closing the doors
- timeUntilDeparture
number
how much time is left until the vehicle leaves the terminal
- noPath
bool
whether or not the vehicle has a path
- daysInDepot
int
amount of days waiting in depot
- daysAtTerminal
int
amount of days waiting at terminal
- doorsOpen
bool
whether doors should be open or closed
- doorsTime
number
time at which the door have been closed/open
- autoDeparture
bool
whether the vehicle departure is managed by the game or not
-
VehicleDepot
-
Defines a vehicle depot
Fields:
- carrier
enum.Carrier
The transport method for the depot, affects available vehicles
- inNodes
{NodeId,...}
the nodes that are entry points for the depot
- outNodes
{NodeId,...}
the nodes that are exit points for the depot
- state
int
- doors
int
- stateTime
int
-
VehicleOrder
-
Contains information about precedence and breaking.
Fields:
- entity
Entity
the vehicle entity of the vehicle before this vehicle
- strongBrakeEntity
bool
- waitingForSpace
bool
- waitingForTrafficLight
bool
-
WaterMesh
-
Contains the geometry information for a single tile of water.
Fields:
- waterLevel
float
level for the surface of the navigatable water
- vertices
{Vec2f,...}
the list of vertices of the mesh
- dephts
{float,...}
the water depth at the vertex position
- indices
{int,...}
- contours
{Contour,...}
a list with boundaries of the water mesh
- pos
Vec2i
coordinate of the tile
Station
-
Pool
-
Defines a common pool in a station for overflowing terminal capacities
Fields:
- edges
{EdgeId,...}
the list of edges of the shared waiting area
- moreCapacity
int
the size of the shared pool
MapGeneration
-
Asset
-
A single asset
Fields:
-
Industry
-
Data about industry
Fields:
-
Map
-
Information about the map, for map generation purposes.
Fields:
- numTilesX
number
number of tiles (256 m x 256 blocks) in X direction
- numTilesY
number
number of tiles (256 m x 256 blocks) in Y direction
-
MapAsset
-
Information about assets to be placed on the map
-
MapIndustry
-
Information about industries on a map
Fields:
-
MapTown
-
Information about towns on a map
Fields:
-
MapTree
-
Information about trees to be placed on the map
-
Town
-
Data about town
Fields:
-
TownInfo
-
Information about towns for map generation.
Fields:
- name
string
name of the town
- position
type.Vec3f
world position of the town
- number
{number,
, number} initialLandUseCapacities initial size for residential, commercial, industrial zones
- landUse2CargoNeeds
{{type.CargoType,...},...}
cargo needs for residential, commercial, industrial zones
-
Tree
-
A single tree
Fields:
Class type.BoundingInfo
Information about the axis aligned bounding box of the model
-
type.BoundingInfo.bbMax
-
Second corner
-
type.BoundingInfo.bbMin
-
First corner
-
type.BoundingInfo.new(bbMin, bbMax)
-
Creates a new bounding info
Parameters:
Class type.Collider
Information about the collider of the model
-
type.Collider.box
-
Only if type == 3, a collider made up of a set of points
-
type.Collider.box
-
Only if type == 2, a collider with a cylindrical shape
- box
type.Collider.Cylinder
-
type.Collider.box
-
Only if type == 1, a collider with a cuboidal shape
-
type.Collider.type
-
The type of collider 0 = NONE, 1 = BOX, 2 = CYLINDER, 3 = POINT_CLOUD
-
type.Collider.type
-
The transform of the collider, relative to which the other data is transformed
Class type.Collider.Box
A rectangular parallelepiped used for colliders
-
type.Collider.Box.halfExtents
-
Distance from transform position to define the cuboid (in the direction relative to the transform)
-
type.Collider.Box.halfExtents
-
The dimensions from the center the cylinder extends to. Before being transformed.
Class type.Collider.PointCloud
A set of points used for collision
-
type.Collider.PointCloud.points
-
A list of points specifying all collision points
Class type.MetadataMap
Contains all metadata of a model. A specific metadata might be nil.
-
type.MetadataMap.airVehicle
-
Defines a model to be used as a air vehicle
- airVehicle
type.MetadataMap.AirVehicle
-
type.MetadataMap.animal
-
Defines the properties of an animal
- animal
type.MetadataMap.Animal
-
type.MetadataMap.autoGroundTex
-
Defines a model to place automatic ground textures when placed in-world
- autoGroundTex
type.MetadataMap.AutoGroundTex
-
type.MetadataMap.availability
-
In-game availability of the object
- availability
type.MetadataMap.Availability
-
type.MetadataMap.cameraConfig
-
Defines custom camera configurations for in-game cockpit view
- cameraConfig
type.MetadataMap.CameraConfig
-
type.MetadataMap.car
-
Empty placeholder to define which models are to be used as car, must also have a roadVehicle entry
-
type.MetadataMap.cargoSlotProvider
-
Used in conjuncion with transport vehicle metadata to define cargo positioning of custom cargo models
- cargoSlotProvider
type.MetadataMap.CargoSlotProvider
-
type.MetadataMap.category
-
Defines UI categories to sort the model in the menu
- category
type.MetadataMap.Category
-
type.MetadataMap.categoryList
-
Additional metadata tags used for terrain generation and other purposes
- categoryList
type.MetadataMap.CategoryList
-
type.MetadataMap.colorConfig
-
Defines the color configurations of the vehicle
- colorConfig
type.MetadataMap.ColorConfig
-
type.MetadataMap.cost
-
In-game cost of the object
- cost
type.MetadataMap.Cost
-
type.MetadataMap.description
-
Name, icons and description for UI display
- description
type.MetadataMap.Description
-
type.MetadataMap.emission
-
In-game emission configuration of the object
- emission
type.MetadataMap.Emission
-
type.MetadataMap.labelList
-
Defines additional information for the emission of labels in-game
- labelList
type.MetadataMap.LabelList
-
type.MetadataMap.maintenance
-
In-game maintenance cost and other data of the object
- maintenance
type.MetadataMap.Maintenance
-
type.MetadataMap.order
-
Defines UI ordering when the item is placed in the menu
- order
type.MetadataMap.Order
-
type.MetadataMap.particleSystem
-
Particles emitted by the object when placed in-game
- particleSystem
type.MetadataMap.ParticleSystem
-
type.MetadataMap.person
-
Definition for in-game persons
- person
type.MetadataMap.Person
-
type.MetadataMap.roadVehicle
-
Defines a model to be used as a rail vehicle
- roadVehicle
type.MetadataMap.RailVehicle
-
type.MetadataMap.roadVehicle
-
Defines a model to be used as a road vehicle
- roadVehicle
type.MetadataMap.RoadVehicle
-
type.MetadataMap.rock
-
Used to define which models can be placed as rock assets
- rock
type.MetadataMap.Rock
-
type.MetadataMap.seatProvider
-
Used in conjuncion with transport vehicle metadata to define seating, driving and person places within the vehicle
- seatProvider
type.MetadataMap.SeatProvider
-
type.MetadataMap.signal
-
Used to define a model to be usable as signal
- signal
type.MetadataMap.Signal
-
type.MetadataMap.soundConfig
-
Defines the sound emitted by the model when in-game
- soundConfig
type.MetadataMap.SoundConfig
-
type.MetadataMap.streetTerminal
-
Defines a model to be used as a street stop
- streetTerminal
type.MetadataMap.StreetTerminal
-
type.MetadataMap.terrainAlignmentProvider
-
Used to define additional terrain modifications the model applies to the terrain when placed
- terrainAlignmentProvider
type.MetadataMap.TerrainAlignmentProvider
-
type.MetadataMap.transportNetworkProvider
-
Defines a transport network to be created when the model is placed
- transportNetworkProvider
type.MetadataMap.TransportNetworkProvider
-
type.MetadataMap.transportVehicle
-
Used to define a model to be usable as transport vehicle
- transportVehicle
type.MetadataMap.TransportVehicle
-
type.MetadataMap.tree
-
Used to define which models can be placed as tree assets
- tree
type.MetadataMap.Tree
-
type.MetadataMap.vehicleDepot
-
Used to define a model to be usable as vehicle depot
- vehicleDepot
type.MetadataMap.VehicleDepot
-
type.MetadataMap.waterVehicle
-
Defines a model to be used as a water vehicle
- waterVehicle
type.MetadataMap.WaterVehicle
Resources
-
AutoGroundTex
-
Specification for auto-generated ground textures
-
BridgeType
-
Specification for bridge types
Fields:
- costFactors
type.Vec3f
factors for computing costs: a thresold, an exponent, and an offset
-
BuildMode
-
How the construction reacts to mouse inputs while building.
Fields:
-
BuildingType
-
Specification for town building types
-
CargoType
-
Specification for cargo types
Fields:
- id
number
Unique identifier for the type
- order
number
Order (for sorting in cargo type lists)
- name
string
display name
- icon
string
display icon path
- iconSmall
string
display icon path for small contextes
- weight
number
cargo weigth for a unit of cargo
-
ConstructionDesc.SnapConfig
-
Defines if the construction can be snapped to tracks, roads or the water surface
-
ConstructionType
-
Type of the construction for displaying in the correct UI category and controlling specific behaviour for the type.
Fields:
- STREET_STATION
0
- RAIL_STATION
1
- AIRPORT
2
- HARBOR
3
- STREET_STATION_CARGO
4
- RAIL_STATION_CARGO
5
- HARBOR_CARGO
6
- STREET_DEPOT
7
- RAIL_DEPOT
8
- WATER_DEPOT
9
- INDUSTRY
10
- ASSET_DEFAULT
11
- ASSET_TRACK
12
- TOWN_BUILDING
13
- STREET_CONSTRUCTION
14
- NONE
15
- AIRPORT_CARGO
16
- TRACK_CONSTRUCTION
17
- WATER_WAYPOINT
18
-
GroundTexture
-
Specification for ground textures
-
GroundTexture.Data
-
Extra information for ground textures
-
IconRenderDistances
-
Used to configure the HUD icon render distances from the camera view.
-
LandUseType
-
Enumeration for land use types
-
LaneConfig
-
Specification for the lanes of street
-
ModuleDesc
-
Used to configure new modules.
-
MultipleUnit
-
Specification for multiple units
-
MultipleUnit.Vehicle
-
Specification for multiple units individual vehicles
-
RailroadCrossingType
-
Specification for railroad crossings
-
RailroadCrossingType.ConfigEntry
-
Specification for railroad crossings models
-
ScriptParamType
-
UI Type for displaying the parameter. Used to configure the parameters used for constructions.
Fields:
- BUTTON
0
- SLIDER
1
- COMBOBOX
2
- ICON_BUTTON
3
- CHECKBOX
4
-
StreetType
-
Specification for street types
-
TownBuildingParams
-
Extra information for town buildings
-
TrackType
-
Specification for a track type
-
TrafficLightType
-
Specification for traffic lights
-
TunnelType
-
Specification for tunnel types
Class ScriptRef
References a function in another file with ".script" exctension.
-
ScriptRef.fileName
-
The script path, toghether with the lua path inside the function
For example, this is the reference for a Crane flock function:
"models/model/animal/animal.flock.crane"
* the tokens separated by '/' before '.' are taken as part of the the path: "models/model/animal/animal"
* the tokens after the second '.' represent the lua path (in this case "flock.crane")
-
ScriptRef.params
-
A lua table of closure parameters that will be added at the end of the parameter list when the script is called.
Class ScriptParam
Used to configure the parameter-based UI.
-
ScriptParam.defaultIndex
-
Default index/state
-
ScriptParam.key
-
Unique key that is passed to the construction functions
-
ScriptParam.name
-
Display name
-
ScriptParam.tooltip
-
Tooltip to display over certain parameters
-
ScriptParam.uiType
-
Type of ui shown in user interface selection
-
ScriptParam.values
-
All possible values of the params
-
ScriptParam.yearFrom
-
Availability from
-
ScriptParam.yearTo
-
Availability to
Class ConstructionDesc
Describes a construction
-
ConstructionDesc.costs
-
Render distance for costs and income HUD icons
-
ConstructionDesc.depots
-
Render distance for depots HUD icons
-
ConstructionDesc.fileName
-
fileName
- fileName
string
A fileName or unique identifier for the construction.
-
ConstructionDesc.industries
-
Render distance for industries HUD icons
-
ConstructionDesc.params
-
Configuration
- params
{ScriptParam,...}
A list of parameters that can be used to configure the construction.
-
ConstructionDesc.planes
-
Render distance planes HUD icons
-
ConstructionDesc.roadVehicles
-
Render distance for roadVehicles HUD icons
-
ConstructionDesc.ships
-
Render distance for ships HUD icons
-
ConstructionDesc.signals
-
Render distance signals HUD icons
-
ConstructionDesc.stations
-
Render distance for stations HUD icons
-
ConstructionDesc.towns
-
Render distance for towns HUD icons
-
ConstructionDesc.towns
-
Render distance for townBuildingsCargo HUD icons
-
ConstructionDesc.trains
-
Render distance trains HUD icons
Transport
-
EdgeGeometry
-
Defines the geometry (shape) of an edge.
Fields:
-
EdgeGeometry.Arc
-
Arc
Fields:
- angle
Number
- center
type.Vec2f
- radius
Number
- startAngle
Number
-
EdgeGeometry.CubicOffsetSpline
-
CubicOffsetSpline
Fields:
-
EdgeGeometry.CubicSpline
-
CubicSpline
Fields:
-
EdgeGeometry.Straight
-
Straight
Fields:
-
EdgeIdDir
-
Input helper type.
Fields:
-
EdgeIdDirAndLength
-
Input helper type.
Fields:
-
EdgeIsect
-
Specifies the intersection of two edges, with waiting area for vehicles.
-
EdgeIsect.Info
-
Data for an edge intersect
-
ExtPath.ExtPathEdge
-
A path edge of an ExtPath.
It can be either an EdgeRange, which is a sub-interval of an edge (see type.edgeId),
or a link connecting two arbitrary points of different edges.
Fields:
- range
ExtPath.ExtPathEdge.EdgeRange
If the Edge represents an EdgeRange, this provides access to its data (nil otherwise)
- link
ExtPath.ExtPathEdge.LinkEdge
If the Edge represents a LinkEdge, this provides access to its data (nil otherwise)
-
ExtPath.ExtPathEdge.EdgeRange
-
An EdgeRange of an ExtPath.ExtPathEdge
Fields:
- edgeId
type.EdgeId
The ID of the corresponding transport edge
- params
{Number,Number}
the start and end positions (range: 0.0 - 1.0)
- dir
bool
direction along the edge (true if along the direction specified by the edgeId, false for reverse)
-
ExtPath.ExtPathEdge::LinkEdge
-
An LinkEdge of an ExtPath.ExtPathEdge
Fields:
- The
points
two locations that are connected
-
NodeId
-
References a single transport network node within a transport network entity
Fields:
- new
func
constructor, either no parameters or and entity and an index
- entity
Entity
the type.ComponentType.TRANSPORT_NETWORK entity
- index
int
the index within the edges field of the transport network component (starting at 0)
-
PortId
-
Identifies a TransportNodeData.Port of a Node within a type.ComponentType.TRANSPORT_NETWORK
Fields:
-
SignalId
-
Identifies a street/track signal
Fields:
- entity
Entity
The entity of the SignalList
- index
int
The index of the signal inside the signal list
-
StationTerminal
-
Identifies a Terminal inside a StationGroup
Fields:
- station
int
The station index in the StationGroup
- terminal
int
The terminal index in the Station
-
TpNetData
-
Contains additional data about the transport network.
-
TransportEdge
-
A single edge within a type.ComponentType.TRANSPORT_NETWORK. Also a referenced by type.EdgeId.
-
TransportEdgeData
-
Data attached to a transport network edge.
-
TransportNode
-
A single node within a type.ComponentType.TRANSPORT_NETWORK. Also a referenced by type.NodeId.
-
TransportNodeData
-
Data attached to a transport network node.
-
TransportNodeData.Port
-
Specifies the connectivity of the node.
A Port associates a neighbouring edge with the node and defines which other ports (and thus edges)
are connected to it.
Pathfinding
-
type.EdgeIdDir.new(edgeID, direction)
-
Generates a new EdgeIdDir item.
Parameters:
- edgeID
type.EdgeID
- direction
bool
-
type.EdgeIdDirAndLength.new(edgeID, direction, length)
-
Generates a new EdgeIdDirAndLength item.
Parameters:
- edgeID
type.EdgeID
- direction
bool
- length
float
Class EdgeId
References a single transport network edge within a transport network entity
-
EdgeId.edgeId
-
The type.ComponentType.TRANSPORT_NETWORK entity
-
EdgeId.index
-
The index within the edges field of the transport network component (starting at 0)
-
EdgeId.new()
-
Constructor: either no parameters or and entity and an index
Class EdgePos
References a position inside an
type.EdgeId
-
EdgePos.edgeId
-
The edge (entity and index within transport network)
-
EdgePos.param
-
The position on the edge
Class Path
A path comprised of EdgeId and directions
-
Path.edges
-
The path data
-
Path.endOffset
-
The actual end of the path (i.e. where to stop) as offset from the end
Class PathPos
The position on a Path
-
PathPos.edgeIndex
-
The index within a path
-
PathPos.pos
-
The position on the spline, relative to the length of the spline
-
PathPos.pos01
-
The position on the spline, normalized as parameter from 0 to 1
Class Terminal
Data for a station Terminal.
-
Terminal.personEdges
-
List of all edges for the person/cargo wait area
-
Terminal.personNodes
-
list of all nodes for the person/cargo wait area
-
Terminal.tag
-
Identifying tag
-
Terminal.vehicleNodeId
-
The position (node) where the vehicle will attempt to stop
Class PathPosData
The position in the world
-
PathPosData.Signal
-
Contains information about a street/track signal
Fields:
- edgePr
{EdgeId,bool}
EdgeId and direction
- type
Type
the type of the signal
- state
int
current animation playing
- stateTime
int
timer for the animation
-
PathPosData.SignalType
-
Enum containing the type of the signal
Fields:
- SIGNAL
0
- ONE_WAY_SIGNAL
1
- WAYPOINT
2
-
PathPosData.pPrime
-
The first derivative
-
PathPosData.pPrimePrime
-
The second derivative
-
PathPosData.position
-
The position in the world
Proposal
-
CollisionInfo
-
Collision information of the type.Proposal.
-
CollisionInfo.EntityData
-
More data about the collision.
-
Context
-
A structure containing extra options for the building of a proposal.
-
ErrorState
-
Contains error information for a proposal.
Wherever a construction cannot be built for any reason, then the ErrorState will contain
one or more message signaling the error type.
-
NodeAndEntity
-
An entity with a type.ComponentType.BASE_NODE component.
Used to specify a new base node entity to be added.
-
Proposal
-
A more complete version of the type.SimpleProposal.
Most data can be read from a type.ProposalData or in the result of cmd.make.buildProposal.
-
Proposal.ConstructionEntity
-
A more complete version of the type.ConstructionEntity.
Most data can be read from a type.ProposalData or in the result of cmd.make.buildProposal.
-
ProposalCreateCallbackResult
-
Contains only the error message.
-
ProposalData
-
Contains the processed result of a type.Proposal.
-
SegmentAndEntity
-
An entity with a type.ComponentType.BASE_EDGE component and extra information.
Used to specify a new base edge entity to be added.
-
StreetProposal
-
A more complete version of the type.SimpleStreetProposal.
Most data can be read from a type.ProposalData or in the result of cmd.make.buildProposal.
-
StreetProposal.EdgeObject
-
A more complete version of the type.EdgeObject.
Most data can be read from a type.ProposalData or in the result of cmd.make.buildProposal.
-
TpNetLinkProposal
-
Contains the processed result with all edge links.
-
TpNetLinkProposal.Data
-
Information about a single link.