Module api.type

Contains game command objects and related utilities.

Tables

AircraftInfo Information about the aircraft.
ComponentType Represents a single component that can be attached to an entity.
ConstructionEntity A structure holding information to add construction entities together with a type.SimpleProposal.
EdgeObject A structure that holds information about new edgeobjects added to the streets
Interval A subsection of a bridge.
LogBook.Log A Log is an entry into a LogBook and keeps track of the evolution of data in time.
Lot Actual information of a type.LotList
Model Information about a single model file: metadata and bounding information
MovePath.DynState The fast-changing component of the position on a path.
ShipInfo Information about the ship.
SimpleProposal A structure holding information to build/remove and update constructions and streets.
SimpleStreetProposal A structure holding information to add street and track entities together with a type.SimpleProposal.
TrainMoveInfo Information about the train.
TransportVehicle.Config Contatins additional data for the transport vehicle
TransportVehicleConfig Vehicles and data for a single transport vehicle.
TransportVehiclePart A subsection of a transport Vehicle.
VehicleInfo Infomation about train carriages
VehiclePart Infomation about a single vehicle in a transport vehicle
VehiclePartInfo.Seat A single seat in a vehicle.
VehiclePartInfo.VehiclePartInfo Details about a vehicle part.
WaterMesh.Contour Represents the boundary of a water mesh.

Class Vec2i

Vec2i.new() Creates a new vector.
Vec2i.new(v) Creates a new vector.
Vec2i.new(x, y) Creates a new vector.
Vec2i.x x
Vec2i.y y

Class Vec2f

Vec2f.new() Creates a new vector.
Vec2f.new(v) Creates a new vector.
Vec2f.new(x, y) Creates a new vector.
Vec2f.x x
Vec2f.y y

Class Vec3f

Vec3f.new() Creates a new vector.
Vec3f.new(v) Creates a new vector.
Vec3f.new(x, y, z) Creates a new vector.
Vec3f.x x
Vec3f.y y
Vec3f.z z

Class Vec4f

Vec4f.new() Creates a new vector.
Vec4f.new(v) Creates a new vector.
Vec4f.new(x, y, z, w) Creates a new vector.
Vec4f.w w
Vec4f.x x
Vec4f.y y
Vec4f.z z

Class Mat4f

Mat4f.new() Creates a new matrix.
Mat4f.new(col0, col1, col2, col3) Creates a new matrix.
Mat4f.new(v) Creates a new matrix.
Mat4f:col() Return i-th column as reference

Class Date

Date.day Day
Date.month Month
Date.year Year

Class Connection

Connection:disconnect() The callback will be no longer called

Class Box2

Box2.max Max
Box2.min Min
Box2.new(min, max) Creates a new Box2.
Box2.new() Creates a new Box2.

Class Box3

Box3.max Max
Box3.min Min
Box3.new(min, max) Creates a new Box3.
Box3.new() Creates a new Box3.

Commands

Book Sends a command object to be executed later or immediately depending on the context.
BuildProposal Command to build a proposal
BuyVehicle Command to buy a vehicle, in a given depot
ConnectTownsAndIndustries Command to automatically connect all towns and industries with roads.
CreateLine Command to set the calendar speed (does affect only availability of objects).
CreateTowns Command to build create a set of new towns
DeleteLine Command to delete a single line.
DevelopTown Command to trigger town developement at the given position.
InstantlyUpdateTownCargoNeeds Command to change the cargo need of a town immediately and for all buildings.
RemoveField Command to remove a field
RemoveTown Command to remove a single town.
ReplaceTerrain Command to redo the map generation.
ReplaceVehicle Command to replace a vehicle
Reverse Command to reverse a vehicle
SellVehicle Command to sell a vehicle immediately
SendScriptEvent Command to send and event from the gui state to the engine state.
SendToDepot Command to send a vehicle to the nearest depot
SetAnimalState Sends a command object to be executed later or immediately depending on the context.
SetCalendarSpeed Command to set the calendar speed (does affect only availability of objects).
SetColor Changes the color of an entity.
SetDate Changes the current in-game date.
SetGameSpeed Command to set the game speed (does affect simulation speed).
SetLine Command to set a vehicle to a given line and stop
SetName Sends a command object to be executed later or immediately depending on the context.
SetTownInfo Command to set the town information.
SetUserStopped Command to stop the vehicle
SetVehicleTargetMaintenanceState Command to stop the vehicle
SpawnAnimal Command to spawn animals.
UpdateLine Command to modify a single line.

Entity Components

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 abut the current speed 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
ModelPerson 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.
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.
ShapeList Contains 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 industries.
SimEntityAtBuilding Additional data for entities waiting at buildings.
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
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.

Class type.BoundingInfo

type.BoundingInfo.bbMax Second corner
type.BoundingInfo.bbMin First corner
type.BoundingInfo.new(bbMin, bbMax) Creates a new bounding info

