Module api.cmd🔗
The module is available on both the GUI State and the Engine State (and the Console State as well). However,
it works in a slightly different manner depending on where it is used from.
On the engine states, commands are executed immediately and the effects are immediately noticeable. Moreover, the callback function
will be called immediately.
The callback function will be called the frame after the command has been executed, after which the changes are visible on the gui and engine
state.
global record Cmd
sendCommand: function<T is ICommandData>(cmd : Command<T>, callback : function(T, boolean, {{Engine.Entity, Engine.Revision}}), progress : CommandProgress) makeAnimalSetStateCmd: function(animalEntity : Engine.Entity, movementType : integer, targetChangedElapsed : number, invalidTileElapsed : number, movementSpeed : number, angularSpeed : number): Command<AnimalSetStateCommandData> makeAnimalSpawnAtCmd: function(fileName : string, position : Vec2f, lookAt : Vec2f): Command<AnimalSpawnAtCommandData> makeCustomEntityDestroyCmd: function(entity : Engine.Entity): Command<CustomEntityDestroyCommandData> makeCustomEntityCreateCmd: function(modelId : integer): Command<CustomEntityCreateCommandData> makeCustomEntityUpdateStateCmd: function(entity : Engine.Entity, customState : ComponentCustomState): Command<CustomEntityUpdateStateCommandData> makeCustomEntityUpdateTransformationCmd: function(entity : Engine.Entity, transf : Mat4f): Command<CustomEntityUpdateTransformationCommandData> makeCustomVehicleCreateOrUpdateCmd: function(vehicleEntity : Engine.Entity, carrier : Carrier, vehicles : {{integer, boolean}}, movePathAircraft : Engine.Component.MovePathAircraft | nil): Command<CustomVehicleCreateCommandData> makeEntitySetColorCmd: function(entity : Engine.Entity, color : Vec3f): Command<EntitySetColorCommandData> makeEntitySetEmissionsCmd: function(entity : Engine.Entity, noisePower : number, pollutionPower : number, radius : number, pollutionRadius : number): Command<EntitySetEmissionsCommandData> makeEntitySetNameCmd: function(entity : Engine.Entity, name : string, forceSameEntity : boolean): Command<EntitySetNameCommandData> makeEntitySetPlayerCmd: function(entity : Engine.Entity, player : Engine.Entity): Command<EntitySetPlayerCommandData> makeGameAddPlayerCmd: function(name : string, color : Vec3f): Command<GameAddPlayerCommandData> makeGameSetCalendarSpeedCmd: function(millisPerDay : integer): Command<GameSetCalendarSpeedCommandData> makeGameSetDateCmd: function(date : Date): Command<GameSetDateCommandData> makeGameSetSpeedCmd: function(speedup : integer): Command<GameSetSpeedCommandData> makeGameSetTimeOfDayCmd: function(timeOfDaySec : integer): Command<GameSetTimeOfDayCommandData> makeGameSetCloudCoverageCmd: function(cloudCoverage : number): Command<GameSetCloudCoverageCommandData> makeIndustrySetDespawnTimeCmd: function(industryEntity : Engine.Entity, timeStamp : integer): Command<IndustrySetDespawnTimeCommandData> makeIndustrySetManualDevelopmentCmd: function(industryEntity : Engine.Entity, manual : boolean): Command<IndustrySetManualDevelopmentCommandData> makeCreateIndustryExtendProposalCmd: function(extendConstruction : Engine.Entity, numTrySlots : integer, numKeepSlots : integer): Command<CreateIndustryExtendProposalCommandData> makeJournalBookAssetCmd: function(player : Engine.Entity, entry : JournalEntry, position : Vec3f): Command<JournalBookAssetCommandData> makeJournalClearAllCmd: function(): Command<JournalClearAllCommandData> makeJournalLogEntryCmd: function(entity : Engine.Entity, logNamesAndValues : {{string, integer, boolean}}): Command<JournalLogEntryCommandData> makeLineCreateCmd: function(name : string, color : Vec3f, player : Engine.Entity, line : Engine.Component.Line): Command<LineCreateCommandData> makeLineDestroyCmd: function(lineEntity : Engine.Entity): Command<LineDestroyCommandData> makeLineUpdateCmd: function(lineEntity : Engine.Entity, data : Engine.Component.Line): Command<LineUpdateCommandData> makeScriptingSendEventCmd: function(src : string, id : string, name : string, param : any): Command<ScriptingSendEventCommandData> makeStockListDiscardCargoCmd: function(stockListEntity : Engine.Entity, stockIds : {StockId}, remainingTimeToDelivery : number): Command<StockListDiscardCargoCommandData> makeStockListSetStocksCargoTypeCmd: function(stockListEntity : Engine.Entity, stockIds : {StockId}, cargoType : CargoTypeId): Command<StockListSetStocksCargoTypeCommandData> makeStockListSetModifiersCmd: function(industryEntity : Engine.Entity, modifiers : Engine.Component.StockList.Modifiers): Command<StockListSetModifiersCommandData> makeTownConnectWithIndustriesCmd: function(townEntities : {Engine.Entity}, connections : {{integer, integer}}, keep : boolean): Command<TownConnectWithIndustriesCommandData> makeTownAutoDetectConnectionsCmd: function(townEntities : {Engine.Entity}): Command makeTownCreateCmd: function(towns : {TownInfo}): Command<TownCreateCommandData> makeTownDestroyCmd: function(townEntity : Engine.Entity): Command<TownDestroyCommandData> makeTownDevelopAtCmd: function(position : Vec2f, developStreets : boolean, upgradeBuildings : boolean): Command<TownDevelopAtCommandData> makeTownCustomDistributionWeightsCmd: function(townEntitiy : Engine.Entity, levelToCapacityDistributionWeights : {{number}}): Command<TownCustomDistributionWeightsCommandData> makeTownSetDevelopmentActiveCmd: function(entity : Engine.Entity, developmentActive : boolean): Command<TownSetDevelopmentActiveCommandData> makeTownSetInitialLandUseCapacitiesCmd: function(entity : Engine.Entity, landUseCapacities : {integer}): Command<TownSetInitialLandUseCapacitiesCommandData> makeTownUpdateCargoNeedsCmd: function(entity : Engine.Entity, cargoNeeds : {{CargoTypeId}}, updateTownBuildings : boolean): Command<TownUpdateCargoNeedsCommandData> makeTownUpdateSizeCmd: function(townEntity : Engine.Entity, sizeFactors : {number}, updateAllBuildings : boolean): Command<TownUpdateSizeCommandData> makeTownBuildingSetBlockedDevelopmentCmd: function(townBuildingEntity : Engine.Entity, blockedDevelopment : boolean): Command<TownBuildingSetBlockedDevelopment> makeVehicleBuyCmd: function(playerEntity : Engine.Entity, depotEntity : Engine.Entity, tvc : TransportVehicleConfig): Command<VehicleBuyCommandData> makeVehicleReplaceCmd: function(vehicleEntity : Engine.Entity, tvc : TransportVehicleConfig): Command<VehicleReplaceCommandData> makeVehicleReverseCmd: function(vehicleEntity : Engine.Entity): Command<VehicleReverseCommandData> makeVehicleSellCmd: function(vehicleEntities : {Engine.Entity}): Command<VehicleSellCommandData> makeVehicleSendToDepotCmd: function(vehicleEntity : Engine.Entity, sellOnArrival : boolean, jumpToDepoEntity : Engine.Entity): Command<VehicleSendToDepotCommandData> makeVehicleSetLineCmd: function(vehicleEntity : Engine.Entity, lineEntity : Engine.Entity, stopIndex : integer): Command<VehicleSetLineCommandData> makeVehicleSetManualDepartureCmd: function(vehicleEntity : Engine.Entity, manual : boolean): Command<VehicleSetManualDepartureCommandData> makeVehicleSetStoppedByUserCmd: function(vehicleEntity : Engine.Entity, stopped : boolean): Command<VehicleSetStoppedByUserCommandData> makeVehicleSetModifiersCmd: function(vehicleEntity : Engine.Entity, modifiers : Engine.Component.TransportVehicle.Modifiers): Command<VehicleSetModifiersCommandData> makeVehicleTryToDepartCmd: function(vehicleEntity : Engine.Entity): Command<VehicleTryToDepartCommandData> makeWorldBuildProposalCmd: function(proposal : Proposal, context : any, ignoreErrors : boolean, doDust : boolean, playerInitiated : boolean): Command<WorldBuildProposalCommandData> makeWorldChangeWindCmd: function(emissionGridEntity : Engine.Entity, wind : Vec2f): Command<WorldChangeWindCommandData> makeWorldReplaceTerrainCmd: function(map : GameMap, terrainConfig : BaseConfig.Terrain, seedText : string, worldEntity : Engine.Entity, keepAssets : boolean): Command<WorldReplaceTerrainCommandData> makeWorldSetBulldozableCmd: function(entity : Engine.Entity, bulldozable : boolean): Command<WorldSetBulldozableCommandData>debug: Debug endrecord Debug
makeMaintenanceCostUpdateCmd: function(maintenanceCostEntity : Engine.Entity, amount : integer, reset : boolean): Command makeSimPersonSetStateCmd: function(entity : Engine.Entity, simPersonState : integer): Command<SimPersonSetStateCommandDataDEBUG> makeSimPersonSetHappiness: function(entity : Engine.Entity, happiness : number): Command makeComponentExchangeCmd: function(entity : Engine.Entity, component : Engine.Component): Command<ComponentExchangeCommandDataDEBUG> makeStockSetCargoAmountCmd: function(entity : Engine.Entity, stockId : StockId, amount : integer, cargoType : string): Command<StockSetCargoAmountCommandDataDEBUG> makeGamePerformSimulationStepsCmd: function(amount : integer): Command<GamePerformSimulationStepsCommandDataDEBUG> makeClearLogbooksCmd: function(towns : boolean): Command endglobal record AnimalSetStateCommandData
animalEntity: Engine.Entity movementType: integer targetChangedElapsed: number invalidTileElapsed: number movementSpeed: number angularSpeed: number endglobal record AnimalSpawnAtCommandData
modelId: integer position: Vec2f lookAt: Vec2f resultEntity: Engine.Entity endglobal record Command<T is ICommandData>
endglobal record ComponentExchangeCommandDataDEBUG
entity: Engine.Entity component: Engine.Component endglobal record CreateIndustryExtendProposalCommandData
extendConstruction: Engine.Entity numTrySlots: integer numKeepSlots: integer resultProposal: Proposal resultCollidingSubconstructions: {integer} endglobal record CustomEntityUpdateStateCommandData
entity: Engine.Entity customState: {<any type> : <any type>} endglobal record CustomVehicleCreateCommandData
vehicleEntity: Engine.Entity carrier: Carrier vehicles: {{integer, boolean}} movePathAircraft: Engine.Component.MovePathAircraft resultEntity: Engine.Entity endglobal record EntitySetEmissionsCommandData
entity: Engine.Entity noisePower: number pollutionPower: number radius: number endglobal record GamePerformSimulationStepsCommandDataDEBUG
amount: integer endglobal record GameSaveCommandData
modDescs: {Mod.GameModDesc} configData: {<any type> : <any type>} guiSaveData: {<any type> : <any type>} fileName: string isAutosave: boolean isMapsave: boolean screenshot: GameScreenshot error: integer endglobal record GameSetCalendarSpeedCommandData
millisPerDay: integer endglobal record GameSetCloudCoverageCommandData
cloudCoverage: number endglobal record GameSetSpeedCommandData
speedup: integer endglobal record GameSetTimeOfDayCommandData
timeOfDaySec: integer endglobal interface ICommandData
endglobal record JournalBookAssetCommandData
playerEntity: Engine.Entity journalEntry: JournalEntry position: Vec3f endglobal record JournalClearAllCommandData
endglobal record JournalLogEntryCommandData
entity: Engine.Entity logName: string time: number value: integer endglobal record LineCreateCommandData
line: Engine.Component.Line name: Engine.Component.Name color: Engine.Component.Color playerOwned: Engine.Component.PlayerOwned resultEntity: Engine.Entity endglobal record MaintenanceCostUpdateCommandDataDEBUG
maintenanceCostEntity: Engine.Entity amount: integer resetAccumulatedCost: boolean endglobal record StockListDiscardCargoCommandData
stockListEntity: Engine.Entity stockIds: {StockId} remainingTimeToDelivery: number endglobal record StockListSetModifiersCommandData
entity: Engine.Entity modifiers: Engine.Component.StockList.Modifiers endglobal record StockListSetStocksCargoTypeCommandData
stockListEntity: Engine.Entity stockIds: {StockId} cargoType: CargoTypeId endglobal record StockSetCargoAmountCommandDataDEBUG
stockListEntity: Engine.Entity stock: StockId amount: integer cargoType: ResName endglobal record TownBuildingSetBlockedDevelopment
townBuildingEntity: Engine.Entity blockedDevelopment: boolean endglobal record TownConnectWithIndustriesCommandData
townEntities: {Engine.Entity} connections: {{integer, integer}} keep: boolean endglobal record TownCustomDistributionWeightsCommandData
townEntity: Engine.Entity levelToCapacityDistributionWeights: {{number, number, number, number}, {number, number, number, number}, {number, number, number, number}} endglobal record TownDevelopAtCommandData
position: Vec2f developStreets: boolean upgradeBuildings: boolean endglobal record TownSetDevelopmentActiveCommandData
townEntity: Engine.Entity developmentActive: boolean endglobal record TownSetInitialLandUseCapacitiesCommandData
townEntity: Engine.Entity initialLandUseCapacities: {integer} endglobal record TownUpdateCargoNeedsCommandData
townEntity: Engine.Entity cargoNeeds: {{CargoTypeId}} updateTownBuildings: boolean endglobal record TownUpdateSizeCommandData
townEntity: Engine.Entity landUseSizeFactors: {number} updateAllBuildings: boolean endglobal record VehicleBuyCommandData
playerEntity: Engine.Entity depotEntity: Engine.Entity config: TransportVehicleConfig resultVehicleEntity: Engine.Entity endglobal record VehicleReplaceCommandData
vehicleEntity: Engine.Entity config: TransportVehicleConfig applyPurchaseCost: boolean endglobal record VehicleSendToDepotCommandData
vehicleEntity: Engine.Entity sellOnArrival: boolean jumpToDepotEntity: Engine.Entity endglobal record VehicleSetLineCommandData
vehicleEntity: Engine.Entity lineEntity: Engine.Entity stopIndex: integer endglobal record VehicleSetModifiersCommandData
entity: Engine.Entity modifiers: Engine.Component.TransportVehicle.Modifiers endglobal record VehicleSetStoppedByUserCommandData
vehicleEntity: Engine.Entity userStopped: boolean endglobal record WorldBuildProposalCommandData
proposal: Proposal context: Context withCostRep: boolean ignoreErrors: boolean resultProposalData: ProposalData resultEntities: {{Engine.Entity, Engine.Revision}} doDust: boolean endglobal record WorldReplaceTerrainCommandData
map: GameMap terrainConfig: BaseConfig.Terrain seedText: string worldEntity: Engine.Entity keepAssets: boolean end
Category: main🔗
Cmd🔗
global record Cmd
sendCommand: function<T is ICommandData>(cmd : Command<T>, callback : function(T, boolean, {{Engine.Entity, Engine.Revision}}), progress : CommandProgress) makeAnimalSetStateCmd: function(animalEntity : Engine.Entity, movementType : integer, targetChangedElapsed : number, invalidTileElapsed : number, movementSpeed : number, angularSpeed : number): Command<AnimalSetStateCommandData> makeAnimalSpawnAtCmd: function(fileName : string, position : Vec2f, lookAt : Vec2f): Command<AnimalSpawnAtCommandData> makeCustomEntityDestroyCmd: function(entity : Engine.Entity): Command<CustomEntityDestroyCommandData> makeCustomEntityCreateCmd: function(modelId : integer): Command<CustomEntityCreateCommandData> makeCustomEntityUpdateStateCmd: function(entity : Engine.Entity, customState : ComponentCustomState): Command<CustomEntityUpdateStateCommandData> makeCustomEntityUpdateTransformationCmd: function(entity : Engine.Entity, transf : Mat4f): Command<CustomEntityUpdateTransformationCommandData> makeCustomVehicleCreateOrUpdateCmd: function(vehicleEntity : Engine.Entity, carrier : Carrier, vehicles : {{integer, boolean}}, movePathAircraft : Engine.Component.MovePathAircraft | nil): Command<CustomVehicleCreateCommandData> makeEntitySetColorCmd: function(entity : Engine.Entity, color : Vec3f): Command<EntitySetColorCommandData> makeEntitySetEmissionsCmd: function(entity : Engine.Entity, noisePower : number, pollutionPower : number, radius : number, pollutionRadius : number): Command<EntitySetEmissionsCommandData> makeEntitySetNameCmd: function(entity : Engine.Entity, name : string, forceSameEntity : boolean): Command<EntitySetNameCommandData> makeEntitySetPlayerCmd: function(entity : Engine.Entity, player : Engine.Entity): Command<EntitySetPlayerCommandData> makeGameAddPlayerCmd: function(name : string, color : Vec3f): Command<GameAddPlayerCommandData> makeGameSetCalendarSpeedCmd: function(millisPerDay : integer): Command<GameSetCalendarSpeedCommandData> makeGameSetDateCmd: function(date : Date): Command<GameSetDateCommandData> makeGameSetSpeedCmd: function(speedup : integer): Command<GameSetSpeedCommandData> makeGameSetTimeOfDayCmd: function(timeOfDaySec : integer): Command<GameSetTimeOfDayCommandData> makeGameSetCloudCoverageCmd: function(cloudCoverage : number): Command<GameSetCloudCoverageCommandData> makeIndustrySetDespawnTimeCmd: function(industryEntity : Engine.Entity, timeStamp : integer): Command<IndustrySetDespawnTimeCommandData> makeIndustrySetManualDevelopmentCmd: function(industryEntity : Engine.Entity, manual : boolean): Command<IndustrySetManualDevelopmentCommandData> makeCreateIndustryExtendProposalCmd: function(extendConstruction : Engine.Entity, numTrySlots : integer, numKeepSlots : integer): Command<CreateIndustryExtendProposalCommandData> makeJournalBookAssetCmd: function(player : Engine.Entity, entry : JournalEntry, position : Vec3f): Command<JournalBookAssetCommandData> makeJournalClearAllCmd: function(): Command<JournalClearAllCommandData> makeJournalLogEntryCmd: function(entity : Engine.Entity, logNamesAndValues : {{string, integer, boolean}}): Command<JournalLogEntryCommandData> makeLineCreateCmd: function(name : string, color : Vec3f, player : Engine.Entity, line : Engine.Component.Line): Command<LineCreateCommandData> makeLineDestroyCmd: function(lineEntity : Engine.Entity): Command<LineDestroyCommandData> makeLineUpdateCmd: function(lineEntity : Engine.Entity, data : Engine.Component.Line): Command<LineUpdateCommandData> makeScriptingSendEventCmd: function(src : string, id : string, name : string, param : any): Command<ScriptingSendEventCommandData> makeStockListDiscardCargoCmd: function(stockListEntity : Engine.Entity, stockIds : {StockId}, remainingTimeToDelivery : number): Command<StockListDiscardCargoCommandData> makeStockListSetStocksCargoTypeCmd: function(stockListEntity : Engine.Entity, stockIds : {StockId}, cargoType : CargoTypeId): Command<StockListSetStocksCargoTypeCommandData> makeStockListSetModifiersCmd: function(industryEntity : Engine.Entity, modifiers : Engine.Component.StockList.Modifiers): Command<StockListSetModifiersCommandData> makeTownConnectWithIndustriesCmd: function(townEntities : {Engine.Entity}, connections : {{integer, integer}}, keep : boolean): Command<TownConnectWithIndustriesCommandData> makeTownAutoDetectConnectionsCmd: function(townEntities : {Engine.Entity}): Command makeTownCreateCmd: function(towns : {TownInfo}): Command<TownCreateCommandData> makeTownDestroyCmd: function(townEntity : Engine.Entity): Command<TownDestroyCommandData> makeTownDevelopAtCmd: function(position : Vec2f, developStreets : boolean, upgradeBuildings : boolean): Command<TownDevelopAtCommandData> makeTownCustomDistributionWeightsCmd: function(townEntitiy : Engine.Entity, levelToCapacityDistributionWeights : {{number}}): Command<TownCustomDistributionWeightsCommandData> makeTownSetDevelopmentActiveCmd: function(entity : Engine.Entity, developmentActive : boolean): Command<TownSetDevelopmentActiveCommandData> makeTownSetInitialLandUseCapacitiesCmd: function(entity : Engine.Entity, landUseCapacities : {integer}): Command<TownSetInitialLandUseCapacitiesCommandData> makeTownUpdateCargoNeedsCmd: function(entity : Engine.Entity, cargoNeeds : {{CargoTypeId}}, updateTownBuildings : boolean): Command<TownUpdateCargoNeedsCommandData> makeTownUpdateSizeCmd: function(townEntity : Engine.Entity, sizeFactors : {number}, updateAllBuildings : boolean): Command<TownUpdateSizeCommandData> makeTownBuildingSetBlockedDevelopmentCmd: function(townBuildingEntity : Engine.Entity, blockedDevelopment : boolean): Command<TownBuildingSetBlockedDevelopment> makeVehicleBuyCmd: function(playerEntity : Engine.Entity, depotEntity : Engine.Entity, tvc : TransportVehicleConfig): Command<VehicleBuyCommandData> makeVehicleReplaceCmd: function(vehicleEntity : Engine.Entity, tvc : TransportVehicleConfig): Command<VehicleReplaceCommandData> makeVehicleReverseCmd: function(vehicleEntity : Engine.Entity): Command<VehicleReverseCommandData> makeVehicleSellCmd: function(vehicleEntities : {Engine.Entity}): Command<VehicleSellCommandData> makeVehicleSendToDepotCmd: function(vehicleEntity : Engine.Entity, sellOnArrival : boolean, jumpToDepoEntity : Engine.Entity): Command<VehicleSendToDepotCommandData> makeVehicleSetLineCmd: function(vehicleEntity : Engine.Entity, lineEntity : Engine.Entity, stopIndex : integer): Command<VehicleSetLineCommandData> makeVehicleSetManualDepartureCmd: function(vehicleEntity : Engine.Entity, manual : boolean): Command<VehicleSetManualDepartureCommandData> makeVehicleSetStoppedByUserCmd: function(vehicleEntity : Engine.Entity, stopped : boolean): Command<VehicleSetStoppedByUserCommandData> makeVehicleSetModifiersCmd: function(vehicleEntity : Engine.Entity, modifiers : Engine.Component.TransportVehicle.Modifiers): Command<VehicleSetModifiersCommandData> makeVehicleTryToDepartCmd: function(vehicleEntity : Engine.Entity): Command<VehicleTryToDepartCommandData> makeWorldBuildProposalCmd: function(proposal : Proposal, context : any, ignoreErrors : boolean, doDust : boolean, playerInitiated : boolean): Command<WorldBuildProposalCommandData> makeWorldChangeWindCmd: function(emissionGridEntity : Engine.Entity, wind : Vec2f): Command<WorldChangeWindCommandData> makeWorldReplaceTerrainCmd: function(map : GameMap, terrainConfig : BaseConfig.Terrain, seedText : string, worldEntity : Engine.Entity, keepAssets : boolean): Command<WorldReplaceTerrainCommandData> makeWorldSetBulldozableCmd: function(entity : Engine.Entity, bulldozable : boolean): Command<WorldSetBulldozableCommandData>debug: Debug endrecord Debug
makeMaintenanceCostUpdateCmd: function(maintenanceCostEntity : Engine.Entity, amount : integer, reset : boolean): Command makeSimPersonSetStateCmd: function(entity : Engine.Entity, simPersonState : integer): Command<SimPersonSetStateCommandDataDEBUG> makeSimPersonSetHappiness: function(entity : Engine.Entity, happiness : number): Command makeComponentExchangeCmd: function(entity : Engine.Entity, component : Engine.Component): Command<ComponentExchangeCommandDataDEBUG> makeStockSetCargoAmountCmd: function(entity : Engine.Entity, stockId : StockId, amount : integer, cargoType : string): Command<StockSetCargoAmountCommandDataDEBUG> makeGamePerformSimulationStepsCmd: function(amount : integer): Command<GamePerformSimulationStepsCommandDataDEBUG> makeClearLogbooksCmd: function(towns : boolean): Command end
contains all commmand factory methods.
Cmd.sendCommand🔗
function Cmd.sendCommand<T is ICommandData>(cmd : Command<T>, callback : function(T, boolean, {{Engine.Entity, Engine.Revision}}), progress : CommandProgress)
Sends a command object to be executed later or immediately depending on the state context. After the execution of the command, the callback function is called.
The callback function receives two parameters:
cmd the command that has been executed, depending on the context this might contain additional information.
success a boolean value to indicate whether the command was successful
Type Parameters
T( isICommandData)
cmd:Command<T>— the command object to be sentcallback:function(T, boolean, {{Engine.Entity, Engine.Revision}})— an optional function that is called after the execution of the commandprogress:CommandProgress— an optional progress object to receive progress updates for long running commands
Cmd.makeAnimalSetStateCmd🔗
function Cmd.makeAnimalSetStateCmd(animalEntity : Engine.Entity, movementType : integer, targetChangedElapsed : number, invalidTileElapsed : number, movementSpeed : number, angularSpeed : number): Command<AnimalSetStateCommandData>
Makes an AnimalSetState command.
When executed, the animal with the given entity Id will be updated.
animalEntity:Engine.Entity— the entity Id of the animal that should be updatedmovementType:integer— the index of the configuration in the animals metadata movementTypes listtargetChangedElapsed:number— time since the current target destination was selectedinvalidTileElapsed:number— time since the animal got into an invalid areamovementSpeed:number— speed that should be usedangularSpeed:number— angular speed that should be used
Command<AnimalSetStateCommandData>— a newly created AnimalSetState command
Cmd.makeAnimalSpawnAtCmd🔗
function Cmd.makeAnimalSpawnAtCmd(fileName : string, position : Vec2f, lookAt : Vec2f): Command<AnimalSpawnAtCommandData>
Makes an AnimalSpawnAt command.
When executed, a new animal entity is spawned at the specified position.
fileName:string— reference to the animal model for the animal that should be spawnedposition:Vec2f— world coordinates of the position where the animal should be spawnedlookAt:Vec2f— the direction the animal is facing in
Command<AnimalSpawnAtCommandData>— a newly created AnimalSpawnAt command
Cmd.makeCustomEntityDestroyCmd🔗
function Cmd.makeCustomEntityDestroyCmd(entity : Engine.Entity): Command<CustomEntityDestroyCommandData>
Makes a CustomEntityDestroy command.
When executed, the command removes the custom entity with the given entity Id.
entity:Engine.Entity— the entity Id of the custom entity
Command<CustomEntityDestroyCommandData>— a newly created CustomEntityDestroy command
Cmd.makeCustomEntityCreateCmd🔗
function Cmd.makeCustomEntityCreateCmd(modelId : integer): Command<CustomEntityCreateCommandData>
Makes a CustomEntityCreate command.
When executed, the command creates a new custom entity with the given model Id.
modelId:integer— the model id of the custom entity
Command<CustomEntityCreateCommandData>— a newly created CustomEntityCreate command
Cmd.makeCustomEntityUpdateStateCmd🔗
function Cmd.makeCustomEntityUpdateStateCmd(entity : Engine.Entity, customState : ComponentCustomState): Command<CustomEntityUpdateStateCommandData>
Makes a CustomEntityUpdateState command.
When executed, the command updates the state of the custom entity.
entity:Engine.Entity— the entity Id of the custom entitycustomState:ComponentCustomState— the new state of the custom entity
Command<CustomEntityUpdateStateCommandData>— a newly created CustomEntityUpdateState command
Cmd.makeCustomEntityUpdateTransformationCmd🔗
function Cmd.makeCustomEntityUpdateTransformationCmd(entity : Engine.Entity, transf : Mat4f): Command<CustomEntityUpdateTransformationCommandData>
Makes a CustomEntityUpdateTransformation command.
When executed, the command updates the transformation of the custom entity.
entity:Engine.Entity— the entity Id of the custom entitytransf:Mat4f— the new transformation of the custom entity
Command<CustomEntityUpdateTransformationCommandData>— a newly created CustomEntityUpdateTransformation command
Cmd.makeCustomVehicleCreateOrUpdateCmd🔗
function Cmd.makeCustomVehicleCreateOrUpdateCmd(vehicleEntity : Engine.Entity, carrier : Carrier, vehicles : {{integer, boolean}}, movePathAircraft : Engine.Component.MovePathAircraft | nil): Command<CustomVehicleCreateCommandData>
Makes a CustomVehicleCreateOrUpdateCmd command.
When executed, the command updates or creates a custom vehicle entity.
vehicleEntity:Engine.Entity— the entity Id of the custom entity, if nil a new entity will be createdcarrier:Carrier— the carrier for the vehicleEntity (currently must be Air)vehicles:{{integer, boolean}}— a list of carriages, a pair of modelId and whether the model shall be reversed (currently only a single entry)movePathAircraft:Engine.Component.MovePathAircraft | nil— optional move path for air and water vehicles (currently path0 and path2 must be empty and the state must be in flight)
Command<CustomVehicleCreateCommandData>— a newly created CustomEntityUpdateTransformation command
Cmd.makeEntitySetColorCmd🔗
function Cmd.makeEntitySetColorCmd(entity : Engine.Entity, color : Vec3f): Command<EntitySetColorCommandData>
Makes an EntitySetColor command.
When executed, the entity Id is set to the given color.
entity:Engine.Entity— the entity Id of the entity that should be coloredcolor:Vec3f— the rgb color
Command<EntitySetColorCommandData>— a newly created EntitySetColor command
Cmd.makeEntitySetEmissionsCmd🔗
function Cmd.makeEntitySetEmissionsCmd(entity : Engine.Entity, noisePower : number, pollutionPower : number, radius : number, pollutionRadius : number): Command<EntitySetEmissionsCommandData>
Makes an EntitySetEmissions command.
When executed, the emission values of the entity are set to the given values.
entity:Engine.Entity— the entity Id of the entity that should be updatednoisePower:number— the noise power of the entitypollutionPower:number— the pollution power of the entityradius:number— the radius of the noise emissionspollutionRadius:number— the radius of the pollution emissions
Command<EntitySetEmissionsCommandData>— a newly created EntitySetEmissions command
Cmd.makeEntitySetNameCmd🔗
function Cmd.makeEntitySetNameCmd(entity : Engine.Entity, name : string, forceSameEntity : boolean): Command<EntitySetNameCommandData>
Makes an EntitySetName command.
When executed, the entity Id is renamed with the given name.
entity:Engine.Entity— the entity Id of the entity that should be renamedname:string— the new name that should be setforceSameEntity:boolean— (optional, default false) Unless true, things like stations that don't have a name on their own will set the stem name instead.
Command<EntitySetNameCommandData>— a newly created EntitySetName command
Cmd.makeEntitySetPlayerCmd🔗
function Cmd.makeEntitySetPlayerCmd(entity : Engine.Entity, player : Engine.Entity): Command<EntitySetPlayerCommandData>
Makes an EntitySetPlayer command.
When executed, the entity is set or unset to the player
entity:Engine.Entity— the entity Id of the entityplayer:Engine.Entity— the entity Id of the player
Command<EntitySetPlayerCommandData>— a newly created EntitySetPlayer command
Cmd.makeGameAddPlayerCmd🔗
function Cmd.makeGameAddPlayerCmd(name : string, color : Vec3f): Command<GameAddPlayerCommandData>
Makes a GameAddPlayer command.
When executed, a new player entity is created.
name:string— the player's namecolor:Vec3f— the player's color
Command<GameAddPlayerCommandData>— a newly created GameAddPlayer command
Cmd.makeGameSetCalendarSpeedCmd🔗
function Cmd.makeGameSetCalendarSpeedCmd(millisPerDay : integer): Command<GameSetCalendarSpeedCommandData>
Makes a GameSetCalendarSpeed command.
When executed, the calendar speed is set to the given value (this affects only the speed of the calendar, and not the simulation speed).
millisPerDay:integer— day length in milliseconds
Command<GameSetCalendarSpeedCommandData>— a newly created GameSetCalendarSpeed command
Cmd.makeGameSetDateCmd🔗
function Cmd.makeGameSetDateCmd(date : Date): Command<GameSetDateCommandData>
Makes a GameSetDate command.
When executed, the calendar date (for vehicle availability, etc.) is set to the given date.
date:Date— the new date that should be set
Command<GameSetDateCommandData>— a newly created GameSetDate command
Cmd.makeGameSetSpeedCmd🔗
function Cmd.makeGameSetSpeedCmd(speedup : integer): Command<GameSetSpeedCommandData>
Makes a GameSetSpeed command.
When executed, the game (simulation) speed is set to the given value.
speedup:integer— a positive number: the speed that the simulation will run at
Command<GameSetSpeedCommandData>— a newly created GameSetSpeed command
Cmd.makeGameSetTimeOfDayCmd🔗
function Cmd.makeGameSetTimeOfDayCmd(timeOfDaySec : integer): Command<GameSetTimeOfDayCommandData>
Makes a GameSetTimeOfDay command.
ParameterstimeOfDaySec:integer— a positive number: the time of day in seconds
Command<GameSetTimeOfDayCommandData>— a newly created GameSetTimeOfDay command
Cmd.makeGameSetCloudCoverageCmd🔗
function Cmd.makeGameSetCloudCoverageCmd(cloudCoverage : number): Command<GameSetCloudCoverageCommandData>
Makes a GameSetCloudCoverage command.
ParameterscloudCoverage:number— the current cloud coverage
Command<GameSetCloudCoverageCommandData>— a newly created GameSetCloudCoverage command
Cmd.makeIndustrySetDespawnTimeCmd🔗
function Cmd.makeIndustrySetDespawnTimeCmd(industryEntity : Engine.Entity, timeStamp : integer): Command<IndustrySetDespawnTimeCommandData>
Makes an IndustrySetDespawnTime command.
When executed, the command sets a new value to the closure time stamp of the given industry.
industryEntity:Engine.Entity— the entity Id of the industrytimeStamp:integer— sets the despawn time of the industry
Command<IndustrySetDespawnTimeCommandData>— a newly created IndustrySetDespawnTime command
Cmd.makeIndustrySetManualDevelopmentCmd🔗
function Cmd.makeIndustrySetManualDevelopmentCmd(industryEntity : Engine.Entity, manual : boolean): Command<IndustrySetManualDevelopmentCommandData>
Makes an IndustrySetManualDevelopment command.
When executed, the command sets the industry to manual mode if manual is true, or to automatic development mode if manual is set to false (default).
industryEntity:Engine.Entity— the entity Id of the industrymanual:boolean— set to true if industries do not start to close/stop countdown and do not level up or down
Command<IndustrySetManualDevelopmentCommandData>— a newly created IndustrySetManualDevelopment command
Cmd.makeCreateIndustryExtendProposalCmd🔗
function Cmd.makeCreateIndustryExtendProposalCmd(extendConstruction : Engine.Entity, numTrySlots : integer, numKeepSlots : integer): Command<CreateIndustryExtendProposalCommandData>
Makes a CreateIndustryExtendProposal command.
When executed, the command generates a new proposal to extend the given industry.
extendConstruction:Engine.Entity— the entity Id of the industry that should be extendednumTrySlots:integer— the number of slots to try to extendnumKeepSlots:integer— the number of slots to keep after the extension
Command<CreateIndustryExtendProposalCommandData>— a newly created CreateIndustryExtendProposal command
Cmd.makeJournalBookAssetCmd🔗
function Cmd.makeJournalBookAssetCmd(player : Engine.Entity, entry : JournalEntry, position : Vec3f): Command<JournalBookAssetCommandData>
Makes a JournalBookAsset command.
When executed, the new journal entry is added to the players journal.
player:Engine.Entity— the entity Id of the playerentry:JournalEntry— the entry to addposition:Vec3f— a position for the event
Command<JournalBookAssetCommandData>— a newly created JournalBookAsset command
Cmd.makeJournalClearAllCmd🔗
function Cmd.makeJournalClearAllCmd(): Command<JournalClearAllCommandData>
Makes a JournalClearAll command.
When executed, the journal and logbook is cleared
Command<JournalClearAllCommandData>— a newly created JournalClearAll command
Cmd.makeJournalLogEntryCmd🔗
function Cmd.makeJournalLogEntryCmd(entity : Engine.Entity, logNamesAndValues : {{string, integer, boolean}}): Command<JournalLogEntryCommandData>
Makes a JournalLogEntry command.
When executed, the log book value is logged.
entity:Engine.Entity— the entity Id of the logbooklogNamesAndValues:{{string, integer, boolean}}— a list of log names and values to log, where each entry contains the log name, value and whether the value is incremental
Command<JournalLogEntryCommandData>— a newly created JournalLogEntry command
Cmd.makeLineCreateCmd🔗
function Cmd.makeLineCreateCmd(name : string, color : Vec3f, player : Engine.Entity, line : Engine.Component.Line): Command<LineCreateCommandData>
Makes a LineCreate command.
When executed, creates a new line with the given parameters.
name:string— the name of the new linecolor:Vec3f— the color of the new lineplayer:Engine.Entity— the entity Id of the player owning the lineline:Engine.Component.Line— the configuration data for the line
Command<LineCreateCommandData>— a newly created LineCreate command
Cmd.makeLineDestroyCmd🔗
function Cmd.makeLineDestroyCmd(lineEntity : Engine.Entity): Command<LineDestroyCommandData>
Makes a LineDestroy command.
When executed, the line with the given entity Id is removed.
lineEntity:Engine.Entity— the line that should be removed
Command<LineDestroyCommandData>— a newly created LineDestroy command
Cmd.makeLineUpdateCmd🔗
function Cmd.makeLineUpdateCmd(lineEntity : Engine.Entity, data : Engine.Component.Line): Command<LineUpdateCommandData>
Makes a LineUpdate command.
When executed, the line with the given entity Id is updated to the new line configuration.
lineEntity:Engine.Entity— the entity Id of the line which should be updateddata:Engine.Component.Line— the new line configuration
Command<LineUpdateCommandData>— a newly created LineUpdate command
Cmd.makeScriptingSendEventCmd🔗
function Cmd.makeScriptingSendEventCmd(src : string, id : string, name : string, param : any): Command<ScriptingSendEventCommandData>
Makes a ScriptingSendEvent command.
When executed, a script event will be broadcasted to all scripts.
src:string— the filename of the game_script that should be the pretended origin of the eventid:string— identifier of the element that caused the eventname:string— identifier of the event typeparam:any— parameters that depend on the context of the event
Command<ScriptingSendEventCommandData>— a newly created ScriptingSendEvent command
Cmd.makeStockListDiscardCargoCmd🔗
function Cmd.makeStockListDiscardCargoCmd(stockListEntity : Engine.Entity, stockIds : {StockId}, remainingTimeToDelivery : number): Command<StockListDiscardCargoCommandData>
Makes a StockListDiscardCargo command.
When executed, discards the cargo of the given stock list.
stockListEntity:Engine.Entity— the entity Id of the stock liststockIds:{StockId}— the list of stock idsremainingTimeToDelivery:number— the time remaining to delivery
Command<StockListDiscardCargoCommandData>— a newly created StockListDiscardCargo command
Cmd.makeStockListSetStocksCargoTypeCmd🔗
function Cmd.makeStockListSetStocksCargoTypeCmd(stockListEntity : Engine.Entity, stockIds : {StockId}, cargoType : CargoTypeId): Command<StockListSetStocksCargoTypeCommandData>
Makes a StockListSetStocksCargoType command.
When executed, sets or resets the cargo type of the given stocks.
stockListEntity:Engine.Entity— the entity Id of the stock liststockIds:{StockId}— the list of stock idscargoType:CargoTypeId— the cargo type to set, empty if the cargo type should be reset
Command<StockListSetStocksCargoTypeCommandData>— a newly created StockListSetStocksCargoType command
Cmd.makeStockListSetModifiersCmd🔗
function Cmd.makeStockListSetModifiersCmd(industryEntity : Engine.Entity, modifiers : Engine.Component.StockList.Modifiers): Command<StockListSetModifiersCommandData>
Makes a StockListSetModifiers command.
Allows changing some properties of industries
industryEntity:Engine.Entity— the entity Id of the industry of which the departure mode is to be changedmodifiers:Engine.Component.StockList.Modifiers— a struct with the changes to the industry parameters
Command<StockListSetModifiersCommandData>— a newly created StockListSetModifiers command
Cmd.makeTownConnectWithIndustriesCmd🔗
function Cmd.makeTownConnectWithIndustriesCmd(townEntities : {Engine.Entity}, connections : {{integer, integer}}, keep : boolean): Command<TownConnectWithIndustriesCommandData>
Makes a TownConnectWithIndustries command.
When executed, the command generates a new street network connecting the given towns and all existing industries.
townEntities:{Engine.Entity}— the entity Ids of the towns to connect togetherconnections:{{integer, integer}}— list with indices into the vector townEntities specifying which towns are to be connectedkeep:boolean— set to true if existing street connections should be kept, otherwise the streets will be removed
Command<TownConnectWithIndustriesCommandData>— a newly created TownConnectWithIndustries command
Cmd.makeTownAutoDetectConnectionsCmd🔗
function Cmd.makeTownAutoDetectConnectionsCmd(townEntities : {Engine.Entity}): Command
Makes a TownAutoDetectConnections command.
When executed, the command tries to detect if an existing connections between towns exists
townEntities:{Engine.Entity}— the entity Ids of the towns to check for connections
Command— a newly created TownAutoDetectConnections command
Cmd.makeTownCreateCmd🔗
function Cmd.makeTownCreateCmd(towns : {TownInfo}): Command<TownCreateCommandData>
Makes a TownCreate command.
When executed, the command initiates the generation of new towns using information contained in TownInfo.
towns:{TownInfo}— a list of town creation information, one for each new town
Command<TownCreateCommandData>— a newly created TownCreate command
Cmd.makeTownDestroyCmd🔗
function Cmd.makeTownDestroyCmd(townEntity : Engine.Entity): Command<TownDestroyCommandData>
Makes a TownDestroy command.
When executed, the town with the given entity Id is removed (all streets and buildings belonging to the town will be removed as well).
townEntity:Engine.Entity— the entity Id of the town that should be removed
Command<TownDestroyCommandData>— a newly created TownDestroy command
Cmd.makeTownDevelopAtCmd🔗
function Cmd.makeTownDevelopAtCmd(position : Vec2f, developStreets : boolean, upgradeBuildings : boolean): Command<TownDevelopAtCommandData>
Makes a TownDevelopAt command.
When executed, the command triggers development of towns at the given position.
By developing towns, new buildings or street segments are added at the given position.
position:Vec2f— the position where development should be triggereddevelopStreets:boolean— develop streetsupgradeBuildings:boolean— upgrade buildings
Command<TownDevelopAtCommandData>— a newly created TownDevelopAt command
Cmd.makeTownCustomDistributionWeightsCmd🔗
function Cmd.makeTownCustomDistributionWeightsCmd(townEntitiy : Engine.Entity, levelToCapacityDistributionWeights : {{number}}): Command<TownCustomDistributionWeightsCommandData>
Makes a TownCustomDistributionWeights command.
When executed, the command sets the level to capacities distribution weights for the town.
townEntitiy:Engine.Entity— the entity Id of the townlevelToCapacityDistributionWeights:{{number}}— level to capacities distribution weights for each land use type
Command<TownCustomDistributionWeightsCommandData>— a newly created TownCustomDistributionWeights command
Cmd.makeTownSetDevelopmentActiveCmd🔗
function Cmd.makeTownSetDevelopmentActiveCmd(entity : Engine.Entity, developmentActive : boolean): Command<TownSetDevelopmentActiveCommandData>
Makes a TownSetDevelopmentActive command.
When executed, the command enables/disables the development of a town.
entity:Engine.Entity— the entity Id of the towndevelopmentActive:boolean— signals whether the town development should be enabled/disabled
Command<TownSetDevelopmentActiveCommandData>— a newly created TownSetDevelopmentActive command
Cmd.makeTownSetInitialLandUseCapacitiesCmd🔗
function Cmd.makeTownSetInitialLandUseCapacitiesCmd(entity : Engine.Entity, landUseCapacities : {integer}): Command<TownSetInitialLandUseCapacitiesCommandData>
Makes a TownSetInitialLandUseCapacities command.
When executed, the town with the given entity Id is set to the given initial capacities.
entity:Engine.Entity— the entity Id of the town that should be updatedlandUseCapacities:{integer}— initial capacities for the residential, commercial and industrial. If not provided, capacities are automatically updated
Command<TownSetInitialLandUseCapacitiesCommandData>— a newly created TownSetInitialLandUseCapacities command
Cmd.makeTownUpdateCargoNeedsCmd🔗
function Cmd.makeTownUpdateCargoNeedsCmd(entity : Engine.Entity, cargoNeeds : {{CargoTypeId}}, updateTownBuildings : boolean): Command<TownUpdateCargoNeedsCommandData>
Makes a TownUpdateCargoNeeds command.
When executed, the cargo needs of the town districts are updated to the provided needs.
entity:Engine.Entity— the entity Id of the town that should be updatedcargoNeeds:{{CargoTypeId}}— a list of cargo type Ids for the needs of each of the three town districts residential, commercial and industrialupdateTownBuildings:boolean— whether to update all buildings immediately
Command<TownUpdateCargoNeedsCommandData>— a newly created TownUpdateCargoNeeds command
Cmd.makeTownUpdateSizeCmd🔗
function Cmd.makeTownUpdateSizeCmd(townEntity : Engine.Entity, sizeFactors : {number}, updateAllBuildings : boolean): Command<TownUpdateSizeCommandData>
Makes a TownUpdateSize command.
When executed, the town with the given entity Id is set to the given initial capacities.
townEntity:Engine.Entity— the entity Id of the town that should be updatedsizeFactors:{number}— initial capacities for the residential, commercial and industrial districts of the townupdateAllBuildings:boolean— whether to update all buildings immediately
Command<TownUpdateSizeCommandData>— a newly created TownUpdateSize command
Cmd.makeTownBuildingSetBlockedDevelopmentCmd🔗
function Cmd.makeTownBuildingSetBlockedDevelopmentCmd(townBuildingEntity : Engine.Entity, blockedDevelopment : boolean): Command<TownBuildingSetBlockedDevelopment>
Makes a TownBuildingSetBlockedDevelopment command.
When executed, makes buildings "Historic" thatn cannot be changed
townBuildingEntity:Engine.Entity— the entity Id of the town building that should be updatedblockedDevelopment:boolean— decides whether to prevent the town developer from changing building
Command<TownBuildingSetBlockedDevelopment>— a newly created TownBuildingSetBlockedDevelopment command
Cmd.makeVehicleBuyCmd🔗
function Cmd.makeVehicleBuyCmd(playerEntity : Engine.Entity, depotEntity : Engine.Entity, tvc : TransportVehicleConfig): Command<VehicleBuyCommandData>
Makes a VehicleBuy command.
When executed, a new vehicle is bought and placed in the given depot.
playerEntity:Engine.Entity— the entity Id of the playerdepotEntity:Engine.Entity— the entity Id of the depot in which the vehicle will appeartvc:TransportVehicleConfig— data containing information about the vehicle being purchased
Command<VehicleBuyCommandData>— a newly created VehicleBuy command
Cmd.makeVehicleReplaceCmd🔗
function Cmd.makeVehicleReplaceCmd(vehicleEntity : Engine.Entity, tvc : TransportVehicleConfig): Command<VehicleReplaceCommandData>
Makes a VehicleReplace command.
When executed, the vehicle with the given entity Id will be replaced by the new vehicle configuration.
vehicleEntity:Engine.Entity— the entity Id of the vehicle that should be replacedtvc:TransportVehicleConfig— data containing information about the new vehicle being purchased
Command<VehicleReplaceCommandData>— a newly created VehicleReplace command
Cmd.makeVehicleReverseCmd🔗
function Cmd.makeVehicleReverseCmd(vehicleEntity : Engine.Entity): Command<VehicleReverseCommandData>
Makes a VehicleReverse command.
When executed, the vehicle with the given entity Id will be reversed.
vehicleEntity:Engine.Entity— the entity Id of the vehicle that should be reversed
Command<VehicleReverseCommandData>— a newly created VehicleReverse command
Cmd.makeVehicleSellCmd🔗
function Cmd.makeVehicleSellCmd(vehicleEntities : {Engine.Entity}): Command<VehicleSellCommandData>
Makes a VehicleSell command.
When executed, the vehicle with the given entity Id will be sold.
vehicleEntities:{Engine.Entity}— the entity ids of the vehicles which should be sold
Command<VehicleSellCommandData>— a newly created VehicleSell command
Cmd.makeVehicleSendToDepotCmd🔗
function Cmd.makeVehicleSendToDepotCmd(vehicleEntity : Engine.Entity, sellOnArrival : boolean, jumpToDepoEntity : Engine.Entity): Command<VehicleSendToDepotCommandData>
Makes a VehicleSendToDepot command.
When executed, the vehicle with the given entity Id will be sent to the nearest reachable depot and (optionally) be sold.
vehicleEntity:Engine.Entity— the entity Id of the vehicle that should be sent to the depotsellOnArrival:boolean— if set to true, the vehicle will be sold upon arrival at the depotjumpToDepoEntity:Engine.Entity— optional. If provided, then vehicle gets "teleported" to depot
Command<VehicleSendToDepotCommandData>— a newly created VehicleSendToDepot command
Cmd.makeVehicleSetLineCmd🔗
function Cmd.makeVehicleSetLineCmd(vehicleEntity : Engine.Entity, lineEntity : Engine.Entity, stopIndex : integer): Command<VehicleSetLineCommandData>
Makes a VehicleSetLine command.
When executed, the vehicle with the provided entity Id is assigned to the line with given entity Id and sent to the stop with the given index.
vehicleEntity:Engine.Entity— the entity Id of the vehicle that should be assigned to the linelineEntity:Engine.Entity— the entity Id of the line on which the vehicle should be sentstopIndex:integer— the position of the stop on the line to which the vehicle should be sent to
Command<VehicleSetLineCommandData>— a newly created VehicleSetLine command
Cmd.makeVehicleSetManualDepartureCmd🔗
function Cmd.makeVehicleSetManualDepartureCmd(vehicleEntity : Engine.Entity, manual : boolean): Command<VehicleSetManualDepartureCommandData>
Makes a VehicleSetManualDeparture command.
When an entity with component type TRANSPORT_VEHICLE is set to manual departure
it will not depart from the terminal under any circumstance (the callback will always return success).
If the entity is not a transport vehicle, the command callback will return False.
vehicleEntity:Engine.Entity— the entity Id of the vehicle of which the departure mode is to be changedmanual:boolean— whether the entity is managed or not
Command<VehicleSetManualDepartureCommandData>— a newly created VehicleSetManualDeparture command
Cmd.makeVehicleSetStoppedByUserCmd🔗
function Cmd.makeVehicleSetStoppedByUserCmd(vehicleEntity : Engine.Entity, stopped : boolean): Command<VehicleSetStoppedByUserCommandData>
Makes a VehicleSetStoppedByUser command.
When executed, the given vehicle is stopped or started as if the user controlled it in the vehicle dialog.
vehicleEntity:Engine.Entity— the entity Id of the vehicle that should be stopped or startedstopped:boolean— stopped true if the vehicle should be stopped
Command<VehicleSetStoppedByUserCommandData>— a newly created VehicleSetStoppedByUser command
Cmd.makeVehicleSetModifiersCmd🔗
function Cmd.makeVehicleSetModifiersCmd(vehicleEntity : Engine.Entity, modifiers : Engine.Component.TransportVehicle.Modifiers): Command<VehicleSetModifiersCommandData>
Makes a VehicleSetModifiers command.
Allows changing some properties of transport vehicles
vehicleEntity:Engine.Entity— the entity Id of the vehicle of which the departure mode is to be changedmodifiers:Engine.Component.TransportVehicle.Modifiers— a struct with the changes to the transport vehicle parameters
Command<VehicleSetModifiersCommandData>— a newly created VehicleSetModifiers command
Cmd.makeVehicleTryToDepartCmd🔗
function Cmd.makeVehicleTryToDepartCmd(vehicleEntity : Engine.Entity): Command<VehicleTryToDepartCommandData>
Makes a VehicleTryToDepart command.
When executed, and the vehicle with entity Id is at the terminal, the vehicle will immediately close
the door and depart as soon as the doors are closed. The vehicle will ignore any departure condition and depart immediately.
The command callback will return success if the entity has a TRANSPORT_VEHICLE component and
is currently waiting at the terminal.
vehicleEntity:Engine.Entity— the entity Id of the vehicle at terminal that should depart
Command<VehicleTryToDepartCommandData>— a newly created VehicleTryToDepart command
Cmd.makeWorldBuildProposalCmd(Proposal, any, boolean, boolean, boolean)🔗
function Cmd.makeWorldBuildProposalCmd(Proposal, any, boolean, boolean, boolean)(proposal : Proposal, context : any, ignoreErrors : boolean, doDust : boolean, playerInitiated : boolean): Command<WorldBuildProposalCommandData>
Makes a WorldBuildProposal command. This command is used to create new constructions and new streets via scripting.
When executed, the given build proposal is built. The command might fail resulting in the proposal not being built.
proposal:Proposal— a proposal containing a preview of the changes that will be applied with this commandcontext:any— a context with extra options for the proposalignoreErrors:boolean— a flag enabling the building of the proposal even if non-critical errors are triggereddoDust:boolean— whether dust effect should be createdplayerInitiated:boolean— whether the command was initiated by a player
Command<WorldBuildProposalCommandData>— a newly created WorldBuildProposal command
Cmd.makeWorldBuildProposalCmd(SimpleProposal, any, boolean, boolean, boolean)🔗
function Cmd.makeWorldBuildProposalCmd(SimpleProposal, any, boolean, boolean, boolean)(SimpleProposal, any, boolean, boolean, boolean): Command<WorldBuildProposalCommandData>Parameters
SimpleProposalanybooleanbooleanboolean
Command<WorldBuildProposalCommandData>
Cmd.makeWorldChangeWindCmd🔗
function Cmd.makeWorldChangeWindCmd(emissionGridEntity : Engine.Entity, wind : Vec2f): Command<WorldChangeWindCommandData>
Makes a WorldChangeWind command.
When executed, the EmissionGrid with the given entity Id is updated to run with the new wind given.
emissionGridEntity:Engine.Entity— the entity Id of the game's emission gridwind:Vec2f— the new wind
Command<WorldChangeWindCommandData>— a newly created WorldChangeWind command
Cmd.makeWorldReplaceTerrainCmd🔗
function Cmd.makeWorldReplaceTerrainCmd(map : GameMap, terrainConfig : BaseConfig.Terrain, seedText : string, worldEntity : Engine.Entity, keepAssets : boolean): Command<WorldReplaceTerrainCommandData>
Makes a WorldReplaceTerrain command.
When executed, the terrain is replaced. This is similar to the generation in map editor.
map:GameMap— an object that specifies the data for the new terrain (heightmap, assets, water level...)terrainConfig:BaseConfig.Terrain— configuration parameters for the new terrainseedText:string— a seed for randomization purposesworldEntity:Engine.Entity— the entity Id of the world, usually 0keepAssets:boolean— if set to true, existing landscape assets are conserved
Command<WorldReplaceTerrainCommandData>— a newly created WorldReplaceTerrain command
Cmd.makeWorldSetBulldozableCmd🔗
function Cmd.makeWorldSetBulldozableCmd(entity : Engine.Entity, bulldozable : boolean): Command<WorldSetBulldozableCommandData>
Makes a WorldSetBulldozable command.
Sets whether an entity can be bulldozed or not.
entity:Engine.Entity— entity IDbulldozable:boolean— whether bulldozeable or not
Command<WorldSetBulldozableCommandData>— a newly created WorldSetBulldozable command
Cmd.Debug🔗
record Cmd.Debug
makeMaintenanceCostUpdateCmd: function(maintenanceCostEntity : Engine.Entity, amount : integer, reset : boolean): Command makeSimPersonSetStateCmd: function(entity : Engine.Entity, simPersonState : integer): Command<SimPersonSetStateCommandDataDEBUG> makeSimPersonSetHappiness: function(entity : Engine.Entity, happiness : number): Command makeComponentExchangeCmd: function(entity : Engine.Entity, component : Engine.Component): Command<ComponentExchangeCommandDataDEBUG> makeStockSetCargoAmountCmd: function(entity : Engine.Entity, stockId : StockId, amount : integer, cargoType : string): Command<StockSetCargoAmountCommandDataDEBUG> makeGamePerformSimulationStepsCmd: function(amount : integer): Command<GamePerformSimulationStepsCommandDataDEBUG> makeClearLogbooksCmd: function(towns : boolean): Command end
Debug command helpers.
Cmd.Debug.makeMaintenanceCostUpdateCmd🔗
function Cmd.Debug.makeMaintenanceCostUpdateCmd(maintenanceCostEntity : Engine.Entity, amount : integer, reset : boolean): Command
Makes a MaintenanceCostUpdate command.
When executed, the maintenance cost amount is updated
maintenanceCostEntity:Engine.Entity— the entity Id of the maintenance cost about to changeamount:integer— of the new maintenance costreset:boolean— the accumulated cost
Command— a newly created MaintenanceCostUpdate command
Cmd.Debug.makeSimPersonSetStateCmd🔗
function Cmd.Debug.makeSimPersonSetStateCmd(entity : Engine.Entity, simPersonState : integer): Command<SimPersonSetStateCommandDataDEBUG>
Sets the state of a simulated person.
Parametersentity:Engine.Entity— the entity IdsimPersonState:integer— the new state
Command<SimPersonSetStateCommandDataDEBUG>— a newly created SimPersonSetState command
Cmd.Debug.makeSimPersonSetHappiness🔗
function Cmd.Debug.makeSimPersonSetHappiness(entity : Engine.Entity, happiness : number): Command
Sets the happiness value of a simulated person.
Parametersentity:Engine.Entity— the entity Idhappiness:number— the new happiness value
Command— a newly created SimPersonSetHappiness command
Cmd.Debug.makeComponentExchangeCmd🔗
function Cmd.Debug.makeComponentExchangeCmd(entity : Engine.Entity, component : Engine.Component): Command<ComponentExchangeCommandDataDEBUG>
Replaces a component on an entity for debugging purposes.
Parametersentity:Engine.Entity— the entity Idcomponent:Engine.Component— the component (EmissionEmitter or ModelInstanceList)
Command<ComponentExchangeCommandDataDEBUG>— a newly created ComponentExchange command
Cmd.Debug.makeStockSetCargoAmountCmd🔗
function Cmd.Debug.makeStockSetCargoAmountCmd(entity : Engine.Entity, stockId : StockId, amount : integer, cargoType : string): Command<StockSetCargoAmountCommandDataDEBUG>
Sets the cargo amount for a stock.
Parametersentity:Engine.Entity— stocklist entitystockId:StockId— the stock IDamount:integer— the cargo amountcargoType:string— optional cargo type URI
Command<StockSetCargoAmountCommandDataDEBUG>— a newly created StockSetCargoAmount command
Cmd.Debug.makeGamePerformSimulationStepsCmd🔗
function Cmd.Debug.makeGamePerformSimulationStepsCmd(amount : integer): Command<GamePerformSimulationStepsCommandDataDEBUG>
Advances the simulation by a given number of steps.
Parametersamount:integer— the number of steps
Command<GamePerformSimulationStepsCommandDataDEBUG>— a newly created GamePerformSimulationSteps command
Cmd.Debug.makeClearLogbooksCmd🔗
function Cmd.Debug.makeClearLogbooksCmd(towns : boolean): Command
Clears either town or global logbooks.
Parameterstowns:boolean— whether to clear town logbooks
Command— a newly created ClearLogbooks command
Cmd.debug🔗
Cmd.debug: Debug
Category: globals🔗
AnimalSetStateCommandData🔗
global record AnimalSetStateCommandData
animalEntity: Engine.Entity movementType: integer targetChangedElapsed: number invalidTileElapsed: number movementSpeed: number angularSpeed: number end
Sends a command object to be executed later or immediately depending on the context.
AnimalSetStateCommandData.animalEntity🔗
AnimalSetStateCommandData.animalEntity: Engine.Entity
Entity id of the animal that should be updated.
AnimalSetStateCommandData.movementType🔗
AnimalSetStateCommandData.movementType: integer
the index of the configuration in the animals metadata movementTypes list
AnimalSetStateCommandData.targetChangedElapsed🔗
AnimalSetStateCommandData.targetChangedElapsed: number
Time since the current target destination was selected.
AnimalSetStateCommandData.invalidTileElapsed🔗
AnimalSetStateCommandData.invalidTileElapsed: number
Time since the animal got into an invalid area.
AnimalSetStateCommandData.movementSpeed🔗
AnimalSetStateCommandData.movementSpeed: number
speed that should be used.
AnimalSetStateCommandData.angularSpeed🔗
AnimalSetStateCommandData.angularSpeed: number
angularSpeed angular speed that should be used.
AnimalSpawnAtCommandData🔗
global record AnimalSpawnAtCommandData
modelId: integer position: Vec2f lookAt: Vec2f resultEntity: Engine.Entity end
Command data for cmd.makeAnimalSpawnAtCmd.
AnimalSpawnAtCommandData.modelId🔗
AnimalSpawnAtCommandData.modelId: integer
reference to the animal model that should be spawned.
AnimalSpawnAtCommandData.position🔗
AnimalSpawnAtCommandData.position: Vec2f
position coordinates of the position where the animal should be spawned.
AnimalSpawnAtCommandData.lookAt🔗
AnimalSpawnAtCommandData.lookAt: Vec2f
lookAt the direction the animal is looking.
AnimalSpawnAtCommandData.resultEntity🔗
AnimalSpawnAtCommandData.resultEntity: Engine.Entity
resultEntity The entity id of the spawned animal, used as a result only.
Command🔗
global record Command<T is ICommandData>
end
Command object sent via cmd.sendCommand.
Type Parameters
T( isICommandData)
ComponentExchangeCommandDataDEBUG🔗
global record ComponentExchangeCommandDataDEBUG
entity: Engine.Entity component: Engine.Component end
ComponentExchangeCommandDataDEBUG.entity🔗
ComponentExchangeCommandDataDEBUG.entity: Engine.Entity
ComponentExchangeCommandDataDEBUG.component🔗
ComponentExchangeCommandDataDEBUG.component: Engine.Component
CreateIndustryExtendProposalCommandData🔗
global record CreateIndustryExtendProposalCommandData
extendConstruction: Engine.Entity numTrySlots: integer numKeepSlots: integer resultProposal: Proposal resultCollidingSubconstructions: {integer} end
Command data for cmd.makeCreateIndustryExtendProposalCmd.
CreateIndustryExtendProposalCommandData.extendConstruction🔗
CreateIndustryExtendProposalCommandData.extendConstruction: Engine.Entity
Entity id of the industry that should be extended.
CreateIndustryExtendProposalCommandData.numTrySlots🔗
CreateIndustryExtendProposalCommandData.numTrySlots: integer
Number of slots to try to extend.
CreateIndustryExtendProposalCommandData.numKeepSlots🔗
CreateIndustryExtendProposalCommandData.numKeepSlots: integer
Number of slots to keep after the extension.
CreateIndustryExtendProposalCommandData.resultProposal🔗
CreateIndustryExtendProposalCommandData.resultProposal: Proposal
The resulting proposal generated by the command (result only).
CreateIndustryExtendProposalCommandData.resultCollidingSubconstructions🔗
CreateIndustryExtendProposalCommandData.resultCollidingSubconstructions: {integer}
The resulting colliding subconstructions generated by the command (result only).
CustomEntityCreateCommandData🔗
Command data for cmd.makeCustomEntityCreateCmd.
CustomEntityCreateCommandData.modelId🔗
CustomEntityCreateCommandData.modelId: integer
Model id of the custom entity.
CustomEntityCreateCommandData.resultEntity🔗
CustomEntityCreateCommandData.resultEntity: Engine.Entity
Created entity id (result only).
CustomEntityDestroyCommandData🔗
Command data for cmd.makeCustomEntityDestroyCmd.
CustomEntityDestroyCommandData.entity🔗
CustomEntityDestroyCommandData.entity: Engine.Entity
Entity id of the custom entity.
CustomEntityUpdateStateCommandData🔗
global record CustomEntityUpdateStateCommandData
entity: Engine.Entity customState: {<any type> : <any type>} end
Command data for cmd.makeCustomEntityUpdateStateCmd.
CustomEntityUpdateStateCommandData.entity🔗
CustomEntityUpdateStateCommandData.entity: Engine.Entity
Entity id of the custom entity.
CustomEntityUpdateStateCommandData.customState🔗
CustomEntityUpdateStateCommandData.customState: {<any type> : <any type>}
New custom state.
CustomEntityUpdateTransformationCommandData🔗
Command data for cmd.makeCustomEntityUpdateTransformationCmd.
CustomEntityUpdateTransformationCommandData.entity🔗
CustomEntityUpdateTransformationCommandData.entity: Engine.Entity
Entity id of the custom entity.
CustomEntityUpdateTransformationCommandData.transf🔗
CustomEntityUpdateTransformationCommandData.transf: Mat4f
New transformation.
CustomVehicleCreateCommandData🔗
global record CustomVehicleCreateCommandData
vehicleEntity: Engine.Entity carrier: Carrier vehicles: {{integer, boolean}} movePathAircraft: Engine.Component.MovePathAircraft resultEntity: Engine.Entity end
Command data for cmd.makeCustomVehicleCreateOrUpdateCmd.
CustomVehicleCreateCommandData.vehicleEntity🔗
CustomVehicleCreateCommandData.vehicleEntity: Engine.Entity
CustomVehicleCreateCommandData.carrier🔗
CustomVehicleCreateCommandData.carrier: Carrier
Model id of the custom entity.
CustomVehicleCreateCommandData.vehicles🔗
CustomVehicleCreateCommandData.vehicles: {{integer, boolean}}
List of carriages to add to the vehicles (model id and reversed status)
CustomVehicleCreateCommandData.movePathAircraft🔗
CustomVehicleCreateCommandData.movePathAircraft: Engine.Component.MovePathAircraft
The move path for aircraft and ships (not all members are utilized, path0 and 2 must be empty and must be in flight state)
CustomVehicleCreateCommandData.resultEntity🔗
CustomVehicleCreateCommandData.resultEntity: Engine.Entity
Created entity id (result only).
EntitySetColorCommandData🔗
Command data for cmd.makeEntitySetColorCmd.
EntitySetColorCommandData.entity🔗
EntitySetColorCommandData.entity: Engine.Entity
Entity id.
EntitySetColorCommandData.color🔗
EntitySetColorCommandData.color: Vec3f
RGB color.
EntitySetEmissionsCommandData🔗
global record EntitySetEmissionsCommandData
entity: Engine.Entity noisePower: number pollutionPower: number radius: number end
Command data for cmd.makeEntitySetEmissionsCmd.
EntitySetEmissionsCommandData.entity🔗
EntitySetEmissionsCommandData.entity: Engine.Entity
Entity id of the emission emitter.
EntitySetEmissionsCommandData.noisePower🔗
EntitySetEmissionsCommandData.noisePower: number
Noise in power.
EntitySetEmissionsCommandData.pollutionPower🔗
EntitySetEmissionsCommandData.pollutionPower: number
Pollution in power.
EntitySetEmissionsCommandData.radius🔗
EntitySetEmissionsCommandData.radius: number
Emission radius in meters.
EntitySetNameCommandData🔗
Command data for cmd.makeEntitySetNameCmd.
EntitySetNameCommandData.entity🔗
EntitySetNameCommandData.entity: Engine.Entity
id of the entity that should be renamed.
EntitySetNameCommandData.name🔗
EntitySetNameCommandData.name: string
the name that should be set.
EntitySetPlayerCommandData🔗
Command data for cmd.makeEntitySetPlayerCmd.
EntitySetPlayerCommandData.entity🔗
EntitySetPlayerCommandData.entity: Engine.Entity
Entity id for which the player will be assigned.
EntitySetPlayerCommandData.playerEntity🔗
EntitySetPlayerCommandData.playerEntity: Engine.Entity
Player entity id.
GameAddPlayerCommandData🔗
Command data for cmd.makeGameAddPlayerCmd.
GameAddPlayerCommandData.name🔗
GameAddPlayerCommandData.name: string
Player name.
GameAddPlayerCommandData.color🔗
GameAddPlayerCommandData.color: Vec3f
Player color.
GameAddPlayerCommandData.resultEntity🔗
GameAddPlayerCommandData.resultEntity: Engine.Entity
Created player entity id (result only).
GamePerformSimulationStepsCommandDataDEBUG🔗
global record GamePerformSimulationStepsCommandDataDEBUG
amount: integer end
GamePerformSimulationStepsCommandDataDEBUG.amount🔗
GamePerformSimulationStepsCommandDataDEBUG.amount: integer
GameSaveCommandData🔗
global record GameSaveCommandData
modDescs: {Mod.GameModDesc} configData: {<any type> : <any type>} guiSaveData: {<any type> : <any type>} fileName: string isAutosave: boolean isMapsave: boolean screenshot: GameScreenshot error: integer end
Command data for saving the game.
GameSaveCommandData.modDescs🔗
GameSaveCommandData.modDescs: {Mod.GameModDesc}
GameSaveCommandData.configData🔗
GameSaveCommandData.configData: {<any type> : <any type>}
GameSaveCommandData.guiSaveData🔗
GameSaveCommandData.guiSaveData: {<any type> : <any type>}
GameSaveCommandData.fileName🔗
GameSaveCommandData.fileName: string
GameSaveCommandData.isAutosave🔗
GameSaveCommandData.isAutosave: boolean
GameSaveCommandData.isMapsave🔗
GameSaveCommandData.isMapsave: boolean
GameSaveCommandData.screenshot🔗
GameSaveCommandData.screenshot: GameScreenshot
GameSaveCommandData.error🔗
GameSaveCommandData.error: integer
GameSetCalendarSpeedCommandData🔗
global record GameSetCalendarSpeedCommandData
millisPerDay: integer end
Command data for cmd.makeGameSetCalendarSpeedCmd.
GameSetCalendarSpeedCommandData.millisPerDay🔗
GameSetCalendarSpeedCommandData.millisPerDay: integer
Day length in milliseconds.
GameSetCloudCoverageCommandData🔗
global record GameSetCloudCoverageCommandData
cloudCoverage: number end
Command data for cmd.makeGameSetCloudCoverageCmd.
GameSetCloudCoverageCommandData.cloudCoverage🔗
GameSetCloudCoverageCommandData.cloudCoverage: number
new cloud coverage.
GameSetDateCommandData🔗
Command data for cmd.makeGameSetDateCmd.
GameSetDateCommandData.date🔗
GameSetDateCommandData.date: Date
New date.
GameSetSpeedCommandData🔗
global record GameSetSpeedCommandData
speedup: integer end
Command data for cmd.makeGameSetSpeedCmd.
GameSetSpeedCommandData.speedup🔗
GameSetSpeedCommandData.speedup: integer
Simulation speed.
GameSetTimeOfDayCommandData🔗
global record GameSetTimeOfDayCommandData
timeOfDaySec: integer end
Command data for cmd.makeGameSetTimeOfDayCmd.
GameSetTimeOfDayCommandData.timeOfDaySec🔗
GameSetTimeOfDayCommandData.timeOfDaySec: integer
Time of day in seconds.
ICommandData🔗
global interface ICommandData
end
Marker interface for command data payloads.
IndustrySetDespawnTimeCommandData🔗
Command data for cmd.makeIndustrySetDespawnTimeCmd._
IndustrySetDespawnTimeCommandData.entity🔗
IndustrySetDespawnTimeCommandData.entity: Engine.Entity
of the building entity of which the despawn timeStamp should change.
IndustrySetDespawnTimeCommandData.timeStamp🔗
IndustrySetDespawnTimeCommandData.timeStamp: integer
time after which the building should be closed.
IndustrySetManualDevelopmentCommandData🔗
Command data for cmd.makeIndustrySetManualDevelopmentCmd.
IndustrySetManualDevelopmentCommandData.entity🔗
IndustrySetManualDevelopmentCommandData.entity: Engine.Entity
Industry entity id.
IndustrySetManualDevelopmentCommandData.manual🔗
IndustrySetManualDevelopmentCommandData.manual: boolean
manual whether the entity should manually be developed.
JournalBookAssetCommandData🔗
global record JournalBookAssetCommandData
playerEntity: Engine.Entity journalEntry: JournalEntry position: Vec3f end
Command data for cmd.makeJournalBookAssetCmd.
JournalBookAssetCommandData.playerEntity🔗
JournalBookAssetCommandData.playerEntity: Engine.Entity
Player entity id.
JournalBookAssetCommandData.journalEntry🔗
JournalBookAssetCommandData.journalEntry: JournalEntry
Journal entry to add.
JournalBookAssetCommandData.position🔗
JournalBookAssetCommandData.position: Vec3f
World position of the journal entry.
JournalClearAllCommandData🔗
global record JournalClearAllCommandData
end
Command data for cmd.makeJournalClearAllCmd.
JournalLogEntryCommandData🔗
global record JournalLogEntryCommandData
entity: Engine.Entity logName: string time: number value: integer end
Command data for cmd.makeJournalLogEntryCmd.
JournalLogEntryCommandData.entity🔗
JournalLogEntryCommandData.entity: Engine.Entity
Entity to log on.
JournalLogEntryCommandData.logName🔗
JournalLogEntryCommandData.logName: string
Log name.
JournalLogEntryCommandData.time🔗
JournalLogEntryCommandData.time: number
Log time.
JournalLogEntryCommandData.value🔗
JournalLogEntryCommandData.value: integer
Log value.
LineCreateCommandData🔗
Command data for cmd.makeLineCreateCmd.
LineCreateCommandData.line🔗
LineCreateCommandData.line: Engine.Component.Line
Line configuration.
LineCreateCommandData.name🔗
LineCreateCommandData.name: Engine.Component.Name
new name component of the line.
LineCreateCommandData.color🔗
LineCreateCommandData.color: Engine.Component.Color
new color component of the line.
LineCreateCommandData.playerOwned🔗
LineCreateCommandData.playerOwned: Engine.Component.PlayerOwned
new player owned component of the line.
LineCreateCommandData.resultEntity🔗
LineCreateCommandData.resultEntity: Engine.Entity
Created line entity id (result only).
LineDestroyCommandData🔗
Command data for cmd.makeLineDestroyCmd.
LineDestroyCommandData.lineEntity🔗
LineDestroyCommandData.lineEntity: Engine.Entity
Line entity id.
LineUpdateCommandData🔗
Command data for cmd.makeLineUpdateCmd.
LineUpdateCommandData.lineEntity🔗
LineUpdateCommandData.lineEntity: Engine.Entity
Line entity id.
LineUpdateCommandData.line🔗
LineUpdateCommandData.line: Engine.Component.Line
New line component.
MaintenanceCostUpdateCommandDataDEBUG🔗
global record MaintenanceCostUpdateCommandDataDEBUG
maintenanceCostEntity: Engine.Entity amount: integer resetAccumulatedCost: boolean end
Command data to set new maintenance cost (debug).
MaintenanceCostUpdateCommandDataDEBUG.maintenanceCostEntity🔗
MaintenanceCostUpdateCommandDataDEBUG.maintenanceCostEntity: Engine.Entity
The entity id of the maintenance cost
MaintenanceCostUpdateCommandDataDEBUG.amount🔗
MaintenanceCostUpdateCommandDataDEBUG.amount: integer
The new maintenance cost amount
MaintenanceCostUpdateCommandDataDEBUG.resetAccumulatedCost🔗
MaintenanceCostUpdateCommandDataDEBUG.resetAccumulatedCost: boolean
Whether to clean the accumulated cost
ScriptingSendEventCommandData🔗
Command data for cmd.makeScriptingSendEventCmd.
ScriptingSendEventCommandData.fileName🔗
ScriptingSendEventCommandData.fileName: string
Filename of the game script that should be the pretended origin of the event.
ScriptingSendEventCommandData.id🔗
ScriptingSendEventCommandData.id: string
Identifier of the element that caused the event.
ScriptingSendEventCommandData.name🔗
ScriptingSendEventCommandData.name: string
Identifier of the event type.
ScriptingSendEventCommandData.param🔗
ScriptingSendEventCommandData.param: any
Parameters that depend on the context of the event.
SimPersonSetStateCommandDataDEBUG🔗
SimPersonSetStateCommandDataDEBUG.entity🔗
SimPersonSetStateCommandDataDEBUG.entity: Engine.Entity
SimPersonSetStateCommandDataDEBUG.type🔗
SimPersonSetStateCommandDataDEBUG.type: integer
StockListDiscardCargoCommandData🔗
global record StockListDiscardCargoCommandData
stockListEntity: Engine.Entity stockIds: {StockId} remainingTimeToDelivery: number end
Command data for cmd.makeStockListDiscardCargoCmd.
StockListDiscardCargoCommandData.stockListEntity🔗
StockListDiscardCargoCommandData.stockListEntity: Engine.Entity
Stock list entity id.
StockListDiscardCargoCommandData.stockIds🔗
StockListDiscardCargoCommandData.stockIds: {StockId}
Stock ids to discard.
StockListDiscardCargoCommandData.remainingTimeToDelivery🔗
StockListDiscardCargoCommandData.remainingTimeToDelivery: number
Time until the cargo is delivered.
StockListSetModifiersCommandData🔗
global record StockListSetModifiersCommandData
entity: Engine.Entity modifiers: Engine.Component.StockList.Modifiers end
Command data for cmd.makeStockListSetModifiersCmd.
StockListSetModifiersCommandData.entity🔗
StockListSetModifiersCommandData.entity: Engine.Entity
Id of the industry entity of which the departure mode should change.
StockListSetModifiersCommandData.modifiers🔗
StockListSetModifiersCommandData.modifiers: Engine.Component.StockList.Modifiers
a struct containing all modifiers applied to the industry.
StockListSetStocksCargoTypeCommandData🔗
global record StockListSetStocksCargoTypeCommandData
stockListEntity: Engine.Entity stockIds: {StockId} cargoType: CargoTypeId end
Command data for cmd.makeStockListSetStocksCargoTypeCmd.
StockListSetStocksCargoTypeCommandData.stockListEntity🔗
StockListSetStocksCargoTypeCommandData.stockListEntity: Engine.Entity
Stock list entity id.
StockListSetStocksCargoTypeCommandData.stockIds🔗
StockListSetStocksCargoTypeCommandData.stockIds: {StockId}
a list of stock ids to set the cargo type
StockListSetStocksCargoTypeCommandData.cargoType🔗
StockListSetStocksCargoTypeCommandData.cargoType: CargoTypeId
cargoType the cargo type to set, empty to reset
StockSetCargoAmountCommandDataDEBUG🔗
global record StockSetCargoAmountCommandDataDEBUG
stockListEntity: Engine.Entity stock: StockId amount: integer cargoType: ResName end
StockSetCargoAmountCommandDataDEBUG.stockListEntity🔗
StockSetCargoAmountCommandDataDEBUG.stockListEntity: Engine.Entity
StockSetCargoAmountCommandDataDEBUG.stock🔗
StockSetCargoAmountCommandDataDEBUG.stock: StockId
StockSetCargoAmountCommandDataDEBUG.amount🔗
StockSetCargoAmountCommandDataDEBUG.amount: integer
StockSetCargoAmountCommandDataDEBUG.cargoType🔗
StockSetCargoAmountCommandDataDEBUG.cargoType: ResName
TownAutoDetectConnectionsCommandData🔗
Command to automatically detect connection existing between towns.
TownAutoDetectConnectionsCommandData.townEntities🔗
TownAutoDetectConnectionsCommandData.townEntities: {Engine.Entity}
Entity ids of the towns to detect connections for.
TownBuildingSetBlockedDevelopment🔗
global record TownBuildingSetBlockedDevelopment
townBuildingEntity: Engine.Entity blockedDevelopment: boolean end
TownBuildingSetBlockedDevelopment.townBuildingEntity🔗
TownBuildingSetBlockedDevelopment.townBuildingEntity: Engine.Entity
Town building entity id.
TownBuildingSetBlockedDevelopment.blockedDevelopment🔗
TownBuildingSetBlockedDevelopment.blockedDevelopment: boolean
Whether to prevent the town developer from changing the town building
TownConnectWithIndustriesCommandData🔗
global record TownConnectWithIndustriesCommandData
townEntities: {Engine.Entity} connections: {{integer, integer}} keep: boolean end
Command data for cmd.makeTownConnectWithIndustriesCmd.
TownConnectWithIndustriesCommandData.townEntities🔗
TownConnectWithIndustriesCommandData.townEntities: {Engine.Entity}
Town entity ids to connect.
TownConnectWithIndustriesCommandData.connections🔗
TownConnectWithIndustriesCommandData.connections: {{integer, integer}}
Connections as pairs of indices into townEntities for start and end destinations
TownConnectWithIndustriesCommandData.keep🔗
TownConnectWithIndustriesCommandData.keep: boolean
Whether to keep existing street connections.
TownCreateCommandData🔗
Command data for cmd.makeTownCreateCmd.
TownCreateCommandData.towns🔗
TownCreateCommandData.towns: {TownInfo}
Town creation information.
TownCreateCommandData.updateInitialLandUseCapacities🔗
TownCreateCommandData.updateInitialLandUseCapacities: boolean
Whether to update initial land use capacities.
TownCustomDistributionWeightsCommandData🔗
global record TownCustomDistributionWeightsCommandData
townEntity: Engine.Entity levelToCapacityDistributionWeights: {{number, number, number, number}, {number, number, number, number}, {number, number, number, number}} end
Command data for cmd.makeTownCustomDistributionWeightsCmd.
TownCustomDistributionWeightsCommandData.townEntity🔗
TownCustomDistributionWeightsCommandData.townEntity: Engine.Entity
Town entity id.
TownCustomDistributionWeightsCommandData.levelToCapacityDistributionWeights🔗
TownCustomDistributionWeightsCommandData.levelToCapacityDistributionWeights: {{number, number, number, number}, {number, number, number, number}, {number, number, number, number}}
Level-to-capacity distribution weights for each land use type.
TownDestroyCommandData🔗
Command data for cmd.makeTownDestroyCmd.
TownDestroyCommandData.townEntity🔗
TownDestroyCommandData.townEntity: Engine.Entity
Town entity id.
TownDevelopAtCommandData🔗
global record TownDevelopAtCommandData
position: Vec2f developStreets: boolean upgradeBuildings: boolean end
Command data for cmd.makeTownDevelopAtCmd.
TownDevelopAtCommandData.position🔗
TownDevelopAtCommandData.position: Vec2f
World position where development should be triggered.
TownDevelopAtCommandData.developStreets🔗
TownDevelopAtCommandData.developStreets: boolean
Whether to develop streets.
TownDevelopAtCommandData.upgradeBuildings🔗
TownDevelopAtCommandData.upgradeBuildings: boolean
Whether to upgrade buildings.
TownSetDevelopmentActiveCommandData🔗
global record TownSetDevelopmentActiveCommandData
townEntity: Engine.Entity developmentActive: boolean end
Command data for cmd.makeTownSetDevelopmentActiveCmd.
TownSetDevelopmentActiveCommandData.townEntity🔗
TownSetDevelopmentActiveCommandData.townEntity: Engine.Entity
Town entity id.
TownSetDevelopmentActiveCommandData.developmentActive🔗
TownSetDevelopmentActiveCommandData.developmentActive: boolean
Whether development should be set to active or inactive.
TownSetInitialLandUseCapacitiesCommandData🔗
global record TownSetInitialLandUseCapacitiesCommandData
townEntity: Engine.Entity initialLandUseCapacities: {integer} end
Command data for cmd.makeTownSetInitialLandUseCapacitiesCmd.
TownSetInitialLandUseCapacitiesCommandData.townEntity🔗
TownSetInitialLandUseCapacitiesCommandData.townEntity: Engine.Entity
Town entity id.
TownSetInitialLandUseCapacitiesCommandData.initialLandUseCapacities🔗
TownSetInitialLandUseCapacitiesCommandData.initialLandUseCapacities: {integer}
Initial capacities for the three land use types (residential, commercial and industrial).
TownUpdateCargoNeedsCommandData🔗
global record TownUpdateCargoNeedsCommandData
townEntity: Engine.Entity cargoNeeds: {{CargoTypeId}} updateTownBuildings: boolean end
Command data for cmd.makeTownUpdateCargoNeedsCmd.
TownUpdateCargoNeedsCommandData.townEntity🔗
TownUpdateCargoNeedsCommandData.townEntity: Engine.Entity
Town entity id.
TownUpdateCargoNeedsCommandData.cargoNeeds🔗
TownUpdateCargoNeedsCommandData.cargoNeeds: {{CargoTypeId}}
Cargo needs per district (residential/commercial/industrial).
TownUpdateCargoNeedsCommandData.updateTownBuildings🔗
TownUpdateCargoNeedsCommandData.updateTownBuildings: boolean
Whether to update all buildings to their target capacity.
TownUpdateSizeCommandData🔗
global record TownUpdateSizeCommandData
townEntity: Engine.Entity landUseSizeFactors: {number} updateAllBuildings: boolean end
Command data for cmd.makeTownUpdateSizeCmd.
TownUpdateSizeCommandData.townEntity🔗
TownUpdateSizeCommandData.townEntity: Engine.Entity
Town entity id.
TownUpdateSizeCommandData.landUseSizeFactors🔗
TownUpdateSizeCommandData.landUseSizeFactors: {number}
Size factors for residential/commercial/industrial.
TownUpdateSizeCommandData.updateAllBuildings🔗
TownUpdateSizeCommandData.updateAllBuildings: boolean
Whether to update all buildings to their target capacity.
VehicleBuyCommandData🔗
Command data for cmd.makeVehicleBuyCmd.
VehicleBuyCommandData.playerEntity🔗
VehicleBuyCommandData.playerEntity: Engine.Entity
Player entity id.
VehicleBuyCommandData.depotEntity🔗
VehicleBuyCommandData.depotEntity: Engine.Entity
Depot entity id.
VehicleBuyCommandData.config🔗
VehicleBuyCommandData.config: TransportVehicleConfig
config data containing information about the vehicle being purchased.
VehicleBuyCommandData.resultVehicleEntity🔗
VehicleBuyCommandData.resultVehicleEntity: Engine.Entity
the entity id of the new vehicle, used only as output when the command is successful.
VehicleReplaceCommandData🔗
global record VehicleReplaceCommandData
vehicleEntity: Engine.Entity config: TransportVehicleConfig applyPurchaseCost: boolean end
Command data for cmd.makeVehicleReplaceCmd.
VehicleReplaceCommandData.vehicleEntity🔗
VehicleReplaceCommandData.vehicleEntity: Engine.Entity
Vehicle entity id.
VehicleReplaceCommandData.config🔗
VehicleReplaceCommandData.config: TransportVehicleConfig
Bew ransport vehicle configuration.
VehicleReplaceCommandData.applyPurchaseCost🔗
VehicleReplaceCommandData.applyPurchaseCost: boolean
Whether to apply the purchase cost of the new vehicle.
VehicleReverseCommandData🔗
Command data for cmd.makeVehicleReverseCmd.
VehicleReverseCommandData.vehicleEntity🔗
VehicleReverseCommandData.vehicleEntity: Engine.Entity
Vehicle entity id of the vehicle that should be reversed
VehicleSellCommandData🔗
Command data for cmd.makeVehicleSellCmd.
VehicleSellCommandData.vehicleEntities🔗
VehicleSellCommandData.vehicleEntities: {Engine.Entity}
Vehicle entity ids.
VehicleSendToDepotCommandData🔗
global record VehicleSendToDepotCommandData
vehicleEntity: Engine.Entity sellOnArrival: boolean jumpToDepotEntity: Engine.Entity end
Command data for cmd.makeVehicleSendToDepotCmd.
VehicleSendToDepotCommandData.vehicleEntity🔗
VehicleSendToDepotCommandData.vehicleEntity: Engine.Entity
Vehicle entity id.
VehicleSendToDepotCommandData.sellOnArrival🔗
VehicleSendToDepotCommandData.sellOnArrival: boolean
if set to true, the vehicle will be sold upon arrival at the depot
VehicleSendToDepotCommandData.jumpToDepotEntity🔗
VehicleSendToDepotCommandData.jumpToDepotEntity: Engine.Entity
VehicleSetLineCommandData🔗
global record VehicleSetLineCommandData
vehicleEntity: Engine.Entity lineEntity: Engine.Entity stopIndex: integer end
Command data for cmd.makeVehicleSetLineCmd.
VehicleSetLineCommandData.vehicleEntity🔗
VehicleSetLineCommandData.vehicleEntity: Engine.Entity
Vehicle entity id.
VehicleSetLineCommandData.lineEntity🔗
VehicleSetLineCommandData.lineEntity: Engine.Entity
id of the line on which the vehicle should be sent
VehicleSetLineCommandData.stopIndex🔗
VehicleSetLineCommandData.stopIndex: integer
the position of the stop on the line to which the vehicle should be sent
VehicleSetManualDepartureCommandData🔗
Command data for cmd.makeVehicleSetManualDepartureCmd.
VehicleSetManualDepartureCommandData.entity🔗
VehicleSetManualDepartureCommandData.entity: Engine.Entity
Id of the vehicle entity of which the departure mode should change
VehicleSetManualDepartureCommandData.manual🔗
VehicleSetManualDepartureCommandData.manual: boolean
manual whether the entity should wait at the terminal or not
VehicleSetModifiersCommandData🔗
Command data for cmd.makeVehicleSetModifiersCmd.
VehicleSetModifiersCommandData.entity🔗
VehicleSetModifiersCommandData.entity: Engine.Entity
Id of the vehicle entity of which the departure mode should change
VehicleSetModifiersCommandData.modifiers🔗
VehicleSetModifiersCommandData.modifiers: Engine.Component.TransportVehicle.Modifiers
a struct containing all modifiers applied to the vehicle
VehicleSetStoppedByUserCommandData🔗
global record VehicleSetStoppedByUserCommandData
vehicleEntity: Engine.Entity userStopped: boolean end
Command data for cmd.makeVehicleSetStoppedByUserCmd.
VehicleSetStoppedByUserCommandData.vehicleEntity🔗
VehicleSetStoppedByUserCommandData.vehicleEntity: Engine.Entity
id of the vehicle that should be stopped or started
VehicleSetStoppedByUserCommandData.userStopped🔗
VehicleSetStoppedByUserCommandData.userStopped: boolean
true if the vehicle should be stopped
VehicleTryToDepartCommandData🔗
Command data for cmd.makeVehicleTryToDepartCmd.
VehicleTryToDepartCommandData.vehicleEntity🔗
VehicleTryToDepartCommandData.vehicleEntity: Engine.Entity
id of the vehicle that should be stopped or started
WorldBuildProposalCommandData🔗
global record WorldBuildProposalCommandData
proposal: Proposal context: Context withCostRep: boolean ignoreErrors: boolean resultProposalData: ProposalData resultEntities: {{Engine.Entity, Engine.Revision}} doDust: boolean end
Command data for cmd.makeWorldBuildProposalCmd.
WorldBuildProposalCommandData.proposal🔗
WorldBuildProposalCommandData.proposal: Proposal
The definition of the proposal
WorldBuildProposalCommandData.context🔗
WorldBuildProposalCommandData.context: Context
A context with extra options for the build
WorldBuildProposalCommandData.withCostRep🔗
WorldBuildProposalCommandData.withCostRep: boolean
tells to ingore costs if set to true
WorldBuildProposalCommandData.ignoreErrors🔗
WorldBuildProposalCommandData.ignoreErrors: boolean
tells to ingore costs if set to true
WorldBuildProposalCommandData.resultProposalData🔗
WorldBuildProposalCommandData.resultProposalData: ProposalData
The resulting data generated by the proposal
WorldBuildProposalCommandData.resultEntities🔗
WorldBuildProposalCommandData.resultEntities: {{Engine.Entity, Engine.Revision}}
only relevant when obtained in callback result, after command has been ran
WorldBuildProposalCommandData.doDust🔗
WorldBuildProposalCommandData.doDust: boolean
whether dust effect should be created
WorldChangeWindCommandData🔗
Command data for cmd.makeWorldChangeWindCmd.
WorldChangeWindCommandData.emissionGridEntity🔗
WorldChangeWindCommandData.emissionGridEntity: Engine.Entity
id of the emission grid affected (noise or pollution)
WorldChangeWindCommandData.wind🔗
WorldChangeWindCommandData.wind: Vec2f
the new wind velocity to set
WorldReplaceTerrainCommandData🔗
global record WorldReplaceTerrainCommandData
map: GameMap terrainConfig: BaseConfig.Terrain seedText: string worldEntity: Engine.Entity keepAssets: boolean end
Command data for cmd.makeWorldReplaceTerrainCmd.
WorldReplaceTerrainCommandData.map🔗
WorldReplaceTerrainCommandData.map: GameMap
WorldReplaceTerrainCommandData.terrainConfig🔗
WorldReplaceTerrainCommandData.terrainConfig: BaseConfig.Terrain
WorldReplaceTerrainCommandData.seedText🔗
WorldReplaceTerrainCommandData.seedText: string
a seed for randomization purposes
WorldReplaceTerrainCommandData.worldEntity🔗
WorldReplaceTerrainCommandData.worldEntity: Engine.Entity
id of the world, usually 0
WorldReplaceTerrainCommandData.keepAssets🔗
WorldReplaceTerrainCommandData.keepAssets: boolean
if set to true, existing landscape assets are conserved
WorldSetBulldozableCommandData🔗
Command data for cmd.makeWorldSetBulldozableCmd.
WorldSetBulldozableCommandData.entity🔗
WorldSetBulldozableCommandData.entity: Engine.Entity
Id of the entity
WorldSetBulldozableCommandData.value🔗
WorldSetBulldozableCommandData.value: boolean
true if entity is bulldozable