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