Class type.Collider

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
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

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.

Class type.Collider.PointCloud

type.Collider.PointCloud.points A list of points specifying all collision points

Class type.MetadataMap

type.MetadataMap.airVehicle Defines a model to be used as a air vehicle
type.MetadataMap.airVehicle Defines the sound emitted by the model when in-game
type.MetadataMap.animal Defines the properties of an animal
type.MetadataMap.autoGroundTex Defines a model to place automatic ground textures when placed in-world
type.MetadataMap.availability In-game availability of the object
type.MetadataMap.cameraConfig Defines custom camera configurations for in-game cockpit view
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
type.MetadataMap.category Defines UI categories to sort the model in the menu
type.MetadataMap.categoryList Additional metadata tags used for terrain generation and other purposes
type.MetadataMap.colorConfig Defines the color configurations of the vehicle
type.MetadataMap.cost In-game cost of the object
type.MetadataMap.description Name, icons and description for UI display
type.MetadataMap.emission In-game emission configuration of the object
type.MetadataMap.labelList Defines additional information for the emission of labels in-game
type.MetadataMap.maintenance In-game maintenance cost and other data of the object
type.MetadataMap.order Defines UI ordering when the item is placed in the menu
type.MetadataMap.particleSystem Particles emitted by the object when placed in-game
type.MetadataMap.person Definition for in-game persons
type.MetadataMap.roadVehicle Defines a model to be used as a road vehicle
type.MetadataMap.roadVehicle Defines a model to be used as a rail vehicle
type.MetadataMap.rock Used to define which models can be placed as rock assets
type.MetadataMap.seatProvider Used in conjuncion with transport vehicle metadata to define seating, driving and person places within the vehicle
type.MetadataMap.signal Used to define a model to be usable as signal
type.MetadataMap.streetTerminal Defines a model to be used as a street stop
type.MetadataMap.terrainAlignmentProvider Used to define additional terrain modifications the model applies to the terrain when placed
type.MetadataMap.transportNetworkProvider Defines a transport network to be created when the model is placed
type.MetadataMap.transportVehicle Used to define a model to be usable as transport vehicle
type.MetadataMap.tree Used to define which models can be placed as tree assets
type.MetadataMap.vehicleDepot Used to define a model to be usable as vehicle depot
type.MetadataMap.waterVehicle Defines a model to be used as a water vehicle

Class ScriptRef

ScriptRef.fileName The script path, toghether with the lua path inside the function
ScriptRef.params A lua table of closure parameters that will be called when the script is called.

Resources

ConstructionDesc Describes a construction
ModuleDesc Used to configure new modules.

Class ScriptParam

ScriptParam.defaultIndex Default index/state
ScriptParam.fileName fileName
ScriptParam.key Unique key that is passed to the construction functions
ScriptParam.name Display name
ScriptParam.params Configuration
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

Transport

EdgeGeometry Defines the geometry (shape) of an edge.
EdgeGeometry.Arc Arc
EdgeGeometry.CubicOffsetSpline CubicOffsetSpline
EdgeGeometry.CubicSpline CubicSpline
EdgeGeometry.Straight Straight
EdgeIsect Specifies the intersection of two edges, with waiting area for vehicles.
EdgeIsect.Info Data for an edge intersect
NodeData.Port Specifies the connectivity of the node.
NodeId References a single transport network node within a transport network entity
TpNetData Contains additional data about the transport network.
TransportEdge A single edge within a ???.
TransportEdgeData Data attached to a transport network edge.
TransportNode A single node within a ???.
TransportNodeData Data attached to a transport network node.
util.pathfinding.EdgeIdDir Input helper type.
util.pathfinding.EdgeIdDirAndLength Input helper type.

Pathfinding

util.pathfinding.EdgeIdDir.new(edgeID, direction) Generates a new EdgeIdDirAndLength item.
util.pathfinding.EdgeIdDirAndLength.new(edgeID, direction, length) Generates a new EdgeIdDirAndLength item.

Class EdgeId

EdgeId.edgeId The ??? 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

EdgePos.edgeId The edge (entity and index within transport network)
EdgePos.param The position on the edge

Class Path

Path.edges The path data
Path.endOffset The actual end of the path (i.e.

Class PathPos

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 PathPosData

PathPosData.Signal Contains information about a street/track signal
PathPosData.pPrime The first derivative
PathPosData.pPrimePrime The second derivative
PathPosData.position The position in the world
type.Signal.Type Enum containing the type of the signal

Enum

enum.Carrier Defines the carrier.
enum.EdgeObjectType Defines the type of an edge object.
enum.TransportMode Defines the transport mode (to black/white list vehicles onto edges).

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.
NodeAndEntity An entity with a {type.ComponentType.BASE_NODE} component.
Proposal A more complete version of the type.SimpleProposal.
Proposal.ConstructionEntity A more complete version of the type.ConstructionEntity.
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.
StreetProposal A more complete version of the type.SimpleStreetProposal.
StreetProposal.EdgeObject A more complete version of the type.EdgeObject.
TpNetLinkProposal Contains the processed result with all edge links.
TpNetLinkProposal.Data Information about a single link.


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 ???, 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.
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
  • speed float
  • speed0 float
  • brakeDecel float
  • accel float
  • timeUntilAccel int
  • timeStanding int
  • timeToIgnore int
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.
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}.
TransportVehiclePart
A subsection of a transport Vehicle.

Fields:

  • part VehiclePart
  • purchaseTime number
  • maintenanceState number
  • targetMaintenanceState number
  • autoLoadConfig {number,...}
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:

  • vertices {Vec3f,...} The list of vertices of the contour
  • edges {Vec3f,...} The list of normals at the vertex

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:

  • v int

Returns:

    Vec2i(v,v)
Vec2i.new(x, y)
Creates a new vector.

Parameters:

  • x int
  • y int

Returns:

    Vec2i(x,y)
Vec2i.x
x
  • x
Vec2i.y
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:

  • v float

Returns:

    Vec2f(v,v)
Vec2f.new(x, y)
Creates a new vector.

Parameters:

  • x float
  • y float

Returns:

    Vec2f(x,y)
Vec2f.x
x
  • x
Vec2f.y
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:

  • v float

Returns:

    Vec3f(v,v,v)
Vec3f.new(x, y, z)
Creates a new vector.

Parameters:

  • x float
  • y float
  • z float

Returns:

    Vec3f(x,y,z)
Vec3f.x
x
  • x
Vec3f.y
y
  • y
Vec3f.z
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:

  • v float

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
  • w
Vec4f.x
x
  • x
Vec4f.y
y
  • y
Vec4f.z
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:

  • v float

Returns:

    diagonal Mat4f matrix
Mat4f:col()
Return i-th column as reference

Class Date

A date for the Gregorian calendar.
Date.day
Day
  • day
Date.month
Month
  • month
Date.year
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
  • max
Box2.min
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
  • max
Box3.min
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
Sends a command object to be executed later or immediately depending on the context.

Fields:

  • playerEntity Entity the entity id of the player
  • journalEntry type.JournalEntry the entry to add
BuildProposal
Command to build a proposal

Fields:

  • withCostRep bool tells to ingore costs if set to true
  • 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 and industries
  • connections {type.CVec2i,...} 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 set the calendar speed (does affect only availability of objects).

Fields:

  • line type.Line the configuration data of the line
  • name string the name of the line
  • color type.Vec3f the line color
  • playerOwned 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:

  • towns {type.TownInfo,...} a list of town information sets
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 ???.

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
Sends a command object to be executed later or immediately depending on the context.

Fields:

  • entity Entity the entity id of the entity that should be renamed
  • name string the name that should be set
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
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
  • 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

Entity Components

Account
Contains financial data. Usually attached to the player Entity.

Fields:

  • balance
  • journal
  • loan
  • maximumLoan
  • minimumLoan
Aircraft
Data attached to aircraft.

Fields:

  • reservedTakeOffRunway
  • reservedLandingRunway
  • pathIndex
  • reservedFrom
  • reservedTo
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:

  • emitter Emitter
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 abut the current speed and calendar speed.

Fields:

  • millisPerDay int length of an in-game day in milliseconds
  • speedup int game simulation speed (non-negative)
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 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:

  • thinInstances {ThinModelInstance,...} A list of models with very simple data attached
  • fatInstances {ModelInstance,...} A list of models with a full transform attached
  • dynamic bool
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
ModelPerson
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
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,...}
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 ???.
  • state int the current animation
  • stateTime int the animation timer
RoadVehicle
Represents a vehicle travelling on roads (either bus or truck)

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
RunwayList
All runways for the entity transport network.

Fields:

  • runways {Runway,...}
ShapeList
Contains procedurally generated shapes.

Fields:

  • shapes Shape a list of shapes
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
  • upgradeProgress number the progress towards upgrade/downgrade
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 industries.

Fields:

  • stock Entity The industry the entity is waiting at
  • arrivalTime int the timestamp when the item arrived at the industry
SimEntityAtBuilding
Additional data for entities waiting at buildings.

Fields:

  • waitingTime int How long the entity has been waiting
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
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
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
  • developmentActive bool
  • emission float
  • trafficSpeed float
TownBuilding
Contains information about a town building.

Fields:

  • personCapacity int
  • stockList 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
  • 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:

  • leftStationSince number 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
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 int
  • userStopped bool
  • depot Entity
  • sellOnArrival bool
  • line Entity the entity of the line
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

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 number
type.Collider.type
The transform of the collider, relative to which the other data is transformed
  • type number

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.airVehicle
Defines the sound emitted by the model when in-game
  • airVehicle type.MetadataMap.SoundConfig
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
  • car type.MetadataMap.Car
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 road vehicle
  • roadVehicle type.MetadataMap.RoadVehicle
type.MetadataMap.roadVehicle
Defines a model to be used as a rail vehicle
  • roadVehicle type.MetadataMap.RailVehicle
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.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

Class ScriptRef

References a function in another file with ".script" exctension.
ScriptRef.fileName
The script path, toghether with the lua path inside the function
ScriptRef.params
A lua table of closure parameters that will be called when the script is called.
  • params Table

Resources

ConstructionDesc
Describes a construction
ModuleDesc
Used to configure new modules.

Class ScriptParam

Used to configure the parameters used for constructions.
ScriptParam.defaultIndex
Default index/state
  • defaultIndex number
ScriptParam.fileName
fileName
  • fileName string A fileName or unique identifier for the construction.
ScriptParam.key
Unique key that is passed to the construction functions
ScriptParam.name
Display name
ScriptParam.params
Configuration
  • params {ScriptParam,...} A list of parameters that can be used to configure the construction.
ScriptParam.tooltip
Tooltip to display over certain parameters
ScriptParam.uiType
Type of ui shown in user interface selection
  • uiType ScriptParam.Type
ScriptParam.values
All possible values of the params
ScriptParam.yearFrom
Availability from
  • yearFrom number
ScriptParam.yearTo
Availability to
  • yearTo number

Transport

EdgeGeometry
Defines the geometry (shape) of an edge.

Fields:

EdgeGeometry.Arc
Arc
EdgeGeometry.CubicOffsetSpline
CubicOffsetSpline
EdgeGeometry.CubicSpline
CubicSpline
EdgeGeometry.Straight
Straight
EdgeIsect
Specifies the intersection of two edges, with waiting area for vehicles.
EdgeIsect.Info
Data for an edge intersect
NodeData.Port
Specifies the connectivity of the node.
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 ??? entity
  • index int the index within the edges field of the transport network component (starting at 0)
TpNetData
Contains additional data about the transport network.
TransportEdge
A single edge within a ???. Also a referenced by type.EdgeId.
TransportEdgeData
Data attached to a transport network edge.
TransportNode
A single node within a ???. Also a referenced by type.NodeId.
TransportNodeData
Data attached to a transport network node.
util.pathfinding.EdgeIdDir
Input helper type.
util.pathfinding.EdgeIdDirAndLength
Input helper type.

Pathfinding

util.pathfinding.EdgeIdDir.new(edgeID, direction)
Generates a new EdgeIdDirAndLength item.

Parameters:

  • edgeID type.EdgeID
  • direction bool
util.pathfinding.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 ??? entity
  • edgeId Entity
EdgeId.index
The index within the edges field of the transport network component (starting at 0)
  • index number
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
  • param number

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
  • endOffset number

Class PathPos

The position on a Path
PathPos.edgeIndex
The index within a path
  • edgeIndex number
PathPos.pos
The position on the spline, relative to the length of the spline
  • pos number
PathPos.pos01
The position on the spline, normalized as parameter from 0 to 1
  • pos01 number

Class PathPosData

The position in the world
PathPosData.Signal
Contains information about a street/track signal

Fields:

  • EdgeId , bool} edgePr EdgeId and direction
  • Type type the type of the signal
  • int stateTime timer for the animation
  • int stateTime timer for the animation
PathPosData.pPrime
The first derivative
PathPosData.pPrimePrime
The second derivative
PathPosData.position
The position in the world
type.Signal.Type
Enum containing the type of the signal

Fields:

  • SIGNAL 0
  • ONE_WAY_SIGNAL 1
  • WAYPOINT 2

Enum

enum.Carrier
Defines the carrier.

Fields:

  • ROAD int = 0
  • RAIL int = 1
  • TRAM int = 2
  • AIR int = 3
  • WATER int = 4
enum.EdgeObjectType
Defines the type of an edge object.

Fields:

  • STOP_LEFT int = 0
  • STOP_RIGHT int = 1
  • SIGNAL int = 2
enum.TransportMode
Defines the transport mode (to black/white list vehicles onto edges).

Fields:

  • ROAD int = 0

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 ???.

Proposal.ConstructionEntity
A more complete version of the type.ConstructionEntity.

Most data can be read from a type.ProposalData or in the result of ???.

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 ???.

StreetProposal.EdgeObject
A more complete version of the type.EdgeObject.

Most data can be read from a type.ProposalData or in the result of ???.

TpNetLinkProposal
Contains the processed result with all edge links.
TpNetLinkProposal.Data
Information about a single link.
generated by LDoc 1.4.3 Last updated 2020-07-02 10:00:04