From 0213e22d6634a6143dce1383ca4642c478e59076 Mon Sep 17 00:00:00 2001 From: ArthurErlich Date: Sun, 4 Oct 2026 22:01:16 +0200 Subject: [PATCH] docs(research): TpF3 mod tooling and structure, offline wiki/script-doc copies Co-Authored-By: Claude Sonnet 5.5 --- .../_metadata/modinfo.json | 15 + .../content/mod.script.tl | 9 + .../ug_tf3_example_config_change/mod.json | 10 + docs/reference/script-doc/api.md | 89 + docs/reference/script-doc/api_cmd.md | 3456 ++ docs/reference/script-doc/api_engine.md | 10532 ++++++ .../reference/script-doc/api_engine_system.md | 3075 ++ docs/reference/script-doc/api_engine_util.md | 4382 +++ docs/reference/script-doc/api_gui.md | 4654 +++ docs/reference/script-doc/api_res.md | 723 + docs/reference/script-doc/api_type.md | 29355 ++++++++++++++++ docs/reference/script-doc/api_type_mod.md | 479 + docs/reference/script-doc/api_type_modhub.md | 3767 ++ docs/reference/script-doc/app.md | 788 + .../content_base_difficulty_util.md | 123 + .../content_base_model_metadata_util.md | 427 + .../script-doc/content_base_post_run_util.md | 41 + .../content_gui_main_mod_entry_point.md | 27 + .../content_gui_main_script_param_util.md | 505 + .../wiki/modding_general_bestpractice.md | 172 + .../wiki/modding_general_guidelines.md | 212 + .../wiki/modding_general_moddefinition.md | 214 + .../wiki/modding_general_modscripts.md | 276 + .../reference/wiki/modding_general_modtags.md | 90 + .../wiki/modding_general_publishing.md | 108 + .../wiki/modding_general_resourcetypes.md | 284 + docs/reference/wiki/modding_general_syntax.md | 254 + docs/reference/wiki/modding_introduction.md | 76 + docs/reference/wiki/modding_scripting_api.md | 9 + .../wiki/modding_scripting_baseconfig.md | 192 + .../wiki/modding_scripting_missions.md | 344 + .../modding_scripting_modifiersfilters.md | 156 + docs/reference/wiki/modding_start.md | 98 + docs/reference/wiki/modding_tools_external.md | 127 + docs/reference/wiki/modding_tools_ingame.md | 189 + .../wiki/modding_tools_modeleditor.md | 670 + docs/reference/wiki/modding_tools_start.md | 85 + .../modding_tools_terraingeneratoreditor.md | 73 + docs/research/mod-tooling.md | 49 + 39 files changed, 66135 insertions(+) create mode 100644 .examples/ug_tf3_example_config_change/_metadata/modinfo.json create mode 100644 .examples/ug_tf3_example_config_change/content/mod.script.tl create mode 100644 .examples/ug_tf3_example_config_change/mod.json create mode 100644 docs/reference/script-doc/api.md create mode 100644 docs/reference/script-doc/api_cmd.md create mode 100644 docs/reference/script-doc/api_engine.md create mode 100644 docs/reference/script-doc/api_engine_system.md create mode 100644 docs/reference/script-doc/api_engine_util.md create mode 100644 docs/reference/script-doc/api_gui.md create mode 100644 docs/reference/script-doc/api_res.md create mode 100644 docs/reference/script-doc/api_type.md create mode 100644 docs/reference/script-doc/api_type_mod.md create mode 100644 docs/reference/script-doc/api_type_modhub.md create mode 100644 docs/reference/script-doc/app.md create mode 100644 docs/reference/script-doc/content_base_difficulty_util.md create mode 100644 docs/reference/script-doc/content_base_model_metadata_util.md create mode 100644 docs/reference/script-doc/content_base_post_run_util.md create mode 100644 docs/reference/script-doc/content_gui_main_mod_entry_point.md create mode 100644 docs/reference/script-doc/content_gui_main_script_param_util.md create mode 100644 docs/reference/wiki/modding_general_bestpractice.md create mode 100644 docs/reference/wiki/modding_general_guidelines.md create mode 100644 docs/reference/wiki/modding_general_moddefinition.md create mode 100644 docs/reference/wiki/modding_general_modscripts.md create mode 100644 docs/reference/wiki/modding_general_modtags.md create mode 100644 docs/reference/wiki/modding_general_publishing.md create mode 100644 docs/reference/wiki/modding_general_resourcetypes.md create mode 100644 docs/reference/wiki/modding_general_syntax.md create mode 100644 docs/reference/wiki/modding_introduction.md create mode 100644 docs/reference/wiki/modding_scripting_api.md create mode 100644 docs/reference/wiki/modding_scripting_baseconfig.md create mode 100644 docs/reference/wiki/modding_scripting_missions.md create mode 100644 docs/reference/wiki/modding_scripting_modifiersfilters.md create mode 100644 docs/reference/wiki/modding_start.md create mode 100644 docs/reference/wiki/modding_tools_external.md create mode 100644 docs/reference/wiki/modding_tools_ingame.md create mode 100644 docs/reference/wiki/modding_tools_modeleditor.md create mode 100644 docs/reference/wiki/modding_tools_start.md create mode 100644 docs/reference/wiki/modding_tools_terraingeneratoreditor.md create mode 100644 docs/research/mod-tooling.md diff --git a/.examples/ug_tf3_example_config_change/_metadata/modinfo.json b/.examples/ug_tf3_example_config_change/_metadata/modinfo.json new file mode 100644 index 0000000..03b3b5c --- /dev/null +++ b/.examples/ug_tf3_example_config_change/_metadata/modinfo.json @@ -0,0 +1,15 @@ +{ + "authors": [ + { + "name": "Urban Games", + "role": "CREATOR" + } + ], + "description": "Simple config change mod", + "summary": "Example config change", + "name": "Example Base Config Change", + "tags": [ + "script" + ], + "url": "" +} diff --git a/.examples/ug_tf3_example_config_change/content/mod.script.tl b/.examples/ug_tf3_example_config_change/content/mod.script.tl new file mode 100644 index 0000000..f689972 --- /dev/null +++ b/.examples/ug_tf3_example_config_change/content/mod.script.tl @@ -0,0 +1,9 @@ +local mod = {} + +mod.preRunFn = function(_configDict : {{string, string}}, _allModParams : {string : {string : integer}}, baseConfig : BaseConfig) + + baseConfig.trainAccelerationFactor = 0.5 + +end + +return mod diff --git a/.examples/ug_tf3_example_config_change/mod.json b/.examples/ug_tf3_example_config_change/mod.json new file mode 100644 index 0000000..8fbe246 --- /dev/null +++ b/.examples/ug_tf3_example_config_change/mod.json @@ -0,0 +1,10 @@ +{ + "modId": "ug_tf3_config_change", + "revision": 1, + "severityAdd": "None", + "severityRemove": "Warning", + "cosmetic": false, + "preRunScript": { + "fileName": "ug_tf3_config_change::mod.script@preRunFn" + } +} diff --git a/docs/reference/script-doc/api.md b/docs/reference/script-doc/api.md new file mode 100644 index 0000000..aa7a12c --- /dev/null +++ b/docs/reference/script-doc/api.md @@ -0,0 +1,89 @@ + + +[index](index.html) / api + +--- + +# Module api[πŸ”—](#api) + +``` +global record api res: Res + gui: Gui + engine: Engine + type: Type + util: ApiUtil + cmd: Cmd + modhub: ModhubApi +end +global app: App +global loaderHelper: LoaderHelper +``` + +## Category: globals[πŸ”—](#category-globals) + +### api[πŸ”—](#$api~api) + +``` +global record api res: Res + gui: Gui + engine: Engine + type: Type + util: ApiUtil + cmd: Cmd + modhub: ModhubApi +end +``` + +### api.res[πŸ”—](#$api~api.res) + +``` +api.res: Res +``` + +### api.gui[πŸ”—](#$api~api.gui) + +``` +api.gui: Gui +``` + +### api.engine[πŸ”—](#$api~api.engine) + +``` +api.engine: Engine +``` + +### api.type[πŸ”—](#$api~api.type) + +``` +api.type: Type +``` + +### api.util[πŸ”—](#$api~api.util) + +``` +api.util: ApiUtil +``` + +### api.cmd[πŸ”—](#$api~api.cmd) + +``` +api.cmd: Cmd +``` + +### api.modhub[πŸ”—](#$api~api.modhub) + +``` +api.modhub: ModhubApi +``` + +### app[πŸ”—](#$api~app) + +``` +global app: App +``` + +### loaderHelper[πŸ”—](#$api~loaderHelper) + +``` +global loaderHelper: LoaderHelper +``` diff --git a/docs/reference/script-doc/api_cmd.md b/docs/reference/script-doc/api_cmd.md new file mode 100644 index 0000000..96a03b3 --- /dev/null +++ b/docs/reference/script-doc/api_cmd.md @@ -0,0 +1,3456 @@ + + +[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 diff --git a/docs/reference/script-doc/api_engine.md b/docs/reference/script-doc/api_engine.md new file mode 100644 index 0000000..f68fc40 --- /dev/null +++ b/docs/reference/script-doc/api_engine.md @@ -0,0 +1,10532 @@ + + +[index](../index.html) / [api](../api.html) / engine + +--- + +# Module api.engine[πŸ”—](#api.engine) + +Contains API for reading the game engine state. +This module is available as read-only access to the entire engine state (in particular to the entire entity component system). It can be accessed from both the GUI State and the Engine State. + +``` +[Expand All] [Collapse All] + +global record Engine type Entity = integer + record Revision num: {integer, integer, integer} +end + record Component record Account new: function(): Account + balance: integer + loan: integer +end + record Aircraft new: function(): Aircraft + reservedTakeOffRunway: boolean + reservedLandingRunway: boolean + pathIndex: integer + reservedFrom: integer + reservedTo: integer +end + record Animal new: function(): Animal + worldPosition: Vec3f + lookingAt: Vec2f + targetCoord: Vec2f + movementSpeed: number + angularSpeed: number + lastUpdateElapsed: number + targetChangedElapsed: number + invalidTileElapsed: number + movementType: integer + roll: number + scaling: number + flock: {Vec3f} +end + record AssetGroup new: function(): AssetGroup +end + record AssetGroupAutoRemove new: function(): AssetGroupAutoRemove +end + record AudioEmitter new: function(): AudioEmitter + emitter: integer +end + record BaseEdge new: function(): BaseEdge + clone: function(BaseEdge): BaseEdge + type: BaseEdgeType + typeIndex: integer + objects: {{Engine.Entity, EdgeObjectType}} + laneConfigs: {LaneConfig} + laneConfigs_native: Vector + roadDevelopmentLocked: boolean + node0: Engine.Entity + node1: Engine.Entity + position0: Vec3f + position1: Vec3f + tangent0: Vec3f + tangent1: Vec3f + laneConfig: {LaneConfig} + edgeDecorations: {{integer, boolean}} + distance: number + roadType: RoadType + roadTemplate: ResName + roadStyle: ResName +end + record BaseEdgeStreet new: function(): BaseEdgeStreet + precedenceNode0: PrecedencePreference + precedenceNode1: PrecedencePreference +end + record BaseNode new: function(): BaseNode + clone: function(BaseNode): BaseNode + position: Vec3f +end + record TrafficLightState new: function(): TrafficLightState + clone: function(TrafficLightState): TrafficLightState + lockedLanes: {integer} + duration: number + minDuration: number + canSkip: boolean +end + record TrafficLightConfig new: function(): TrafficLightConfig + clone: function(TrafficLightConfig): TrafficLightConfig + states: {TrafficLightState} + trafficLightType: integer +end + record BaseNodeConfig new: function(): BaseNodeConfig + laneConnections: {LaneConnection} + crosswalks: {Entity} + trafficLightPreference: TrafficLightPreference + trafficLightConfig: TrafficLightConfig + doubleSlipSwitch: boolean + userModifiedLaneConnections: boolean + userModifiedTrafficLightStates: boolean +end + record BaseNodeTrafficLight new: function(): BaseNodeTrafficLight + trafficLightData: TrafficLightData + state: integer + time: number + stateTimes: {integer} +end + record BaseParallelStrip new: function(): BaseParallelStrip + record BaseEdgeRange new: function(): BaseEdgeRange + edge: Engine.Entity + bounds: {number, number} +end + rangeGroups: {{BaseEdgeRange}} + rangeGroups_native: Vector> +end + record BoundingVolume new: function(): BoundingVolume + bbox: Box3f +end + record Bridge new: function(): Bridge + record Interval new: function(): Interval + splines: {{Vec3f}} + railingModels: {{integer, Mat4f}} +end + intervals: {Interval} +end + record BuildCost new: function(): BuildCost + buildCost: integer + bulldozeCost: integer + noCostAtAll: boolean +end + record BulldozerInfo new: function(): BulldozerInfo + locked: boolean +end + record Carriage new: function(): Carriage + reversed: boolean +end + record CarriageList new: function(): CarriageList + carriages: {Engine.Entity} +end + record ColliderList new: function(): ColliderList + colliders: {{Collider, Mat4f}} +end + record Color new: function(): Color + color: Vec3f +end + record Construction new: function(): Construction + record ConstructionParams new: function(): ConstructionParams + seed: integer + modules: {integer : } +end + fileName: ResName + params: ConstructionParams + params_native: NativeLuaTable + transf: Mat4f + timeBuilt: integer + frozenNodes: {Engine.Entity} + frozenEdges: {Engine.Entity} + depots: {Engine.Entity} + stations: {Engine.Entity} + industries: {Engine.Entity} + townBuildings: {Engine.Entity} + subconstructions: {Engine.Entity} + persistentMetadata: ConstructionInstanceMetadata + slots: {Slot} + slotConfig: {string : SlotConfig} + dependentSlots: {integer, {integer}} + tag2modelInstance: {string, {{Engine.Entity, integer}}} + entityAndIndex2labelTexts: {{Engine.Entity, integer}, {string}} + tag2segments: {string, {Engine.Entity}} +end + record CustomState new: function(): CustomState + state: { : } +end + record EmissionEmitter new: function(): EmissionEmitter + position: Vec3f + radius: number + noisePower: number + pollutionPower: number +end + record EmissionGrid new: function(): EmissionGrid + record Type Noise: Type + Pollution: Type +end + X0: integer + Y0: integer + width: integer + height: integer + gridPointSize: Vec2f + concentrationBuffer: Gridf + averageConcentration: Gridf + type: Type + wind: Vec2f +end + record Field new: function(): Field +end + record GameScript new: function(): GameScript + gameScript: ResName + addedToExistingSavegame: boolean + state: T + state_native: NativeLuaTable + eventSubscriptions: any +end + record GameSpeed new: function(): GameSpeed + speedup: integer + millisPerDay: integer +end + record GameTime new: function(): GameTime + gameTime: integer + gameTime0: integer + dates: {{integer, Date}} + timeOfDaySec: integer + tickCount: integer + updateCount: integer +end + record Industry new: function(): Industry + stockList: Engine.Entity + level: integer + closureTimeStamp: integer + upgradeProgress: number + manualDevelopment: boolean + construction: Engine.Entity + maxLevel: integer +end + record Landmark new: function(): Landmark + transportNetworkEntity: Engine.Entity + active: boolean +end + record LandVehicle new: function(): LandVehicle + record DynState new: function(): DynState + brakingTimer: number + turnLeft: boolean + turnRight: boolean +end + isTram: boolean + dyn: DynState +end + record Line new: function(): Line + + record LoadMode LOAD_IF_AVAILABLE: LoadMode + FULL_LOAD_ANY: LoadMode + FULL_LOAD_ALL: LoadMode + LEGACY_UNLOAD_ONLY: LoadMode +end + record StopConfig new: function(StopConfig): StopConfig + load: {boolean} + maxLoad: {number} + forceUnload: boolean + destroyForConfigChange: boolean + destroyForRefresh: boolean +end + record Stop new: function(): Stop + stationGroup: Engine.Entity + station: integer + terminal: integer + alternativeTerminals: {StationTerminal} + loadMode: LoadMode + minWaitingTime: number + maxWaitingTime: number + maxAdditionalWaitingTime: number + waypoints: {Waypoint} + stopConfig: StopConfig +end + stops: {Stop} + vehicleInfo: LineVehicleInfo + customFilters: boolean + reservationPriority: number +end + record LogBook new: function(): LogBook + record Log new: function(): Log + times: {integer} + values: {integer} + times_native: Vector + values_native: Vector +end + refEntity2name2log: {Engine.Entity : {string : Log}} + name2log: {string : Log} + name2log_native: Map +end + record LotList new: function(): LotList + record Lot new: function(): Lot + vertices: {Vec2f} + texCoords: {Vec2f} + triangles: {integer} + texKey: ResName + solid: boolean +end + lots: {Lot} +end + record MaintenanceCost new: function(): MaintenanceCost + maintenanceCost: integer + accumulatedCost: {{Carrier, Carrier} : integer} +end + record ModelInstanceList new: function(): ModelInstanceList + fatInstances: {ModelInstance} + thinInstances: {ThinModelInstance} + fatInstances_native: Vector + thinInstances_native: Vector + dynamic: boolean +end + record ModelPerson new: function(): ModelPerson + path: ExtPath + pathPos: PathPos + stopped: boolean + topSpeed: number + speed: number + brakeDecel: number + offset: number + position: Vec3f + movementType: integer + dist: number + dist0: number + stateTime: integer + startWaitTime: number + endWaitTime: number +end + record ModelPersonIdle new: function(): ModelPersonIdle + arrivalTime: integer +end + record MovePath new: function(): MovePath + record DynState new: function(): DynState + pathPos: PathPos + speed: number + brakeDecel: number + accel: number + timeUntilAccel: number + timeStanding: number + timeToIgnore: number + approachingStation: boolean +end + path: Path + endParam: number + endPos: number + state: VehicleState + blocked: integer + allowEarlyArrival: boolean + reverse: boolean + servedFrom: integer + servedTo: integer + occupiedBackIndex: integer + occupiedFrontIndex: integer + dyn: DynState + dyn0: DynState +end + record MovePathAircraft new: function(): MovePathAircraft + record AircraftState new: function(): AircraftState + record DynState new: function(): DynState + velocity: Vec2f + lastAccel: Vec2f + pitch: number + pitchV: number + roll: number + rollV: number + thrust: number + thrustV: number + elevator: number + aileronLeft: number + propPhase: number + flaps: number + alt: number +end + flightState: FlightState + cruiseAlt: number + waitingDistance: number + waitingPriority: integer + gear: boolean + gearTime: integer + dyn: DynState + dyn0: DynState +end + record ShipState new: function(): ShipState + record DynState new: function(): DynState + lastAccel: number + tractiveEffort: number + tractiveEffortV: number + roll: number + rollV: number + powerOutput: number + approachingStation: boolean + paddlePhase: number + actualPos: PathPosData +end + waitingDist: number + clearToLand: boolean + startPathPosData: PathPosData + targetPathPosData: PathPosData + dyn: DynState + dyn0: DynState +end + record PathState PATH0: PathState + PATH1: PathState + PATH2: PathState +end + path0: Path + path1: {{EdgeGeometry, boolean}} + path2: Path + pathPos: PathPos + pathPos0: PathPos + state: VehicleState + pathState: PathState + speed: number + speed0: number + brakeDecel: number + aircraftState: AircraftState + shipState: ShipState +end + record Name new: function(): Name + name: string +end + record Parcel new: function(): Parcel + record CollisionType Environment: CollisionType + Parcel: CollisionType +end + record Face new: function(): Face + points: {Vec3f} + collision: {CollisionType : boolean} +end + streetSegment: Engine.Entity + left: boolean + curveParam: number + offset: number + faces: {Face} +end + record PersonCapacity new: function(): PersonCapacity + type: LandUseType + capacity: integer + personNodes: {NodeId} + vehicleNodes: {NodeId} +end + record Player new: function(): Player + headquarters: Engine.Entity +end + record PlayerOwned new: function(): PlayerOwned + player: Engine.Entity +end + record RailroadCrossing new: function(): RailroadCrossing + record State OPEN: State + CLOSED: State + WAITING: State +end + nodes: {Engine.Entity} + edges: {Engine.Entity} + typeIndex: integer + state: State + stateTime: integer +end + record RunwayList new: function(): RunwayList + runways: {Runway} +end + record Scaffold new: function(): Scaffold + record Type NEW: Type + UPGRADE: Type + DOWNGRADE: Type +end + type: Type + oldModelId: integer + oldTransf: Mat4f + oldBuildingFace: {{Vec2f}} + oldFloorLevel: {{number}} + oldHeight: number + buildingFace: {{Vec2f}} + floorLevel: {{number}} + height: number + constructionStartTime: integer + constructionEndTime: integer + cranePosition: Vec2f + craneAngle: number + craneTerrainHeight: number + craneAngleSpan: {number} +end + record ShapeList new: function(): ShapeList + shapes: {Shape} +end + record Ship new: function(): Ship + pathIndex: integer + reservedFrom: integer + reservedTo: integer +end + record SignalList new: function(): SignalList + signals: {Signal} +end + record SimCargo record PickupPoint new: function(): PickupPoint + vehicle: Engine.Entity + line: Engine.Entity + position: Vec3f + carrier: Carrier +end + new: function(): SimCargo + cargoType: CargoTypeId + targetOrPickupEntity: Engine.Entity + sourceEntity: Engine.Entity + pickupPoints: {PickupPoint} + speed: number + startTime: integer + pickupTime: integer + deliveryExtensionDuration: integer +end + record SimEntityAtBuilding new: function(): SimEntityAtBuilding + waitingTime: number +end + record SimEntityAtStock new: function(): SimEntityAtStock + stock: {Engine.Entity, StockId} + arrivalTime: integer +end + record SimEntityAtTerminal new: function(): SimEntityAtTerminal + line: Engine.Entity + lineStop0: integer + lineStop1: integer + arrivalTime: number + vehicle: Engine.Entity +end + record SimEntityAtVehicle new: function(): SimEntityAtVehicle + line: Engine.Entity + lineStop0: integer + lineStop1: integer + vehicle: Engine.Entity + roundTripCounter: integer +end + record SimEntityIdle new: function(): SimEntityIdle +end + record SimEntityNeedsPath new: function(): SimEntityNeedsPath + input: PathFactoryInput + output: PathFactoryOutput +end + record SimEntityMoving new: function(): SimEntityMoving + line: Engine.Entity + lineStop0: integer + lineStop1: integer + partialPath: boolean + expectedArrivalTime: number +end + record SimPersonAtTerminal new: function(): SimPersonAtTerminal + edgeId: EdgeId + place: integer +end + record SimPersonAtVehicle new: function(): SimPersonAtVehicle + vehicle: Engine.Entity + part: integer + place: integer + expectedArrivalTime: number +end + record SimPerson new: function(): SimPerson + cargoType: CargoTypeId + destinations: {Engine.Entity} + moveModes: {MoveMode} + travelTimes: {number} + targetOrAtEntity: Engine.Entity + lastNonResType: LandUseType + lastMoveMode: MoveMode + walkSpeed: number + modelIdPerson: integer + colorConfigPerson: integer + modelIdCar: integer + colorConfigCar: integer + lastDestinationUpdate: integer + landUse2ReachableWalkDrive: {integer, integer} + landUse2ReachableLines: {integer, integer} + pickupTime: integer + happiness: number +end + type Station = Station + record StationGroup new: function(): StationGroup + stations: {Engine.Entity} +end + record StockList record Stock new: function(): Stock + type: StockListType + cargoType: CargoTypeId + cargoTypes: CargoTypeSet + mixedTypes: boolean + capacity: integer + loadSpeedModifier: number + loadIndicatorModelInstanceIndices: {integer} + tag: integer +end + record StockData new: function(): StockData + consumeFrequency: number +end + record Rule new: function(): Rule + input: {{integer}} + output: {CargoTypeId : integer} + capacity: integer + consumptionFactor: number + booster: boolean + boostFactor: number + priority: integer + slot: integer +end + record RuleData new: function(): RuleData + record ApplyInfo new: function(): ApplyInfo + time: integer + interval: integer + consumedCargo: {StockId} + producedCargo: {{CargoTypeId, integer}} +end + applyHistory: {ApplyInfo} + lastApplyDecayFactor: number +end + record CargoData new: function(): CargoData + produceFrequency: integer +end + record Modifiers new: function(): Modifiers + + productivity: number +end + new: function(): StockList + stocks: {Stock} + rules: {Rule} + stockDatas: {StockData} + ruleDatas: {RuleData} + cargoData: {CargoTypeId : CargoData} + thrownAwayCargo: integer + modifiers: Modifiers +end + record Subconstruction new: function(): Subconstruction + tag: integer + slotIds: {integer} + metadata: SubconstructionInstanceMetadata +end + record Terrain new: function(): Terrain + size: Vec2i + baseLevels: integer + baseResolution: Vec3f + highLevels: integer + offsetZ: number + waterLevel: number + dataMaps: {string, HeightmapNew} +end + record TerrainAlignmentList new: function(): TerrainAlignmentList + terrainAlignments: {TerrainAlignment} +end + record TerrainTile new: function(): TerrainTile + terrainEntity: Engine.Entity + position: Vec2i +end + record TerrainTileBrush new: function(): TerrainTileBrush + materialIndexBrush: {integer} + forceAboveBit: {boolean} +end + record TerrainTileHeightmap new: function(): TerrainTileHeightmap + vertices: {integer} +end + record TickEpoch new: function(): TickEpoch + time: integer + commandIndex: integer + subIndex: integer +end + record Town new: function(): Town + initialLandUseCapacities: {integer} + capacityScalingFactor: number + levelToCapacityDistributionWeights: {{number}} + sizeFactors: {number} + cargoNeeds: {{{CargoTypeId, number}}} + developmentActive: boolean + noise: number + pollution: number +end + record TownBuilding new: function(): TownBuilding + personCapacity: Engine.Entity + stockList: Engine.Entity + construction: Engine.Entity + level: integer + parcels: {Engine.Entity} + depth: integer + height: number + town: Engine.Entity + timeBuilt: integer + blockedDevelopment: boolean +end + record TownConnection new: function(): TownConnection + entity0: Engine.Entity + entity1: Engine.Entity + position0: Vec2f + position1: Vec2f + time: number + currentTime: number + lastUpgradeYear: integer + valid: boolean +end + record TpNetLink new: function(): TpNetLink + from: EdgePos + to: EdgePos +end + record Train new: function(): Train +end + record TransportNetwork new: function(): TransportNetwork + nodes: {Node} + edges: {Edge} + turnaroundEdges: {integer} +end + record TransportNetworkNodes new: function(): TransportNetworkNodes +end + record TransportVehicle record Modifiers new: function(): Modifiers + + topSpeedScale: number + noiseScale: number + pollutionScale: number + comfortScale: number +end + record LoadSpeedModifiers vehicleOverlength: number + stockCompatibility: number + vehicleCompatibility: number + vehicleIncompatibility: number + getTotalPenalty: function(LoadSpeedModifiers): number +end + record Config new: function(): Config + transportModes: {TransportMode : boolean} + allCaps: {CargoTypeId} + capacities: {CargoTypeId} + loadSpeeds: {number} + reversible: boolean +end + record LoadState new: function(): LoadState + None: LoadState + Arrived: LoadState + Unloading: LoadState + Loading: LoadState + WaitForScheduledDeparture: LoadState + Departing: LoadState +end + record PendingIncomeParams new: function(): PendingIncomeParams + record EntityRev0 entity: Engine.Entity + rev0: integer +end + amount: integer + carrier: Carrier + vehicleEntity: Engine.Entity + lineEntity: Engine.Entity +end + new: function(): TransportVehicle + carrier: Carrier + transportVehicleConfig: TransportVehicleConfig + config: Config + state: TransportVehicleState + userStopped: boolean + depot: Engine.Entity + sellOnArrival: boolean + line: Engine.Entity + stopIndex: integer + arrivalStationTerminal: StationTerminal + arrivalStationTerminalLocked: boolean + lineStopDepartures: {integer} + lastLineStopDeparture: integer + sectionTimes: {number} + lineStop2cargo2available: {{CargoTypeId}} + loadState: LoadState + timeUntilNextScheduledDeparture: number + loadSpeedModifiers: {CargoTypeId : LoadSpeedModifiers} + timeUntilCloseDoors: number + timeUntilDeparture: number + timeUntilNextLoad: {CargoTypeId : number} + timeUntilNextUnload: {CargoTypeId : number} + lastStationStockIndex: integer + doorsTime: integer + daysInDepot: integer + daysAtTerminal: integer + doorsOpen: boolean + noPath: boolean + autoDeparture: boolean + maintenanceStation: Engine.Entity + modifiers: Modifiers + unloadPendingIncome: PendingIncomeParams + closestTown: Engine.Entity + visitedStops: {integer} +end + record VehicleDepot new: function(): VehicleDepot + carrier: Carrier + transportModes: {TransportMode : boolean} + inNodes: {NodeId} + outNodes: {NodeId} + state: integer + doors: number + stateTime: integer + catchmentArea: CatchmentArea + maintenancePool: integer + maxPoolUsage: number + averagePoolUsage: number + poolUsageTicks: integer + filterTags: {string} +end + record VehicleOrder new: function(): VehicleOrder + equals: function(VehicleOrder, VehicleOrder): boolean + entity: Engine.Entity + strongBrakeEntity: boolean + waitingForSpace: boolean + waitingForTrafficLight: boolean +end + record Warehouse new: function(): Warehouse + stockList: Engine.Entity + construction: Engine.Entity +end + record WaterMesh new: function(): WaterMesh + record Contour new: function(): Contour + vertices: {Vec2f} + normals: {Vec2f} +end + waterLevel: number + vertices: {Vec2f} + depths: {number} + indices: {integer} + contours: {Contour} + pos: Vec2i +end + record World new: function(): World + cloudCoverage: number +end +end + record ComponentType AIRCRAFT: ComponentType + ANIMAL: ComponentType + ASSET_GROUP: ComponentType + BASE_EDGE: ComponentType + BASE_EDGE_STREET: ComponentType + BASE_NODE: ComponentType + BASE_PARALLEL_STRIP: ComponentType + CUSTOM_STATE: ComponentType + EMISSION_EMITTER: ComponentType + FIELD: ComponentType + GAME_TIME: ComponentType + GAME_SPEED: ComponentType + MODEL_INSTANCE_LIST: ComponentType + NAME: ComponentType + LINE: ComponentType + LOG_BOOK: ComponentType + MODEL_PERSON: ComponentType + MOVE_PATH: ComponentType + MOVE_PATH_AIRCRAFT: ComponentType + STATION: ComponentType + STATION_GROUP: ComponentType + SIM_PERSON: ComponentType + SIM_PERSON_AT_TERMINAL: ComponentType + SIM_PERSON_AT_VEHICLE: ComponentType + SIM_CARGO: ComponentType + SIM_ENTITY_AT_BUILDING: ComponentType + SIM_ENTITY_AT_VEHICLE: ComponentType + SIM_ENTITY_AT_TERMINAL: ComponentType + SIM_ENTITY_IDLE: ComponentType + SIM_ENTITY_MOVING: ComponentType + SIGNAL_LIST: ComponentType + TOWN: ComponentType + INDUSTRY: ComponentType + STOCK_LIST: ComponentType + TOWN_BUILDING: ComponentType + TRANSPORT_VEHICLE: ComponentType + TRAIN: ComponentType + CARRIAGE: ComponentType + CARRIAGE_LIST: ComponentType + VEHICLE_DEPOT: ComponentType + COLOR: ComponentType + BOUNDING_VOLUME: ComponentType + CONSTRUCTION: ComponentType + SUBCONSTRUCTION: ComponentType + PERSON_CAPACITY: ComponentType + PLAYER_OWNED: ComponentType + ACCOUNT: ComponentType + GAME_SCRIPT: ComponentType + WAREHOUSE: ComponentType + TRANSPORT_NETWORK: ComponentType + MAINTENANCE_COST: ComponentType + RAILROAD_CROSSING: ComponentType + PLAYER: ComponentType + WORLD: ComponentType + BRIDGE: ComponentType + BASE_NODE_CONFIG: ComponentType + LAND_VEHICLE: ComponentType + BASE_NODE_TRAFFIC_LIGHT: ComponentType + EDGE_OBJECT: ComponentType + EMISSION_GRID: ComponentType + TERRAIN: ComponentType +end + getComponent: function(entity : Entity, type : ComponentType): T + record EntityFilters requireOwnedByPlayer: Engine.Entity + filterFn: function(Engine.Entity): boolean +end + forEachEntityWithComponent: function(fn : function(Entity), componentType : ComponentType) + forEachEntity: function(callback : function(Entity)) + getEntitiesWithComponent: function(componentType : ComponentType, filters : EntityFilters): {Engine.Entity} + getRevision: function(entity : Entity): Revision + entityExists: function(entity : Entity): boolean + record UtilTerrain isValidCoordinate: function(position : Vec2f): boolean + getHeightAt: function(position : Vec2f): number + getBaseHeightAt: function(position : Vec2f): number + isOnWater: function(position : Vec2f): boolean + getHeightmapEntity: function(position : Vec2i): Engine.Entity + getBoundingBox: function(): Box2f + makeMapFromGame: function(withHeightmap : boolean, withTowns : boolean, withIndustries : boolean, withAssets : boolean): GameMap + getTerrainEntityRevisions: function(): {Engine.Entity : Engine.Revision} + getBaseResolution: function(): Vec3f + getHighResolution: function(): Vec3f + ceilTerrainFragmentInTiles: function(percentage : number): integer +end + record MapGen createTowns: function(string, {GameMap.Town}): TownResult + createIndustries: function(string, {GameMap.Industry}): IndustryResult + getDefaultTownConnections: function({GameMap.Town}): {{integer, integer}} + getMinMaxValidTerrainHeight: function(): {number, number} + getMinMaxValidNumTowns: function(): {integer, integer} + getMinMaxValidNumIndustries: function(): {integer, integer} +end + record Config getConfigDict: function(): {string : string} + getModParams: function(): {string : { : }} +end + system: System + terrain: UtilTerrain + mapgen: MapGen + util: EngineUtil + config: Config +end +``` + +## Category: main[πŸ”—](#category-main) + +### Engine[πŸ”—](#$api.engine~Engine) + +``` +[Expand All] [Collapse All] + +global record Engine type Entity = integer + record Revision num: {integer, integer, integer} +end + record Component record Account new: function(): Account + balance: integer + loan: integer +end + record Aircraft new: function(): Aircraft + reservedTakeOffRunway: boolean + reservedLandingRunway: boolean + pathIndex: integer + reservedFrom: integer + reservedTo: integer +end + record Animal new: function(): Animal + worldPosition: Vec3f + lookingAt: Vec2f + targetCoord: Vec2f + movementSpeed: number + angularSpeed: number + lastUpdateElapsed: number + targetChangedElapsed: number + invalidTileElapsed: number + movementType: integer + roll: number + scaling: number + flock: {Vec3f} +end + record AssetGroup new: function(): AssetGroup +end + record AssetGroupAutoRemove new: function(): AssetGroupAutoRemove +end + record AudioEmitter new: function(): AudioEmitter + emitter: integer +end + record BaseEdge new: function(): BaseEdge + clone: function(BaseEdge): BaseEdge + type: BaseEdgeType + typeIndex: integer + objects: {{Engine.Entity, EdgeObjectType}} + laneConfigs: {LaneConfig} + laneConfigs_native: Vector + roadDevelopmentLocked: boolean + node0: Engine.Entity + node1: Engine.Entity + position0: Vec3f + position1: Vec3f + tangent0: Vec3f + tangent1: Vec3f + laneConfig: {LaneConfig} + edgeDecorations: {{integer, boolean}} + distance: number + roadType: RoadType + roadTemplate: ResName + roadStyle: ResName +end + record BaseEdgeStreet new: function(): BaseEdgeStreet + precedenceNode0: PrecedencePreference + precedenceNode1: PrecedencePreference +end + record BaseNode new: function(): BaseNode + clone: function(BaseNode): BaseNode + position: Vec3f +end + record TrafficLightState new: function(): TrafficLightState + clone: function(TrafficLightState): TrafficLightState + lockedLanes: {integer} + duration: number + minDuration: number + canSkip: boolean +end + record TrafficLightConfig new: function(): TrafficLightConfig + clone: function(TrafficLightConfig): TrafficLightConfig + states: {TrafficLightState} + trafficLightType: integer +end + record BaseNodeConfig new: function(): BaseNodeConfig + laneConnections: {LaneConnection} + crosswalks: {Entity} + trafficLightPreference: TrafficLightPreference + trafficLightConfig: TrafficLightConfig + doubleSlipSwitch: boolean + userModifiedLaneConnections: boolean + userModifiedTrafficLightStates: boolean +end + record BaseNodeTrafficLight new: function(): BaseNodeTrafficLight + trafficLightData: TrafficLightData + state: integer + time: number + stateTimes: {integer} +end + record BaseParallelStrip new: function(): BaseParallelStrip + record BaseEdgeRange new: function(): BaseEdgeRange + edge: Engine.Entity + bounds: {number, number} +end + rangeGroups: {{BaseEdgeRange}} + rangeGroups_native: Vector> +end + record BoundingVolume new: function(): BoundingVolume + bbox: Box3f +end + record Bridge new: function(): Bridge + record Interval new: function(): Interval + splines: {{Vec3f}} + railingModels: {{integer, Mat4f}} +end + intervals: {Interval} +end + record BuildCost new: function(): BuildCost + buildCost: integer + bulldozeCost: integer + noCostAtAll: boolean +end + record BulldozerInfo new: function(): BulldozerInfo + locked: boolean +end + record Carriage new: function(): Carriage + reversed: boolean +end + record CarriageList new: function(): CarriageList + carriages: {Engine.Entity} +end + record ColliderList new: function(): ColliderList + colliders: {{Collider, Mat4f}} +end + record Color new: function(): Color + color: Vec3f +end + record Construction new: function(): Construction + record ConstructionParams new: function(): ConstructionParams + seed: integer + modules: {integer : } +end + fileName: ResName + params: ConstructionParams + params_native: NativeLuaTable + transf: Mat4f + timeBuilt: integer + frozenNodes: {Engine.Entity} + frozenEdges: {Engine.Entity} + depots: {Engine.Entity} + stations: {Engine.Entity} + industries: {Engine.Entity} + townBuildings: {Engine.Entity} + subconstructions: {Engine.Entity} + persistentMetadata: ConstructionInstanceMetadata + slots: {Slot} + slotConfig: {string : SlotConfig} + dependentSlots: {integer, {integer}} + tag2modelInstance: {string, {{Engine.Entity, integer}}} + entityAndIndex2labelTexts: {{Engine.Entity, integer}, {string}} + tag2segments: {string, {Engine.Entity}} +end + record CustomState new: function(): CustomState + state: { : } +end + record EmissionEmitter new: function(): EmissionEmitter + position: Vec3f + radius: number + noisePower: number + pollutionPower: number +end + record EmissionGrid new: function(): EmissionGrid + record Type Noise: Type + Pollution: Type +end + X0: integer + Y0: integer + width: integer + height: integer + gridPointSize: Vec2f + concentrationBuffer: Gridf + averageConcentration: Gridf + type: Type + wind: Vec2f +end + record Field new: function(): Field +end + record GameScript new: function(): GameScript + gameScript: ResName + addedToExistingSavegame: boolean + state: T + state_native: NativeLuaTable + eventSubscriptions: any +end + record GameSpeed new: function(): GameSpeed + speedup: integer + millisPerDay: integer +end + record GameTime new: function(): GameTime + gameTime: integer + gameTime0: integer + dates: {{integer, Date}} + timeOfDaySec: integer + tickCount: integer + updateCount: integer +end + record Industry new: function(): Industry + stockList: Engine.Entity + level: integer + closureTimeStamp: integer + upgradeProgress: number + manualDevelopment: boolean + construction: Engine.Entity + maxLevel: integer +end + record Landmark new: function(): Landmark + transportNetworkEntity: Engine.Entity + active: boolean +end + record LandVehicle new: function(): LandVehicle + record DynState new: function(): DynState + brakingTimer: number + turnLeft: boolean + turnRight: boolean +end + isTram: boolean + dyn: DynState +end + record Line new: function(): Line + + record LoadMode LOAD_IF_AVAILABLE: LoadMode + FULL_LOAD_ANY: LoadMode + FULL_LOAD_ALL: LoadMode + LEGACY_UNLOAD_ONLY: LoadMode +end + record StopConfig new: function(StopConfig): StopConfig + load: {boolean} + maxLoad: {number} + forceUnload: boolean + destroyForConfigChange: boolean + destroyForRefresh: boolean +end + record Stop new: function(): Stop + stationGroup: Engine.Entity + station: integer + terminal: integer + alternativeTerminals: {StationTerminal} + loadMode: LoadMode + minWaitingTime: number + maxWaitingTime: number + maxAdditionalWaitingTime: number + waypoints: {Waypoint} + stopConfig: StopConfig +end + stops: {Stop} + vehicleInfo: LineVehicleInfo + customFilters: boolean + reservationPriority: number +end + record LogBook new: function(): LogBook + record Log new: function(): Log + times: {integer} + values: {integer} + times_native: Vector + values_native: Vector +end + refEntity2name2log: {Engine.Entity : {string : Log}} + name2log: {string : Log} + name2log_native: Map +end + record LotList new: function(): LotList + record Lot new: function(): Lot + vertices: {Vec2f} + texCoords: {Vec2f} + triangles: {integer} + texKey: ResName + solid: boolean +end + lots: {Lot} +end + record MaintenanceCost new: function(): MaintenanceCost + maintenanceCost: integer + accumulatedCost: {{Carrier, Carrier} : integer} +end + record ModelInstanceList new: function(): ModelInstanceList + fatInstances: {ModelInstance} + thinInstances: {ThinModelInstance} + fatInstances_native: Vector + thinInstances_native: Vector + dynamic: boolean +end + record ModelPerson new: function(): ModelPerson + path: ExtPath + pathPos: PathPos + stopped: boolean + topSpeed: number + speed: number + brakeDecel: number + offset: number + position: Vec3f + movementType: integer + dist: number + dist0: number + stateTime: integer + startWaitTime: number + endWaitTime: number +end + record ModelPersonIdle new: function(): ModelPersonIdle + arrivalTime: integer +end + record MovePath new: function(): MovePath + record DynState new: function(): DynState + pathPos: PathPos + speed: number + brakeDecel: number + accel: number + timeUntilAccel: number + timeStanding: number + timeToIgnore: number + approachingStation: boolean +end + path: Path + endParam: number + endPos: number + state: VehicleState + blocked: integer + allowEarlyArrival: boolean + reverse: boolean + servedFrom: integer + servedTo: integer + occupiedBackIndex: integer + occupiedFrontIndex: integer + dyn: DynState + dyn0: DynState +end + record MovePathAircraft new: function(): MovePathAircraft + record AircraftState new: function(): AircraftState + record DynState new: function(): DynState + velocity: Vec2f + lastAccel: Vec2f + pitch: number + pitchV: number + roll: number + rollV: number + thrust: number + thrustV: number + elevator: number + aileronLeft: number + propPhase: number + flaps: number + alt: number +end + flightState: FlightState + cruiseAlt: number + waitingDistance: number + waitingPriority: integer + gear: boolean + gearTime: integer + dyn: DynState + dyn0: DynState +end + record ShipState new: function(): ShipState + record DynState new: function(): DynState + lastAccel: number + tractiveEffort: number + tractiveEffortV: number + roll: number + rollV: number + powerOutput: number + approachingStation: boolean + paddlePhase: number + actualPos: PathPosData +end + waitingDist: number + clearToLand: boolean + startPathPosData: PathPosData + targetPathPosData: PathPosData + dyn: DynState + dyn0: DynState +end + record PathState PATH0: PathState + PATH1: PathState + PATH2: PathState +end + path0: Path + path1: {{EdgeGeometry, boolean}} + path2: Path + pathPos: PathPos + pathPos0: PathPos + state: VehicleState + pathState: PathState + speed: number + speed0: number + brakeDecel: number + aircraftState: AircraftState + shipState: ShipState +end + record Name new: function(): Name + name: string +end + record Parcel new: function(): Parcel + record CollisionType Environment: CollisionType + Parcel: CollisionType +end + record Face new: function(): Face + points: {Vec3f} + collision: {CollisionType : boolean} +end + streetSegment: Engine.Entity + left: boolean + curveParam: number + offset: number + faces: {Face} +end + record PersonCapacity new: function(): PersonCapacity + type: LandUseType + capacity: integer + personNodes: {NodeId} + vehicleNodes: {NodeId} +end + record Player new: function(): Player + headquarters: Engine.Entity +end + record PlayerOwned new: function(): PlayerOwned + player: Engine.Entity +end + record RailroadCrossing new: function(): RailroadCrossing + record State OPEN: State + CLOSED: State + WAITING: State +end + nodes: {Engine.Entity} + edges: {Engine.Entity} + typeIndex: integer + state: State + stateTime: integer +end + record RunwayList new: function(): RunwayList + runways: {Runway} +end + record Scaffold new: function(): Scaffold + record Type NEW: Type + UPGRADE: Type + DOWNGRADE: Type +end + type: Type + oldModelId: integer + oldTransf: Mat4f + oldBuildingFace: {{Vec2f}} + oldFloorLevel: {{number}} + oldHeight: number + buildingFace: {{Vec2f}} + floorLevel: {{number}} + height: number + constructionStartTime: integer + constructionEndTime: integer + cranePosition: Vec2f + craneAngle: number + craneTerrainHeight: number + craneAngleSpan: {number} +end + record ShapeList new: function(): ShapeList + shapes: {Shape} +end + record Ship new: function(): Ship + pathIndex: integer + reservedFrom: integer + reservedTo: integer +end + record SignalList new: function(): SignalList + signals: {Signal} +end + record SimCargo record PickupPoint new: function(): PickupPoint + vehicle: Engine.Entity + line: Engine.Entity + position: Vec3f + carrier: Carrier +end + new: function(): SimCargo + cargoType: CargoTypeId + targetOrPickupEntity: Engine.Entity + sourceEntity: Engine.Entity + pickupPoints: {PickupPoint} + speed: number + startTime: integer + pickupTime: integer + deliveryExtensionDuration: integer +end + record SimEntityAtBuilding new: function(): SimEntityAtBuilding + waitingTime: number +end + record SimEntityAtStock new: function(): SimEntityAtStock + stock: {Engine.Entity, StockId} + arrivalTime: integer +end + record SimEntityAtTerminal new: function(): SimEntityAtTerminal + line: Engine.Entity + lineStop0: integer + lineStop1: integer + arrivalTime: number + vehicle: Engine.Entity +end + record SimEntityAtVehicle new: function(): SimEntityAtVehicle + line: Engine.Entity + lineStop0: integer + lineStop1: integer + vehicle: Engine.Entity + roundTripCounter: integer +end + record SimEntityIdle new: function(): SimEntityIdle +end + record SimEntityNeedsPath new: function(): SimEntityNeedsPath + input: PathFactoryInput + output: PathFactoryOutput +end + record SimEntityMoving new: function(): SimEntityMoving + line: Engine.Entity + lineStop0: integer + lineStop1: integer + partialPath: boolean + expectedArrivalTime: number +end + record SimPersonAtTerminal new: function(): SimPersonAtTerminal + edgeId: EdgeId + place: integer +end + record SimPersonAtVehicle new: function(): SimPersonAtVehicle + vehicle: Engine.Entity + part: integer + place: integer + expectedArrivalTime: number +end + record SimPerson new: function(): SimPerson + cargoType: CargoTypeId + destinations: {Engine.Entity} + moveModes: {MoveMode} + travelTimes: {number} + targetOrAtEntity: Engine.Entity + lastNonResType: LandUseType + lastMoveMode: MoveMode + walkSpeed: number + modelIdPerson: integer + colorConfigPerson: integer + modelIdCar: integer + colorConfigCar: integer + lastDestinationUpdate: integer + landUse2ReachableWalkDrive: {integer, integer} + landUse2ReachableLines: {integer, integer} + pickupTime: integer + happiness: number +end + type Station = Station + record StationGroup new: function(): StationGroup + stations: {Engine.Entity} +end + record StockList record Stock new: function(): Stock + type: StockListType + cargoType: CargoTypeId + cargoTypes: CargoTypeSet + mixedTypes: boolean + capacity: integer + loadSpeedModifier: number + loadIndicatorModelInstanceIndices: {integer} + tag: integer +end + record StockData new: function(): StockData + consumeFrequency: number +end + record Rule new: function(): Rule + input: {{integer}} + output: {CargoTypeId : integer} + capacity: integer + consumptionFactor: number + booster: boolean + boostFactor: number + priority: integer + slot: integer +end + record RuleData new: function(): RuleData + record ApplyInfo new: function(): ApplyInfo + time: integer + interval: integer + consumedCargo: {StockId} + producedCargo: {{CargoTypeId, integer}} +end + applyHistory: {ApplyInfo} + lastApplyDecayFactor: number +end + record CargoData new: function(): CargoData + produceFrequency: integer +end + record Modifiers new: function(): Modifiers + + productivity: number +end + new: function(): StockList + stocks: {Stock} + rules: {Rule} + stockDatas: {StockData} + ruleDatas: {RuleData} + cargoData: {CargoTypeId : CargoData} + thrownAwayCargo: integer + modifiers: Modifiers +end + record Subconstruction new: function(): Subconstruction + tag: integer + slotIds: {integer} + metadata: SubconstructionInstanceMetadata +end + record Terrain new: function(): Terrain + size: Vec2i + baseLevels: integer + baseResolution: Vec3f + highLevels: integer + offsetZ: number + waterLevel: number + dataMaps: {string, HeightmapNew} +end + record TerrainAlignmentList new: function(): TerrainAlignmentList + terrainAlignments: {TerrainAlignment} +end + record TerrainTile new: function(): TerrainTile + terrainEntity: Engine.Entity + position: Vec2i +end + record TerrainTileBrush new: function(): TerrainTileBrush + materialIndexBrush: {integer} + forceAboveBit: {boolean} +end + record TerrainTileHeightmap new: function(): TerrainTileHeightmap + vertices: {integer} +end + record TickEpoch new: function(): TickEpoch + time: integer + commandIndex: integer + subIndex: integer +end + record Town new: function(): Town + initialLandUseCapacities: {integer} + capacityScalingFactor: number + levelToCapacityDistributionWeights: {{number}} + sizeFactors: {number} + cargoNeeds: {{{CargoTypeId, number}}} + developmentActive: boolean + noise: number + pollution: number +end + record TownBuilding new: function(): TownBuilding + personCapacity: Engine.Entity + stockList: Engine.Entity + construction: Engine.Entity + level: integer + parcels: {Engine.Entity} + depth: integer + height: number + town: Engine.Entity + timeBuilt: integer + blockedDevelopment: boolean +end + record TownConnection new: function(): TownConnection + entity0: Engine.Entity + entity1: Engine.Entity + position0: Vec2f + position1: Vec2f + time: number + currentTime: number + lastUpgradeYear: integer + valid: boolean +end + record TpNetLink new: function(): TpNetLink + from: EdgePos + to: EdgePos +end + record Train new: function(): Train +end + record TransportNetwork new: function(): TransportNetwork + nodes: {Node} + edges: {Edge} + turnaroundEdges: {integer} +end + record TransportNetworkNodes new: function(): TransportNetworkNodes +end + record TransportVehicle record Modifiers new: function(): Modifiers + + topSpeedScale: number + noiseScale: number + pollutionScale: number + comfortScale: number +end + record LoadSpeedModifiers vehicleOverlength: number + stockCompatibility: number + vehicleCompatibility: number + vehicleIncompatibility: number + getTotalPenalty: function(LoadSpeedModifiers): number +end + record Config new: function(): Config + transportModes: {TransportMode : boolean} + allCaps: {CargoTypeId} + capacities: {CargoTypeId} + loadSpeeds: {number} + reversible: boolean +end + record LoadState new: function(): LoadState + None: LoadState + Arrived: LoadState + Unloading: LoadState + Loading: LoadState + WaitForScheduledDeparture: LoadState + Departing: LoadState +end + record PendingIncomeParams new: function(): PendingIncomeParams + record EntityRev0 entity: Engine.Entity + rev0: integer +end + amount: integer + carrier: Carrier + vehicleEntity: Engine.Entity + lineEntity: Engine.Entity +end + new: function(): TransportVehicle + carrier: Carrier + transportVehicleConfig: TransportVehicleConfig + config: Config + state: TransportVehicleState + userStopped: boolean + depot: Engine.Entity + sellOnArrival: boolean + line: Engine.Entity + stopIndex: integer + arrivalStationTerminal: StationTerminal + arrivalStationTerminalLocked: boolean + lineStopDepartures: {integer} + lastLineStopDeparture: integer + sectionTimes: {number} + lineStop2cargo2available: {{CargoTypeId}} + loadState: LoadState + timeUntilNextScheduledDeparture: number + loadSpeedModifiers: {CargoTypeId : LoadSpeedModifiers} + timeUntilCloseDoors: number + timeUntilDeparture: number + timeUntilNextLoad: {CargoTypeId : number} + timeUntilNextUnload: {CargoTypeId : number} + lastStationStockIndex: integer + doorsTime: integer + daysInDepot: integer + daysAtTerminal: integer + doorsOpen: boolean + noPath: boolean + autoDeparture: boolean + maintenanceStation: Engine.Entity + modifiers: Modifiers + unloadPendingIncome: PendingIncomeParams + closestTown: Engine.Entity + visitedStops: {integer} +end + record VehicleDepot new: function(): VehicleDepot + carrier: Carrier + transportModes: {TransportMode : boolean} + inNodes: {NodeId} + outNodes: {NodeId} + state: integer + doors: number + stateTime: integer + catchmentArea: CatchmentArea + maintenancePool: integer + maxPoolUsage: number + averagePoolUsage: number + poolUsageTicks: integer + filterTags: {string} +end + record VehicleOrder new: function(): VehicleOrder + equals: function(VehicleOrder, VehicleOrder): boolean + entity: Engine.Entity + strongBrakeEntity: boolean + waitingForSpace: boolean + waitingForTrafficLight: boolean +end + record Warehouse new: function(): Warehouse + stockList: Engine.Entity + construction: Engine.Entity +end + record WaterMesh new: function(): WaterMesh + record Contour new: function(): Contour + vertices: {Vec2f} + normals: {Vec2f} +end + waterLevel: number + vertices: {Vec2f} + depths: {number} + indices: {integer} + contours: {Contour} + pos: Vec2i +end + record World new: function(): World + cloudCoverage: number +end +end + record ComponentType AIRCRAFT: ComponentType + ANIMAL: ComponentType + ASSET_GROUP: ComponentType + BASE_EDGE: ComponentType + BASE_EDGE_STREET: ComponentType + BASE_NODE: ComponentType + BASE_PARALLEL_STRIP: ComponentType + CUSTOM_STATE: ComponentType + EMISSION_EMITTER: ComponentType + FIELD: ComponentType + GAME_TIME: ComponentType + GAME_SPEED: ComponentType + MODEL_INSTANCE_LIST: ComponentType + NAME: ComponentType + LINE: ComponentType + LOG_BOOK: ComponentType + MODEL_PERSON: ComponentType + MOVE_PATH: ComponentType + MOVE_PATH_AIRCRAFT: ComponentType + STATION: ComponentType + STATION_GROUP: ComponentType + SIM_PERSON: ComponentType + SIM_PERSON_AT_TERMINAL: ComponentType + SIM_PERSON_AT_VEHICLE: ComponentType + SIM_CARGO: ComponentType + SIM_ENTITY_AT_BUILDING: ComponentType + SIM_ENTITY_AT_VEHICLE: ComponentType + SIM_ENTITY_AT_TERMINAL: ComponentType + SIM_ENTITY_IDLE: ComponentType + SIM_ENTITY_MOVING: ComponentType + SIGNAL_LIST: ComponentType + TOWN: ComponentType + INDUSTRY: ComponentType + STOCK_LIST: ComponentType + TOWN_BUILDING: ComponentType + TRANSPORT_VEHICLE: ComponentType + TRAIN: ComponentType + CARRIAGE: ComponentType + CARRIAGE_LIST: ComponentType + VEHICLE_DEPOT: ComponentType + COLOR: ComponentType + BOUNDING_VOLUME: ComponentType + CONSTRUCTION: ComponentType + SUBCONSTRUCTION: ComponentType + PERSON_CAPACITY: ComponentType + PLAYER_OWNED: ComponentType + ACCOUNT: ComponentType + GAME_SCRIPT: ComponentType + WAREHOUSE: ComponentType + TRANSPORT_NETWORK: ComponentType + MAINTENANCE_COST: ComponentType + RAILROAD_CROSSING: ComponentType + PLAYER: ComponentType + WORLD: ComponentType + BRIDGE: ComponentType + BASE_NODE_CONFIG: ComponentType + LAND_VEHICLE: ComponentType + BASE_NODE_TRAFFIC_LIGHT: ComponentType + EDGE_OBJECT: ComponentType + EMISSION_GRID: ComponentType + TERRAIN: ComponentType +end + getComponent: function(entity : Entity, type : ComponentType): T + record EntityFilters requireOwnedByPlayer: Engine.Entity + filterFn: function(Engine.Entity): boolean +end + forEachEntityWithComponent: function(fn : function(Entity), componentType : ComponentType) + forEachEntity: function(callback : function(Entity)) + getEntitiesWithComponent: function(componentType : ComponentType, filters : EntityFilters): {Engine.Entity} + getRevision: function(entity : Entity): Revision + entityExists: function(entity : Entity): boolean + record UtilTerrain isValidCoordinate: function(position : Vec2f): boolean + getHeightAt: function(position : Vec2f): number + getBaseHeightAt: function(position : Vec2f): number + isOnWater: function(position : Vec2f): boolean + getHeightmapEntity: function(position : Vec2i): Engine.Entity + getBoundingBox: function(): Box2f + makeMapFromGame: function(withHeightmap : boolean, withTowns : boolean, withIndustries : boolean, withAssets : boolean): GameMap + getTerrainEntityRevisions: function(): {Engine.Entity : Engine.Revision} + getBaseResolution: function(): Vec3f + getHighResolution: function(): Vec3f + ceilTerrainFragmentInTiles: function(percentage : number): integer +end + record MapGen createTowns: function(string, {GameMap.Town}): TownResult + createIndustries: function(string, {GameMap.Industry}): IndustryResult + getDefaultTownConnections: function({GameMap.Town}): {{integer, integer}} + getMinMaxValidTerrainHeight: function(): {number, number} + getMinMaxValidNumTowns: function(): {integer, integer} + getMinMaxValidNumIndustries: function(): {integer, integer} +end + record Config getConfigDict: function(): {string : string} + getModParams: function(): {string : { : }} +end + system: System + terrain: UtilTerrain + mapgen: MapGen + util: EngineUtil + config: Config +end +``` + +Main Engine interface + +### Engine.Entity[πŸ”—](#$api.engine~Engine.Entity) + +``` +type Engine.Entity = integer +``` + +### Engine.Revision[πŸ”—](#$api.engine~Engine.Revision) + +``` +record Engine.Revision num: {integer, integer, integer} +end +``` + +Keeps track of modifications to entities. + +### Engine.Revision.num[πŸ”—](#$api.engine~Engine.Revision.num) + +``` +Engine.Revision.num: {integer, integer, integer} +``` + +### Engine.Component[πŸ”—](#$api.engine~Engine.Component) + +``` +[Expand All] [Collapse All] + +record Engine.Component record Account new: function(): Account + balance: integer + loan: integer +end + record Aircraft new: function(): Aircraft + reservedTakeOffRunway: boolean + reservedLandingRunway: boolean + pathIndex: integer + reservedFrom: integer + reservedTo: integer +end + record Animal new: function(): Animal + worldPosition: Vec3f + lookingAt: Vec2f + targetCoord: Vec2f + movementSpeed: number + angularSpeed: number + lastUpdateElapsed: number + targetChangedElapsed: number + invalidTileElapsed: number + movementType: integer + roll: number + scaling: number + flock: {Vec3f} +end + record AssetGroup new: function(): AssetGroup +end + record AssetGroupAutoRemove new: function(): AssetGroupAutoRemove +end + record AudioEmitter new: function(): AudioEmitter + emitter: integer +end + record BaseEdge new: function(): BaseEdge + clone: function(BaseEdge): BaseEdge + type: BaseEdgeType + typeIndex: integer + objects: {{Engine.Entity, EdgeObjectType}} + laneConfigs: {LaneConfig} + laneConfigs_native: Vector + roadDevelopmentLocked: boolean + node0: Engine.Entity + node1: Engine.Entity + position0: Vec3f + position1: Vec3f + tangent0: Vec3f + tangent1: Vec3f + laneConfig: {LaneConfig} + edgeDecorations: {{integer, boolean}} + distance: number + roadType: RoadType + roadTemplate: ResName + roadStyle: ResName +end + record BaseEdgeStreet new: function(): BaseEdgeStreet + precedenceNode0: PrecedencePreference + precedenceNode1: PrecedencePreference +end + record BaseNode new: function(): BaseNode + clone: function(BaseNode): BaseNode + position: Vec3f +end + record TrafficLightState new: function(): TrafficLightState + clone: function(TrafficLightState): TrafficLightState + lockedLanes: {integer} + duration: number + minDuration: number + canSkip: boolean +end + record TrafficLightConfig new: function(): TrafficLightConfig + clone: function(TrafficLightConfig): TrafficLightConfig + states: {TrafficLightState} + trafficLightType: integer +end + record BaseNodeConfig new: function(): BaseNodeConfig + laneConnections: {LaneConnection} + crosswalks: {Entity} + trafficLightPreference: TrafficLightPreference + trafficLightConfig: TrafficLightConfig + doubleSlipSwitch: boolean + userModifiedLaneConnections: boolean + userModifiedTrafficLightStates: boolean +end + record BaseNodeTrafficLight new: function(): BaseNodeTrafficLight + trafficLightData: TrafficLightData + state: integer + time: number + stateTimes: {integer} +end + record BaseParallelStrip new: function(): BaseParallelStrip + record BaseEdgeRange new: function(): BaseEdgeRange + edge: Engine.Entity + bounds: {number, number} +end + rangeGroups: {{BaseEdgeRange}} + rangeGroups_native: Vector> +end + record BoundingVolume new: function(): BoundingVolume + bbox: Box3f +end + record Bridge new: function(): Bridge + record Interval new: function(): Interval + splines: {{Vec3f}} + railingModels: {{integer, Mat4f}} +end + intervals: {Interval} +end + record BuildCost new: function(): BuildCost + buildCost: integer + bulldozeCost: integer + noCostAtAll: boolean +end + record BulldozerInfo new: function(): BulldozerInfo + locked: boolean +end + record Carriage new: function(): Carriage + reversed: boolean +end + record CarriageList new: function(): CarriageList + carriages: {Engine.Entity} +end + record ColliderList new: function(): ColliderList + colliders: {{Collider, Mat4f}} +end + record Color new: function(): Color + color: Vec3f +end + record Construction new: function(): Construction + record ConstructionParams new: function(): ConstructionParams + seed: integer + modules: {integer : } +end + fileName: ResName + params: ConstructionParams + params_native: NativeLuaTable + transf: Mat4f + timeBuilt: integer + frozenNodes: {Engine.Entity} + frozenEdges: {Engine.Entity} + depots: {Engine.Entity} + stations: {Engine.Entity} + industries: {Engine.Entity} + townBuildings: {Engine.Entity} + subconstructions: {Engine.Entity} + persistentMetadata: ConstructionInstanceMetadata + slots: {Slot} + slotConfig: {string : SlotConfig} + dependentSlots: {integer, {integer}} + tag2modelInstance: {string, {{Engine.Entity, integer}}} + entityAndIndex2labelTexts: {{Engine.Entity, integer}, {string}} + tag2segments: {string, {Engine.Entity}} +end + record CustomState new: function(): CustomState + state: { : } +end + record EmissionEmitter new: function(): EmissionEmitter + position: Vec3f + radius: number + noisePower: number + pollutionPower: number +end + record EmissionGrid new: function(): EmissionGrid + record Type Noise: Type + Pollution: Type +end + X0: integer + Y0: integer + width: integer + height: integer + gridPointSize: Vec2f + concentrationBuffer: Gridf + averageConcentration: Gridf + type: Type + wind: Vec2f +end + record Field new: function(): Field +end + record GameScript new: function(): GameScript + gameScript: ResName + addedToExistingSavegame: boolean + state: T + state_native: NativeLuaTable + eventSubscriptions: any +end + record GameSpeed new: function(): GameSpeed + speedup: integer + millisPerDay: integer +end + record GameTime new: function(): GameTime + gameTime: integer + gameTime0: integer + dates: {{integer, Date}} + timeOfDaySec: integer + tickCount: integer + updateCount: integer +end + record Industry new: function(): Industry + stockList: Engine.Entity + level: integer + closureTimeStamp: integer + upgradeProgress: number + manualDevelopment: boolean + construction: Engine.Entity + maxLevel: integer +end + record Landmark new: function(): Landmark + transportNetworkEntity: Engine.Entity + active: boolean +end + record LandVehicle new: function(): LandVehicle + record DynState new: function(): DynState + brakingTimer: number + turnLeft: boolean + turnRight: boolean +end + isTram: boolean + dyn: DynState +end + record Line new: function(): Line + + record LoadMode LOAD_IF_AVAILABLE: LoadMode + FULL_LOAD_ANY: LoadMode + FULL_LOAD_ALL: LoadMode + LEGACY_UNLOAD_ONLY: LoadMode +end + record StopConfig new: function(StopConfig): StopConfig + load: {boolean} + maxLoad: {number} + forceUnload: boolean + destroyForConfigChange: boolean + destroyForRefresh: boolean +end + record Stop new: function(): Stop + stationGroup: Engine.Entity + station: integer + terminal: integer + alternativeTerminals: {StationTerminal} + loadMode: LoadMode + minWaitingTime: number + maxWaitingTime: number + maxAdditionalWaitingTime: number + waypoints: {Waypoint} + stopConfig: StopConfig +end + stops: {Stop} + vehicleInfo: LineVehicleInfo + customFilters: boolean + reservationPriority: number +end + record LogBook new: function(): LogBook + record Log new: function(): Log + times: {integer} + values: {integer} + times_native: Vector + values_native: Vector +end + refEntity2name2log: {Engine.Entity : {string : Log}} + name2log: {string : Log} + name2log_native: Map +end + record LotList new: function(): LotList + record Lot new: function(): Lot + vertices: {Vec2f} + texCoords: {Vec2f} + triangles: {integer} + texKey: ResName + solid: boolean +end + lots: {Lot} +end + record MaintenanceCost new: function(): MaintenanceCost + maintenanceCost: integer + accumulatedCost: {{Carrier, Carrier} : integer} +end + record ModelInstanceList new: function(): ModelInstanceList + fatInstances: {ModelInstance} + thinInstances: {ThinModelInstance} + fatInstances_native: Vector + thinInstances_native: Vector + dynamic: boolean +end + record ModelPerson new: function(): ModelPerson + path: ExtPath + pathPos: PathPos + stopped: boolean + topSpeed: number + speed: number + brakeDecel: number + offset: number + position: Vec3f + movementType: integer + dist: number + dist0: number + stateTime: integer + startWaitTime: number + endWaitTime: number +end + record ModelPersonIdle new: function(): ModelPersonIdle + arrivalTime: integer +end + record MovePath new: function(): MovePath + record DynState new: function(): DynState + pathPos: PathPos + speed: number + brakeDecel: number + accel: number + timeUntilAccel: number + timeStanding: number + timeToIgnore: number + approachingStation: boolean +end + path: Path + endParam: number + endPos: number + state: VehicleState + blocked: integer + allowEarlyArrival: boolean + reverse: boolean + servedFrom: integer + servedTo: integer + occupiedBackIndex: integer + occupiedFrontIndex: integer + dyn: DynState + dyn0: DynState +end + record MovePathAircraft new: function(): MovePathAircraft + record AircraftState new: function(): AircraftState + record DynState new: function(): DynState + velocity: Vec2f + lastAccel: Vec2f + pitch: number + pitchV: number + roll: number + rollV: number + thrust: number + thrustV: number + elevator: number + aileronLeft: number + propPhase: number + flaps: number + alt: number +end + flightState: FlightState + cruiseAlt: number + waitingDistance: number + waitingPriority: integer + gear: boolean + gearTime: integer + dyn: DynState + dyn0: DynState +end + record ShipState new: function(): ShipState + record DynState new: function(): DynState + lastAccel: number + tractiveEffort: number + tractiveEffortV: number + roll: number + rollV: number + powerOutput: number + approachingStation: boolean + paddlePhase: number + actualPos: PathPosData +end + waitingDist: number + clearToLand: boolean + startPathPosData: PathPosData + targetPathPosData: PathPosData + dyn: DynState + dyn0: DynState +end + record PathState PATH0: PathState + PATH1: PathState + PATH2: PathState +end + path0: Path + path1: {{EdgeGeometry, boolean}} + path2: Path + pathPos: PathPos + pathPos0: PathPos + state: VehicleState + pathState: PathState + speed: number + speed0: number + brakeDecel: number + aircraftState: AircraftState + shipState: ShipState +end + record Name new: function(): Name + name: string +end + record Parcel new: function(): Parcel + record CollisionType Environment: CollisionType + Parcel: CollisionType +end + record Face new: function(): Face + points: {Vec3f} + collision: {CollisionType : boolean} +end + streetSegment: Engine.Entity + left: boolean + curveParam: number + offset: number + faces: {Face} +end + record PersonCapacity new: function(): PersonCapacity + type: LandUseType + capacity: integer + personNodes: {NodeId} + vehicleNodes: {NodeId} +end + record Player new: function(): Player + headquarters: Engine.Entity +end + record PlayerOwned new: function(): PlayerOwned + player: Engine.Entity +end + record RailroadCrossing new: function(): RailroadCrossing + record State OPEN: State + CLOSED: State + WAITING: State +end + nodes: {Engine.Entity} + edges: {Engine.Entity} + typeIndex: integer + state: State + stateTime: integer +end + record RunwayList new: function(): RunwayList + runways: {Runway} +end + record Scaffold new: function(): Scaffold + record Type NEW: Type + UPGRADE: Type + DOWNGRADE: Type +end + type: Type + oldModelId: integer + oldTransf: Mat4f + oldBuildingFace: {{Vec2f}} + oldFloorLevel: {{number}} + oldHeight: number + buildingFace: {{Vec2f}} + floorLevel: {{number}} + height: number + constructionStartTime: integer + constructionEndTime: integer + cranePosition: Vec2f + craneAngle: number + craneTerrainHeight: number + craneAngleSpan: {number} +end + record ShapeList new: function(): ShapeList + shapes: {Shape} +end + record Ship new: function(): Ship + pathIndex: integer + reservedFrom: integer + reservedTo: integer +end + record SignalList new: function(): SignalList + signals: {Signal} +end + record SimCargo record PickupPoint new: function(): PickupPoint + vehicle: Engine.Entity + line: Engine.Entity + position: Vec3f + carrier: Carrier +end + new: function(): SimCargo + cargoType: CargoTypeId + targetOrPickupEntity: Engine.Entity + sourceEntity: Engine.Entity + pickupPoints: {PickupPoint} + speed: number + startTime: integer + pickupTime: integer + deliveryExtensionDuration: integer +end + record SimEntityAtBuilding new: function(): SimEntityAtBuilding + waitingTime: number +end + record SimEntityAtStock new: function(): SimEntityAtStock + stock: {Engine.Entity, StockId} + arrivalTime: integer +end + record SimEntityAtTerminal new: function(): SimEntityAtTerminal + line: Engine.Entity + lineStop0: integer + lineStop1: integer + arrivalTime: number + vehicle: Engine.Entity +end + record SimEntityAtVehicle new: function(): SimEntityAtVehicle + line: Engine.Entity + lineStop0: integer + lineStop1: integer + vehicle: Engine.Entity + roundTripCounter: integer +end + record SimEntityIdle new: function(): SimEntityIdle +end + record SimEntityNeedsPath new: function(): SimEntityNeedsPath + input: PathFactoryInput + output: PathFactoryOutput +end + record SimEntityMoving new: function(): SimEntityMoving + line: Engine.Entity + lineStop0: integer + lineStop1: integer + partialPath: boolean + expectedArrivalTime: number +end + record SimPersonAtTerminal new: function(): SimPersonAtTerminal + edgeId: EdgeId + place: integer +end + record SimPersonAtVehicle new: function(): SimPersonAtVehicle + vehicle: Engine.Entity + part: integer + place: integer + expectedArrivalTime: number +end + record SimPerson new: function(): SimPerson + cargoType: CargoTypeId + destinations: {Engine.Entity} + moveModes: {MoveMode} + travelTimes: {number} + targetOrAtEntity: Engine.Entity + lastNonResType: LandUseType + lastMoveMode: MoveMode + walkSpeed: number + modelIdPerson: integer + colorConfigPerson: integer + modelIdCar: integer + colorConfigCar: integer + lastDestinationUpdate: integer + landUse2ReachableWalkDrive: {integer, integer} + landUse2ReachableLines: {integer, integer} + pickupTime: integer + happiness: number +end + type Station = Station + record StationGroup new: function(): StationGroup + stations: {Engine.Entity} +end + record StockList record Stock new: function(): Stock + type: StockListType + cargoType: CargoTypeId + cargoTypes: CargoTypeSet + mixedTypes: boolean + capacity: integer + loadSpeedModifier: number + loadIndicatorModelInstanceIndices: {integer} + tag: integer +end + record StockData new: function(): StockData + consumeFrequency: number +end + record Rule new: function(): Rule + input: {{integer}} + output: {CargoTypeId : integer} + capacity: integer + consumptionFactor: number + booster: boolean + boostFactor: number + priority: integer + slot: integer +end + record RuleData new: function(): RuleData + record ApplyInfo new: function(): ApplyInfo + time: integer + interval: integer + consumedCargo: {StockId} + producedCargo: {{CargoTypeId, integer}} +end + applyHistory: {ApplyInfo} + lastApplyDecayFactor: number +end + record CargoData new: function(): CargoData + produceFrequency: integer +end + record Modifiers new: function(): Modifiers + + productivity: number +end + new: function(): StockList + stocks: {Stock} + rules: {Rule} + stockDatas: {StockData} + ruleDatas: {RuleData} + cargoData: {CargoTypeId : CargoData} + thrownAwayCargo: integer + modifiers: Modifiers +end + record Subconstruction new: function(): Subconstruction + tag: integer + slotIds: {integer} + metadata: SubconstructionInstanceMetadata +end + record Terrain new: function(): Terrain + size: Vec2i + baseLevels: integer + baseResolution: Vec3f + highLevels: integer + offsetZ: number + waterLevel: number + dataMaps: {string, HeightmapNew} +end + record TerrainAlignmentList new: function(): TerrainAlignmentList + terrainAlignments: {TerrainAlignment} +end + record TerrainTile new: function(): TerrainTile + terrainEntity: Engine.Entity + position: Vec2i +end + record TerrainTileBrush new: function(): TerrainTileBrush + materialIndexBrush: {integer} + forceAboveBit: {boolean} +end + record TerrainTileHeightmap new: function(): TerrainTileHeightmap + vertices: {integer} +end + record TickEpoch new: function(): TickEpoch + time: integer + commandIndex: integer + subIndex: integer +end + record Town new: function(): Town + initialLandUseCapacities: {integer} + capacityScalingFactor: number + levelToCapacityDistributionWeights: {{number}} + sizeFactors: {number} + cargoNeeds: {{{CargoTypeId, number}}} + developmentActive: boolean + noise: number + pollution: number +end + record TownBuilding new: function(): TownBuilding + personCapacity: Engine.Entity + stockList: Engine.Entity + construction: Engine.Entity + level: integer + parcels: {Engine.Entity} + depth: integer + height: number + town: Engine.Entity + timeBuilt: integer + blockedDevelopment: boolean +end + record TownConnection new: function(): TownConnection + entity0: Engine.Entity + entity1: Engine.Entity + position0: Vec2f + position1: Vec2f + time: number + currentTime: number + lastUpgradeYear: integer + valid: boolean +end + record TpNetLink new: function(): TpNetLink + from: EdgePos + to: EdgePos +end + record Train new: function(): Train +end + record TransportNetwork new: function(): TransportNetwork + nodes: {Node} + edges: {Edge} + turnaroundEdges: {integer} +end + record TransportNetworkNodes new: function(): TransportNetworkNodes +end + record TransportVehicle record Modifiers new: function(): Modifiers + + topSpeedScale: number + noiseScale: number + pollutionScale: number + comfortScale: number +end + record LoadSpeedModifiers vehicleOverlength: number + stockCompatibility: number + vehicleCompatibility: number + vehicleIncompatibility: number + getTotalPenalty: function(LoadSpeedModifiers): number +end + record Config new: function(): Config + transportModes: {TransportMode : boolean} + allCaps: {CargoTypeId} + capacities: {CargoTypeId} + loadSpeeds: {number} + reversible: boolean +end + record LoadState new: function(): LoadState + None: LoadState + Arrived: LoadState + Unloading: LoadState + Loading: LoadState + WaitForScheduledDeparture: LoadState + Departing: LoadState +end + record PendingIncomeParams new: function(): PendingIncomeParams + record EntityRev0 entity: Engine.Entity + rev0: integer +end + amount: integer + carrier: Carrier + vehicleEntity: Engine.Entity + lineEntity: Engine.Entity +end + new: function(): TransportVehicle + carrier: Carrier + transportVehicleConfig: TransportVehicleConfig + config: Config + state: TransportVehicleState + userStopped: boolean + depot: Engine.Entity + sellOnArrival: boolean + line: Engine.Entity + stopIndex: integer + arrivalStationTerminal: StationTerminal + arrivalStationTerminalLocked: boolean + lineStopDepartures: {integer} + lastLineStopDeparture: integer + sectionTimes: {number} + lineStop2cargo2available: {{CargoTypeId}} + loadState: LoadState + timeUntilNextScheduledDeparture: number + loadSpeedModifiers: {CargoTypeId : LoadSpeedModifiers} + timeUntilCloseDoors: number + timeUntilDeparture: number + timeUntilNextLoad: {CargoTypeId : number} + timeUntilNextUnload: {CargoTypeId : number} + lastStationStockIndex: integer + doorsTime: integer + daysInDepot: integer + daysAtTerminal: integer + doorsOpen: boolean + noPath: boolean + autoDeparture: boolean + maintenanceStation: Engine.Entity + modifiers: Modifiers + unloadPendingIncome: PendingIncomeParams + closestTown: Engine.Entity + visitedStops: {integer} +end + record VehicleDepot new: function(): VehicleDepot + carrier: Carrier + transportModes: {TransportMode : boolean} + inNodes: {NodeId} + outNodes: {NodeId} + state: integer + doors: number + stateTime: integer + catchmentArea: CatchmentArea + maintenancePool: integer + maxPoolUsage: number + averagePoolUsage: number + poolUsageTicks: integer + filterTags: {string} +end + record VehicleOrder new: function(): VehicleOrder + equals: function(VehicleOrder, VehicleOrder): boolean + entity: Engine.Entity + strongBrakeEntity: boolean + waitingForSpace: boolean + waitingForTrafficLight: boolean +end + record Warehouse new: function(): Warehouse + stockList: Engine.Entity + construction: Engine.Entity +end + record WaterMesh new: function(): WaterMesh + record Contour new: function(): Contour + vertices: {Vec2f} + normals: {Vec2f} +end + waterLevel: number + vertices: {Vec2f} + depths: {number} + indices: {integer} + contours: {Contour} + pos: Vec2i +end + record World new: function(): World + cloudCoverage: number +end +end +``` + +### Engine.Component.Account[πŸ”—](#$api.engine~Engine.Component.Account) + +``` +record Engine.Component.Account new: function(): Account + balance: integer + loan: integer +end +``` + +Contains financial data. Usually attached to the player Entity + +### Engine.Component.Account.new[πŸ”—](#$api.engine~Engine.Component.Account.new) + +``` +function Engine.Component.Account.new(): Account +``` + +**Returns** + +1. `Account` + +### Engine.Component.Account.balance[πŸ”—](#$api.engine~Engine.Component.Account.balance) + +``` +Engine.Component.Account.balance: integer +``` + +Current balance + +### Engine.Component.Account.loan[πŸ”—](#$api.engine~Engine.Component.Account.loan) + +``` +Engine.Component.Account.loan: integer +``` + +Current loan + +### Engine.Component.Aircraft[πŸ”—](#$api.engine~Engine.Component.Aircraft) + +``` +record Engine.Component.Aircraft new: function(): Aircraft + reservedTakeOffRunway: boolean + reservedLandingRunway: boolean + pathIndex: integer + reservedFrom: integer + reservedTo: integer +end +``` + +Data attached to aircraft + +### Engine.Component.Aircraft.new[πŸ”—](#$api.engine~Engine.Component.Aircraft.new) + +``` +function Engine.Component.Aircraft.new(): Aircraft +``` + +**Returns** + +1. `Aircraft` + +### Engine.Component.Aircraft.reservedTakeOffRunway[πŸ”—](#$api.engine~Engine.Component.Aircraft.reservedTakeOffRunway) + +``` +Engine.Component.Aircraft.reservedTakeOffRunway: boolean +``` + +Has the runway been reserved for takeoff + +### Engine.Component.Aircraft.reservedLandingRunway[πŸ”—](#$api.engine~Engine.Component.Aircraft.reservedLandingRunway) + +``` +Engine.Component.Aircraft.reservedLandingRunway: boolean +``` + +Has the runway been reserved for landing + +### Engine.Component.Aircraft.pathIndex[πŸ”—](#$api.engine~Engine.Component.Aircraft.pathIndex) + +``` +Engine.Component.Aircraft.pathIndex: integer +``` + +Edge index on the path + +### Engine.Component.Aircraft.reservedFrom[πŸ”—](#$api.engine~Engine.Component.Aircraft.reservedFrom) + +``` +Engine.Component.Aircraft.reservedFrom: integer +``` + +Edge index on the path from which the reservation starts + +### Engine.Component.Aircraft.reservedTo[πŸ”—](#$api.engine~Engine.Component.Aircraft.reservedTo) + +``` +Engine.Component.Aircraft.reservedTo: integer +``` + +Edge index on the path on which the reservation stops + +### Engine.Component.Animal[πŸ”—](#$api.engine~Engine.Component.Animal) + +``` +record Engine.Component.Animal new: function(): Animal + worldPosition: Vec3f + lookingAt: Vec2f + targetCoord: Vec2f + movementSpeed: number + angularSpeed: number + lastUpdateElapsed: number + targetChangedElapsed: number + invalidTileElapsed: number + movementType: integer + roll: number + scaling: number + flock: {Vec3f} +end +``` + +Data attached to animals. Contains information about position and movement + +### Engine.Component.Animal.new[πŸ”—](#$api.engine~Engine.Component.Animal.new) + +``` +function Engine.Component.Animal.new(): Animal +``` + +**Returns** + +1. `Animal` + +### Engine.Component.Animal.worldPosition[πŸ”—](#$api.engine~Engine.Component.Animal.worldPosition) + +``` +Engine.Component.Animal.worldPosition: Vec3f +``` + +Current location in the game world + +### Engine.Component.Animal.lookingAt[πŸ”—](#$api.engine~Engine.Component.Animal.lookingAt) + +``` +Engine.Component.Animal.lookingAt: Vec2f +``` + +Direction in which the animal is oriented + +### Engine.Component.Animal.targetCoord[πŸ”—](#$api.engine~Engine.Component.Animal.targetCoord) + +``` +Engine.Component.Animal.targetCoord: Vec2f +``` + +Destination where the animal is heading + +### Engine.Component.Animal.movementSpeed[πŸ”—](#$api.engine~Engine.Component.Animal.movementSpeed) + +``` +Engine.Component.Animal.movementSpeed: number +``` + +The forward speed + +### Engine.Component.Animal.angularSpeed[πŸ”—](#$api.engine~Engine.Component.Animal.angularSpeed) + +``` +Engine.Component.Animal.angularSpeed: number +``` + +The turn speed + +### Engine.Component.Animal.lastUpdateElapsed[πŸ”—](#$api.engine~Engine.Component.Animal.lastUpdateElapsed) + +``` +Engine.Component.Animal.lastUpdateElapsed: number +``` + +Time since the last update of the animal + +### Engine.Component.Animal.targetChangedElapsed[πŸ”—](#$api.engine~Engine.Component.Animal.targetChangedElapsed) + +``` +Engine.Component.Animal.targetChangedElapsed: number +``` + +Time since the last reorientation of the animal + +### Engine.Component.Animal.invalidTileElapsed[πŸ”—](#$api.engine~Engine.Component.Animal.invalidTileElapsed) + +``` +Engine.Component.Animal.invalidTileElapsed: number +``` + +Time since the animal is in an invalid location + +### Engine.Component.Animal.movementType[πŸ”—](#$api.engine~Engine.Component.Animal.movementType) + +``` +Engine.Component.Animal.movementType: integer +``` + +Index of the current movement type + +### Engine.Component.Animal.roll[πŸ”—](#$api.engine~Engine.Component.Animal.roll) + +``` +Engine.Component.Animal.roll: number +``` + +Current roll value + +### Engine.Component.Animal.scaling[πŸ”—](#$api.engine~Engine.Component.Animal.scaling) + +``` +Engine.Component.Animal.scaling: number +``` + +Scale of the animal + +### Engine.Component.Animal.flock[πŸ”—](#$api.engine~Engine.Component.Animal.flock) + +``` +Engine.Component.Animal.flock: {Vec3f} +``` + +Offset for each of the flock animals relative to the worldPosition + +### Engine.Component.AssetGroup[πŸ”—](#$api.engine~Engine.Component.AssetGroup) + +``` +record Engine.Component.AssetGroup new: function(): AssetGroup +end +``` + +Data attached to assets, in particular trees. +Assets are grouped together when built together in order to speed up rendering performance. +Usually comes together with a ModelInstanceList + +### Engine.Component.AssetGroup.new[πŸ”—](#$api.engine~Engine.Component.AssetGroup.new) + +``` +function Engine.Component.AssetGroup.new(): AssetGroup +``` + +**Returns** + +1. `AssetGroup` + +### Engine.Component.AssetGroupAutoRemove[πŸ”—](#$api.engine~Engine.Component.AssetGroupAutoRemove) + +``` +record Engine.Component.AssetGroupAutoRemove new: function(): AssetGroupAutoRemove +end +``` + +Data attached to assets entities to enable automatic removal when it collides with newly built objects + +### Engine.Component.AssetGroupAutoRemove.new[πŸ”—](#$api.engine~Engine.Component.AssetGroupAutoRemove.new) + +``` +function Engine.Component.AssetGroupAutoRemove.new(): AssetGroupAutoRemove +``` + +**Returns** + +1. `AssetGroupAutoRemove` + +### Engine.Component.AudioEmitter[πŸ”—](#$api.engine~Engine.Component.AudioEmitter) + +``` +record Engine.Component.AudioEmitter new: function(): AudioEmitter + emitter: integer +end +``` + +An entity with an AudioEmitter emits a sound source + +### Engine.Component.AudioEmitter.new[πŸ”—](#$api.engine~Engine.Component.AudioEmitter.new) + +``` +function Engine.Component.AudioEmitter.new(): AudioEmitter +``` + +**Returns** + +1. `AudioEmitter` + +### Engine.Component.AudioEmitter.emitter[πŸ”—](#$api.engine~Engine.Component.AudioEmitter.emitter) + +``` +Engine.Component.AudioEmitter.emitter: integer +``` + +Audio emitter reference + +### Engine.Component.BaseEdge[πŸ”—](#$api.engine~Engine.Component.BaseEdge) + +``` +record Engine.Component.BaseEdge new: function(): BaseEdge + clone: function(BaseEdge): BaseEdge + type: BaseEdgeType + typeIndex: integer + objects: {{Engine.Entity, EdgeObjectType}} + laneConfigs: {LaneConfig} + laneConfigs_native: Vector + roadDevelopmentLocked: boolean + node0: Engine.Entity + node1: Engine.Entity + position0: Vec3f + position1: Vec3f + tangent0: Vec3f + tangent1: Vec3f + laneConfig: {LaneConfig} + edgeDecorations: {{integer, boolean}} + distance: number + roadType: RoadType + roadTemplate: ResName + roadStyle: ResName +end +``` + +Type attached to streets and tracks, specifying the street type and other details. +A BaseEdge usually also has a BaseEdgeStreet and a TransportNetwork + +### Engine.Component.BaseEdge.new[πŸ”—](#$api.engine~Engine.Component.BaseEdge.new) + +``` +function Engine.Component.BaseEdge.new(): BaseEdge +``` + +**Returns** + +1. `BaseEdge` + +### Engine.Component.BaseEdge.clone[πŸ”—](#$api.engine~Engine.Component.BaseEdge.clone) + +``` +function Engine.Component.BaseEdge.clone(BaseEdge): BaseEdge +``` + +**Parameters** + +* `BaseEdge` + +**Returns** + +1. `BaseEdge` + +### Engine.Component.BaseEdge.type[πŸ”—](#$api.engine~Engine.Component.BaseEdge.type) + +``` +Engine.Component.BaseEdge.type: BaseEdgeType +``` + +### Engine.Component.BaseEdge.typeIndex[πŸ”—](#$api.engine~Engine.Component.BaseEdge.typeIndex) + +``` +Engine.Component.BaseEdge.typeIndex: integer +``` + +### Engine.Component.BaseEdge.objects[πŸ”—](#$api.engine~Engine.Component.BaseEdge.objects) + +``` +Engine.Component.BaseEdge.objects: {{Engine.Entity, EdgeObjectType}} +``` + +### Engine.Component.BaseEdge.laneConfigs[πŸ”—](#$api.engine~Engine.Component.BaseEdge.laneConfigs) + +``` +Engine.Component.BaseEdge.laneConfigs: {LaneConfig} +``` + +### Engine.Component.BaseEdge.laneConfigs\_native[πŸ”—](#$api.engine~Engine.Component.BaseEdge.laneConfigs_native) + +``` +Engine.Component.BaseEdge.laneConfigs_native: Vector +``` + +### Engine.Component.BaseEdge.roadDevelopmentLocked[πŸ”—](#$api.engine~Engine.Component.BaseEdge.roadDevelopmentLocked) + +``` +Engine.Component.BaseEdge.roadDevelopmentLocked: boolean +``` + +prevent towns from updating or extending this road + +### Engine.Component.BaseEdge.node0[πŸ”—](#$api.engine~Engine.Component.BaseEdge.node0) + +``` +Engine.Component.BaseEdge.node0: Engine.Entity +``` + +### Engine.Component.BaseEdge.node1[πŸ”—](#$api.engine~Engine.Component.BaseEdge.node1) + +``` +Engine.Component.BaseEdge.node1: Engine.Entity +``` + +### Engine.Component.BaseEdge.position0[πŸ”—](#$api.engine~Engine.Component.BaseEdge.position0) + +``` +Engine.Component.BaseEdge.position0: Vec3f +``` + +### Engine.Component.BaseEdge.position1[πŸ”—](#$api.engine~Engine.Component.BaseEdge.position1) + +``` +Engine.Component.BaseEdge.position1: Vec3f +``` + +### Engine.Component.BaseEdge.tangent0[πŸ”—](#$api.engine~Engine.Component.BaseEdge.tangent0) + +``` +Engine.Component.BaseEdge.tangent0: Vec3f +``` + +### Engine.Component.BaseEdge.tangent1[πŸ”—](#$api.engine~Engine.Component.BaseEdge.tangent1) + +``` +Engine.Component.BaseEdge.tangent1: Vec3f +``` + +### Engine.Component.BaseEdge.laneConfig[πŸ”—](#$api.engine~Engine.Component.BaseEdge.laneConfig) + +``` +Engine.Component.BaseEdge.laneConfig: {LaneConfig} +``` + +### Engine.Component.BaseEdge.edgeDecorations[πŸ”—](#$api.engine~Engine.Component.BaseEdge.edgeDecorations) + +``` +Engine.Component.BaseEdge.edgeDecorations: {{integer, boolean}} +``` + +### Engine.Component.BaseEdge.distance[πŸ”—](#$api.engine~Engine.Component.BaseEdge.distance) + +``` +Engine.Component.BaseEdge.distance: number +``` + +### Engine.Component.BaseEdge.roadType[πŸ”—](#$api.engine~Engine.Component.BaseEdge.roadType) + +``` +Engine.Component.BaseEdge.roadType: RoadType +``` + +Type of road (STREET or TRACK) + +### Engine.Component.BaseEdge.roadTemplate[πŸ”—](#$api.engine~Engine.Component.BaseEdge.roadTemplate) + +``` +Engine.Component.BaseEdge.roadTemplate: ResName +``` + +Road template resource name + +### Engine.Component.BaseEdge.roadStyle[πŸ”—](#$api.engine~Engine.Component.BaseEdge.roadStyle) + +``` +Engine.Component.BaseEdge.roadStyle: ResName +``` + +Road style resource name + +### Engine.Component.BaseEdgeStreet[πŸ”—](#$api.engine~Engine.Component.BaseEdgeStreet) + +``` +record Engine.Component.BaseEdgeStreet new: function(): BaseEdgeStreet + precedenceNode0: PrecedencePreference + precedenceNode1: PrecedencePreference +end +``` + +Contains details about a base edge when it is a street + +### Engine.Component.BaseEdgeStreet.new[πŸ”—](#$api.engine~Engine.Component.BaseEdgeStreet.new) + +``` +function Engine.Component.BaseEdgeStreet.new(): BaseEdgeStreet +``` + +**Returns** + +1. `BaseEdgeStreet` + +### Engine.Component.BaseEdgeStreet.precedenceNode0[πŸ”—](#$api.engine~Engine.Component.BaseEdgeStreet.precedenceNode0) + +``` +Engine.Component.BaseEdgeStreet.precedenceNode0: PrecedencePreference +``` + +Precedence preference at first node + +### Engine.Component.BaseEdgeStreet.precedenceNode1[πŸ”—](#$api.engine~Engine.Component.BaseEdgeStreet.precedenceNode1) + +``` +Engine.Component.BaseEdgeStreet.precedenceNode1: PrecedencePreference +``` + +Precedence preference at second node + +### Engine.Component.BaseNode[πŸ”—](#$api.engine~Engine.Component.BaseNode) + +``` +record Engine.Component.BaseNode new: function(): BaseNode + clone: function(BaseNode): BaseNode + position: Vec3f +end +``` + +A node in a street graph, e.g. a railroad crossing, a switch, or street crossing + +### Engine.Component.BaseNode.new[πŸ”—](#$api.engine~Engine.Component.BaseNode.new) + +``` +function Engine.Component.BaseNode.new(): BaseNode +``` + +**Returns** + +1. `BaseNode` + +### Engine.Component.BaseNode.clone[πŸ”—](#$api.engine~Engine.Component.BaseNode.clone) + +``` +function Engine.Component.BaseNode.clone(BaseNode): BaseNode +``` + +**Parameters** + +* `BaseNode` + +**Returns** + +1. `BaseNode` + +### Engine.Component.BaseNode.position[πŸ”—](#$api.engine~Engine.Component.BaseNode.position) + +``` +Engine.Component.BaseNode.position: Vec3f +``` + +Position of the node in world coordinates + +### Engine.Component.TrafficLightState[πŸ”—](#$api.engine~Engine.Component.TrafficLightState) + +``` +record Engine.Component.TrafficLightState new: function(): TrafficLightState + clone: function(TrafficLightState): TrafficLightState + lockedLanes: {integer} + duration: number + minDuration: number + canSkip: boolean +end +``` + +A signle state (= phase) of the traffic light + +### Engine.Component.TrafficLightState.new[πŸ”—](#$api.engine~Engine.Component.TrafficLightState.new) + +``` +function Engine.Component.TrafficLightState.new(): TrafficLightState +``` + +**Returns** + +1. `TrafficLightState` + +### Engine.Component.TrafficLightState.clone[πŸ”—](#$api.engine~Engine.Component.TrafficLightState.clone) + +``` +function Engine.Component.TrafficLightState.clone(TrafficLightState): TrafficLightState +``` + +**Parameters** + +* `TrafficLightState` + +**Returns** + +1. `TrafficLightState` + +### Engine.Component.TrafficLightState.lockedLanes[πŸ”—](#$api.engine~Engine.Component.TrafficLightState.lockedLanes) + +``` +Engine.Component.TrafficLightState.lockedLanes: {integer} +``` + +### Engine.Component.TrafficLightState.duration[πŸ”—](#$api.engine~Engine.Component.TrafficLightState.duration) + +``` +Engine.Component.TrafficLightState.duration: number +``` + +### Engine.Component.TrafficLightState.minDuration[πŸ”—](#$api.engine~Engine.Component.TrafficLightState.minDuration) + +``` +Engine.Component.TrafficLightState.minDuration: number +``` + +### Engine.Component.TrafficLightState.canSkip[πŸ”—](#$api.engine~Engine.Component.TrafficLightState.canSkip) + +``` +Engine.Component.TrafficLightState.canSkip: boolean +``` + +### Engine.Component.TrafficLightConfig[πŸ”—](#$api.engine~Engine.Component.TrafficLightConfig) + +``` +record Engine.Component.TrafficLightConfig new: function(): TrafficLightConfig + clone: function(TrafficLightConfig): TrafficLightConfig + states: {TrafficLightState} + trafficLightType: integer +end +``` + +Traffic light configuration for the node, including phases (states) + +### Engine.Component.TrafficLightConfig.new[πŸ”—](#$api.engine~Engine.Component.TrafficLightConfig.new) + +``` +function Engine.Component.TrafficLightConfig.new(): TrafficLightConfig +``` + +**Returns** + +1. `TrafficLightConfig` + +### Engine.Component.TrafficLightConfig.clone[πŸ”—](#$api.engine~Engine.Component.TrafficLightConfig.clone) + +``` +function Engine.Component.TrafficLightConfig.clone(TrafficLightConfig): TrafficLightConfig +``` + +**Parameters** + +* `TrafficLightConfig` + +**Returns** + +1. `TrafficLightConfig` + +### Engine.Component.TrafficLightConfig.states[πŸ”—](#$api.engine~Engine.Component.TrafficLightConfig.states) + +``` +Engine.Component.TrafficLightConfig.states: {TrafficLightState} +``` + +### Engine.Component.TrafficLightConfig.trafficLightType[πŸ”—](#$api.engine~Engine.Component.TrafficLightConfig.trafficLightType) + +``` +Engine.Component.TrafficLightConfig.trafficLightType: integer +``` + +### Engine.Component.BaseNodeConfig[πŸ”—](#$api.engine~Engine.Component.BaseNodeConfig) + +``` +record Engine.Component.BaseNodeConfig new: function(): BaseNodeConfig + laneConnections: {LaneConnection} + crosswalks: {Entity} + trafficLightPreference: TrafficLightPreference + trafficLightConfig: TrafficLightConfig + doubleSlipSwitch: boolean + userModifiedLaneConnections: boolean + userModifiedTrafficLightStates: boolean +end +``` + +A custom configuration for the lanes + +### Engine.Component.BaseNodeConfig.new[πŸ”—](#$api.engine~Engine.Component.BaseNodeConfig.new) + +``` +function Engine.Component.BaseNodeConfig.new(): BaseNodeConfig +``` + +**Returns** + +1. `BaseNodeConfig` + +### Engine.Component.BaseNodeConfig.laneConnections[πŸ”—](#$api.engine~Engine.Component.BaseNodeConfig.laneConnections) + +``` +Engine.Component.BaseNodeConfig.laneConnections: {LaneConnection} +``` + +### Engine.Component.BaseNodeConfig.crosswalks[πŸ”—](#$api.engine~Engine.Component.BaseNodeConfig.crosswalks) + +``` +Engine.Component.BaseNodeConfig.crosswalks: {Entity} +``` + +### Engine.Component.BaseNodeConfig.trafficLightPreference[πŸ”—](#$api.engine~Engine.Component.BaseNodeConfig.trafficLightPreference) + +``` +Engine.Component.BaseNodeConfig.trafficLightPreference: TrafficLightPreference +``` + +### Engine.Component.BaseNodeConfig.trafficLightConfig[πŸ”—](#$api.engine~Engine.Component.BaseNodeConfig.trafficLightConfig) + +``` +Engine.Component.BaseNodeConfig.trafficLightConfig: TrafficLightConfig +``` + +### Engine.Component.BaseNodeConfig.doubleSlipSwitch[πŸ”—](#$api.engine~Engine.Component.BaseNodeConfig.doubleSlipSwitch) + +``` +Engine.Component.BaseNodeConfig.doubleSlipSwitch: boolean +``` + +### Engine.Component.BaseNodeConfig.userModifiedLaneConnections[πŸ”—](#$api.engine~Engine.Component.BaseNodeConfig.userModifiedLaneConnections) + +``` +Engine.Component.BaseNodeConfig.userModifiedLaneConnections: boolean +``` + +### Engine.Component.BaseNodeConfig.userModifiedTrafficLightStates[πŸ”—](#$api.engine~Engine.Component.BaseNodeConfig.userModifiedTrafficLightStates) + +``` +Engine.Component.BaseNodeConfig.userModifiedTrafficLightStates: boolean +``` + +### Engine.Component.BaseNodeTrafficLight[πŸ”—](#$api.engine~Engine.Component.BaseNodeTrafficLight) + +``` +record Engine.Component.BaseNodeTrafficLight new: function(): BaseNodeTrafficLight + trafficLightData: TrafficLightData + state: integer + time: number + stateTimes: {integer} +end +``` + +Additional traffic light data for a base node + +### Engine.Component.BaseNodeTrafficLight.new[πŸ”—](#$api.engine~Engine.Component.BaseNodeTrafficLight.new) + +``` +function Engine.Component.BaseNodeTrafficLight.new(): BaseNodeTrafficLight +``` + +**Returns** + +1. `BaseNodeTrafficLight` + +### Engine.Component.BaseNodeTrafficLight.trafficLightData[πŸ”—](#$api.engine~Engine.Component.BaseNodeTrafficLight.trafficLightData) + +``` +Engine.Component.BaseNodeTrafficLight.trafficLightData: TrafficLightData +``` + +### Engine.Component.BaseNodeTrafficLight.state[πŸ”—](#$api.engine~Engine.Component.BaseNodeTrafficLight.state) + +``` +Engine.Component.BaseNodeTrafficLight.state: integer +``` + +### Engine.Component.BaseNodeTrafficLight.time[πŸ”—](#$api.engine~Engine.Component.BaseNodeTrafficLight.time) + +``` +Engine.Component.BaseNodeTrafficLight.time: number +``` + +### Engine.Component.BaseNodeTrafficLight.stateTimes[πŸ”—](#$api.engine~Engine.Component.BaseNodeTrafficLight.stateTimes) + +``` +Engine.Component.BaseNodeTrafficLight.stateTimes: {integer} +``` + +### Engine.Component.BaseParallelStrip[πŸ”—](#$api.engine~Engine.Component.BaseParallelStrip) + +``` +[Expand All] [Collapse All] + +record Engine.Component.BaseParallelStrip new: function(): BaseParallelStrip + record BaseEdgeRange new: function(): BaseEdgeRange + edge: Engine.Entity + bounds: {number, number} +end + rangeGroups: {{BaseEdgeRange}} + rangeGroups_native: Vector> +end +``` + +Stores groups of ranges (a range is reflected as a BaseEdgeRange) + +### Engine.Component.BaseParallelStrip.new[πŸ”—](#$api.engine~Engine.Component.BaseParallelStrip.new) + +``` +function Engine.Component.BaseParallelStrip.new(): BaseParallelStrip +``` + +**Returns** + +1. `BaseParallelStrip` + +### Engine.Component.BaseParallelStrip.BaseEdgeRange[πŸ”—](#$api.engine~Engine.Component.BaseParallelStrip.BaseEdgeRange) + +``` +record Engine.Component.BaseParallelStrip.BaseEdgeRange new: function(): BaseEdgeRange + edge: Engine.Entity + bounds: {number, number} +end +``` + +Stores a fraction of a base edge (BaseEdge) + +### Engine.Component.BaseParallelStrip.BaseEdgeRange.new[πŸ”—](#$api.engine~Engine.Component.BaseParallelStrip.BaseEdgeRange.new) + +``` +function Engine.Component.BaseParallelStrip.BaseEdgeRange.new(): BaseEdgeRange +``` + +**Returns** + +1. `BaseEdgeRange` + +### Engine.Component.BaseParallelStrip.BaseEdgeRange.edge[πŸ”—](#$api.engine~Engine.Component.BaseParallelStrip.BaseEdgeRange.edge) + +``` +Engine.Component.BaseParallelStrip.BaseEdgeRange.edge: Engine.Entity +``` + +### Engine.Component.BaseParallelStrip.BaseEdgeRange.bounds[πŸ”—](#$api.engine~Engine.Component.BaseParallelStrip.BaseEdgeRange.bounds) + +``` +Engine.Component.BaseParallelStrip.BaseEdgeRange.bounds: {number, number} +``` + +### Engine.Component.BaseParallelStrip.rangeGroups[πŸ”—](#$api.engine~Engine.Component.BaseParallelStrip.rangeGroups) + +``` +Engine.Component.BaseParallelStrip.rangeGroups: {{BaseEdgeRange}} +``` + +### Engine.Component.BaseParallelStrip.rangeGroups\_native[πŸ”—](#$api.engine~Engine.Component.BaseParallelStrip.rangeGroups_native) + +``` +Engine.Component.BaseParallelStrip.rangeGroups_native: Vector> +``` + +### Engine.Component.BoundingVolume[πŸ”—](#$api.engine~Engine.Component.BoundingVolume) + +``` +record Engine.Component.BoundingVolume new: function(): BoundingVolume + bbox: Box3f +end +``` + +Contains the bounding box of an entity + +### Engine.Component.BoundingVolume.new[πŸ”—](#$api.engine~Engine.Component.BoundingVolume.new) + +``` +function Engine.Component.BoundingVolume.new(): BoundingVolume +``` + +**Returns** + +1. `BoundingVolume` + +### Engine.Component.BoundingVolume.bbox[πŸ”—](#$api.engine~Engine.Component.BoundingVolume.bbox) + +``` +Engine.Component.BoundingVolume.bbox: Box3f +``` + +The axis aligned bounding box + +### Engine.Component.Bridge[πŸ”—](#$api.engine~Engine.Component.Bridge) + +``` +[Expand All] [Collapse All] + +record Engine.Component.Bridge new: function(): Bridge + record Interval new: function(): Interval + splines: {{Vec3f}} + railingModels: {{integer, Mat4f}} +end + intervals: {Interval} +end +``` + +Contains the full information and the entire spline of a bridge, if this was configured to do so + +### Engine.Component.Bridge.new[πŸ”—](#$api.engine~Engine.Component.Bridge.new) + +``` +function Engine.Component.Bridge.new(): Bridge +``` + +**Returns** + +1. `Bridge` + +### Engine.Component.Bridge.Interval[πŸ”—](#$api.engine~Engine.Component.Bridge.Interval) + +``` +record Engine.Component.Bridge.Interval new: function(): Interval + splines: {{Vec3f}} + railingModels: {{integer, Mat4f}} +end +``` + +A subsection of a bridge + +### Engine.Component.Bridge.Interval.new[πŸ”—](#$api.engine~Engine.Component.Bridge.Interval.new) + +``` +function Engine.Component.Bridge.Interval.new(): Interval +``` + +**Returns** + +1. `Interval` + +### Engine.Component.Bridge.Interval.splines[πŸ”—](#$api.engine~Engine.Component.Bridge.Interval.splines) + +``` +Engine.Component.Bridge.Interval.splines: {{Vec3f}} +``` + +### Engine.Component.Bridge.Interval.railingModels[πŸ”—](#$api.engine~Engine.Component.Bridge.Interval.railingModels) + +``` +Engine.Component.Bridge.Interval.railingModels: {{integer, Mat4f}} +``` + +### Engine.Component.Bridge.intervals[πŸ”—](#$api.engine~Engine.Component.Bridge.intervals) + +``` +Engine.Component.Bridge.intervals: {Interval} +``` + +### Engine.Component.BuildCost[πŸ”—](#$api.engine~Engine.Component.BuildCost) + +``` +record Engine.Component.BuildCost new: function(): BuildCost + buildCost: integer + bulldozeCost: integer + noCostAtAll: boolean +end +``` + +Stores the costs of an entity (e.g. Constructions or Edges) + +### Engine.Component.BuildCost.new[πŸ”—](#$api.engine~Engine.Component.BuildCost.new) + +``` +function Engine.Component.BuildCost.new(): BuildCost +``` + +**Returns** + +1. `BuildCost` + +### Engine.Component.BuildCost.buildCost[πŸ”—](#$api.engine~Engine.Component.BuildCost.buildCost) + +``` +Engine.Component.BuildCost.buildCost: integer +``` + +### Engine.Component.BuildCost.bulldozeCost[πŸ”—](#$api.engine~Engine.Component.BuildCost.bulldozeCost) + +``` +Engine.Component.BuildCost.bulldozeCost: integer +``` + +### Engine.Component.BuildCost.noCostAtAll[πŸ”—](#$api.engine~Engine.Component.BuildCost.noCostAtAll) + +``` +Engine.Component.BuildCost.noCostAtAll: boolean +``` + +### Engine.Component.BulldozerInfo[πŸ”—](#$api.engine~Engine.Component.BulldozerInfo) + +``` +record Engine.Component.BulldozerInfo new: function(): BulldozerInfo + locked: boolean +end +``` + +Allows to set certain entities to be not bulldozable + +### Engine.Component.BulldozerInfo.new[πŸ”—](#$api.engine~Engine.Component.BulldozerInfo.new) + +``` +function Engine.Component.BulldozerInfo.new(): BulldozerInfo +``` + +**Returns** + +1. `BulldozerInfo` + +### Engine.Component.BulldozerInfo.locked[πŸ”—](#$api.engine~Engine.Component.BulldozerInfo.locked) + +``` +Engine.Component.BulldozerInfo.locked: boolean +``` + +### Engine.Component.Carriage[πŸ”—](#$api.engine~Engine.Component.Carriage) + +``` +record Engine.Component.Carriage new: function(): Carriage + reversed: boolean +end +``` + +Represents a single waggon of a train (a single carriage or engine). + +### Engine.Component.Carriage.new[πŸ”—](#$api.engine~Engine.Component.Carriage.new) + +``` +function Engine.Component.Carriage.new(): Carriage +``` + +**Returns** + +1. `Carriage` + +### Engine.Component.Carriage.reversed[πŸ”—](#$api.engine~Engine.Component.Carriage.reversed) + +``` +Engine.Component.Carriage.reversed: boolean +``` + +true if the train travels reversed + +### Engine.Component.CarriageList[πŸ”—](#$api.engine~Engine.Component.CarriageList) + +``` +record Engine.Component.CarriageList new: function(): CarriageList + carriages: {Engine.Entity} +end +``` + +Represents a list of engines and carriages (usually of a train) + +### Engine.Component.CarriageList.new[πŸ”—](#$api.engine~Engine.Component.CarriageList.new) + +``` +function Engine.Component.CarriageList.new(): CarriageList +``` + +**Returns** + +1. `CarriageList` + +### Engine.Component.CarriageList.carriages[πŸ”—](#$api.engine~Engine.Component.CarriageList.carriages) + +``` +Engine.Component.CarriageList.carriages: {Engine.Entity} +``` + +all waggons and engines + +### Engine.Component.ColliderList[πŸ”—](#$api.engine~Engine.Component.ColliderList) + +``` +record Engine.Component.ColliderList new: function(): ColliderList + colliders: {{Collider, Mat4f}} +end +``` + +A list of colliders of different shapes, with an extra transformation + +### Engine.Component.ColliderList.new[πŸ”—](#$api.engine~Engine.Component.ColliderList.new) + +``` +function Engine.Component.ColliderList.new(): ColliderList +``` + +**Returns** + +1. `ColliderList` + +### Engine.Component.ColliderList.colliders[πŸ”—](#$api.engine~Engine.Component.ColliderList.colliders) + +``` +Engine.Component.ColliderList.colliders: {{Collider, Mat4f}} +``` + +a list of colliders and transformation that belong to the entity + +### Engine.Component.Color[πŸ”—](#$api.engine~Engine.Component.Color) + +``` +record Engine.Component.Color new: function(): Color + color: Vec3f +end +``` + +Specifies the color of an entity + +### Engine.Component.Color.new[πŸ”—](#$api.engine~Engine.Component.Color.new) + +``` +function Engine.Component.Color.new(): Color +``` + +**Returns** + +1. `Color` + +### Engine.Component.Color.color[πŸ”—](#$api.engine~Engine.Component.Color.color) + +``` +Engine.Component.Color.color: Vec3f +``` + +the RGB color of the entity + +### Engine.Component.Construction[πŸ”—](#$api.engine~Engine.Component.Construction) + +``` +[Expand All] [Collapse All] + +record Engine.Component.Construction new: function(): Construction + record ConstructionParams new: function(): ConstructionParams + seed: integer + modules: {integer : } +end + fileName: ResName + params: ConstructionParams + params_native: NativeLuaTable + transf: Mat4f + timeBuilt: integer + frozenNodes: {Engine.Entity} + frozenEdges: {Engine.Entity} + depots: {Engine.Entity} + stations: {Engine.Entity} + industries: {Engine.Entity} + townBuildings: {Engine.Entity} + subconstructions: {Engine.Entity} + persistentMetadata: ConstructionInstanceMetadata + slots: {Slot} + slotConfig: {string : SlotConfig} + dependentSlots: {integer, {integer}} + tag2modelInstance: {string, {{Engine.Entity, integer}}} + entityAndIndex2labelTexts: {{Engine.Entity, integer}, {string}} + tag2segments: {string, {Engine.Entity}} +end +``` + +A construction: usually contains stations, depots, town buildings or industries. + +### Engine.Component.Construction.new[πŸ”—](#$api.engine~Engine.Component.Construction.new) + +``` +function Engine.Component.Construction.new(): Construction +``` + +**Returns** + +1. `Construction` + +### Engine.Component.Construction.ConstructionParams[πŸ”—](#$api.engine~Engine.Component.Construction.ConstructionParams) + +``` +record Engine.Component.Construction.ConstructionParams new: function(): ConstructionParams + seed: integer + modules: {integer : } +end +``` + +### Engine.Component.Construction.ConstructionParams.new[πŸ”—](#$api.engine~Engine.Component.Construction.ConstructionParams.new) + +``` +function Engine.Component.Construction.ConstructionParams.new(): ConstructionParams +``` + +**Returns** + +1. `ConstructionParams` + +### Engine.Component.Construction.ConstructionParams.seed[πŸ”—](#$api.engine~Engine.Component.Construction.ConstructionParams.seed) + +``` +Engine.Component.Construction.ConstructionParams.seed: integer +``` + +### Engine.Component.Construction.ConstructionParams.modules[πŸ”—](#$api.engine~Engine.Component.Construction.ConstructionParams.modules) + +``` +Engine.Component.Construction.ConstructionParams.modules: {integer : } +``` + +### Engine.Component.Construction.fileName[πŸ”—](#$api.engine~Engine.Component.Construction.fileName) + +``` +Engine.Component.Construction.fileName: ResName +``` + +the name of the construction (or the id in case of dynamic constructions) + +### Engine.Component.Construction.params[πŸ”—](#$api.engine~Engine.Component.Construction.params) + +``` +Engine.Component.Construction.params: ConstructionParams +``` + +the parameters, passed to the `updateFn`. + +### Engine.Component.Construction.params\_native[πŸ”—](#$api.engine~Engine.Component.Construction.params_native) + +``` +Engine.Component.Construction.params_native: NativeLuaTable +``` + +### Engine.Component.Construction.transf[πŸ”—](#$api.engine~Engine.Component.Construction.transf) + +``` +Engine.Component.Construction.transf: Mat4f +``` + +the world transformation of the construction + +### Engine.Component.Construction.timeBuilt[πŸ”—](#$api.engine~Engine.Component.Construction.timeBuilt) + +``` +Engine.Component.Construction.timeBuilt: integer +``` + +the in-game time when the construction was first placed + +### Engine.Component.Construction.frozenNodes[πŸ”—](#$api.engine~Engine.Component.Construction.frozenNodes) + +``` +Engine.Component.Construction.frozenNodes: {Engine.Entity} +``` + +nodes that belong to the construction and cannot be moved + +### Engine.Component.Construction.frozenEdges[πŸ”—](#$api.engine~Engine.Component.Construction.frozenEdges) + +``` +Engine.Component.Construction.frozenEdges: {Engine.Entity} +``` + +edges that belong to the construction and cannot be moved + +### Engine.Component.Construction.depots[πŸ”—](#$api.engine~Engine.Component.Construction.depots) + +``` +Engine.Component.Construction.depots: {Engine.Entity} +``` + +depots that belong to the construction + +### Engine.Component.Construction.stations[πŸ”—](#$api.engine~Engine.Component.Construction.stations) + +``` +Engine.Component.Construction.stations: {Engine.Entity} +``` + +stations that belong to the construction + +### Engine.Component.Construction.industries[πŸ”—](#$api.engine~Engine.Component.Construction.industries) + +``` +Engine.Component.Construction.industries: {Engine.Entity} +``` + +industries that belong to the construction + +### Engine.Component.Construction.townBuildings[πŸ”—](#$api.engine~Engine.Component.Construction.townBuildings) + +``` +Engine.Component.Construction.townBuildings: {Engine.Entity} +``` + +town building that belong to the construction + +### Engine.Component.Construction.subconstructions[πŸ”—](#$api.engine~Engine.Component.Construction.subconstructions) + +``` +Engine.Component.Construction.subconstructions: {Engine.Entity} +``` + +all subconstructions generated by the construction + +### Engine.Component.Construction.persistentMetadata[πŸ”—](#$api.engine~Engine.Component.Construction.persistentMetadata) + +``` +Engine.Component.Construction.persistentMetadata: ConstructionInstanceMetadata +``` + +all metadata that is persisted in the component + +### Engine.Component.Construction.slots[πŸ”—](#$api.engine~Engine.Component.Construction.slots) + +``` +Engine.Component.Construction.slots: {Slot} +``` + +all slots of the modular construction + +### Engine.Component.Construction.slotConfig[πŸ”—](#$api.engine~Engine.Component.Construction.slotConfig) + +``` +Engine.Component.Construction.slotConfig: {string : SlotConfig} +``` + +configuration by slot type + +### Engine.Component.Construction.dependentSlots[πŸ”—](#$api.engine~Engine.Component.Construction.dependentSlots) + +``` +Engine.Component.Construction.dependentSlots: {integer, {integer}} +``` + +### Engine.Component.Construction.tag2modelInstance[πŸ”—](#$api.engine~Engine.Component.Construction.tag2modelInstance) + +``` +Engine.Component.Construction.tag2modelInstance: {string, {{Engine.Entity, integer}}} +``` + +### Engine.Component.Construction.entityAndIndex2labelTexts[πŸ”—](#$api.engine~Engine.Component.Construction.entityAndIndex2labelTexts) + +``` +Engine.Component.Construction.entityAndIndex2labelTexts: {{Engine.Entity, integer}, {string}} +``` + +### Engine.Component.Construction.tag2segments[πŸ”—](#$api.engine~Engine.Component.Construction.tag2segments) + +``` +Engine.Component.Construction.tag2segments: {string, {Engine.Entity}} +``` + +### Engine.Component.CustomState[πŸ”—](#$api.engine~Engine.Component.CustomState) + +``` +record Engine.Component.CustomState new: function(): CustomState + state: { : } +end +``` + +The internal state of a custom entity state + +### Engine.Component.CustomState.new[πŸ”—](#$api.engine~Engine.Component.CustomState.new) + +``` +function Engine.Component.CustomState.new(): CustomState +``` + +**Returns** + +1. `CustomState` + +### Engine.Component.CustomState.state[πŸ”—](#$api.engine~Engine.Component.CustomState.state) + +``` +Engine.Component.CustomState.state: { : } +``` + +the internal state as a generic table + +### Engine.Component.EmissionEmitter[πŸ”—](#$api.engine~Engine.Component.EmissionEmitter) + +``` +record Engine.Component.EmissionEmitter new: function(): EmissionEmitter + position: Vec3f + radius: number + noisePower: number + pollutionPower: number +end +``` + +An emission emitter, which emits pollution and/or noise + +### Engine.Component.EmissionEmitter.new[πŸ”—](#$api.engine~Engine.Component.EmissionEmitter.new) + +``` +function Engine.Component.EmissionEmitter.new(): EmissionEmitter +``` + +**Returns** + +1. `EmissionEmitter` + +### Engine.Component.EmissionEmitter.position[πŸ”—](#$api.engine~Engine.Component.EmissionEmitter.position) + +``` +Engine.Component.EmissionEmitter.position: Vec3f +``` + +the position of the emission emitter + +### Engine.Component.EmissionEmitter.radius[πŸ”—](#$api.engine~Engine.Component.EmissionEmitter.radius) + +``` +Engine.Component.EmissionEmitter.radius: number +``` + +the radius in which the emitter is applied (usually 0) + +### Engine.Component.EmissionEmitter.noisePower[πŸ”—](#$api.engine~Engine.Component.EmissionEmitter.noisePower) + +``` +Engine.Component.EmissionEmitter.noisePower: number +``` + +the noise power of the emission emitter + +### Engine.Component.EmissionEmitter.pollutionPower[πŸ”—](#$api.engine~Engine.Component.EmissionEmitter.pollutionPower) + +``` +Engine.Component.EmissionEmitter.pollutionPower: number +``` + +the pollution power of the emission emitter + +### Engine.Component.EmissionGrid[πŸ”—](#$api.engine~Engine.Component.EmissionGrid) + +``` +[Expand All] [Collapse All] + +record Engine.Component.EmissionGrid new: function(): EmissionGrid + record Type Noise: Type + Pollution: Type +end + X0: integer + Y0: integer + width: integer + height: integer + gridPointSize: Vec2f + concentrationBuffer: Gridf + averageConcentration: Gridf + type: Type + wind: Vec2f +end +``` + +The grid containing the emission data + +### Engine.Component.EmissionGrid.new[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.new) + +``` +function Engine.Component.EmissionGrid.new(): EmissionGrid +``` + +**Returns** + +1. `EmissionGrid` + +### Engine.Component.EmissionGrid.Type[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.Type) + +``` +record Engine.Component.EmissionGrid.Type Noise: Type + Pollution: Type +end +``` + +The emission grid type + +### Engine.Component.EmissionGrid.Type.Noise[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.Type.Noise) + +``` +Engine.Component.EmissionGrid.Type.Noise: Type +``` + +### Engine.Component.EmissionGrid.Type.Pollution[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.Type.Pollution) + +``` +Engine.Component.EmissionGrid.Type.Pollution: Type +``` + +### Engine.Component.EmissionGrid.X0[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.X0) + +``` +Engine.Component.EmissionGrid.X0: integer +``` + +the bottom left corner x coordinate + +### Engine.Component.EmissionGrid.Y0[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.Y0) + +``` +Engine.Component.EmissionGrid.Y0: integer +``` + +the bottom left corner y coordinate + +### Engine.Component.EmissionGrid.width[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.width) + +``` +Engine.Component.EmissionGrid.width: integer +``` + +### Engine.Component.EmissionGrid.height[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.height) + +``` +Engine.Component.EmissionGrid.height: integer +``` + +### Engine.Component.EmissionGrid.gridPointSize[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.gridPointSize) + +``` +Engine.Component.EmissionGrid.gridPointSize: Vec2f +``` + +the resolution of the grid + +### Engine.Component.EmissionGrid.concentrationBuffer[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.concentrationBuffer) + +``` +Engine.Component.EmissionGrid.concentrationBuffer: Gridf +``` + +### Engine.Component.EmissionGrid.averageConcentration[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.averageConcentration) + +``` +Engine.Component.EmissionGrid.averageConcentration: Gridf +``` + +### Engine.Component.EmissionGrid.type[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.type) + +``` +Engine.Component.EmissionGrid.type: Type +``` + +enum type for noise (0) or pollution (1) + +### Engine.Component.EmissionGrid.wind[πŸ”—](#$api.engine~Engine.Component.EmissionGrid.wind) + +``` +Engine.Component.EmissionGrid.wind: Vec2f +``` + +global wind direction + +### Engine.Component.Field[πŸ”—](#$api.engine~Engine.Component.Field) + +``` +record Engine.Component.Field new: function(): Field +end +``` + +Contains data representing a farm field on the terrain + +### Engine.Component.Field.new[πŸ”—](#$api.engine~Engine.Component.Field.new) + +``` +function Engine.Component.Field.new(): Field +``` + +**Returns** + +1. `Field` + +### Engine.Component.GameScript[πŸ”—](#$api.engine~Engine.Component.GameScript) + +``` +record Engine.Component.GameScript new: function(): GameScript + gameScript: ResName + addedToExistingSavegame: boolean + state: T + state_native: NativeLuaTable + eventSubscriptions: any +end +``` + +The internal state of a single gamescript + +##### Type Parameters + +* **`T`** + +### Engine.Component.GameScript.new[πŸ”—](#$api.engine~Engine.Component.GameScript.new) + +``` +function Engine.Component.GameScript.new(): GameScript +``` + +**Returns** + +1. `GameScript` + +### Engine.Component.GameScript.gameScript[πŸ”—](#$api.engine~Engine.Component.GameScript.gameScript) + +``` +Engine.Component.GameScript.gameScript: ResName +``` + +the gamescript for this entity + +### Engine.Component.GameScript.addedToExistingSavegame[πŸ”—](#$api.engine~Engine.Component.GameScript.addedToExistingSavegame) + +``` +Engine.Component.GameScript.addedToExistingSavegame: boolean +``` + +### Engine.Component.GameScript.state[πŸ”—](#$api.engine~Engine.Component.GameScript.state) + +``` +Engine.Component.GameScript.state: T +``` + +the internal state as a generic table + +### Engine.Component.GameScript.state\_native[πŸ”—](#$api.engine~Engine.Component.GameScript.state_native) + +``` +Engine.Component.GameScript.state_native: NativeLuaTable +``` + +### Engine.Component.GameScript.eventSubscriptions[πŸ”—](#$api.engine~Engine.Component.GameScript.eventSubscriptions) + +``` +Engine.Component.GameScript.eventSubscriptions: any +``` + +the event subscriptions for this gamescript + +### Engine.Component.GameSpeed[πŸ”—](#$api.engine~Engine.Component.GameSpeed) + +``` +record Engine.Component.GameSpeed new: function(): GameSpeed + speedup: integer + millisPerDay: integer +end +``` + +Information about the current game simulation and calendar speed. + +### Engine.Component.GameSpeed.new[πŸ”—](#$api.engine~Engine.Component.GameSpeed.new) + +``` +function Engine.Component.GameSpeed.new(): GameSpeed +``` + +**Returns** + +1. `GameSpeed` + +### Engine.Component.GameSpeed.speedup[πŸ”—](#$api.engine~Engine.Component.GameSpeed.speedup) + +``` +Engine.Component.GameSpeed.speedup: integer +``` + +multiplier for game simulation speed (non-negative, 0 = paused) + +### Engine.Component.GameSpeed.millisPerDay[πŸ”—](#$api.engine~Engine.Component.GameSpeed.millisPerDay) + +``` +Engine.Component.GameSpeed.millisPerDay: integer +``` + +length of an in-game calendar day in milliseconds (affected by speedup, 0 = paused) + +### Engine.Component.GameTime[πŸ”—](#$api.engine~Engine.Component.GameTime) + +``` +record Engine.Component.GameTime new: function(): GameTime + gameTime: integer + gameTime0: integer + dates: {{integer, Date}} + timeOfDaySec: integer + tickCount: integer + updateCount: integer +end +``` + +Information about the current ingame time. + +### Engine.Component.GameTime.new[πŸ”—](#$api.engine~Engine.Component.GameTime.new) + +``` +function Engine.Component.GameTime.new(): GameTime +``` + +**Returns** + +1. `GameTime` + +### Engine.Component.GameTime.gameTime[πŸ”—](#$api.engine~Engine.Component.GameTime.gameTime) + +``` +Engine.Component.GameTime.gameTime: integer +``` + +the current ingame time + +### Engine.Component.GameTime.gameTime0[πŸ”—](#$api.engine~Engine.Component.GameTime.gameTime0) + +``` +Engine.Component.GameTime.gameTime0: integer +``` + +the ingame time when the last update occured + +### Engine.Component.GameTime.dates[πŸ”—](#$api.engine~Engine.Component.GameTime.dates) + +``` +Engine.Component.GameTime.dates: {{integer, Date}} +``` + +### Engine.Component.GameTime.timeOfDaySec[πŸ”—](#$api.engine~Engine.Component.GameTime.timeOfDaySec) + +``` +Engine.Component.GameTime.timeOfDaySec: integer +``` + +### Engine.Component.GameTime.tickCount[πŸ”—](#$api.engine~Engine.Component.GameTime.tickCount) + +``` +Engine.Component.GameTime.tickCount: integer +``` + +number of simulation ticks, ticks also when the game is paused (once per frame) + +### Engine.Component.GameTime.updateCount[πŸ”—](#$api.engine~Engine.Component.GameTime.updateCount) + +``` +Engine.Component.GameTime.updateCount: integer +``` + +number of simulation updates, does not tick when the simulation is paused + +### Engine.Component.Industry[πŸ”—](#$api.engine~Engine.Component.Industry) + +``` +record Engine.Component.Industry new: function(): Industry + stockList: Engine.Entity + level: integer + closureTimeStamp: integer + upgradeProgress: number + manualDevelopment: boolean + construction: Engine.Entity + maxLevel: integer +end +``` + +Contains information about industries. + +### Engine.Component.Industry.new[πŸ”—](#$api.engine~Engine.Component.Industry.new) + +``` +function Engine.Component.Industry.new(): Industry +``` + +**Returns** + +1. `Industry` + +### Engine.Component.Industry.stockList[πŸ”—](#$api.engine~Engine.Component.Industry.stockList) + +``` +Engine.Component.Industry.stockList: Engine.Entity +``` + +stock list entity + +### Engine.Component.Industry.level[πŸ”—](#$api.engine~Engine.Component.Industry.level) + +``` +Engine.Component.Industry.level: integer +``` + +the current level of the construction + +### Engine.Component.Industry.closureTimeStamp[πŸ”—](#$api.engine~Engine.Component.Industry.closureTimeStamp) + +``` +Engine.Component.Industry.closureTimeStamp: integer +``` + +time after which the building will be closed + +### Engine.Component.Industry.upgradeProgress[πŸ”—](#$api.engine~Engine.Component.Industry.upgradeProgress) + +``` +Engine.Component.Industry.upgradeProgress: number +``` + +the progress towards upgrade/downgrade + +### Engine.Component.Industry.manualDevelopment[πŸ”—](#$api.engine~Engine.Component.Industry.manualDevelopment) + +``` +Engine.Component.Industry.manualDevelopment: boolean +``` + +set to true if industries do not start to close/stop countdown and do not level up or down + +### Engine.Component.Industry.construction[πŸ”—](#$api.engine~Engine.Component.Industry.construction) + +``` +Engine.Component.Industry.construction: Engine.Entity +``` + +the construction entity + +### Engine.Component.Industry.maxLevel[πŸ”—](#$api.engine~Engine.Component.Industry.maxLevel) + +``` +Engine.Component.Industry.maxLevel: integer +``` + +the maximum level of the construction + +### Engine.Component.Landmark[πŸ”—](#$api.engine~Engine.Component.Landmark) + +``` +record Engine.Component.Landmark new: function(): Landmark + transportNetworkEntity: Engine.Entity + active: boolean +end +``` + +Information about landmarks used for path finding. + +### Engine.Component.Landmark.new[πŸ”—](#$api.engine~Engine.Component.Landmark.new) + +``` +function Engine.Component.Landmark.new(): Landmark +``` + +**Returns** + +1. `Landmark` + +### Engine.Component.Landmark.transportNetworkEntity[πŸ”—](#$api.engine~Engine.Component.Landmark.transportNetworkEntity) + +``` +Engine.Component.Landmark.transportNetworkEntity: Engine.Entity +``` + +the entity for the landmark + +### Engine.Component.Landmark.active[πŸ”—](#$api.engine~Engine.Component.Landmark.active) + +``` +Engine.Component.Landmark.active: boolean +``` + +whether the landmark is currently active + +### Engine.Component.LandVehicle[πŸ”—](#$api.engine~Engine.Component.LandVehicle) + +``` +[Expand All] [Collapse All] + +record Engine.Component.LandVehicle new: function(): LandVehicle + record DynState new: function(): DynState + brakingTimer: number + turnLeft: boolean + turnRight: boolean +end + isTram: boolean + dyn: DynState +end +``` + +Represents a vehicle travelling on roads (either bus or truck) + +### Engine.Component.LandVehicle.new[πŸ”—](#$api.engine~Engine.Component.LandVehicle.new) + +``` +function Engine.Component.LandVehicle.new(): LandVehicle +``` + +**Returns** + +1. `LandVehicle` + +### Engine.Component.LandVehicle.DynState[πŸ”—](#$api.engine~Engine.Component.LandVehicle.DynState) + +``` +record Engine.Component.LandVehicle.DynState new: function(): DynState + brakingTimer: number + turnLeft: boolean + turnRight: boolean +end +``` + +The fast-changing component of a LandVehicle. + +### Engine.Component.LandVehicle.DynState.new[πŸ”—](#$api.engine~Engine.Component.LandVehicle.DynState.new) + +``` +function Engine.Component.LandVehicle.DynState.new(): DynState +``` + +**Returns** + +1. `DynState` + +### Engine.Component.LandVehicle.DynState.brakingTimer[πŸ”—](#$api.engine~Engine.Component.LandVehicle.DynState.brakingTimer) + +``` +Engine.Component.LandVehicle.DynState.brakingTimer: number +``` + +time in seconds that counts down. When positive, braking lights are on + +### Engine.Component.LandVehicle.DynState.turnLeft[πŸ”—](#$api.engine~Engine.Component.LandVehicle.DynState.turnLeft) + +``` +Engine.Component.LandVehicle.DynState.turnLeft: boolean +``` + +true if the vehicle is turning left + +### Engine.Component.LandVehicle.DynState.turnRight[πŸ”—](#$api.engine~Engine.Component.LandVehicle.DynState.turnRight) + +``` +Engine.Component.LandVehicle.DynState.turnRight: boolean +``` + +true if the vehicle is turning right + +### Engine.Component.LandVehicle.isTram[πŸ”—](#$api.engine~Engine.Component.LandVehicle.isTram) + +``` +Engine.Component.LandVehicle.isTram: boolean +``` + +### Engine.Component.LandVehicle.dyn[πŸ”—](#$api.engine~Engine.Component.LandVehicle.dyn) + +``` +Engine.Component.LandVehicle.dyn: DynState +``` + +the fast-changing component of the LandVehicle + +### Engine.Component.Line[πŸ”—](#$api.engine~Engine.Component.Line) + +``` +[Expand All] [Collapse All] + +record Engine.Component.Line new: function(): Line + + record LoadMode LOAD_IF_AVAILABLE: LoadMode + FULL_LOAD_ANY: LoadMode + FULL_LOAD_ALL: LoadMode + LEGACY_UNLOAD_ONLY: LoadMode +end + record StopConfig new: function(StopConfig): StopConfig + load: {boolean} + maxLoad: {number} + forceUnload: boolean + destroyForConfigChange: boolean + destroyForRefresh: boolean +end + record Stop new: function(): Stop + stationGroup: Engine.Entity + station: integer + terminal: integer + alternativeTerminals: {StationTerminal} + loadMode: LoadMode + minWaitingTime: number + maxWaitingTime: number + maxAdditionalWaitingTime: number + waypoints: {Waypoint} + stopConfig: StopConfig +end + stops: {Stop} + vehicleInfo: LineVehicleInfo + customFilters: boolean + reservationPriority: number +end +``` + +An line with stops and configurations + +### Engine.Component.Line.new()[πŸ”—](#$api.engine~Engine.Component.Line.new()) + +``` +function Engine.Component.Line.new()(): Line +``` + +**Returns** + +1. `Line` + +### Engine.Component.Line.new(Line)[πŸ”—](#$api.engine~Engine.Component.Line.new(Line)) + +``` +function Engine.Component.Line.new(Line)(Line): Line +``` + +**Parameters** + +* `Line` + +**Returns** + +1. `Line` + +### Engine.Component.Line.LoadMode[πŸ”—](#$api.engine~Engine.Component.Line.LoadMode) + +``` +record Engine.Component.Line.LoadMode LOAD_IF_AVAILABLE: LoadMode + FULL_LOAD_ANY: LoadMode + FULL_LOAD_ALL: LoadMode + LEGACY_UNLOAD_ONLY: LoadMode +end +``` + +Type of loading/waiting for the line. + +### Engine.Component.Line.LoadMode.LOAD\_IF\_AVAILABLE[πŸ”—](#$api.engine~Engine.Component.Line.LoadMode.LOAD_IF_AVAILABLE) + +``` +Engine.Component.Line.LoadMode.LOAD_IF_AVAILABLE: LoadMode +``` + +### Engine.Component.Line.LoadMode.FULL\_LOAD\_ANY[πŸ”—](#$api.engine~Engine.Component.Line.LoadMode.FULL_LOAD_ANY) + +``` +Engine.Component.Line.LoadMode.FULL_LOAD_ANY: LoadMode +``` + +### Engine.Component.Line.LoadMode.FULL\_LOAD\_ALL[πŸ”—](#$api.engine~Engine.Component.Line.LoadMode.FULL_LOAD_ALL) + +``` +Engine.Component.Line.LoadMode.FULL_LOAD_ALL: LoadMode +``` + +### Engine.Component.Line.LoadMode.LEGACY\_UNLOAD\_ONLY[πŸ”—](#$api.engine~Engine.Component.Line.LoadMode.LEGACY_UNLOAD_ONLY) + +``` +Engine.Component.Line.LoadMode.LEGACY_UNLOAD_ONLY: LoadMode +``` + +### Engine.Component.Line.StopConfig[πŸ”—](#$api.engine~Engine.Component.Line.StopConfig) + +``` +record Engine.Component.Line.StopConfig new: function(StopConfig): StopConfig + load: {boolean} + maxLoad: {number} + forceUnload: boolean + destroyForConfigChange: boolean + destroyForRefresh: boolean +end +``` + +Configuration details for a line stop + +### Engine.Component.Line.StopConfig.new[πŸ”—](#$api.engine~Engine.Component.Line.StopConfig.new) + +``` +function Engine.Component.Line.StopConfig.new(StopConfig): StopConfig +``` + +**Parameters** + +* `StopConfig` + +**Returns** + +1. `StopConfig` + +### Engine.Component.Line.StopConfig.load[πŸ”—](#$api.engine~Engine.Component.Line.StopConfig.load) + +``` +Engine.Component.Line.StopConfig.load: {boolean} +``` + +for each cargo type, if it should be loaded + +### Engine.Component.Line.StopConfig.maxLoad[πŸ”—](#$api.engine~Engine.Component.Line.StopConfig.maxLoad) + +``` +Engine.Component.Line.StopConfig.maxLoad: {number} +``` + +for each cargo type, its max allowed fraction of total capacity (from 0 to 1) + +### Engine.Component.Line.StopConfig.forceUnload[πŸ”—](#$api.engine~Engine.Component.Line.StopConfig.forceUnload) + +``` +Engine.Component.Line.StopConfig.forceUnload: boolean +``` + +whether to unload cargo at compatible input-stocks, even if there is no space in that stock (cargo will be destroyed) + +### Engine.Component.Line.StopConfig.destroyForConfigChange[πŸ”—](#$api.engine~Engine.Component.Line.StopConfig.destroyForConfigChange) + +``` +Engine.Component.Line.StopConfig.destroyForConfigChange: boolean +``` + +whether to destroy cargo to allow changing the load config of a vehicle (even without compatible input-stock). +This only happens in case a different cargo type is available to be loaded up at this stock. + +### Engine.Component.Line.StopConfig.destroyForRefresh[πŸ”—](#$api.engine~Engine.Component.Line.StopConfig.destroyForRefresh) + +``` +Engine.Component.Line.StopConfig.destroyForRefresh: boolean +``` + +whether to destroy cargo that was originally picked up by the vehicle at this output-stock (even without compatible input-stock). +This only happens in case the cargo did a full round trip and new cargo of the same type is available to be loaded up at this stock. + +### Engine.Component.Line.Stop[πŸ”—](#$api.engine~Engine.Component.Line.Stop) + +``` +record Engine.Component.Line.Stop new: function(): Stop + stationGroup: Engine.Entity + station: integer + terminal: integer + alternativeTerminals: {StationTerminal} + loadMode: LoadMode + minWaitingTime: number + maxWaitingTime: number + maxAdditionalWaitingTime: number + waypoints: {Waypoint} + stopConfig: StopConfig +end +``` + +Configuration for a line stop + +### Engine.Component.Line.Stop.new[πŸ”—](#$api.engine~Engine.Component.Line.Stop.new) + +``` +function Engine.Component.Line.Stop.new(): Stop +``` + +**Returns** + +1. `Stop` + +### Engine.Component.Line.Stop.stationGroup[πŸ”—](#$api.engine~Engine.Component.Line.Stop.stationGroup) + +``` +Engine.Component.Line.Stop.stationGroup: Engine.Entity +``` + +the station group entity to which the line stop belongs + +### Engine.Component.Line.Stop.station[πŸ”—](#$api.engine~Engine.Component.Line.Stop.station) + +``` +Engine.Component.Line.Stop.station: integer +``` + +the station (within the station group) + +### Engine.Component.Line.Stop.terminal[πŸ”—](#$api.engine~Engine.Component.Line.Stop.terminal) + +``` +Engine.Component.Line.Stop.terminal: integer +``` + +the terminal (within the station) for the stop + +### Engine.Component.Line.Stop.alternativeTerminals[πŸ”—](#$api.engine~Engine.Component.Line.Stop.alternativeTerminals) + +``` +Engine.Component.Line.Stop.alternativeTerminals: {StationTerminal} +``` + +Alternative terminals for the stop + +### Engine.Component.Line.Stop.loadMode[πŸ”—](#$api.engine~Engine.Component.Line.Stop.loadMode) + +``` +Engine.Component.Line.Stop.loadMode: LoadMode +``` + +the configuration of what to load and not to load + +### Engine.Component.Line.Stop.minWaitingTime[πŸ”—](#$api.engine~Engine.Component.Line.Stop.minWaitingTime) + +``` +Engine.Component.Line.Stop.minWaitingTime: number +``` + +minimum waiting time at this stop + +### Engine.Component.Line.Stop.maxWaitingTime[πŸ”—](#$api.engine~Engine.Component.Line.Stop.maxWaitingTime) + +``` +Engine.Component.Line.Stop.maxWaitingTime: number +``` + +maximum waiting time at this stop + +### Engine.Component.Line.Stop.maxAdditionalWaitingTime[πŸ”—](#$api.engine~Engine.Component.Line.Stop.maxAdditionalWaitingTime) + +``` +Engine.Component.Line.Stop.maxAdditionalWaitingTime: number +``` + +maximum additional waiting time (after unloading/loading) at this stop + +### Engine.Component.Line.Stop.waypoints[πŸ”—](#$api.engine~Engine.Component.Line.Stop.waypoints) + +``` +Engine.Component.Line.Stop.waypoints: {Waypoint} +``` + +all waypoints after the stop + +### Engine.Component.Line.Stop.stopConfig[πŸ”—](#$api.engine~Engine.Component.Line.Stop.stopConfig) + +``` +Engine.Component.Line.Stop.stopConfig: StopConfig +``` + +configuration how much of what cargo type to load and unload + +### Engine.Component.Line.stops[πŸ”—](#$api.engine~Engine.Component.Line.stops) + +``` +Engine.Component.Line.stops: {Stop} +``` + +all line stops in order + +### Engine.Component.Line.vehicleInfo[πŸ”—](#$api.engine~Engine.Component.Line.vehicleInfo) + +``` +Engine.Component.Line.vehicleInfo: LineVehicleInfo +``` + +information about vehicles of the line + +### Engine.Component.Line.customFilters[πŸ”—](#$api.engine~Engine.Component.Line.customFilters) + +``` +Engine.Component.Line.customFilters: boolean +``` + +### Engine.Component.Line.reservationPriority[πŸ”—](#$api.engine~Engine.Component.Line.reservationPriority) + +``` +Engine.Component.Line.reservationPriority: number +``` + +### Engine.Component.LogBook[πŸ”—](#$api.engine~Engine.Component.LogBook) + +``` +[Expand All] [Collapse All] + +record Engine.Component.LogBook new: function(): LogBook + record Log new: function(): Log + times: {integer} + values: {integer} + times_native: Vector + values_native: Vector +end + refEntity2name2log: {Engine.Entity : {string : Log}} + name2log: {string : Log} + name2log_native: Map +end +``` + +A LogBook contains information about the evolution of a variable (e.g. amounts of money) over time. +Be caucious when working with this component, as it can grow quite large over time and lua performance might not be ideal. +Prefer the native utilities in `api.engine.util.logbook` whenever possible. + +### Engine.Component.LogBook.new[πŸ”—](#$api.engine~Engine.Component.LogBook.new) + +``` +function Engine.Component.LogBook.new(): LogBook +``` + +**Returns** + +1. `LogBook` + +### Engine.Component.LogBook.Log[πŸ”—](#$api.engine~Engine.Component.LogBook.Log) + +``` +record Engine.Component.LogBook.Log new: function(): Log + times: {integer} + values: {integer} + times_native: Vector + values_native: Vector +end +``` + +A Log is an entry into a LogBook and keeps track of the evolution of data in time. + +### Engine.Component.LogBook.Log.new[πŸ”—](#$api.engine~Engine.Component.LogBook.Log.new) + +``` +function Engine.Component.LogBook.Log.new(): Log +``` + +**Returns** + +1. `Log` + +### Engine.Component.LogBook.Log.times[πŸ”—](#$api.engine~Engine.Component.LogBook.Log.times) + +``` +Engine.Component.LogBook.Log.times: {integer} +``` + +### Engine.Component.LogBook.Log.values[πŸ”—](#$api.engine~Engine.Component.LogBook.Log.values) + +``` +Engine.Component.LogBook.Log.values: {integer} +``` + +### Engine.Component.LogBook.Log.times\_native[πŸ”—](#$api.engine~Engine.Component.LogBook.Log.times_native) + +``` +Engine.Component.LogBook.Log.times_native: Vector +``` + +### Engine.Component.LogBook.Log.values\_native[πŸ”—](#$api.engine~Engine.Component.LogBook.Log.values_native) + +``` +Engine.Component.LogBook.Log.values_native: Vector +``` + +### Engine.Component.LogBook.refEntity2name2log[πŸ”—](#$api.engine~Engine.Component.LogBook.refEntity2name2log) + +``` +Engine.Component.LogBook.refEntity2name2log: {Engine.Entity : {string : Log}} +``` + +### Engine.Component.LogBook.name2log[πŸ”—](#$api.engine~Engine.Component.LogBook.name2log) + +``` +Engine.Component.LogBook.name2log: {string : Log} +``` + +A map from a key to a Log + +### Engine.Component.LogBook.name2log\_native[πŸ”—](#$api.engine~Engine.Component.LogBook.name2log_native) + +``` +Engine.Component.LogBook.name2log_native: Map +``` + +### Engine.Component.LotList[πŸ”—](#$api.engine~Engine.Component.LotList) + +``` +[Expand All] [Collapse All] + +record Engine.Component.LotList new: function(): LotList + record Lot new: function(): Lot + vertices: {Vec2f} + texCoords: {Vec2f} + triangles: {integer} + texKey: ResName + solid: boolean +end + lots: {Lot} +end +``` + +Information about ground textures that are paining the terrain + +### Engine.Component.LotList.new[πŸ”—](#$api.engine~Engine.Component.LotList.new) + +``` +function Engine.Component.LotList.new(): LotList +``` + +**Returns** + +1. `LotList` + +### Engine.Component.LotList.Lot[πŸ”—](#$api.engine~Engine.Component.LotList.Lot) + +``` +record Engine.Component.LotList.Lot new: function(): Lot + vertices: {Vec2f} + texCoords: {Vec2f} + triangles: {integer} + texKey: ResName + solid: boolean +end +``` + +Actual information of a LotList + +### Engine.Component.LotList.Lot.new[πŸ”—](#$api.engine~Engine.Component.LotList.Lot.new) + +``` +function Engine.Component.LotList.Lot.new(): Lot +``` + +**Returns** + +1. `Lot` + +### Engine.Component.LotList.Lot.vertices[πŸ”—](#$api.engine~Engine.Component.LotList.Lot.vertices) + +``` +Engine.Component.LotList.Lot.vertices: {Vec2f} +``` + +list vertices of the lot + +### Engine.Component.LotList.Lot.texCoords[πŸ”—](#$api.engine~Engine.Component.LotList.Lot.texCoords) + +``` +Engine.Component.LotList.Lot.texCoords: {Vec2f} +``` + +list of texture coordinates for the lot (same length as vertices) + +### Engine.Component.LotList.Lot.triangles[πŸ”—](#$api.engine~Engine.Component.LotList.Lot.triangles) + +``` +Engine.Component.LotList.Lot.triangles: {integer} +``` + +alternative to vertices, a list of triangles can be specified instead (must be a multiple of 3) + +### Engine.Component.LotList.Lot.texKey[πŸ”—](#$api.engine~Engine.Component.LotList.Lot.texKey) + +``` +Engine.Component.LotList.Lot.texKey: ResName +``` + +the ground texture key to use + +### Engine.Component.LotList.Lot.solid[πŸ”—](#$api.engine~Engine.Component.LotList.Lot.solid) + +``` +Engine.Component.LotList.Lot.solid: boolean +``` + +### Engine.Component.LotList.lots[πŸ”—](#$api.engine~Engine.Component.LotList.lots) + +``` +Engine.Component.LotList.lots: {Lot} +``` + +a list of lots for the entity + +### Engine.Component.MaintenanceCost[πŸ”—](#$api.engine~Engine.Component.MaintenanceCost) + +``` +record Engine.Component.MaintenanceCost new: function(): MaintenanceCost + maintenanceCost: integer + accumulatedCost: {{Carrier, Carrier} : integer} +end +``` + +Contains the maintenance cost of objects + +### Engine.Component.MaintenanceCost.new[πŸ”—](#$api.engine~Engine.Component.MaintenanceCost.new) + +``` +function Engine.Component.MaintenanceCost.new(): MaintenanceCost +``` + +**Returns** + +1. `MaintenanceCost` + +### Engine.Component.MaintenanceCost.maintenanceCost[πŸ”—](#$api.engine~Engine.Component.MaintenanceCost.maintenanceCost) + +``` +Engine.Component.MaintenanceCost.maintenanceCost: integer +``` + +the maintenance cost of an object + +### Engine.Component.MaintenanceCost.accumulatedCost[πŸ”—](#$api.engine~Engine.Component.MaintenanceCost.accumulatedCost) + +``` +Engine.Component.MaintenanceCost.accumulatedCost: {{Carrier, Carrier} : integer} +``` + +### Engine.Component.ModelInstanceList[πŸ”—](#$api.engine~Engine.Component.ModelInstanceList) + +``` +record Engine.Component.ModelInstanceList new: function(): ModelInstanceList + fatInstances: {ModelInstance} + thinInstances: {ThinModelInstance} + fatInstances_native: Vector + thinInstances_native: Vector + dynamic: boolean +end +``` + +Contains all models rendered by the entity + +### Engine.Component.ModelInstanceList.new[πŸ”—](#$api.engine~Engine.Component.ModelInstanceList.new) + +``` +function Engine.Component.ModelInstanceList.new(): ModelInstanceList +``` + +**Returns** + +1. `ModelInstanceList` + +### Engine.Component.ModelInstanceList.fatInstances[πŸ”—](#$api.engine~Engine.Component.ModelInstanceList.fatInstances) + +``` +Engine.Component.ModelInstanceList.fatInstances: {ModelInstance} +``` + +A list of models with a full transform attached + +### Engine.Component.ModelInstanceList.thinInstances[πŸ”—](#$api.engine~Engine.Component.ModelInstanceList.thinInstances) + +``` +Engine.Component.ModelInstanceList.thinInstances: {ThinModelInstance} +``` + +A list of models with very simple data attached + +### Engine.Component.ModelInstanceList.fatInstances\_native[πŸ”—](#$api.engine~Engine.Component.ModelInstanceList.fatInstances_native) + +``` +Engine.Component.ModelInstanceList.fatInstances_native: Vector +``` + +native variant for more performant access + +### Engine.Component.ModelInstanceList.thinInstances\_native[πŸ”—](#$api.engine~Engine.Component.ModelInstanceList.thinInstances_native) + +``` +Engine.Component.ModelInstanceList.thinInstances_native: Vector +``` + +native variant for more performant access + +### Engine.Component.ModelInstanceList.dynamic[πŸ”—](#$api.engine~Engine.Component.ModelInstanceList.dynamic) + +``` +Engine.Component.ModelInstanceList.dynamic: boolean +``` + +### Engine.Component.ModelPerson[πŸ”—](#$api.engine~Engine.Component.ModelPerson) + +``` +record Engine.Component.ModelPerson new: function(): ModelPerson + path: ExtPath + pathPos: PathPos + stopped: boolean + topSpeed: number + speed: number + brakeDecel: number + offset: number + position: Vec3f + movementType: integer + dist: number + dist0: number + stateTime: integer + startWaitTime: number + endWaitTime: number +end +``` + +Additional data for persons walking in the world + +### Engine.Component.ModelPerson.new[πŸ”—](#$api.engine~Engine.Component.ModelPerson.new) + +``` +function Engine.Component.ModelPerson.new(): ModelPerson +``` + +**Returns** + +1. `ModelPerson` + +### Engine.Component.ModelPerson.path[πŸ”—](#$api.engine~Engine.Component.ModelPerson.path) + +``` +Engine.Component.ModelPerson.path: ExtPath +``` + +the current path of the person + +### Engine.Component.ModelPerson.pathPos[πŸ”—](#$api.engine~Engine.Component.ModelPerson.pathPos) + +``` +Engine.Component.ModelPerson.pathPos: PathPos +``` + +the current position on the path + +### Engine.Component.ModelPerson.stopped[πŸ”—](#$api.engine~Engine.Component.ModelPerson.stopped) + +``` +Engine.Component.ModelPerson.stopped: boolean +``` + +whether a person is currently not walking + +### Engine.Component.ModelPerson.topSpeed[πŸ”—](#$api.engine~Engine.Component.ModelPerson.topSpeed) + +``` +Engine.Component.ModelPerson.topSpeed: number +``` + +the maximal speed of a person + +### Engine.Component.ModelPerson.speed[πŸ”—](#$api.engine~Engine.Component.ModelPerson.speed) + +``` +Engine.Component.ModelPerson.speed: number +``` + +the current speed of a person + +### Engine.Component.ModelPerson.brakeDecel[πŸ”—](#$api.engine~Engine.Component.ModelPerson.brakeDecel) + +``` +Engine.Component.ModelPerson.brakeDecel: number +``` + +the current deceleration speed of persons + +### Engine.Component.ModelPerson.offset[πŸ”—](#$api.engine~Engine.Component.ModelPerson.offset) + +``` +Engine.Component.ModelPerson.offset: number +``` + +an offset perpendicular to the path + +### Engine.Component.ModelPerson.position[πŸ”—](#$api.engine~Engine.Component.ModelPerson.position) + +``` +Engine.Component.ModelPerson.position: Vec3f +``` + +the position in the world + +### Engine.Component.ModelPerson.movementType[πŸ”—](#$api.engine~Engine.Component.ModelPerson.movementType) + +``` +Engine.Component.ModelPerson.movementType: integer +``` + +the animation used to move the person + +### Engine.Component.ModelPerson.dist[πŸ”—](#$api.engine~Engine.Component.ModelPerson.dist) + +``` +Engine.Component.ModelPerson.dist: number +``` + +distance from the target + +### Engine.Component.ModelPerson.dist0[πŸ”—](#$api.engine~Engine.Component.ModelPerson.dist0) + +``` +Engine.Component.ModelPerson.dist0: number +``` + +distance from the target (last frame) + +### Engine.Component.ModelPerson.stateTime[πŸ”—](#$api.engine~Engine.Component.ModelPerson.stateTime) + +``` +Engine.Component.ModelPerson.stateTime: integer +``` + +the animation timer + +### Engine.Component.ModelPerson.startWaitTime[πŸ”—](#$api.engine~Engine.Component.ModelPerson.startWaitTime) + +``` +Engine.Component.ModelPerson.startWaitTime: number +``` + +waiting beside a car (before getting in, after coming out) start + +### Engine.Component.ModelPerson.endWaitTime[πŸ”—](#$api.engine~Engine.Component.ModelPerson.endWaitTime) + +``` +Engine.Component.ModelPerson.endWaitTime: number +``` + +waiting in front of a car (before getting in, after coming out) end + +### Engine.Component.ModelPersonIdle[πŸ”—](#$api.engine~Engine.Component.ModelPersonIdle) + +``` +record Engine.Component.ModelPersonIdle new: function(): ModelPersonIdle + arrivalTime: integer +end +``` + +Additional data for idle person + +### Engine.Component.ModelPersonIdle.new[πŸ”—](#$api.engine~Engine.Component.ModelPersonIdle.new) + +``` +function Engine.Component.ModelPersonIdle.new(): ModelPersonIdle +``` + +**Returns** + +1. `ModelPersonIdle` + +### Engine.Component.ModelPersonIdle.arrivalTime[πŸ”—](#$api.engine~Engine.Component.ModelPersonIdle.arrivalTime) + +``` +Engine.Component.ModelPersonIdle.arrivalTime: integer +``` + +the time since the person stopped + +### Engine.Component.MovePath[πŸ”—](#$api.engine~Engine.Component.MovePath) + +``` +[Expand All] [Collapse All] + +record Engine.Component.MovePath new: function(): MovePath + record DynState new: function(): DynState + pathPos: PathPos + speed: number + brakeDecel: number + accel: number + timeUntilAccel: number + timeStanding: number + timeToIgnore: number + approachingStation: boolean +end + path: Path + endParam: number + endPos: number + state: VehicleState + blocked: integer + allowEarlyArrival: boolean + reverse: boolean + servedFrom: integer + servedTo: integer + occupiedBackIndex: integer + occupiedFrontIndex: integer + dyn: DynState + dyn0: DynState +end +``` + +Represents a path a vehicle is currently following + +### Engine.Component.MovePath.new[πŸ”—](#$api.engine~Engine.Component.MovePath.new) + +``` +function Engine.Component.MovePath.new(): MovePath +``` + +**Returns** + +1. `MovePath` + +### Engine.Component.MovePath.DynState[πŸ”—](#$api.engine~Engine.Component.MovePath.DynState) + +``` +record Engine.Component.MovePath.DynState new: function(): DynState + pathPos: PathPos + speed: number + brakeDecel: number + accel: number + timeUntilAccel: number + timeStanding: number + timeToIgnore: number + approachingStation: boolean +end +``` + +The fast-changing component of the position on a path. + +### Engine.Component.MovePath.DynState.new[πŸ”—](#$api.engine~Engine.Component.MovePath.DynState.new) + +``` +function Engine.Component.MovePath.DynState.new(): DynState +``` + +**Returns** + +1. `DynState` + +### Engine.Component.MovePath.DynState.pathPos[πŸ”—](#$api.engine~Engine.Component.MovePath.DynState.pathPos) + +``` +Engine.Component.MovePath.DynState.pathPos: PathPos +``` + +the position on the path + +### Engine.Component.MovePath.DynState.speed[πŸ”—](#$api.engine~Engine.Component.MovePath.DynState.speed) + +``` +Engine.Component.MovePath.DynState.speed: number +``` + +### Engine.Component.MovePath.DynState.brakeDecel[πŸ”—](#$api.engine~Engine.Component.MovePath.DynState.brakeDecel) + +``` +Engine.Component.MovePath.DynState.brakeDecel: number +``` + +### Engine.Component.MovePath.DynState.accel[πŸ”—](#$api.engine~Engine.Component.MovePath.DynState.accel) + +``` +Engine.Component.MovePath.DynState.accel: number +``` + +### Engine.Component.MovePath.DynState.timeUntilAccel[πŸ”—](#$api.engine~Engine.Component.MovePath.DynState.timeUntilAccel) + +``` +Engine.Component.MovePath.DynState.timeUntilAccel: number +``` + +### Engine.Component.MovePath.DynState.timeStanding[πŸ”—](#$api.engine~Engine.Component.MovePath.DynState.timeStanding) + +``` +Engine.Component.MovePath.DynState.timeStanding: number +``` + +### Engine.Component.MovePath.DynState.timeToIgnore[πŸ”—](#$api.engine~Engine.Component.MovePath.DynState.timeToIgnore) + +``` +Engine.Component.MovePath.DynState.timeToIgnore: number +``` + +### Engine.Component.MovePath.DynState.approachingStation[πŸ”—](#$api.engine~Engine.Component.MovePath.DynState.approachingStation) + +``` +Engine.Component.MovePath.DynState.approachingStation: boolean +``` + +### Engine.Component.MovePath.path[πŸ”—](#$api.engine~Engine.Component.MovePath.path) + +``` +Engine.Component.MovePath.path: Path +``` + +a series of edges the vehicle is following + +### Engine.Component.MovePath.endParam[πŸ”—](#$api.engine~Engine.Component.MovePath.endParam) + +``` +Engine.Component.MovePath.endParam: number +``` + +### Engine.Component.MovePath.endPos[πŸ”—](#$api.engine~Engine.Component.MovePath.endPos) + +``` +Engine.Component.MovePath.endPos: number +``` + +### Engine.Component.MovePath.state[πŸ”—](#$api.engine~Engine.Component.MovePath.state) + +``` +Engine.Component.MovePath.state: VehicleState +``` + +### Engine.Component.MovePath.blocked[πŸ”—](#$api.engine~Engine.Component.MovePath.blocked) + +``` +Engine.Component.MovePath.blocked: integer +``` + +### Engine.Component.MovePath.allowEarlyArrival[πŸ”—](#$api.engine~Engine.Component.MovePath.allowEarlyArrival) + +``` +Engine.Component.MovePath.allowEarlyArrival: boolean +``` + +### Engine.Component.MovePath.reverse[πŸ”—](#$api.engine~Engine.Component.MovePath.reverse) + +``` +Engine.Component.MovePath.reverse: boolean +``` + +### Engine.Component.MovePath.servedFrom[πŸ”—](#$api.engine~Engine.Component.MovePath.servedFrom) + +``` +Engine.Component.MovePath.servedFrom: integer +``` + +### Engine.Component.MovePath.servedTo[πŸ”—](#$api.engine~Engine.Component.MovePath.servedTo) + +``` +Engine.Component.MovePath.servedTo: integer +``` + +### Engine.Component.MovePath.occupiedBackIndex[πŸ”—](#$api.engine~Engine.Component.MovePath.occupiedBackIndex) + +``` +Engine.Component.MovePath.occupiedBackIndex: integer +``` + +### Engine.Component.MovePath.occupiedFrontIndex[πŸ”—](#$api.engine~Engine.Component.MovePath.occupiedFrontIndex) + +``` +Engine.Component.MovePath.occupiedFrontIndex: integer +``` + +### Engine.Component.MovePath.dyn[πŸ”—](#$api.engine~Engine.Component.MovePath.dyn) + +``` +Engine.Component.MovePath.dyn: DynState +``` + +the fast-changing component of the position on the path + +### Engine.Component.MovePath.dyn0[πŸ”—](#$api.engine~Engine.Component.MovePath.dyn0) + +``` +Engine.Component.MovePath.dyn0: DynState +``` + +the dyn state at the beginning of the simulation frame (optional) + +### Engine.Component.MovePathAircraft[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft) + +``` +[Expand All] [Collapse All] + +record Engine.Component.MovePathAircraft new: function(): MovePathAircraft + record AircraftState new: function(): AircraftState + record DynState new: function(): DynState + velocity: Vec2f + lastAccel: Vec2f + pitch: number + pitchV: number + roll: number + rollV: number + thrust: number + thrustV: number + elevator: number + aileronLeft: number + propPhase: number + flaps: number + alt: number +end + flightState: FlightState + cruiseAlt: number + waitingDistance: number + waitingPriority: integer + gear: boolean + gearTime: integer + dyn: DynState + dyn0: DynState +end + record ShipState new: function(): ShipState + record DynState new: function(): DynState + lastAccel: number + tractiveEffort: number + tractiveEffortV: number + roll: number + rollV: number + powerOutput: number + approachingStation: boolean + paddlePhase: number + actualPos: PathPosData +end + waitingDist: number + clearToLand: boolean + startPathPosData: PathPosData + targetPathPosData: PathPosData + dyn: DynState + dyn0: DynState +end + record PathState PATH0: PathState + PATH1: PathState + PATH2: PathState +end + path0: Path + path1: {{EdgeGeometry, boolean}} + path2: Path + pathPos: PathPos + pathPos0: PathPos + state: VehicleState + pathState: PathState + speed: number + speed0: number + brakeDecel: number + aircraftState: AircraftState + shipState: ShipState +end +``` + +### Engine.Component.MovePathAircraft.new[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.new) + +``` +function Engine.Component.MovePathAircraft.new(): MovePathAircraft +``` + +**Returns** + +1. `MovePathAircraft` + +### Engine.Component.MovePathAircraft.AircraftState[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState) + +``` +[Expand All] [Collapse All] + +record Engine.Component.MovePathAircraft.AircraftState new: function(): AircraftState + record DynState new: function(): DynState + velocity: Vec2f + lastAccel: Vec2f + pitch: number + pitchV: number + roll: number + rollV: number + thrust: number + thrustV: number + elevator: number + aileronLeft: number + propPhase: number + flaps: number + alt: number +end + flightState: FlightState + cruiseAlt: number + waitingDistance: number + waitingPriority: integer + gear: boolean + gearTime: integer + dyn: DynState + dyn0: DynState +end +``` + +Additional data for aircraft path + +### Engine.Component.MovePathAircraft.AircraftState.new[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.new) + +``` +function Engine.Component.MovePathAircraft.AircraftState.new(): AircraftState +``` + +**Returns** + +1. `AircraftState` + +### Engine.Component.MovePathAircraft.AircraftState.DynState[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState) + +``` +record Engine.Component.MovePathAircraft.AircraftState.DynState new: function(): DynState + velocity: Vec2f + lastAccel: Vec2f + pitch: number + pitchV: number + roll: number + rollV: number + thrust: number + thrustV: number + elevator: number + aileronLeft: number + propPhase: number + flaps: number + alt: number +end +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.new[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.new) + +``` +function Engine.Component.MovePathAircraft.AircraftState.DynState.new(): DynState +``` + +**Returns** + +1. `DynState` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.velocity[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.velocity) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.velocity: Vec2f +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.lastAccel[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.lastAccel) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.lastAccel: Vec2f +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.pitch[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.pitch) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.pitch: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.pitchV[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.pitchV) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.pitchV: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.roll[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.roll) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.roll: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.rollV[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.rollV) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.rollV: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.thrust[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.thrust) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.thrust: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.thrustV[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.thrustV) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.thrustV: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.elevator[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.elevator) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.elevator: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.aileronLeft[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.aileronLeft) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.aileronLeft: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.propPhase[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.propPhase) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.propPhase: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.flaps[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.flaps) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.flaps: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.DynState.alt[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.DynState.alt) + +``` +Engine.Component.MovePathAircraft.AircraftState.DynState.alt: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.flightState[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.flightState) + +``` +Engine.Component.MovePathAircraft.AircraftState.flightState: FlightState +``` + +current flight state of the aircraft + +### Engine.Component.MovePathAircraft.AircraftState.cruiseAlt[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.cruiseAlt) + +``` +Engine.Component.MovePathAircraft.AircraftState.cruiseAlt: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.waitingDistance[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.waitingDistance) + +``` +Engine.Component.MovePathAircraft.AircraftState.waitingDistance: number +``` + +### Engine.Component.MovePathAircraft.AircraftState.waitingPriority[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.waitingPriority) + +``` +Engine.Component.MovePathAircraft.AircraftState.waitingPriority: integer +``` + +### Engine.Component.MovePathAircraft.AircraftState.gear[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.gear) + +``` +Engine.Component.MovePathAircraft.AircraftState.gear: boolean +``` + +### Engine.Component.MovePathAircraft.AircraftState.gearTime[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.gearTime) + +``` +Engine.Component.MovePathAircraft.AircraftState.gearTime: integer +``` + +### Engine.Component.MovePathAircraft.AircraftState.dyn[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.dyn) + +``` +Engine.Component.MovePathAircraft.AircraftState.dyn: DynState +``` + +### Engine.Component.MovePathAircraft.AircraftState.dyn0[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.AircraftState.dyn0) + +``` +Engine.Component.MovePathAircraft.AircraftState.dyn0: DynState +``` + +### Engine.Component.MovePathAircraft.ShipState[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState) + +``` +[Expand All] [Collapse All] + +record Engine.Component.MovePathAircraft.ShipState new: function(): ShipState + record DynState new: function(): DynState + lastAccel: number + tractiveEffort: number + tractiveEffortV: number + roll: number + rollV: number + powerOutput: number + approachingStation: boolean + paddlePhase: number + actualPos: PathPosData +end + waitingDist: number + clearToLand: boolean + startPathPosData: PathPosData + targetPathPosData: PathPosData + dyn: DynState + dyn0: DynState +end +``` + +### Engine.Component.MovePathAircraft.ShipState.new[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.new) + +``` +function Engine.Component.MovePathAircraft.ShipState.new(): ShipState +``` + +**Returns** + +1. `ShipState` + +### Engine.Component.MovePathAircraft.ShipState.DynState[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.DynState) + +``` +record Engine.Component.MovePathAircraft.ShipState.DynState new: function(): DynState + lastAccel: number + tractiveEffort: number + tractiveEffortV: number + roll: number + rollV: number + powerOutput: number + approachingStation: boolean + paddlePhase: number + actualPos: PathPosData +end +``` + +### Engine.Component.MovePathAircraft.ShipState.DynState.new[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.DynState.new) + +``` +function Engine.Component.MovePathAircraft.ShipState.DynState.new(): DynState +``` + +**Returns** + +1. `DynState` + +### Engine.Component.MovePathAircraft.ShipState.DynState.lastAccel[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.DynState.lastAccel) + +``` +Engine.Component.MovePathAircraft.ShipState.DynState.lastAccel: number +``` + +### Engine.Component.MovePathAircraft.ShipState.DynState.tractiveEffort[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.DynState.tractiveEffort) + +``` +Engine.Component.MovePathAircraft.ShipState.DynState.tractiveEffort: number +``` + +### Engine.Component.MovePathAircraft.ShipState.DynState.tractiveEffortV[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.DynState.tractiveEffortV) + +``` +Engine.Component.MovePathAircraft.ShipState.DynState.tractiveEffortV: number +``` + +### Engine.Component.MovePathAircraft.ShipState.DynState.roll[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.DynState.roll) + +``` +Engine.Component.MovePathAircraft.ShipState.DynState.roll: number +``` + +### Engine.Component.MovePathAircraft.ShipState.DynState.rollV[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.DynState.rollV) + +``` +Engine.Component.MovePathAircraft.ShipState.DynState.rollV: number +``` + +### Engine.Component.MovePathAircraft.ShipState.DynState.powerOutput[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.DynState.powerOutput) + +``` +Engine.Component.MovePathAircraft.ShipState.DynState.powerOutput: number +``` + +### Engine.Component.MovePathAircraft.ShipState.DynState.approachingStation[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.DynState.approachingStation) + +``` +Engine.Component.MovePathAircraft.ShipState.DynState.approachingStation: boolean +``` + +### Engine.Component.MovePathAircraft.ShipState.DynState.paddlePhase[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.DynState.paddlePhase) + +``` +Engine.Component.MovePathAircraft.ShipState.DynState.paddlePhase: number +``` + +### Engine.Component.MovePathAircraft.ShipState.DynState.actualPos[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.DynState.actualPos) + +``` +Engine.Component.MovePathAircraft.ShipState.DynState.actualPos: PathPosData +``` + +### Engine.Component.MovePathAircraft.ShipState.waitingDist[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.waitingDist) + +``` +Engine.Component.MovePathAircraft.ShipState.waitingDist: number +``` + +### Engine.Component.MovePathAircraft.ShipState.clearToLand[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.clearToLand) + +``` +Engine.Component.MovePathAircraft.ShipState.clearToLand: boolean +``` + +### Engine.Component.MovePathAircraft.ShipState.startPathPosData[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.startPathPosData) + +``` +Engine.Component.MovePathAircraft.ShipState.startPathPosData: PathPosData +``` + +### Engine.Component.MovePathAircraft.ShipState.targetPathPosData[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.targetPathPosData) + +``` +Engine.Component.MovePathAircraft.ShipState.targetPathPosData: PathPosData +``` + +### Engine.Component.MovePathAircraft.ShipState.dyn[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.dyn) + +``` +Engine.Component.MovePathAircraft.ShipState.dyn: DynState +``` + +### Engine.Component.MovePathAircraft.ShipState.dyn0[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.ShipState.dyn0) + +``` +Engine.Component.MovePathAircraft.ShipState.dyn0: DynState +``` + +### Engine.Component.MovePathAircraft.PathState[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.PathState) + +``` +record Engine.Component.MovePathAircraft.PathState PATH0: PathState + PATH1: PathState + PATH2: PathState +end +``` + +### Engine.Component.MovePathAircraft.PathState.PATH0[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.PathState.PATH0) + +``` +Engine.Component.MovePathAircraft.PathState.PATH0: PathState +``` + +### Engine.Component.MovePathAircraft.PathState.PATH1[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.PathState.PATH1) + +``` +Engine.Component.MovePathAircraft.PathState.PATH1: PathState +``` + +### Engine.Component.MovePathAircraft.PathState.PATH2[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.PathState.PATH2) + +``` +Engine.Component.MovePathAircraft.PathState.PATH2: PathState +``` + +### Engine.Component.MovePathAircraft.path0[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.path0) + +``` +Engine.Component.MovePathAircraft.path0: Path +``` + +### Engine.Component.MovePathAircraft.path1[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.path1) + +``` +Engine.Component.MovePathAircraft.path1: {{EdgeGeometry, boolean}} +``` + +### Engine.Component.MovePathAircraft.path2[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.path2) + +``` +Engine.Component.MovePathAircraft.path2: Path +``` + +### Engine.Component.MovePathAircraft.pathPos[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.pathPos) + +``` +Engine.Component.MovePathAircraft.pathPos: PathPos +``` + +### Engine.Component.MovePathAircraft.pathPos0[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.pathPos0) + +``` +Engine.Component.MovePathAircraft.pathPos0: PathPos +``` + +### Engine.Component.MovePathAircraft.state[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.state) + +``` +Engine.Component.MovePathAircraft.state: VehicleState +``` + +### Engine.Component.MovePathAircraft.pathState[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.pathState) + +``` +Engine.Component.MovePathAircraft.pathState: PathState +``` + +### Engine.Component.MovePathAircraft.speed[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.speed) + +``` +Engine.Component.MovePathAircraft.speed: number +``` + +### Engine.Component.MovePathAircraft.speed0[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.speed0) + +``` +Engine.Component.MovePathAircraft.speed0: number +``` + +### Engine.Component.MovePathAircraft.brakeDecel[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.brakeDecel) + +``` +Engine.Component.MovePathAircraft.brakeDecel: number +``` + +### Engine.Component.MovePathAircraft.aircraftState[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.aircraftState) + +``` +Engine.Component.MovePathAircraft.aircraftState: AircraftState +``` + +### Engine.Component.MovePathAircraft.shipState[πŸ”—](#$api.engine~Engine.Component.MovePathAircraft.shipState) + +``` +Engine.Component.MovePathAircraft.shipState: ShipState +``` + +### Engine.Component.Name[πŸ”—](#$api.engine~Engine.Component.Name) + +``` +record Engine.Component.Name new: function(): Name + name: string +end +``` + +Specifies the name of an entity + +### Engine.Component.Name.new[πŸ”—](#$api.engine~Engine.Component.Name.new) + +``` +function Engine.Component.Name.new(): Name +``` + +**Returns** + +1. `Name` + +### Engine.Component.Name.name[πŸ”—](#$api.engine~Engine.Component.Name.name) + +``` +Engine.Component.Name.name: string +``` + +the name of the entity + +### Engine.Component.Parcel[πŸ”—](#$api.engine~Engine.Component.Parcel) + +``` +[Expand All] [Collapse All] + +record Engine.Component.Parcel new: function(): Parcel + record CollisionType Environment: CollisionType + Parcel: CollisionType +end + record Face new: function(): Face + points: {Vec3f} + collision: {CollisionType : boolean} +end + streetSegment: Engine.Entity + left: boolean + curveParam: number + offset: number + faces: {Face} +end +``` + +A parcel is a region of space near a road where a town building can be built. + +### Engine.Component.Parcel.new[πŸ”—](#$api.engine~Engine.Component.Parcel.new) + +``` +function Engine.Component.Parcel.new(): Parcel +``` + +**Returns** + +1. `Parcel` + +### Engine.Component.Parcel.CollisionType[πŸ”—](#$api.engine~Engine.Component.Parcel.CollisionType) + +``` +record Engine.Component.Parcel.CollisionType Environment: CollisionType + Parcel: CollisionType +end +``` + +### Engine.Component.Parcel.CollisionType.Environment[πŸ”—](#$api.engine~Engine.Component.Parcel.CollisionType.Environment) + +``` +Engine.Component.Parcel.CollisionType.Environment: CollisionType +``` + +### Engine.Component.Parcel.CollisionType.Parcel[πŸ”—](#$api.engine~Engine.Component.Parcel.CollisionType.Parcel) + +``` +Engine.Component.Parcel.CollisionType.Parcel: CollisionType +``` + +### Engine.Component.Parcel.Face[πŸ”—](#$api.engine~Engine.Component.Parcel.Face) + +``` +record Engine.Component.Parcel.Face new: function(): Face + points: {Vec3f} + collision: {CollisionType : boolean} +end +``` + +### Engine.Component.Parcel.Face.new[πŸ”—](#$api.engine~Engine.Component.Parcel.Face.new) + +``` +function Engine.Component.Parcel.Face.new(): Face +``` + +**Returns** + +1. `Face` + +### Engine.Component.Parcel.Face.points[πŸ”—](#$api.engine~Engine.Component.Parcel.Face.points) + +``` +Engine.Component.Parcel.Face.points: {Vec3f} +``` + +### Engine.Component.Parcel.Face.collision[πŸ”—](#$api.engine~Engine.Component.Parcel.Face.collision) + +``` +Engine.Component.Parcel.Face.collision: {CollisionType : boolean} +``` + +### Engine.Component.Parcel.streetSegment[πŸ”—](#$api.engine~Engine.Component.Parcel.streetSegment) + +``` +Engine.Component.Parcel.streetSegment: Engine.Entity +``` + +the street edge to which the parcel belongs + +### Engine.Component.Parcel.left[πŸ”—](#$api.engine~Engine.Component.Parcel.left) + +``` +Engine.Component.Parcel.left: boolean +``` + +### Engine.Component.Parcel.curveParam[πŸ”—](#$api.engine~Engine.Component.Parcel.curveParam) + +``` +Engine.Component.Parcel.curveParam: number +``` + +### Engine.Component.Parcel.offset[πŸ”—](#$api.engine~Engine.Component.Parcel.offset) + +``` +Engine.Component.Parcel.offset: number +``` + +### Engine.Component.Parcel.faces[πŸ”—](#$api.engine~Engine.Component.Parcel.faces) + +``` +Engine.Component.Parcel.faces: {Face} +``` + +### Engine.Component.PersonCapacity[πŸ”—](#$api.engine~Engine.Component.PersonCapacity) + +``` +record Engine.Component.PersonCapacity new: function(): PersonCapacity + type: LandUseType + capacity: integer + personNodes: {NodeId} + vehicleNodes: {NodeId} +end +``` + +Contains information about a workplace of household. + +### Engine.Component.PersonCapacity.new[πŸ”—](#$api.engine~Engine.Component.PersonCapacity.new) + +``` +function Engine.Component.PersonCapacity.new(): PersonCapacity +``` + +**Returns** + +1. `PersonCapacity` + +### Engine.Component.PersonCapacity.type[πŸ”—](#$api.engine~Engine.Component.PersonCapacity.type) + +``` +Engine.Component.PersonCapacity.type: LandUseType +``` + +the type of capacity (1 = residential, 2 = commercial, 3 = industrial) + +### Engine.Component.PersonCapacity.capacity[πŸ”—](#$api.engine~Engine.Component.PersonCapacity.capacity) + +``` +Engine.Component.PersonCapacity.capacity: integer +``` + +total capacity (tenants or workers) of the Entity + +### Engine.Component.PersonCapacity.personNodes[πŸ”—](#$api.engine~Engine.Component.PersonCapacity.personNodes) + +``` +Engine.Component.PersonCapacity.personNodes: {NodeId} +``` + +### Engine.Component.PersonCapacity.vehicleNodes[πŸ”—](#$api.engine~Engine.Component.PersonCapacity.vehicleNodes) + +``` +Engine.Component.PersonCapacity.vehicleNodes: {NodeId} +``` + +### Engine.Component.Player[πŸ”—](#$api.engine~Engine.Component.Player) + +``` +record Engine.Component.Player new: function(): Player + headquarters: Engine.Entity +end +``` + +Represent a player + +### Engine.Component.Player.new[πŸ”—](#$api.engine~Engine.Component.Player.new) + +``` +function Engine.Component.Player.new(): Player +``` + +**Returns** + +1. `Player` + +### Engine.Component.Player.headquarters[πŸ”—](#$api.engine~Engine.Component.Player.headquarters) + +``` +Engine.Component.Player.headquarters: Engine.Entity +``` + +the current headquarters construction + +### Engine.Component.PlayerOwned[πŸ”—](#$api.engine~Engine.Component.PlayerOwned) + +``` +record Engine.Component.PlayerOwned new: function(): PlayerOwned + player: Engine.Entity +end +``` + +An entity with player owner is property of the owner and can be bulldozed only by him. + +### Engine.Component.PlayerOwned.new[πŸ”—](#$api.engine~Engine.Component.PlayerOwned.new) + +``` +function Engine.Component.PlayerOwned.new(): PlayerOwned +``` + +**Returns** + +1. `PlayerOwned` + +### Engine.Component.PlayerOwned.player[πŸ”—](#$api.engine~Engine.Component.PlayerOwned.player) + +``` +Engine.Component.PlayerOwned.player: Engine.Entity +``` + +the owner of the entity + +### Engine.Component.RailroadCrossing[πŸ”—](#$api.engine~Engine.Component.RailroadCrossing) + +``` +[Expand All] [Collapse All] + +record Engine.Component.RailroadCrossing new: function(): RailroadCrossing + record State OPEN: State + CLOSED: State + WAITING: State +end + nodes: {Engine.Entity} + edges: {Engine.Entity} + typeIndex: integer + state: State + stateTime: integer +end +``` + +A railroad crossing + +### Engine.Component.RailroadCrossing.new[πŸ”—](#$api.engine~Engine.Component.RailroadCrossing.new) + +``` +function Engine.Component.RailroadCrossing.new(): RailroadCrossing +``` + +**Returns** + +1. `RailroadCrossing` + +### Engine.Component.RailroadCrossing.State[πŸ”—](#$api.engine~Engine.Component.RailroadCrossing.State) + +``` +record Engine.Component.RailroadCrossing.State OPEN: State + CLOSED: State + WAITING: State +end +``` + +Animation state of a railroad crossing + +### Engine.Component.RailroadCrossing.State.OPEN[πŸ”—](#$api.engine~Engine.Component.RailroadCrossing.State.OPEN) + +``` +Engine.Component.RailroadCrossing.State.OPEN: State +``` + +### Engine.Component.RailroadCrossing.State.CLOSED[πŸ”—](#$api.engine~Engine.Component.RailroadCrossing.State.CLOSED) + +``` +Engine.Component.RailroadCrossing.State.CLOSED: State +``` + +### Engine.Component.RailroadCrossing.State.WAITING[πŸ”—](#$api.engine~Engine.Component.RailroadCrossing.State.WAITING) + +``` +Engine.Component.RailroadCrossing.State.WAITING: State +``` + +### Engine.Component.RailroadCrossing.nodes[πŸ”—](#$api.engine~Engine.Component.RailroadCrossing.nodes) + +``` +Engine.Component.RailroadCrossing.nodes: {Engine.Entity} +``` + +nodes belonging to the railroad crossing + +### Engine.Component.RailroadCrossing.edges[πŸ”—](#$api.engine~Engine.Component.RailroadCrossing.edges) + +``` +Engine.Component.RailroadCrossing.edges: {Engine.Entity} +``` + +edges belonging to the railroad crossing + +### Engine.Component.RailroadCrossing.typeIndex[πŸ”—](#$api.engine~Engine.Component.RailroadCrossing.typeIndex) + +``` +Engine.Component.RailroadCrossing.typeIndex: integer +``` + +the type of crossing, as an index in api.res.railroadCrossingTypeRep. + +### Engine.Component.RailroadCrossing.state[πŸ”—](#$api.engine~Engine.Component.RailroadCrossing.state) + +``` +Engine.Component.RailroadCrossing.state: State +``` + +the current animation + +### Engine.Component.RailroadCrossing.stateTime[πŸ”—](#$api.engine~Engine.Component.RailroadCrossing.stateTime) + +``` +Engine.Component.RailroadCrossing.stateTime: integer +``` + +the animation timer + +### Engine.Component.RunwayList[πŸ”—](#$api.engine~Engine.Component.RunwayList) + +``` +record Engine.Component.RunwayList new: function(): RunwayList + runways: {Runway} +end +``` + +All runways for the entity transport network. + +### Engine.Component.RunwayList.new[πŸ”—](#$api.engine~Engine.Component.RunwayList.new) + +``` +function Engine.Component.RunwayList.new(): RunwayList +``` + +**Returns** + +1. `RunwayList` + +### Engine.Component.RunwayList.runways[πŸ”—](#$api.engine~Engine.Component.RunwayList.runways) + +``` +Engine.Component.RunwayList.runways: {Runway} +``` + +### Engine.Component.Scaffold[πŸ”—](#$api.engine~Engine.Component.Scaffold) + +``` +[Expand All] [Collapse All] + +record Engine.Component.Scaffold new: function(): Scaffold + record Type NEW: Type + UPGRADE: Type + DOWNGRADE: Type +end + type: Type + oldModelId: integer + oldTransf: Mat4f + oldBuildingFace: {{Vec2f}} + oldFloorLevel: {{number}} + oldHeight: number + buildingFace: {{Vec2f}} + floorLevel: {{number}} + height: number + constructionStartTime: integer + constructionEndTime: integer + cranePosition: Vec2f + craneAngle: number + craneTerrainHeight: number + craneAngleSpan: {number} +end +``` + +### Engine.Component.Scaffold.new[πŸ”—](#$api.engine~Engine.Component.Scaffold.new) + +``` +function Engine.Component.Scaffold.new(): Scaffold +``` + +**Returns** + +1. `Scaffold` + +### Engine.Component.Scaffold.Type[πŸ”—](#$api.engine~Engine.Component.Scaffold.Type) + +``` +record Engine.Component.Scaffold.Type NEW: Type + UPGRADE: Type + DOWNGRADE: Type +end +``` + +### Engine.Component.Scaffold.Type.NEW[πŸ”—](#$api.engine~Engine.Component.Scaffold.Type.NEW) + +``` +Engine.Component.Scaffold.Type.NEW: Type +``` + +### Engine.Component.Scaffold.Type.UPGRADE[πŸ”—](#$api.engine~Engine.Component.Scaffold.Type.UPGRADE) + +``` +Engine.Component.Scaffold.Type.UPGRADE: Type +``` + +### Engine.Component.Scaffold.Type.DOWNGRADE[πŸ”—](#$api.engine~Engine.Component.Scaffold.Type.DOWNGRADE) + +``` +Engine.Component.Scaffold.Type.DOWNGRADE: Type +``` + +### Engine.Component.Scaffold.type[πŸ”—](#$api.engine~Engine.Component.Scaffold.type) + +``` +Engine.Component.Scaffold.type: Type +``` + +### Engine.Component.Scaffold.oldModelId[πŸ”—](#$api.engine~Engine.Component.Scaffold.oldModelId) + +``` +Engine.Component.Scaffold.oldModelId: integer +``` + +### Engine.Component.Scaffold.oldTransf[πŸ”—](#$api.engine~Engine.Component.Scaffold.oldTransf) + +``` +Engine.Component.Scaffold.oldTransf: Mat4f +``` + +### Engine.Component.Scaffold.oldBuildingFace[πŸ”—](#$api.engine~Engine.Component.Scaffold.oldBuildingFace) + +``` +Engine.Component.Scaffold.oldBuildingFace: {{Vec2f}} +``` + +### Engine.Component.Scaffold.oldFloorLevel[πŸ”—](#$api.engine~Engine.Component.Scaffold.oldFloorLevel) + +``` +Engine.Component.Scaffold.oldFloorLevel: {{number}} +``` + +### Engine.Component.Scaffold.oldHeight[πŸ”—](#$api.engine~Engine.Component.Scaffold.oldHeight) + +``` +Engine.Component.Scaffold.oldHeight: number +``` + +### Engine.Component.Scaffold.buildingFace[πŸ”—](#$api.engine~Engine.Component.Scaffold.buildingFace) + +``` +Engine.Component.Scaffold.buildingFace: {{Vec2f}} +``` + +### Engine.Component.Scaffold.floorLevel[πŸ”—](#$api.engine~Engine.Component.Scaffold.floorLevel) + +``` +Engine.Component.Scaffold.floorLevel: {{number}} +``` + +### Engine.Component.Scaffold.height[πŸ”—](#$api.engine~Engine.Component.Scaffold.height) + +``` +Engine.Component.Scaffold.height: number +``` + +### Engine.Component.Scaffold.constructionStartTime[πŸ”—](#$api.engine~Engine.Component.Scaffold.constructionStartTime) + +``` +Engine.Component.Scaffold.constructionStartTime: integer +``` + +### Engine.Component.Scaffold.constructionEndTime[πŸ”—](#$api.engine~Engine.Component.Scaffold.constructionEndTime) + +``` +Engine.Component.Scaffold.constructionEndTime: integer +``` + +### Engine.Component.Scaffold.cranePosition[πŸ”—](#$api.engine~Engine.Component.Scaffold.cranePosition) + +``` +Engine.Component.Scaffold.cranePosition: Vec2f +``` + +### Engine.Component.Scaffold.craneAngle[πŸ”—](#$api.engine~Engine.Component.Scaffold.craneAngle) + +``` +Engine.Component.Scaffold.craneAngle: number +``` + +### Engine.Component.Scaffold.craneTerrainHeight[πŸ”—](#$api.engine~Engine.Component.Scaffold.craneTerrainHeight) + +``` +Engine.Component.Scaffold.craneTerrainHeight: number +``` + +### Engine.Component.Scaffold.craneAngleSpan[πŸ”—](#$api.engine~Engine.Component.Scaffold.craneAngleSpan) + +``` +Engine.Component.Scaffold.craneAngleSpan: {number} +``` + +### Engine.Component.ShapeList[πŸ”—](#$api.engine~Engine.Component.ShapeList) + +``` +record Engine.Component.ShapeList new: function(): ShapeList + shapes: {Shape} +end +``` + +Contains a list procedurally generated shapes. + +### Engine.Component.ShapeList.new[πŸ”—](#$api.engine~Engine.Component.ShapeList.new) + +``` +function Engine.Component.ShapeList.new(): ShapeList +``` + +**Returns** + +1. `ShapeList` + +### Engine.Component.ShapeList.shapes[πŸ”—](#$api.engine~Engine.Component.ShapeList.shapes) + +``` +Engine.Component.ShapeList.shapes: {Shape} +``` + +a list of shapes + +### Engine.Component.Ship[πŸ”—](#$api.engine~Engine.Component.Ship) + +``` +record Engine.Component.Ship new: function(): Ship + pathIndex: integer + reservedFrom: integer + reservedTo: integer +end +``` + +Contains information about pathing and extra data of ships. + +### Engine.Component.Ship.new[πŸ”—](#$api.engine~Engine.Component.Ship.new) + +``` +function Engine.Component.Ship.new(): Ship +``` + +**Returns** + +1. `Ship` + +### Engine.Component.Ship.pathIndex[πŸ”—](#$api.engine~Engine.Component.Ship.pathIndex) + +``` +Engine.Component.Ship.pathIndex: integer +``` + +the current position on the path + +### Engine.Component.Ship.reservedFrom[πŸ”—](#$api.engine~Engine.Component.Ship.reservedFrom) + +``` +Engine.Component.Ship.reservedFrom: integer +``` + +the starting edge reserved by the ship + +### Engine.Component.Ship.reservedTo[πŸ”—](#$api.engine~Engine.Component.Ship.reservedTo) + +``` +Engine.Component.Ship.reservedTo: integer +``` + +the ending edge reserved by the ship + +### Engine.Component.SignalList[πŸ”—](#$api.engine~Engine.Component.SignalList) + +``` +record Engine.Component.SignalList new: function(): SignalList + signals: {Signal} +end +``` + +Contains a list of signals for the entity. + +### Engine.Component.SignalList.new[πŸ”—](#$api.engine~Engine.Component.SignalList.new) + +``` +function Engine.Component.SignalList.new(): SignalList +``` + +**Returns** + +1. `SignalList` + +### Engine.Component.SignalList.signals[πŸ”—](#$api.engine~Engine.Component.SignalList.signals) + +``` +Engine.Component.SignalList.signals: {Signal} +``` + +a list of signals + +### Engine.Component.SimCargo[πŸ”—](#$api.engine~Engine.Component.SimCargo) + +``` +[Expand All] [Collapse All] + +record Engine.Component.SimCargo record PickupPoint new: function(): PickupPoint + vehicle: Engine.Entity + line: Engine.Entity + position: Vec3f + carrier: Carrier +end + new: function(): SimCargo + cargoType: CargoTypeId + targetOrPickupEntity: Engine.Entity + sourceEntity: Engine.Entity + pickupPoints: {PickupPoint} + speed: number + startTime: integer + pickupTime: integer + deliveryExtensionDuration: integer +end +``` + +Additional data for cargo. + +### Engine.Component.SimCargo.PickupPoint[πŸ”—](#$api.engine~Engine.Component.SimCargo.PickupPoint) + +``` +record Engine.Component.SimCargo.PickupPoint new: function(): PickupPoint + vehicle: Engine.Entity + line: Engine.Entity + position: Vec3f + carrier: Carrier +end +``` + +Historic transport data for cargo items. + +### Engine.Component.SimCargo.PickupPoint.new[πŸ”—](#$api.engine~Engine.Component.SimCargo.PickupPoint.new) + +``` +function Engine.Component.SimCargo.PickupPoint.new(): PickupPoint +``` + +**Returns** + +1. `PickupPoint` + +### Engine.Component.SimCargo.PickupPoint.vehicle[πŸ”—](#$api.engine~Engine.Component.SimCargo.PickupPoint.vehicle) + +``` +Engine.Component.SimCargo.PickupPoint.vehicle: Engine.Entity +``` + +the vehicle the cargo item was transported with + +### Engine.Component.SimCargo.PickupPoint.line[πŸ”—](#$api.engine~Engine.Component.SimCargo.PickupPoint.line) + +``` +Engine.Component.SimCargo.PickupPoint.line: Engine.Entity +``` + +the line the cargo item was transported on + +### Engine.Component.SimCargo.PickupPoint.position[πŸ”—](#$api.engine~Engine.Component.SimCargo.PickupPoint.position) + +``` +Engine.Component.SimCargo.PickupPoint.position: Vec3f +``` + +the position of the cargo item on the vehicle + +### Engine.Component.SimCargo.PickupPoint.carrier[πŸ”—](#$api.engine~Engine.Component.SimCargo.PickupPoint.carrier) + +``` +Engine.Component.SimCargo.PickupPoint.carrier: Carrier +``` + +the transport method used to transport the cargo item + +### Engine.Component.SimCargo.new[πŸ”—](#$api.engine~Engine.Component.SimCargo.new) + +``` +function Engine.Component.SimCargo.new(): SimCargo +``` + +**Returns** + +1. `SimCargo` + +### Engine.Component.SimCargo.cargoType[πŸ”—](#$api.engine~Engine.Component.SimCargo.cargoType) + +``` +Engine.Component.SimCargo.cargoType: CargoTypeId +``` + +The cargo type of the cargo (never 0) + +### Engine.Component.SimCargo.targetOrPickupEntity[πŸ”—](#$api.engine~Engine.Component.SimCargo.targetOrPickupEntity) + +``` +Engine.Component.SimCargo.targetOrPickupEntity: Engine.Entity +``` + +the entity of the target where the cargo item heads to + +### Engine.Component.SimCargo.sourceEntity[πŸ”—](#$api.engine~Engine.Component.SimCargo.sourceEntity) + +``` +Engine.Component.SimCargo.sourceEntity: Engine.Entity +``` + +the entity of the source where the cargo item came from + +### Engine.Component.SimCargo.pickupPoints[πŸ”—](#$api.engine~Engine.Component.SimCargo.pickupPoints) + +``` +Engine.Component.SimCargo.pickupPoints: {PickupPoint} +``` + +### Engine.Component.SimCargo.speed[πŸ”—](#$api.engine~Engine.Component.SimCargo.speed) + +``` +Engine.Component.SimCargo.speed: number +``` + +### Engine.Component.SimCargo.startTime[πŸ”—](#$api.engine~Engine.Component.SimCargo.startTime) + +``` +Engine.Component.SimCargo.startTime: integer +``` + +the timestamp when the cargo item was produced + +### Engine.Component.SimCargo.pickupTime[πŸ”—](#$api.engine~Engine.Component.SimCargo.pickupTime) + +``` +Engine.Component.SimCargo.pickupTime: integer +``` + +the timestamp when the cargo item was picked up + +### Engine.Component.SimCargo.deliveryExtensionDuration[πŸ”—](#$api.engine~Engine.Component.SimCargo.deliveryExtensionDuration) + +``` +Engine.Component.SimCargo.deliveryExtensionDuration: integer +``` + +the duration of extra time to deliver the cargo + +### Engine.Component.SimEntityAtBuilding[πŸ”—](#$api.engine~Engine.Component.SimEntityAtBuilding) + +``` +record Engine.Component.SimEntityAtBuilding new: function(): SimEntityAtBuilding + waitingTime: number +end +``` + +Additional data for entities waiting at buildings. + +### Engine.Component.SimEntityAtBuilding.new[πŸ”—](#$api.engine~Engine.Component.SimEntityAtBuilding.new) + +``` +function Engine.Component.SimEntityAtBuilding.new(): SimEntityAtBuilding +``` + +**Returns** + +1. `SimEntityAtBuilding` + +### Engine.Component.SimEntityAtBuilding.waitingTime[πŸ”—](#$api.engine~Engine.Component.SimEntityAtBuilding.waitingTime) + +``` +Engine.Component.SimEntityAtBuilding.waitingTime: number +``` + +How long the entity has been waiting + +### Engine.Component.SimEntityAtStock[πŸ”—](#$api.engine~Engine.Component.SimEntityAtStock) + +``` +record Engine.Component.SimEntityAtStock new: function(): SimEntityAtStock + stock: {Engine.Entity, StockId} + arrivalTime: integer +end +``` + +Additional data for entities waiting at industries. + +### Engine.Component.SimEntityAtStock.new[πŸ”—](#$api.engine~Engine.Component.SimEntityAtStock.new) + +``` +function Engine.Component.SimEntityAtStock.new(): SimEntityAtStock +``` + +**Returns** + +1. `SimEntityAtStock` + +### Engine.Component.SimEntityAtStock.stock[πŸ”—](#$api.engine~Engine.Component.SimEntityAtStock.stock) + +``` +Engine.Component.SimEntityAtStock.stock: {Engine.Entity, StockId} +``` + +The industry the entity is waiting at + +### Engine.Component.SimEntityAtStock.arrivalTime[πŸ”—](#$api.engine~Engine.Component.SimEntityAtStock.arrivalTime) + +``` +Engine.Component.SimEntityAtStock.arrivalTime: integer +``` + +the timestamp when the item arrived at the industry + +### Engine.Component.SimEntityAtTerminal[πŸ”—](#$api.engine~Engine.Component.SimEntityAtTerminal) + +``` +record Engine.Component.SimEntityAtTerminal new: function(): SimEntityAtTerminal + line: Engine.Entity + lineStop0: integer + lineStop1: integer + arrivalTime: number + vehicle: Engine.Entity +end +``` + +Additional data for entities waiting at terminals. + +### Engine.Component.SimEntityAtTerminal.new[πŸ”—](#$api.engine~Engine.Component.SimEntityAtTerminal.new) + +``` +function Engine.Component.SimEntityAtTerminal.new(): SimEntityAtTerminal +``` + +**Returns** + +1. `SimEntityAtTerminal` + +### Engine.Component.SimEntityAtTerminal.line[πŸ”—](#$api.engine~Engine.Component.SimEntityAtTerminal.line) + +``` +Engine.Component.SimEntityAtTerminal.line: Engine.Entity +``` + +The line the entity is waiting for + +### Engine.Component.SimEntityAtTerminal.lineStop0[πŸ”—](#$api.engine~Engine.Component.SimEntityAtTerminal.lineStop0) + +``` +Engine.Component.SimEntityAtTerminal.lineStop0: integer +``` + +The stop the entity is waiting at + +### Engine.Component.SimEntityAtTerminal.lineStop1[πŸ”—](#$api.engine~Engine.Component.SimEntityAtTerminal.lineStop1) + +``` +Engine.Component.SimEntityAtTerminal.lineStop1: integer +``` + +The stop the entity will get off the vehicle + +### Engine.Component.SimEntityAtTerminal.arrivalTime[πŸ”—](#$api.engine~Engine.Component.SimEntityAtTerminal.arrivalTime) + +``` +Engine.Component.SimEntityAtTerminal.arrivalTime: number +``` + +the timestamp when the item arrived at the station terminal + +### Engine.Component.SimEntityAtTerminal.vehicle[πŸ”—](#$api.engine~Engine.Component.SimEntityAtTerminal.vehicle) + +``` +Engine.Component.SimEntityAtTerminal.vehicle: Engine.Entity +``` + +the vehicle the entity is currently waiting for + +### Engine.Component.SimEntityAtVehicle[πŸ”—](#$api.engine~Engine.Component.SimEntityAtVehicle) + +``` +record Engine.Component.SimEntityAtVehicle new: function(): SimEntityAtVehicle + line: Engine.Entity + lineStop0: integer + lineStop1: integer + vehicle: Engine.Entity + roundTripCounter: integer +end +``` + +Additional data for entities travelling on a vehicle. + +### Engine.Component.SimEntityAtVehicle.new[πŸ”—](#$api.engine~Engine.Component.SimEntityAtVehicle.new) + +``` +function Engine.Component.SimEntityAtVehicle.new(): SimEntityAtVehicle +``` + +**Returns** + +1. `SimEntityAtVehicle` + +### Engine.Component.SimEntityAtVehicle.line[πŸ”—](#$api.engine~Engine.Component.SimEntityAtVehicle.line) + +``` +Engine.Component.SimEntityAtVehicle.line: Engine.Entity +``` + +The line the entity is currently using + +### Engine.Component.SimEntityAtVehicle.lineStop0[πŸ”—](#$api.engine~Engine.Component.SimEntityAtVehicle.lineStop0) + +``` +Engine.Component.SimEntityAtVehicle.lineStop0: integer +``` + +The stop the entity waited at + +### Engine.Component.SimEntityAtVehicle.lineStop1[πŸ”—](#$api.engine~Engine.Component.SimEntityAtVehicle.lineStop1) + +``` +Engine.Component.SimEntityAtVehicle.lineStop1: integer +``` + +The stop the entity will get off the vehicle + +### Engine.Component.SimEntityAtVehicle.vehicle[πŸ”—](#$api.engine~Engine.Component.SimEntityAtVehicle.vehicle) + +``` +Engine.Component.SimEntityAtVehicle.vehicle: Engine.Entity +``` + +the vehicle the entity is currently in + +### Engine.Component.SimEntityAtVehicle.roundTripCounter[πŸ”—](#$api.engine~Engine.Component.SimEntityAtVehicle.roundTripCounter) + +``` +Engine.Component.SimEntityAtVehicle.roundTripCounter: integer +``` + +how often the entity reached the stock again where it was by the vehicle loaded + +### Engine.Component.SimEntityIdle[πŸ”—](#$api.engine~Engine.Component.SimEntityIdle) + +``` +record Engine.Component.SimEntityIdle new: function(): SimEntityIdle +end +``` + +Additional data for entities that are idle. + +### Engine.Component.SimEntityIdle.new[πŸ”—](#$api.engine~Engine.Component.SimEntityIdle.new) + +``` +function Engine.Component.SimEntityIdle.new(): SimEntityIdle +``` + +**Returns** + +1. `SimEntityIdle` + +### Engine.Component.SimEntityNeedsPath[πŸ”—](#$api.engine~Engine.Component.SimEntityNeedsPath) + +``` +record Engine.Component.SimEntityNeedsPath new: function(): SimEntityNeedsPath + input: PathFactoryInput + output: PathFactoryOutput +end +``` + +Additional data for entities that need path calculation. + +### Engine.Component.SimEntityNeedsPath.new[πŸ”—](#$api.engine~Engine.Component.SimEntityNeedsPath.new) + +``` +function Engine.Component.SimEntityNeedsPath.new(): SimEntityNeedsPath +``` + +**Returns** + +1. `SimEntityNeedsPath` + +### Engine.Component.SimEntityNeedsPath.input[πŸ”—](#$api.engine~Engine.Component.SimEntityNeedsPath.input) + +``` +Engine.Component.SimEntityNeedsPath.input: PathFactoryInput +``` + +### Engine.Component.SimEntityNeedsPath.output[πŸ”—](#$api.engine~Engine.Component.SimEntityNeedsPath.output) + +``` +Engine.Component.SimEntityNeedsPath.output: PathFactoryOutput +``` + +### Engine.Component.SimEntityMoving[πŸ”—](#$api.engine~Engine.Component.SimEntityMoving) + +``` +record Engine.Component.SimEntityMoving new: function(): SimEntityMoving + line: Engine.Entity + lineStop0: integer + lineStop1: integer + partialPath: boolean + expectedArrivalTime: number +end +``` + +Additional data for entities that are moving. + +### Engine.Component.SimEntityMoving.new[πŸ”—](#$api.engine~Engine.Component.SimEntityMoving.new) + +``` +function Engine.Component.SimEntityMoving.new(): SimEntityMoving +``` + +**Returns** + +1. `SimEntityMoving` + +### Engine.Component.SimEntityMoving.line[πŸ”—](#$api.engine~Engine.Component.SimEntityMoving.line) + +``` +Engine.Component.SimEntityMoving.line: Engine.Entity +``` + +The line the entity is currently using + +### Engine.Component.SimEntityMoving.lineStop0[πŸ”—](#$api.engine~Engine.Component.SimEntityMoving.lineStop0) + +``` +Engine.Component.SimEntityMoving.lineStop0: integer +``` + +The stop the entity waited at + +### Engine.Component.SimEntityMoving.lineStop1[πŸ”—](#$api.engine~Engine.Component.SimEntityMoving.lineStop1) + +``` +Engine.Component.SimEntityMoving.lineStop1: integer +``` + +### Engine.Component.SimEntityMoving.partialPath[πŸ”—](#$api.engine~Engine.Component.SimEntityMoving.partialPath) + +``` +Engine.Component.SimEntityMoving.partialPath: boolean +``` + +true if the path complete until the destination + +### Engine.Component.SimEntityMoving.expectedArrivalTime[πŸ”—](#$api.engine~Engine.Component.SimEntityMoving.expectedArrivalTime) + +``` +Engine.Component.SimEntityMoving.expectedArrivalTime: number +``` + +### Engine.Component.SimPersonAtTerminal[πŸ”—](#$api.engine~Engine.Component.SimPersonAtTerminal) + +``` +record Engine.Component.SimPersonAtTerminal new: function(): SimPersonAtTerminal + edgeId: EdgeId + place: integer +end +``` + +Additional data for a person waiting at the terminal + +### Engine.Component.SimPersonAtTerminal.new[πŸ”—](#$api.engine~Engine.Component.SimPersonAtTerminal.new) + +``` +function Engine.Component.SimPersonAtTerminal.new(): SimPersonAtTerminal +``` + +**Returns** + +1. `SimPersonAtTerminal` + +### Engine.Component.SimPersonAtTerminal.edgeId[πŸ”—](#$api.engine~Engine.Component.SimPersonAtTerminal.edgeId) + +``` +Engine.Component.SimPersonAtTerminal.edgeId: EdgeId +``` + +the edge of the transport network the entity is waiting at + +### Engine.Component.SimPersonAtTerminal.place[πŸ”—](#$api.engine~Engine.Component.SimPersonAtTerminal.place) + +``` +Engine.Component.SimPersonAtTerminal.place: integer +``` + +the place on the edge + +### Engine.Component.SimPersonAtVehicle[πŸ”—](#$api.engine~Engine.Component.SimPersonAtVehicle) + +``` +record Engine.Component.SimPersonAtVehicle new: function(): SimPersonAtVehicle + vehicle: Engine.Entity + part: integer + place: integer + expectedArrivalTime: number +end +``` + +Additional data for a person travelling on a vehicle + +### Engine.Component.SimPersonAtVehicle.new[πŸ”—](#$api.engine~Engine.Component.SimPersonAtVehicle.new) + +``` +function Engine.Component.SimPersonAtVehicle.new(): SimPersonAtVehicle +``` + +**Returns** + +1. `SimPersonAtVehicle` + +### Engine.Component.SimPersonAtVehicle.vehicle[πŸ”—](#$api.engine~Engine.Component.SimPersonAtVehicle.vehicle) + +``` +Engine.Component.SimPersonAtVehicle.vehicle: Engine.Entity +``` + +the vehicle the entity is using + +### Engine.Component.SimPersonAtVehicle.part[πŸ”—](#$api.engine~Engine.Component.SimPersonAtVehicle.part) + +``` +Engine.Component.SimPersonAtVehicle.part: integer +``` + +the vehicle part (carriage) the entity is using + +### Engine.Component.SimPersonAtVehicle.place[πŸ”—](#$api.engine~Engine.Component.SimPersonAtVehicle.place) + +``` +Engine.Component.SimPersonAtVehicle.place: integer +``` + +the place (seat) in the vehicle + +### Engine.Component.SimPersonAtVehicle.expectedArrivalTime[πŸ”—](#$api.engine~Engine.Component.SimPersonAtVehicle.expectedArrivalTime) + +``` +Engine.Component.SimPersonAtVehicle.expectedArrivalTime: number +``` + +### Engine.Component.SimPerson[πŸ”—](#$api.engine~Engine.Component.SimPerson) + +``` +record Engine.Component.SimPerson new: function(): SimPerson + cargoType: CargoTypeId + destinations: {Engine.Entity} + moveModes: {MoveMode} + travelTimes: {number} + targetOrAtEntity: Engine.Entity + lastNonResType: LandUseType + lastMoveMode: MoveMode + walkSpeed: number + modelIdPerson: integer + colorConfigPerson: integer + modelIdCar: integer + colorConfigCar: integer + lastDestinationUpdate: integer + landUse2ReachableWalkDrive: {integer, integer} + landUse2ReachableLines: {integer, integer} + pickupTime: integer + happiness: number +end +``` + +Additional data for persons. + +### Engine.Component.SimPerson.new[πŸ”—](#$api.engine~Engine.Component.SimPerson.new) + +``` +function Engine.Component.SimPerson.new(): SimPerson +``` + +**Returns** + +1. `SimPerson` + +### Engine.Component.SimPerson.cargoType[πŸ”—](#$api.engine~Engine.Component.SimPerson.cargoType) + +``` +Engine.Component.SimPerson.cargoType: CargoTypeId +``` + +the cargo type of the person (always 0) + +### Engine.Component.SimPerson.destinations[πŸ”—](#$api.engine~Engine.Component.SimPerson.destinations) + +``` +Engine.Component.SimPerson.destinations: {Engine.Entity} +``` + +the destinations for residence, shopping and work + +### Engine.Component.SimPerson.moveModes[πŸ”—](#$api.engine~Engine.Component.SimPerson.moveModes) + +``` +Engine.Component.SimPerson.moveModes: {MoveMode} +``` + +### Engine.Component.SimPerson.travelTimes[πŸ”—](#$api.engine~Engine.Component.SimPerson.travelTimes) + +``` +Engine.Component.SimPerson.travelTimes: {number} +``` + +### Engine.Component.SimPerson.targetOrAtEntity[πŸ”—](#$api.engine~Engine.Component.SimPerson.targetOrAtEntity) + +``` +Engine.Component.SimPerson.targetOrAtEntity: Engine.Entity +``` + +the entity where the person is or where the person heads to + +### Engine.Component.SimPerson.lastNonResType[πŸ”—](#$api.engine~Engine.Component.SimPerson.lastNonResType) + +``` +Engine.Component.SimPerson.lastNonResType: LandUseType +``` + +### Engine.Component.SimPerson.lastMoveMode[πŸ”—](#$api.engine~Engine.Component.SimPerson.lastMoveMode) + +``` +Engine.Component.SimPerson.lastMoveMode: MoveMode +``` + +the last used move mode + +### Engine.Component.SimPerson.walkSpeed[πŸ”—](#$api.engine~Engine.Component.SimPerson.walkSpeed) + +``` +Engine.Component.SimPerson.walkSpeed: number +``` + +### Engine.Component.SimPerson.modelIdPerson[πŸ”—](#$api.engine~Engine.Component.SimPerson.modelIdPerson) + +``` +Engine.Component.SimPerson.modelIdPerson: integer +``` + +the model that is used for the person + +### Engine.Component.SimPerson.colorConfigPerson[πŸ”—](#$api.engine~Engine.Component.SimPerson.colorConfigPerson) + +``` +Engine.Component.SimPerson.colorConfigPerson: integer +``` + +the color config for the clothes of the person + +### Engine.Component.SimPerson.modelIdCar[πŸ”—](#$api.engine~Engine.Component.SimPerson.modelIdCar) + +``` +Engine.Component.SimPerson.modelIdCar: integer +``` + +the model that is used as a car + +### Engine.Component.SimPerson.colorConfigCar[πŸ”—](#$api.engine~Engine.Component.SimPerson.colorConfigCar) + +``` +Engine.Component.SimPerson.colorConfigCar: integer +``` + +the color config for the car + +### Engine.Component.SimPerson.lastDestinationUpdate[πŸ”—](#$api.engine~Engine.Component.SimPerson.lastDestinationUpdate) + +``` +Engine.Component.SimPerson.lastDestinationUpdate: integer +``` + +the timestamp of the latest destination recalculation + +### Engine.Component.SimPerson.landUse2ReachableWalkDrive[πŸ”—](#$api.engine~Engine.Component.SimPerson.landUse2ReachableWalkDrive) + +``` +Engine.Component.SimPerson.landUse2ReachableWalkDrive: {integer, integer} +``` + +### Engine.Component.SimPerson.landUse2ReachableLines[πŸ”—](#$api.engine~Engine.Component.SimPerson.landUse2ReachableLines) + +``` +Engine.Component.SimPerson.landUse2ReachableLines: {integer, integer} +``` + +### Engine.Component.SimPerson.pickupTime[πŸ”—](#$api.engine~Engine.Component.SimPerson.pickupTime) + +``` +Engine.Component.SimPerson.pickupTime: integer +``` + +### Engine.Component.SimPerson.happiness[πŸ”—](#$api.engine~Engine.Component.SimPerson.happiness) + +``` +Engine.Component.SimPerson.happiness: number +``` + +### Engine.Component.Station[πŸ”—](#$api.engine~Engine.Component.Station) + +``` +type Engine.Component.Station = Station +``` + +Defines a station, i.e. a group of terminals (places where a vehicle stops and loads cargo) + +### Engine.Component.StationGroup[πŸ”—](#$api.engine~Engine.Component.StationGroup) + +``` +record Engine.Component.StationGroup new: function(): StationGroup + stations: {Engine.Entity} +end +``` + +Defines a group of stations, can group together stations with very different transport modes + +### Engine.Component.StationGroup.new[πŸ”—](#$api.engine~Engine.Component.StationGroup.new) + +``` +function Engine.Component.StationGroup.new(): StationGroup +``` + +**Returns** + +1. `StationGroup` + +### Engine.Component.StationGroup.stations[πŸ”—](#$api.engine~Engine.Component.StationGroup.stations) + +``` +Engine.Component.StationGroup.stations: {Engine.Entity} +``` + +A list of stations that are grouped together + +### Engine.Component.StockList[πŸ”—](#$api.engine~Engine.Component.StockList) + +``` +[Expand All] [Collapse All] + +record Engine.Component.StockList record Stock new: function(): Stock + type: StockListType + cargoType: CargoTypeId + cargoTypes: CargoTypeSet + mixedTypes: boolean + capacity: integer + loadSpeedModifier: number + loadIndicatorModelInstanceIndices: {integer} + tag: integer +end + record StockData new: function(): StockData + consumeFrequency: number +end + record Rule new: function(): Rule + input: {{integer}} + output: {CargoTypeId : integer} + capacity: integer + consumptionFactor: number + booster: boolean + boostFactor: number + priority: integer + slot: integer +end + record RuleData new: function(): RuleData + record ApplyInfo new: function(): ApplyInfo + time: integer + interval: integer + consumedCargo: {StockId} + producedCargo: {{CargoTypeId, integer}} +end + applyHistory: {ApplyInfo} + lastApplyDecayFactor: number +end + record CargoData new: function(): CargoData + produceFrequency: integer +end + record Modifiers new: function(): Modifiers + + productivity: number +end + new: function(): StockList + stocks: {Stock} + rules: {Rule} + stockDatas: {StockData} + ruleDatas: {RuleData} + cargoData: {CargoTypeId : CargoData} + thrownAwayCargo: integer + modifiers: Modifiers +end +``` + +Stock list data. + +### Engine.Component.StockList.Stock[πŸ”—](#$api.engine~Engine.Component.StockList.Stock) + +``` +record Engine.Component.StockList.Stock new: function(): Stock + type: StockListType + cargoType: CargoTypeId + cargoTypes: CargoTypeSet + mixedTypes: boolean + capacity: integer + loadSpeedModifier: number + loadIndicatorModelInstanceIndices: {integer} + tag: integer +end +``` + +Stock data for a single stock in a StockList. + +### Engine.Component.StockList.Stock.new[πŸ”—](#$api.engine~Engine.Component.StockList.Stock.new) + +``` +function Engine.Component.StockList.Stock.new(): Stock +``` + +**Returns** + +1. `Stock` + +### Engine.Component.StockList.Stock.type[πŸ”—](#$api.engine~Engine.Component.StockList.Stock.type) + +``` +Engine.Component.StockList.Stock.type: StockListType +``` + +### Engine.Component.StockList.Stock.cargoType[πŸ”—](#$api.engine~Engine.Component.StockList.Stock.cargoType) + +``` +Engine.Component.StockList.Stock.cargoType: CargoTypeId +``` + +### Engine.Component.StockList.Stock.cargoTypes[πŸ”—](#$api.engine~Engine.Component.StockList.Stock.cargoTypes) + +``` +Engine.Component.StockList.Stock.cargoTypes: CargoTypeSet +``` + +### Engine.Component.StockList.Stock.mixedTypes[πŸ”—](#$api.engine~Engine.Component.StockList.Stock.mixedTypes) + +``` +Engine.Component.StockList.Stock.mixedTypes: boolean +``` + +### Engine.Component.StockList.Stock.capacity[πŸ”—](#$api.engine~Engine.Component.StockList.Stock.capacity) + +``` +Engine.Component.StockList.Stock.capacity: integer +``` + +### Engine.Component.StockList.Stock.loadSpeedModifier[πŸ”—](#$api.engine~Engine.Component.StockList.Stock.loadSpeedModifier) + +``` +Engine.Component.StockList.Stock.loadSpeedModifier: number +``` + +### Engine.Component.StockList.Stock.loadIndicatorModelInstanceIndices[πŸ”—](#$api.engine~Engine.Component.StockList.Stock.loadIndicatorModelInstanceIndices) + +``` +Engine.Component.StockList.Stock.loadIndicatorModelInstanceIndices: {integer} +``` + +### Engine.Component.StockList.Stock.tag[πŸ”—](#$api.engine~Engine.Component.StockList.Stock.tag) + +``` +Engine.Component.StockList.Stock.tag: integer +``` + +### Engine.Component.StockList.StockData[πŸ”—](#$api.engine~Engine.Component.StockList.StockData) + +``` +record Engine.Component.StockList.StockData new: function(): StockData + consumeFrequency: number +end +``` + +StockData for a StockList. + +### Engine.Component.StockList.StockData.new[πŸ”—](#$api.engine~Engine.Component.StockList.StockData.new) + +``` +function Engine.Component.StockList.StockData.new(): StockData +``` + +**Returns** + +1. `StockData` + +### Engine.Component.StockList.StockData.consumeFrequency[πŸ”—](#$api.engine~Engine.Component.StockList.StockData.consumeFrequency) + +``` +Engine.Component.StockList.StockData.consumeFrequency: number +``` + +### Engine.Component.StockList.Rule[πŸ”—](#$api.engine~Engine.Component.StockList.Rule) + +``` +record Engine.Component.StockList.Rule new: function(): Rule + input: {{integer}} + output: {CargoTypeId : integer} + capacity: integer + consumptionFactor: number + booster: boolean + boostFactor: number + priority: integer + slot: integer +end +``` + +Rule data for a StockList. + +### Engine.Component.StockList.Rule.new[πŸ”—](#$api.engine~Engine.Component.StockList.Rule.new) + +``` +function Engine.Component.StockList.Rule.new(): Rule +``` + +**Returns** + +1. `Rule` + +### Engine.Component.StockList.Rule.input[πŸ”—](#$api.engine~Engine.Component.StockList.Rule.input) + +``` +Engine.Component.StockList.Rule.input: {{integer}} +``` + +### Engine.Component.StockList.Rule.output[πŸ”—](#$api.engine~Engine.Component.StockList.Rule.output) + +``` +Engine.Component.StockList.Rule.output: {CargoTypeId : integer} +``` + +### Engine.Component.StockList.Rule.capacity[πŸ”—](#$api.engine~Engine.Component.StockList.Rule.capacity) + +``` +Engine.Component.StockList.Rule.capacity: integer +``` + +### Engine.Component.StockList.Rule.consumptionFactor[πŸ”—](#$api.engine~Engine.Component.StockList.Rule.consumptionFactor) + +``` +Engine.Component.StockList.Rule.consumptionFactor: number +``` + +### Engine.Component.StockList.Rule.booster[πŸ”—](#$api.engine~Engine.Component.StockList.Rule.booster) + +``` +Engine.Component.StockList.Rule.booster: boolean +``` + +### Engine.Component.StockList.Rule.boostFactor[πŸ”—](#$api.engine~Engine.Component.StockList.Rule.boostFactor) + +``` +Engine.Component.StockList.Rule.boostFactor: number +``` + +### Engine.Component.StockList.Rule.priority[πŸ”—](#$api.engine~Engine.Component.StockList.Rule.priority) + +``` +Engine.Component.StockList.Rule.priority: integer +``` + +### Engine.Component.StockList.Rule.slot[πŸ”—](#$api.engine~Engine.Component.StockList.Rule.slot) + +``` +Engine.Component.StockList.Rule.slot: integer +``` + +### Engine.Component.StockList.RuleData[πŸ”—](#$api.engine~Engine.Component.StockList.RuleData) + +``` +[Expand All] [Collapse All] + +record Engine.Component.StockList.RuleData new: function(): RuleData + record ApplyInfo new: function(): ApplyInfo + time: integer + interval: integer + consumedCargo: {StockId} + producedCargo: {{CargoTypeId, integer}} +end + applyHistory: {ApplyInfo} + lastApplyDecayFactor: number +end +``` + +RuleData data for a StockList. + +### Engine.Component.StockList.RuleData.new[πŸ”—](#$api.engine~Engine.Component.StockList.RuleData.new) + +``` +function Engine.Component.StockList.RuleData.new(): RuleData +``` + +**Returns** + +1. `RuleData` + +### Engine.Component.StockList.RuleData.ApplyInfo[πŸ”—](#$api.engine~Engine.Component.StockList.RuleData.ApplyInfo) + +``` +record Engine.Component.StockList.RuleData.ApplyInfo new: function(): ApplyInfo + time: integer + interval: integer + consumedCargo: {StockId} + producedCargo: {{CargoTypeId, integer}} +end +``` + +ApplyInfo data for a StockList. + +### Engine.Component.StockList.RuleData.ApplyInfo.new[πŸ”—](#$api.engine~Engine.Component.StockList.RuleData.ApplyInfo.new) + +``` +function Engine.Component.StockList.RuleData.ApplyInfo.new(): ApplyInfo +``` + +**Returns** + +1. `ApplyInfo` + +### Engine.Component.StockList.RuleData.ApplyInfo.time[πŸ”—](#$api.engine~Engine.Component.StockList.RuleData.ApplyInfo.time) + +``` +Engine.Component.StockList.RuleData.ApplyInfo.time: integer +``` + +### Engine.Component.StockList.RuleData.ApplyInfo.interval[πŸ”—](#$api.engine~Engine.Component.StockList.RuleData.ApplyInfo.interval) + +``` +Engine.Component.StockList.RuleData.ApplyInfo.interval: integer +``` + +### Engine.Component.StockList.RuleData.ApplyInfo.consumedCargo[πŸ”—](#$api.engine~Engine.Component.StockList.RuleData.ApplyInfo.consumedCargo) + +``` +Engine.Component.StockList.RuleData.ApplyInfo.consumedCargo: {StockId} +``` + +### Engine.Component.StockList.RuleData.ApplyInfo.producedCargo[πŸ”—](#$api.engine~Engine.Component.StockList.RuleData.ApplyInfo.producedCargo) + +``` +Engine.Component.StockList.RuleData.ApplyInfo.producedCargo: {{CargoTypeId, integer}} +``` + +### Engine.Component.StockList.RuleData.applyHistory[πŸ”—](#$api.engine~Engine.Component.StockList.RuleData.applyHistory) + +``` +Engine.Component.StockList.RuleData.applyHistory: {ApplyInfo} +``` + +### Engine.Component.StockList.RuleData.lastApplyDecayFactor[πŸ”—](#$api.engine~Engine.Component.StockList.RuleData.lastApplyDecayFactor) + +``` +Engine.Component.StockList.RuleData.lastApplyDecayFactor: number +``` + +### Engine.Component.StockList.CargoData[πŸ”—](#$api.engine~Engine.Component.StockList.CargoData) + +``` +record Engine.Component.StockList.CargoData new: function(): CargoData + produceFrequency: integer +end +``` + +CargoData for a StockList. + +### Engine.Component.StockList.CargoData.new[πŸ”—](#$api.engine~Engine.Component.StockList.CargoData.new) + +``` +function Engine.Component.StockList.CargoData.new(): CargoData +``` + +**Returns** + +1. `CargoData` + +### Engine.Component.StockList.CargoData.produceFrequency[πŸ”—](#$api.engine~Engine.Component.StockList.CargoData.produceFrequency) + +``` +Engine.Component.StockList.CargoData.produceFrequency: integer +``` + +### Engine.Component.StockList.Modifiers[πŸ”—](#$api.engine~Engine.Component.StockList.Modifiers) + +``` +record Engine.Component.StockList.Modifiers new: function(): Modifiers + + productivity: number +end +``` + +Modifiers for the stocklist + +### Engine.Component.StockList.Modifiers.new()[πŸ”—](#$api.engine~Engine.Component.StockList.Modifiers.new()) + +``` +function Engine.Component.StockList.Modifiers.new()(): Modifiers +``` + +**Returns** + +1. `Modifiers` + +### Engine.Component.StockList.Modifiers.new(Modifiers)[πŸ”—](#$api.engine~Engine.Component.StockList.Modifiers.new(Modifiers)) + +``` +function Engine.Component.StockList.Modifiers.new(Modifiers)(Modifiers): Modifiers +``` + +**Parameters** + +* `Modifiers` + +**Returns** + +1. `Modifiers` + +### Engine.Component.StockList.Modifiers.productivity[πŸ”—](#$api.engine~Engine.Component.StockList.Modifiers.productivity) + +``` +Engine.Component.StockList.Modifiers.productivity: number +``` + +the productivity of the stocklist + +### Engine.Component.StockList.new[πŸ”—](#$api.engine~Engine.Component.StockList.new) + +``` +function Engine.Component.StockList.new(): StockList +``` + +**Returns** + +1. `StockList` + +### Engine.Component.StockList.stocks[πŸ”—](#$api.engine~Engine.Component.StockList.stocks) + +``` +Engine.Component.StockList.stocks: {Stock} +``` + +### Engine.Component.StockList.rules[πŸ”—](#$api.engine~Engine.Component.StockList.rules) + +``` +Engine.Component.StockList.rules: {Rule} +``` + +### Engine.Component.StockList.stockDatas[πŸ”—](#$api.engine~Engine.Component.StockList.stockDatas) + +``` +Engine.Component.StockList.stockDatas: {StockData} +``` + +### Engine.Component.StockList.ruleDatas[πŸ”—](#$api.engine~Engine.Component.StockList.ruleDatas) + +``` +Engine.Component.StockList.ruleDatas: {RuleData} +``` + +### Engine.Component.StockList.cargoData[πŸ”—](#$api.engine~Engine.Component.StockList.cargoData) + +``` +Engine.Component.StockList.cargoData: {CargoTypeId : CargoData} +``` + +### Engine.Component.StockList.thrownAwayCargo[πŸ”—](#$api.engine~Engine.Component.StockList.thrownAwayCargo) + +``` +Engine.Component.StockList.thrownAwayCargo: integer +``` + +### Engine.Component.StockList.modifiers[πŸ”—](#$api.engine~Engine.Component.StockList.modifiers) + +``` +Engine.Component.StockList.modifiers: Modifiers +``` + +### Engine.Component.Subconstruction[πŸ”—](#$api.engine~Engine.Component.Subconstruction) + +``` +record Engine.Component.Subconstruction new: function(): Subconstruction + tag: integer + slotIds: {integer} + metadata: SubconstructionInstanceMetadata +end +``` + +Subconstruction data. + +### Engine.Component.Subconstruction.new[πŸ”—](#$api.engine~Engine.Component.Subconstruction.new) + +``` +function Engine.Component.Subconstruction.new(): Subconstruction +``` + +**Returns** + +1. `Subconstruction` + +### Engine.Component.Subconstruction.tag[πŸ”—](#$api.engine~Engine.Component.Subconstruction.tag) + +``` +Engine.Component.Subconstruction.tag: integer +``` + +### Engine.Component.Subconstruction.slotIds[πŸ”—](#$api.engine~Engine.Component.Subconstruction.slotIds) + +``` +Engine.Component.Subconstruction.slotIds: {integer} +``` + +Slots that are assigned to this subconstruction, for selection/bulldoze purposes + +### Engine.Component.Subconstruction.metadata[πŸ”—](#$api.engine~Engine.Component.Subconstruction.metadata) + +``` +Engine.Component.Subconstruction.metadata: SubconstructionInstanceMetadata +``` + +### Engine.Component.Terrain[πŸ”—](#$api.engine~Engine.Component.Terrain) + +``` +record Engine.Component.Terrain new: function(): Terrain + size: Vec2i + baseLevels: integer + baseResolution: Vec3f + highLevels: integer + offsetZ: number + waterLevel: number + dataMaps: {string, HeightmapNew} +end +``` + +Contains information about the map. + +### Engine.Component.Terrain.new[πŸ”—](#$api.engine~Engine.Component.Terrain.new) + +``` +function Engine.Component.Terrain.new(): Terrain +``` + +**Returns** + +1. `Terrain` + +### Engine.Component.Terrain.size[πŸ”—](#$api.engine~Engine.Component.Terrain.size) + +``` +Engine.Component.Terrain.size: Vec2i +``` + +the number of tiles of the terrain + +### Engine.Component.Terrain.baseLevels[πŸ”—](#$api.engine~Engine.Component.Terrain.baseLevels) + +``` +Engine.Component.Terrain.baseLevels: integer +``` + +number of base levels + +### Engine.Component.Terrain.baseResolution[πŸ”—](#$api.engine~Engine.Component.Terrain.baseResolution) + +``` +Engine.Component.Terrain.baseResolution: Vec3f +``` + +resolution for all three dimensions + +### Engine.Component.Terrain.highLevels[πŸ”—](#$api.engine~Engine.Component.Terrain.highLevels) + +``` +Engine.Component.Terrain.highLevels: integer +``` + +### Engine.Component.Terrain.offsetZ[πŸ”—](#$api.engine~Engine.Component.Terrain.offsetZ) + +``` +Engine.Component.Terrain.offsetZ: number +``` + +### Engine.Component.Terrain.waterLevel[πŸ”—](#$api.engine~Engine.Component.Terrain.waterLevel) + +``` +Engine.Component.Terrain.waterLevel: number +``` + +level for the surface of the navigatable water + +### Engine.Component.Terrain.dataMaps[πŸ”—](#$api.engine~Engine.Component.Terrain.dataMaps) + +``` +Engine.Component.Terrain.dataMaps: {string, HeightmapNew} +``` + +### Engine.Component.TerrainAlignmentList[πŸ”—](#$api.engine~Engine.Component.TerrainAlignmentList) + +``` +record Engine.Component.TerrainAlignmentList new: function(): TerrainAlignmentList + terrainAlignments: {TerrainAlignment} +end +``` + +Contains information about how terrain needs to be aligned. + +### Engine.Component.TerrainAlignmentList.new[πŸ”—](#$api.engine~Engine.Component.TerrainAlignmentList.new) + +``` +function Engine.Component.TerrainAlignmentList.new(): TerrainAlignmentList +``` + +**Returns** + +1. `TerrainAlignmentList` + +### Engine.Component.TerrainAlignmentList.terrainAlignments[πŸ”—](#$api.engine~Engine.Component.TerrainAlignmentList.terrainAlignments) + +``` +Engine.Component.TerrainAlignmentList.terrainAlignments: {TerrainAlignment} +``` + +### Engine.Component.TerrainTile[πŸ”—](#$api.engine~Engine.Component.TerrainTile) + +``` +record Engine.Component.TerrainTile new: function(): TerrainTile + terrainEntity: Engine.Entity + position: Vec2i +end +``` + +Contains information about a single tile of the map. +A tile is a 256m x 256m chunk of the map. + +### Engine.Component.TerrainTile.new[πŸ”—](#$api.engine~Engine.Component.TerrainTile.new) + +``` +function Engine.Component.TerrainTile.new(): TerrainTile +``` + +**Returns** + +1. `TerrainTile` + +### Engine.Component.TerrainTile.terrainEntity[πŸ”—](#$api.engine~Engine.Component.TerrainTile.terrainEntity) + +``` +Engine.Component.TerrainTile.terrainEntity: Engine.Entity +``` + +a reference to the entity with terrain information + +### Engine.Component.TerrainTile.position[πŸ”—](#$api.engine~Engine.Component.TerrainTile.position) + +``` +Engine.Component.TerrainTile.position: Vec2i +``` + +the position of the tile in the tile grid + +### Engine.Component.TerrainTileBrush[πŸ”—](#$api.engine~Engine.Component.TerrainTileBrush) + +``` +record Engine.Component.TerrainTileBrush new: function(): TerrainTileBrush + materialIndexBrush: {integer} + forceAboveBit: {boolean} +end +``` + +Contains information about the brush layer of a tile of the map. + +### Engine.Component.TerrainTileBrush.new[πŸ”—](#$api.engine~Engine.Component.TerrainTileBrush.new) + +``` +function Engine.Component.TerrainTileBrush.new(): TerrainTileBrush +``` + +**Returns** + +1. `TerrainTileBrush` + +### Engine.Component.TerrainTileBrush.materialIndexBrush[πŸ”—](#$api.engine~Engine.Component.TerrainTileBrush.materialIndexBrush) + +``` +Engine.Component.TerrainTileBrush.materialIndexBrush: {integer} +``` + +contains the material id of the brush layer + +### Engine.Component.TerrainTileBrush.forceAboveBit[πŸ”—](#$api.engine~Engine.Component.TerrainTileBrush.forceAboveBit) + +``` +Engine.Component.TerrainTileBrush.forceAboveBit: {boolean} +``` + +### Engine.Component.TerrainTileHeightmap[πŸ”—](#$api.engine~Engine.Component.TerrainTileHeightmap) + +``` +record Engine.Component.TerrainTileHeightmap new: function(): TerrainTileHeightmap + vertices: {integer} +end +``` + +Contains information about the geometry of the tile. + +### Engine.Component.TerrainTileHeightmap.new[πŸ”—](#$api.engine~Engine.Component.TerrainTileHeightmap.new) + +``` +function Engine.Component.TerrainTileHeightmap.new(): TerrainTileHeightmap +``` + +**Returns** + +1. `TerrainTileHeightmap` + +### Engine.Component.TerrainTileHeightmap.vertices[πŸ”—](#$api.engine~Engine.Component.TerrainTileHeightmap.vertices) + +``` +Engine.Component.TerrainTileHeightmap.vertices: {integer} +``` + +contains the heightmap information for the tile. Each value is for a position in the heightmap grid of the tile with a 4m resolution + +### Engine.Component.TickEpoch[πŸ”—](#$api.engine~Engine.Component.TickEpoch) + +``` +record Engine.Component.TickEpoch new: function(): TickEpoch + time: integer + commandIndex: integer + subIndex: integer +end +``` + +Tracks information about the last time an entity was modified or added. + +### Engine.Component.TickEpoch.new[πŸ”—](#$api.engine~Engine.Component.TickEpoch.new) + +``` +function Engine.Component.TickEpoch.new(): TickEpoch +``` + +**Returns** + +1. `TickEpoch` + +### Engine.Component.TickEpoch.time[πŸ”—](#$api.engine~Engine.Component.TickEpoch.time) + +``` +Engine.Component.TickEpoch.time: integer +``` + +a unique index incrementing each simulation update step + +### Engine.Component.TickEpoch.commandIndex[πŸ”—](#$api.engine~Engine.Component.TickEpoch.commandIndex) + +``` +Engine.Component.TickEpoch.commandIndex: integer +``` + +a unique index counting commands within a frame + +### Engine.Component.TickEpoch.subIndex[πŸ”—](#$api.engine~Engine.Component.TickEpoch.subIndex) + +``` +Engine.Component.TickEpoch.subIndex: integer +``` + +a unique increasing index within a command + +### Engine.Component.Town[πŸ”—](#$api.engine~Engine.Component.Town) + +``` +record Engine.Component.Town new: function(): Town + initialLandUseCapacities: {integer} + capacityScalingFactor: number + levelToCapacityDistributionWeights: {{number}} + sizeFactors: {number} + cargoNeeds: {{{CargoTypeId, number}}} + developmentActive: boolean + noise: number + pollution: number +end +``` + +Contains information about a single town. + +### Engine.Component.Town.new[πŸ”—](#$api.engine~Engine.Component.Town.new) + +``` +function Engine.Component.Town.new(): Town +``` + +**Returns** + +1. `Town` + +### Engine.Component.Town.initialLandUseCapacities[πŸ”—](#$api.engine~Engine.Component.Town.initialLandUseCapacities) + +``` +Engine.Component.Town.initialLandUseCapacities: {integer} +``` + +initial capacities for the residential, commercial and industrial district of the town + +### Engine.Component.Town.capacityScalingFactor[πŸ”—](#$api.engine~Engine.Component.Town.capacityScalingFactor) + +``` +Engine.Component.Town.capacityScalingFactor: number +``` + +### Engine.Component.Town.levelToCapacityDistributionWeights[πŸ”—](#$api.engine~Engine.Component.Town.levelToCapacityDistributionWeights) + +``` +Engine.Component.Town.levelToCapacityDistributionWeights: {{number}} +``` + +### Engine.Component.Town.sizeFactors[πŸ”—](#$api.engine~Engine.Component.Town.sizeFactors) + +``` +Engine.Component.Town.sizeFactors: {number} +``` + +a base size of the town + +### Engine.Component.Town.cargoNeeds[πŸ”—](#$api.engine~Engine.Component.Town.cargoNeeds) + +``` +Engine.Component.Town.cargoNeeds: {{{CargoTypeId, number}}} +``` + +list of cargo type ids for the needs of each of the three town districts **residential**, **commercial** and **industrial** + +### Engine.Component.Town.developmentActive[πŸ”—](#$api.engine~Engine.Component.Town.developmentActive) + +``` +Engine.Component.Town.developmentActive: boolean +``` + +turns off growth of the town + +### Engine.Component.Town.noise[πŸ”—](#$api.engine~Engine.Component.Town.noise) + +``` +Engine.Component.Town.noise: number +``` + +the accumulated noise in decibels, it's prefered to use `api.engine.util.getTownEmissionDB` + +### Engine.Component.Town.pollution[πŸ”—](#$api.engine~Engine.Component.Town.pollution) + +``` +Engine.Component.Town.pollution: number +``` + +the accumulated noise in decibels, it's prefered to use `api.engine.util.getTownEmissionDB` + +### Engine.Component.TownBuilding[πŸ”—](#$api.engine~Engine.Component.TownBuilding) + +``` +record Engine.Component.TownBuilding new: function(): TownBuilding + personCapacity: Engine.Entity + stockList: Engine.Entity + construction: Engine.Entity + level: integer + parcels: {Engine.Entity} + depth: integer + height: number + town: Engine.Entity + timeBuilt: integer + blockedDevelopment: boolean +end +``` + +Contains information about a town building. + +### Engine.Component.TownBuilding.new[πŸ”—](#$api.engine~Engine.Component.TownBuilding.new) + +``` +function Engine.Component.TownBuilding.new(): TownBuilding +``` + +**Returns** + +1. `TownBuilding` + +### Engine.Component.TownBuilding.personCapacity[πŸ”—](#$api.engine~Engine.Component.TownBuilding.personCapacity) + +``` +Engine.Component.TownBuilding.personCapacity: Engine.Entity +``` + +### Engine.Component.TownBuilding.stockList[πŸ”—](#$api.engine~Engine.Component.TownBuilding.stockList) + +``` +Engine.Component.TownBuilding.stockList: Engine.Entity +``` + +### Engine.Component.TownBuilding.construction[πŸ”—](#$api.engine~Engine.Component.TownBuilding.construction) + +``` +Engine.Component.TownBuilding.construction: Engine.Entity +``` + +### Engine.Component.TownBuilding.level[πŸ”—](#$api.engine~Engine.Component.TownBuilding.level) + +``` +Engine.Component.TownBuilding.level: integer +``` + +level of the building (1-4) + +### Engine.Component.TownBuilding.parcels[πŸ”—](#$api.engine~Engine.Component.TownBuilding.parcels) + +``` +Engine.Component.TownBuilding.parcels: {Engine.Entity} +``` + +parcels occupied by the building + +### Engine.Component.TownBuilding.depth[πŸ”—](#$api.engine~Engine.Component.TownBuilding.depth) + +``` +Engine.Component.TownBuilding.depth: integer +``` + +the depth in number of parcels (1-4) + +### Engine.Component.TownBuilding.height[πŸ”—](#$api.engine~Engine.Component.TownBuilding.height) + +``` +Engine.Component.TownBuilding.height: number +``` + +the height in meters of the building + +### Engine.Component.TownBuilding.town[πŸ”—](#$api.engine~Engine.Component.TownBuilding.town) + +``` +Engine.Component.TownBuilding.town: Engine.Entity +``` + +the town entity + +### Engine.Component.TownBuilding.timeBuilt[πŸ”—](#$api.engine~Engine.Component.TownBuilding.timeBuilt) + +``` +Engine.Component.TownBuilding.timeBuilt: integer +``` + +the timestamp when the building was built + +### Engine.Component.TownBuilding.blockedDevelopment[πŸ”—](#$api.engine~Engine.Component.TownBuilding.blockedDevelopment) + +``` +Engine.Component.TownBuilding.blockedDevelopment: boolean +``` + +block town developer from changing this building + +### Engine.Component.TownConnection[πŸ”—](#$api.engine~Engine.Component.TownConnection) + +``` +record Engine.Component.TownConnection new: function(): TownConnection + entity0: Engine.Entity + entity1: Engine.Entity + position0: Vec2f + position1: Vec2f + time: number + currentTime: number + lastUpgradeYear: integer + valid: boolean +end +``` + +Defines a connection between towns. + +### Engine.Component.TownConnection.new[πŸ”—](#$api.engine~Engine.Component.TownConnection.new) + +``` +function Engine.Component.TownConnection.new(): TownConnection +``` + +**Returns** + +1. `TownConnection` + +### Engine.Component.TownConnection.entity0[πŸ”—](#$api.engine~Engine.Component.TownConnection.entity0) + +``` +Engine.Component.TownConnection.entity0: Engine.Entity +``` + +first town + +### Engine.Component.TownConnection.entity1[πŸ”—](#$api.engine~Engine.Component.TownConnection.entity1) + +``` +Engine.Component.TownConnection.entity1: Engine.Entity +``` + +second town + +### Engine.Component.TownConnection.position0[πŸ”—](#$api.engine~Engine.Component.TownConnection.position0) + +``` +Engine.Component.TownConnection.position0: Vec2f +``` + +position of the first town + +### Engine.Component.TownConnection.position1[πŸ”—](#$api.engine~Engine.Component.TownConnection.position1) + +``` +Engine.Component.TownConnection.position1: Vec2f +``` + +position of the second town + +### Engine.Component.TownConnection.time[πŸ”—](#$api.engine~Engine.Component.TownConnection.time) + +``` +Engine.Component.TownConnection.time: number +``` + +approximate time taken to travel the connection + +### Engine.Component.TownConnection.currentTime[πŸ”—](#$api.engine~Engine.Component.TownConnection.currentTime) + +``` +Engine.Component.TownConnection.currentTime: number +``` + +### Engine.Component.TownConnection.lastUpgradeYear[πŸ”—](#$api.engine~Engine.Component.TownConnection.lastUpgradeYear) + +``` +Engine.Component.TownConnection.lastUpgradeYear: integer +``` + +### Engine.Component.TownConnection.valid[πŸ”—](#$api.engine~Engine.Component.TownConnection.valid) + +``` +Engine.Component.TownConnection.valid: boolean +``` + +### Engine.Component.TpNetLink[πŸ”—](#$api.engine~Engine.Component.TpNetLink) + +``` +record Engine.Component.TpNetLink new: function(): TpNetLink + from: EdgePos + to: EdgePos +end +``` + +Represents a link between transport networks. +A link is an automatic pedestrian connection. + +### Engine.Component.TpNetLink.new[πŸ”—](#$api.engine~Engine.Component.TpNetLink.new) + +``` +function Engine.Component.TpNetLink.new(): TpNetLink +``` + +**Returns** + +1. `TpNetLink` + +### Engine.Component.TpNetLink.from[πŸ”—](#$api.engine~Engine.Component.TpNetLink.from) + +``` +Engine.Component.TpNetLink.from: EdgePos +``` + +link starting edge position + +### Engine.Component.TpNetLink.to[πŸ”—](#$api.engine~Engine.Component.TpNetLink.to) + +``` +Engine.Component.TpNetLink.to: EdgePos +``` + +link end edge position + +### Engine.Component.Train[πŸ”—](#$api.engine~Engine.Component.Train) + +``` +record Engine.Component.Train new: function(): Train +end +``` + +Represents an entire train + +### Engine.Component.Train.new[πŸ”—](#$api.engine~Engine.Component.Train.new) + +``` +function Engine.Component.Train.new(): Train +``` + +**Returns** + +1. `Train` + +### Engine.Component.TransportNetwork[πŸ”—](#$api.engine~Engine.Component.TransportNetwork) + +``` +record Engine.Component.TransportNetwork new: function(): TransportNetwork + nodes: {Node} + edges: {Edge} + turnaroundEdges: {integer} +end +``` + +Contains the graph of edges and nodes onto which vehicles and person move. + +### Engine.Component.TransportNetwork.new[πŸ”—](#$api.engine~Engine.Component.TransportNetwork.new) + +``` +function Engine.Component.TransportNetwork.new(): TransportNetwork +``` + +**Returns** + +1. `TransportNetwork` + +### Engine.Component.TransportNetwork.nodes[πŸ”—](#$api.engine~Engine.Component.TransportNetwork.nodes) + +``` +Engine.Component.TransportNetwork.nodes: {Node} +``` + +The list of nodes of the transport network + +### Engine.Component.TransportNetwork.edges[πŸ”—](#$api.engine~Engine.Component.TransportNetwork.edges) + +``` +Engine.Component.TransportNetwork.edges: {Edge} +``` + +The list of edges of the transport network + +### Engine.Component.TransportNetwork.turnaroundEdges[πŸ”—](#$api.engine~Engine.Component.TransportNetwork.turnaroundEdges) + +``` +Engine.Component.TransportNetwork.turnaroundEdges: {integer} +``` + +for each edge, the index of the first edge on the opposite lane + +### Engine.Component.TransportNetworkNodes[πŸ”—](#$api.engine~Engine.Component.TransportNetworkNodes) + +``` +record Engine.Component.TransportNetworkNodes new: function(): TransportNetworkNodes +end +``` + +Data for TransportNetworkNodes marker component. + +### Engine.Component.TransportNetworkNodes.new[πŸ”—](#$api.engine~Engine.Component.TransportNetworkNodes.new) + +``` +function Engine.Component.TransportNetworkNodes.new(): TransportNetworkNodes +``` + +**Returns** + +1. `TransportNetworkNodes` + +### Engine.Component.TransportVehicle[πŸ”—](#$api.engine~Engine.Component.TransportVehicle) + +``` +[Expand All] [Collapse All] + +record Engine.Component.TransportVehicle record Modifiers new: function(): Modifiers + + topSpeedScale: number + noiseScale: number + pollutionScale: number + comfortScale: number +end + record LoadSpeedModifiers vehicleOverlength: number + stockCompatibility: number + vehicleCompatibility: number + vehicleIncompatibility: number + getTotalPenalty: function(LoadSpeedModifiers): number +end + record Config new: function(): Config + transportModes: {TransportMode : boolean} + allCaps: {CargoTypeId} + capacities: {CargoTypeId} + loadSpeeds: {number} + reversible: boolean +end + record LoadState new: function(): LoadState + None: LoadState + Arrived: LoadState + Unloading: LoadState + Loading: LoadState + WaitForScheduledDeparture: LoadState + Departing: LoadState +end + record PendingIncomeParams new: function(): PendingIncomeParams + record EntityRev0 entity: Engine.Entity + rev0: integer +end + amount: integer + carrier: Carrier + vehicleEntity: Engine.Entity + lineEntity: Engine.Entity +end + new: function(): TransportVehicle + carrier: Carrier + transportVehicleConfig: TransportVehicleConfig + config: Config + state: TransportVehicleState + userStopped: boolean + depot: Engine.Entity + sellOnArrival: boolean + line: Engine.Entity + stopIndex: integer + arrivalStationTerminal: StationTerminal + arrivalStationTerminalLocked: boolean + lineStopDepartures: {integer} + lastLineStopDeparture: integer + sectionTimes: {number} + lineStop2cargo2available: {{CargoTypeId}} + loadState: LoadState + timeUntilNextScheduledDeparture: number + loadSpeedModifiers: {CargoTypeId : LoadSpeedModifiers} + timeUntilCloseDoors: number + timeUntilDeparture: number + timeUntilNextLoad: {CargoTypeId : number} + timeUntilNextUnload: {CargoTypeId : number} + lastStationStockIndex: integer + doorsTime: integer + daysInDepot: integer + daysAtTerminal: integer + doorsOpen: boolean + noPath: boolean + autoDeparture: boolean + maintenanceStation: Engine.Entity + modifiers: Modifiers + unloadPendingIncome: PendingIncomeParams + closestTown: Engine.Entity + visitedStops: {integer} +end +``` + +Represents a single transport vehicle + +### Engine.Component.TransportVehicle.Modifiers[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Modifiers) + +``` +record Engine.Component.TransportVehicle.Modifiers new: function(): Modifiers + + topSpeedScale: number + noiseScale: number + pollutionScale: number + comfortScale: number +end +``` + +Contains modifiers for the entire transport vehicle + +### Engine.Component.TransportVehicle.Modifiers.new()[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Modifiers.new()) + +``` +function Engine.Component.TransportVehicle.Modifiers.new()(): Modifiers +``` + +**Returns** + +1. `Modifiers` + +### Engine.Component.TransportVehicle.Modifiers.new(Modifiers)[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Modifiers.new(Modifiers)) + +``` +function Engine.Component.TransportVehicle.Modifiers.new(Modifiers)(Modifiers): Modifiers +``` + +**Parameters** + +* `Modifiers` + +**Returns** + +1. `Modifiers` + +### Engine.Component.TransportVehicle.Modifiers.topSpeedScale[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Modifiers.topSpeedScale) + +``` +Engine.Component.TransportVehicle.Modifiers.topSpeedScale: number +``` + +allows scaling the transport vehicle top speed + +### Engine.Component.TransportVehicle.Modifiers.noiseScale[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Modifiers.noiseScale) + +``` +Engine.Component.TransportVehicle.Modifiers.noiseScale: number +``` + +allows scaling the transport vehicle noise + +### Engine.Component.TransportVehicle.Modifiers.pollutionScale[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Modifiers.pollutionScale) + +``` +Engine.Component.TransportVehicle.Modifiers.pollutionScale: number +``` + +allows scaling the transport vehicle pollution + +### Engine.Component.TransportVehicle.Modifiers.comfortScale[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Modifiers.comfortScale) + +``` +Engine.Component.TransportVehicle.Modifiers.comfortScale: number +``` + +allows scaling the transport vehicle comfort + +### Engine.Component.TransportVehicle.LoadSpeedModifiers[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadSpeedModifiers) + +``` +record Engine.Component.TransportVehicle.LoadSpeedModifiers vehicleOverlength: number + stockCompatibility: number + vehicleCompatibility: number + vehicleIncompatibility: number + getTotalPenalty: function(LoadSpeedModifiers): number +end +``` + +Contains current effective modifiers for the transport vehicle load speed. + +### Engine.Component.TransportVehicle.LoadSpeedModifiers.vehicleOverlength[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadSpeedModifiers.vehicleOverlength) + +``` +Engine.Component.TransportVehicle.LoadSpeedModifiers.vehicleOverlength: number +``` + +the modifier poriton because of overlength with the terminal + +### Engine.Component.TransportVehicle.LoadSpeedModifiers.stockCompatibility[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadSpeedModifiers.stockCompatibility) + +``` +Engine.Component.TransportVehicle.LoadSpeedModifiers.stockCompatibility: number +``` + +the compatibility with the stock + +### Engine.Component.TransportVehicle.LoadSpeedModifiers.vehicleCompatibility[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadSpeedModifiers.vehicleCompatibility) + +``` +Engine.Component.TransportVehicle.LoadSpeedModifiers.vehicleCompatibility: number +``` + +the compatibility with the terminal + +### Engine.Component.TransportVehicle.LoadSpeedModifiers.vehicleIncompatibility[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadSpeedModifiers.vehicleIncompatibility) + +``` +Engine.Component.TransportVehicle.LoadSpeedModifiers.vehicleIncompatibility: number +``` + +the incompatibility with the terminal + +### Engine.Component.TransportVehicle.LoadSpeedModifiers.getTotalPenalty[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadSpeedModifiers.getTotalPenalty) + +``` +function Engine.Component.TransportVehicle.LoadSpeedModifiers.getTotalPenalty(LoadSpeedModifiers): number +``` + +computed total penalty from all modifiers + +**Parameters** + +* `LoadSpeedModifiers` + +**Returns** + +1. `number` + +### Engine.Component.TransportVehicle.Config[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Config) + +``` +record Engine.Component.TransportVehicle.Config new: function(): Config + transportModes: {TransportMode : boolean} + allCaps: {CargoTypeId} + capacities: {CargoTypeId} + loadSpeeds: {number} + reversible: boolean +end +``` + +Contains additional data for the transport vehicle + +### Engine.Component.TransportVehicle.Config.new[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Config.new) + +``` +function Engine.Component.TransportVehicle.Config.new(): Config +``` + +**Returns** + +1. `Config` + +### Engine.Component.TransportVehicle.Config.transportModes[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Config.transportModes) + +``` +Engine.Component.TransportVehicle.Config.transportModes: {TransportMode : boolean} +``` + +### Engine.Component.TransportVehicle.Config.allCaps[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Config.allCaps) + +``` +Engine.Component.TransportVehicle.Config.allCaps: {CargoTypeId} +``` + +### Engine.Component.TransportVehicle.Config.capacities[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Config.capacities) + +``` +Engine.Component.TransportVehicle.Config.capacities: {CargoTypeId} +``` + +all cargo capacities of the vehicle + +### Engine.Component.TransportVehicle.Config.loadSpeeds[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Config.loadSpeeds) + +``` +Engine.Component.TransportVehicle.Config.loadSpeeds: {number} +``` + +### Engine.Component.TransportVehicle.Config.reversible[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.Config.reversible) + +``` +Engine.Component.TransportVehicle.Config.reversible: boolean +``` + +### Engine.Component.TransportVehicle.LoadState[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadState) + +``` +record Engine.Component.TransportVehicle.LoadState new: function(): LoadState + None: LoadState + Arrived: LoadState + Unloading: LoadState + Loading: LoadState + WaitForScheduledDeparture: LoadState + Departing: LoadState +end +``` + +Contains additional data for the transport vehicle + +### Engine.Component.TransportVehicle.LoadState.new[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadState.new) + +``` +function Engine.Component.TransportVehicle.LoadState.new(): LoadState +``` + +**Returns** + +1. `LoadState` + +### Engine.Component.TransportVehicle.LoadState.None[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadState.None) + +``` +Engine.Component.TransportVehicle.LoadState.None: LoadState +``` + +### Engine.Component.TransportVehicle.LoadState.Arrived[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadState.Arrived) + +``` +Engine.Component.TransportVehicle.LoadState.Arrived: LoadState +``` + +### Engine.Component.TransportVehicle.LoadState.Unloading[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadState.Unloading) + +``` +Engine.Component.TransportVehicle.LoadState.Unloading: LoadState +``` + +### Engine.Component.TransportVehicle.LoadState.Loading[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadState.Loading) + +``` +Engine.Component.TransportVehicle.LoadState.Loading: LoadState +``` + +### Engine.Component.TransportVehicle.LoadState.WaitForScheduledDeparture[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadState.WaitForScheduledDeparture) + +``` +Engine.Component.TransportVehicle.LoadState.WaitForScheduledDeparture: LoadState +``` + +### Engine.Component.TransportVehicle.LoadState.Departing[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.LoadState.Departing) + +``` +Engine.Component.TransportVehicle.LoadState.Departing: LoadState +``` + +### Engine.Component.TransportVehicle.PendingIncomeParams[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.PendingIncomeParams) + +``` +[Expand All] [Collapse All] + +record Engine.Component.TransportVehicle.PendingIncomeParams new: function(): PendingIncomeParams + record EntityRev0 entity: Engine.Entity + rev0: integer +end + amount: integer + carrier: Carrier + vehicleEntity: Engine.Entity + lineEntity: Engine.Entity +end +``` + +Contains information about pending split income for the transport vehicle + +### Engine.Component.TransportVehicle.PendingIncomeParams.new[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.PendingIncomeParams.new) + +``` +function Engine.Component.TransportVehicle.PendingIncomeParams.new(): PendingIncomeParams +``` + +**Returns** + +1. `PendingIncomeParams` + +### Engine.Component.TransportVehicle.PendingIncomeParams.EntityRev0[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.PendingIncomeParams.EntityRev0) + +``` +record Engine.Component.TransportVehicle.PendingIncomeParams.EntityRev0 entity: Engine.Entity + rev0: integer +end +``` + +Contains information about entity and revision for the pending income + +### Engine.Component.TransportVehicle.PendingIncomeParams.EntityRev0.entity[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.PendingIncomeParams.EntityRev0.entity) + +``` +Engine.Component.TransportVehicle.PendingIncomeParams.EntityRev0.entity: Engine.Entity +``` + +the entity id + +### Engine.Component.TransportVehicle.PendingIncomeParams.EntityRev0.rev0[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.PendingIncomeParams.EntityRev0.rev0) + +``` +Engine.Component.TransportVehicle.PendingIncomeParams.EntityRev0.rev0: integer +``` + +the revision 0 of the entity + +### Engine.Component.TransportVehicle.PendingIncomeParams.amount[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.PendingIncomeParams.amount) + +``` +Engine.Component.TransportVehicle.PendingIncomeParams.amount: integer +``` + +total income pending to be unloaded + +### Engine.Component.TransportVehicle.PendingIncomeParams.carrier[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.PendingIncomeParams.carrier) + +``` +Engine.Component.TransportVehicle.PendingIncomeParams.carrier: Carrier +``` + +the carrier for which the income is pending + +### Engine.Component.TransportVehicle.PendingIncomeParams.vehicleEntity[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.PendingIncomeParams.vehicleEntity) + +``` +Engine.Component.TransportVehicle.PendingIncomeParams.vehicleEntity: Engine.Entity +``` + +accounted vehicle entity id + +### Engine.Component.TransportVehicle.PendingIncomeParams.lineEntity[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.PendingIncomeParams.lineEntity) + +``` +Engine.Component.TransportVehicle.PendingIncomeParams.lineEntity: Engine.Entity +``` + +accounted line entity id + +### Engine.Component.TransportVehicle.new[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.new) + +``` +function Engine.Component.TransportVehicle.new(): TransportVehicle +``` + +**Returns** + +1. `TransportVehicle` + +### Engine.Component.TransportVehicle.carrier[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.carrier) + +``` +Engine.Component.TransportVehicle.carrier: Carrier +``` + +the type of transport vehicle + +### Engine.Component.TransportVehicle.transportVehicleConfig[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.transportVehicleConfig) + +``` +Engine.Component.TransportVehicle.transportVehicleConfig: TransportVehicleConfig +``` + +the configuration of vehicle models in this vehicle + +### Engine.Component.TransportVehicle.config[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.config) + +``` +Engine.Component.TransportVehicle.config: Config +``` + +various configuration properties for the vehicle + +### Engine.Component.TransportVehicle.state[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.state) + +``` +Engine.Component.TransportVehicle.state: TransportVehicleState +``` + +current state of the vehicle + +### Engine.Component.TransportVehicle.userStopped[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.userStopped) + +``` +Engine.Component.TransportVehicle.userStopped: boolean +``` + +whether or not the user stopped the vehicle + +### Engine.Component.TransportVehicle.depot[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.depot) + +``` +Engine.Component.TransportVehicle.depot: Engine.Entity +``` + +if in depot, the Entity Id of the depot + +### Engine.Component.TransportVehicle.sellOnArrival[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.sellOnArrival) + +``` +Engine.Component.TransportVehicle.sellOnArrival: boolean +``` + +whether or not the vehicle will be sold on arrival + +### Engine.Component.TransportVehicle.line[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.line) + +``` +Engine.Component.TransportVehicle.line: Engine.Entity +``` + +the entity of the line (if assigned to one) + +### Engine.Component.TransportVehicle.stopIndex[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.stopIndex) + +``` +Engine.Component.TransportVehicle.stopIndex: integer +``` + +the stop index of the line (if assigned to one) + +### Engine.Component.TransportVehicle.arrivalStationTerminal[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.arrivalStationTerminal) + +``` +Engine.Component.TransportVehicle.arrivalStationTerminal: StationTerminal +``` + +The terminal to which the vehicle currently tries to go + +### Engine.Component.TransportVehicle.arrivalStationTerminalLocked[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.arrivalStationTerminalLocked) + +``` +Engine.Component.TransportVehicle.arrivalStationTerminalLocked: boolean +``` + +If the arrivalStationTerminal is the final decision + +### Engine.Component.TransportVehicle.lineStopDepartures[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.lineStopDepartures) + +``` +Engine.Component.TransportVehicle.lineStopDepartures: {integer} +``` + +timestamps of the last departures at each line stop + +### Engine.Component.TransportVehicle.lastLineStopDeparture[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.lastLineStopDeparture) + +``` +Engine.Component.TransportVehicle.lastLineStopDeparture: integer +``` + +timestamp of the last departure at any line + +### Engine.Component.TransportVehicle.sectionTimes[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.sectionTimes) + +``` +Engine.Component.TransportVehicle.sectionTimes: {number} +``` + +time taken for each section between line stops + +### Engine.Component.TransportVehicle.lineStop2cargo2available[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.lineStop2cargo2available) + +``` +Engine.Component.TransportVehicle.lineStop2cargo2available: {{CargoTypeId}} +``` + +available capacity per cargo type for each line stop + +### Engine.Component.TransportVehicle.loadState[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.loadState) + +``` +Engine.Component.TransportVehicle.loadState: LoadState +``` + +current loading state of the vehicle + +### Engine.Component.TransportVehicle.timeUntilNextScheduledDeparture[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.timeUntilNextScheduledDeparture) + +``` +Engine.Component.TransportVehicle.timeUntilNextScheduledDeparture: number +``` + +how much time is left until the vehicle will start loading cargo + +### Engine.Component.TransportVehicle.loadSpeedModifiers[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.loadSpeedModifiers) + +``` +Engine.Component.TransportVehicle.loadSpeedModifiers: {CargoTypeId : LoadSpeedModifiers} +``` + +current effective load speed modifiers per cargo type + +### Engine.Component.TransportVehicle.timeUntilCloseDoors[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.timeUntilCloseDoors) + +``` +Engine.Component.TransportVehicle.timeUntilCloseDoors: number +``` + +how much time is left until the vehicle starts closing the doors + +### Engine.Component.TransportVehicle.timeUntilDeparture[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.timeUntilDeparture) + +``` +Engine.Component.TransportVehicle.timeUntilDeparture: number +``` + +how much time is left until the vehicle leaves the terminal + +### Engine.Component.TransportVehicle.timeUntilNextLoad[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.timeUntilNextLoad) + +``` +Engine.Component.TransportVehicle.timeUntilNextLoad: {CargoTypeId : number} +``` + +time until the next load per cargo type + +### Engine.Component.TransportVehicle.timeUntilNextUnload[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.timeUntilNextUnload) + +``` +Engine.Component.TransportVehicle.timeUntilNextUnload: {CargoTypeId : number} +``` + +time until the next unload per cargo type + +### Engine.Component.TransportVehicle.lastStationStockIndex[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.lastStationStockIndex) + +``` +Engine.Component.TransportVehicle.lastStationStockIndex: integer +``` + +index of the last station/stock where cargo was loaded/unloaded if multiple compatible stocks are in reach of the current +terminal of the currently loading/unloading cargo type. + +### Engine.Component.TransportVehicle.doorsTime[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.doorsTime) + +``` +Engine.Component.TransportVehicle.doorsTime: integer +``` + +time at which the door have been closed/open + +### Engine.Component.TransportVehicle.daysInDepot[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.daysInDepot) + +``` +Engine.Component.TransportVehicle.daysInDepot: integer +``` + +amount of days waiting in depot + +### Engine.Component.TransportVehicle.daysAtTerminal[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.daysAtTerminal) + +``` +Engine.Component.TransportVehicle.daysAtTerminal: integer +``` + +amount of days waiting at terminal + +### Engine.Component.TransportVehicle.doorsOpen[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.doorsOpen) + +``` +Engine.Component.TransportVehicle.doorsOpen: boolean +``` + +whether doors should be open or closed + +### Engine.Component.TransportVehicle.noPath[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.noPath) + +``` +Engine.Component.TransportVehicle.noPath: boolean +``` + +whether or not the vehicle has a path + +### Engine.Component.TransportVehicle.autoDeparture[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.autoDeparture) + +``` +Engine.Component.TransportVehicle.autoDeparture: boolean +``` + +whether the vehicle departure is managed by the game or not + +### Engine.Component.TransportVehicle.maintenanceStation[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.maintenanceStation) + +``` +Engine.Component.TransportVehicle.maintenanceStation: Engine.Entity +``` + +the maintenance station maintaining the vehicle + +### Engine.Component.TransportVehicle.modifiers[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.modifiers) + +``` +Engine.Component.TransportVehicle.modifiers: Modifiers +``` + +modifiers applied to the transport vehicle + +### Engine.Component.TransportVehicle.unloadPendingIncome[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.unloadPendingIncome) + +``` +Engine.Component.TransportVehicle.unloadPendingIncome: PendingIncomeParams +``` + +list of pending income + +### Engine.Component.TransportVehicle.closestTown[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.closestTown) + +``` +Engine.Component.TransportVehicle.closestTown: Engine.Entity +``` + +the closest town to the vehicle + +### Engine.Component.TransportVehicle.visitedStops[πŸ”—](#$api.engine~Engine.Component.TransportVehicle.visitedStops) + +``` +Engine.Component.TransportVehicle.visitedStops: {integer} +``` + +The last stops on the line the transport vehicle stopped at +The length is limited to the number of stops on the line + +### Engine.Component.VehicleDepot[πŸ”—](#$api.engine~Engine.Component.VehicleDepot) + +``` +record Engine.Component.VehicleDepot new: function(): VehicleDepot + carrier: Carrier + transportModes: {TransportMode : boolean} + inNodes: {NodeId} + outNodes: {NodeId} + state: integer + doors: number + stateTime: integer + catchmentArea: CatchmentArea + maintenancePool: integer + maxPoolUsage: number + averagePoolUsage: number + poolUsageTicks: integer + filterTags: {string} +end +``` + +Defines a vehicle depot + +### Engine.Component.VehicleDepot.new[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.new) + +``` +function Engine.Component.VehicleDepot.new(): VehicleDepot +``` + +**Returns** + +1. `VehicleDepot` + +### Engine.Component.VehicleDepot.carrier[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.carrier) + +``` +Engine.Component.VehicleDepot.carrier: Carrier +``` + +The transport method for the depot, affects available vehicles + +### Engine.Component.VehicleDepot.transportModes[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.transportModes) + +``` +Engine.Component.VehicleDepot.transportModes: {TransportMode : boolean} +``` + +### Engine.Component.VehicleDepot.inNodes[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.inNodes) + +``` +Engine.Component.VehicleDepot.inNodes: {NodeId} +``` + +the nodes that are entry points for the depot + +### Engine.Component.VehicleDepot.outNodes[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.outNodes) + +``` +Engine.Component.VehicleDepot.outNodes: {NodeId} +``` + +the nodes that are exit points for the depot + +### Engine.Component.VehicleDepot.state[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.state) + +``` +Engine.Component.VehicleDepot.state: integer +``` + +### Engine.Component.VehicleDepot.doors[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.doors) + +``` +Engine.Component.VehicleDepot.doors: number +``` + +### Engine.Component.VehicleDepot.stateTime[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.stateTime) + +``` +Engine.Component.VehicleDepot.stateTime: integer +``` + +### Engine.Component.VehicleDepot.catchmentArea[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.catchmentArea) + +``` +Engine.Component.VehicleDepot.catchmentArea: CatchmentArea +``` + +the area around the station where vehicles are maintained + +### Engine.Component.VehicleDepot.maintenancePool[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.maintenancePool) + +``` +Engine.Component.VehicleDepot.maintenancePool: integer +``` + +number of vehicles that can be maintained + +### Engine.Component.VehicleDepot.maxPoolUsage[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.maxPoolUsage) + +``` +Engine.Component.VehicleDepot.maxPoolUsage: number +``` + +maximum number of vehicles that were recently maintained at the same time + +### Engine.Component.VehicleDepot.averagePoolUsage[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.averagePoolUsage) + +``` +Engine.Component.VehicleDepot.averagePoolUsage: number +``` + +average accumulated number of vehicles that were recently maintained at the same time + +### Engine.Component.VehicleDepot.poolUsageTicks[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.poolUsageTicks) + +``` +Engine.Component.VehicleDepot.poolUsageTicks: integer +``` + +number of ticks for recently maintained vehicles statistics + +### Engine.Component.VehicleDepot.filterTags[πŸ”—](#$api.engine~Engine.Component.VehicleDepot.filterTags) + +``` +Engine.Component.VehicleDepot.filterTags: {string} +``` + +vehicle filter tags + +### Engine.Component.VehicleOrder[πŸ”—](#$api.engine~Engine.Component.VehicleOrder) + +``` +record Engine.Component.VehicleOrder new: function(): VehicleOrder + equals: function(VehicleOrder, VehicleOrder): boolean + entity: Engine.Entity + strongBrakeEntity: boolean + waitingForSpace: boolean + waitingForTrafficLight: boolean +end +``` + +Contains information about precedence and breaking. + +### Engine.Component.VehicleOrder.new[πŸ”—](#$api.engine~Engine.Component.VehicleOrder.new) + +``` +function Engine.Component.VehicleOrder.new(): VehicleOrder +``` + +**Returns** + +1. `VehicleOrder` + +### Engine.Component.VehicleOrder.equals[πŸ”—](#$api.engine~Engine.Component.VehicleOrder.equals) + +``` +function Engine.Component.VehicleOrder.equals(VehicleOrder, VehicleOrder): boolean +``` + +**Parameters** + +* `VehicleOrder` +* `VehicleOrder` + +**Returns** + +1. `boolean` + +### Engine.Component.VehicleOrder.entity[πŸ”—](#$api.engine~Engine.Component.VehicleOrder.entity) + +``` +Engine.Component.VehicleOrder.entity: Engine.Entity +``` + +the vehicle entity of the vehicle before this vehicle + +### Engine.Component.VehicleOrder.strongBrakeEntity[πŸ”—](#$api.engine~Engine.Component.VehicleOrder.strongBrakeEntity) + +``` +Engine.Component.VehicleOrder.strongBrakeEntity: boolean +``` + +### Engine.Component.VehicleOrder.waitingForSpace[πŸ”—](#$api.engine~Engine.Component.VehicleOrder.waitingForSpace) + +``` +Engine.Component.VehicleOrder.waitingForSpace: boolean +``` + +### Engine.Component.VehicleOrder.waitingForTrafficLight[πŸ”—](#$api.engine~Engine.Component.VehicleOrder.waitingForTrafficLight) + +``` +Engine.Component.VehicleOrder.waitingForTrafficLight: boolean +``` + +### Engine.Component.Warehouse[πŸ”—](#$api.engine~Engine.Component.Warehouse) + +``` +record Engine.Component.Warehouse new: function(): Warehouse + stockList: Engine.Entity + construction: Engine.Entity +end +``` + +Contains information about warehouses. + +### Engine.Component.Warehouse.new[πŸ”—](#$api.engine~Engine.Component.Warehouse.new) + +``` +function Engine.Component.Warehouse.new(): Warehouse +``` + +**Returns** + +1. `Warehouse` + +### Engine.Component.Warehouse.stockList[πŸ”—](#$api.engine~Engine.Component.Warehouse.stockList) + +``` +Engine.Component.Warehouse.stockList: Engine.Entity +``` + +contains coresponding stock list + +### Engine.Component.Warehouse.construction[πŸ”—](#$api.engine~Engine.Component.Warehouse.construction) + +``` +Engine.Component.Warehouse.construction: Engine.Entity +``` + +containing the warehouse + +### Engine.Component.WaterMesh[πŸ”—](#$api.engine~Engine.Component.WaterMesh) + +``` +[Expand All] [Collapse All] + +record Engine.Component.WaterMesh new: function(): WaterMesh + record Contour new: function(): Contour + vertices: {Vec2f} + normals: {Vec2f} +end + waterLevel: number + vertices: {Vec2f} + depths: {number} + indices: {integer} + contours: {Contour} + pos: Vec2i +end +``` + +Contains the geometry information for a single tile of water. + +### Engine.Component.WaterMesh.new[πŸ”—](#$api.engine~Engine.Component.WaterMesh.new) + +``` +function Engine.Component.WaterMesh.new(): WaterMesh +``` + +**Returns** + +1. `WaterMesh` + +### Engine.Component.WaterMesh.Contour[πŸ”—](#$api.engine~Engine.Component.WaterMesh.Contour) + +``` +record Engine.Component.WaterMesh.Contour new: function(): Contour + vertices: {Vec2f} + normals: {Vec2f} +end +``` + +Represents the boundary of a water mesh. + +### Engine.Component.WaterMesh.Contour.new[πŸ”—](#$api.engine~Engine.Component.WaterMesh.Contour.new) + +``` +function Engine.Component.WaterMesh.Contour.new(): Contour +``` + +**Returns** + +1. `Contour` + +### Engine.Component.WaterMesh.Contour.vertices[πŸ”—](#$api.engine~Engine.Component.WaterMesh.Contour.vertices) + +``` +Engine.Component.WaterMesh.Contour.vertices: {Vec2f} +``` + +The list of vertices of the contour + +### Engine.Component.WaterMesh.Contour.normals[πŸ”—](#$api.engine~Engine.Component.WaterMesh.Contour.normals) + +``` +Engine.Component.WaterMesh.Contour.normals: {Vec2f} +``` + +The list of normals at the vertex + +### Engine.Component.WaterMesh.waterLevel[πŸ”—](#$api.engine~Engine.Component.WaterMesh.waterLevel) + +``` +Engine.Component.WaterMesh.waterLevel: number +``` + +level for the surface of the navigatable water + +### Engine.Component.WaterMesh.vertices[πŸ”—](#$api.engine~Engine.Component.WaterMesh.vertices) + +``` +Engine.Component.WaterMesh.vertices: {Vec2f} +``` + +the list of vertices of the mesh + +### Engine.Component.WaterMesh.depths[πŸ”—](#$api.engine~Engine.Component.WaterMesh.depths) + +``` +Engine.Component.WaterMesh.depths: {number} +``` + +the water depth at the vertex position + +### Engine.Component.WaterMesh.indices[πŸ”—](#$api.engine~Engine.Component.WaterMesh.indices) + +``` +Engine.Component.WaterMesh.indices: {integer} +``` + +### Engine.Component.WaterMesh.contours[πŸ”—](#$api.engine~Engine.Component.WaterMesh.contours) + +``` +Engine.Component.WaterMesh.contours: {Contour} +``` + +a list with boundaries of the water mesh + +### Engine.Component.WaterMesh.pos[πŸ”—](#$api.engine~Engine.Component.WaterMesh.pos) + +``` +Engine.Component.WaterMesh.pos: Vec2i +``` + +coordinate of the tile + +### Engine.Component.World[πŸ”—](#$api.engine~Engine.Component.World) + +``` +record Engine.Component.World new: function(): World + cloudCoverage: number +end +``` + +The World Component + +### Engine.Component.World.new[πŸ”—](#$api.engine~Engine.Component.World.new) + +``` +function Engine.Component.World.new(): World +``` + +**Returns** + +1. `World` + +### Engine.Component.World.cloudCoverage[πŸ”—](#$api.engine~Engine.Component.World.cloudCoverage) + +``` +Engine.Component.World.cloudCoverage: number +``` + +### Engine.ComponentType[πŸ”—](#$api.engine~Engine.ComponentType) + +``` +record Engine.ComponentType AIRCRAFT: ComponentType + ANIMAL: ComponentType + ASSET_GROUP: ComponentType + BASE_EDGE: ComponentType + BASE_EDGE_STREET: ComponentType + BASE_NODE: ComponentType + BASE_PARALLEL_STRIP: ComponentType + CUSTOM_STATE: ComponentType + EMISSION_EMITTER: ComponentType + FIELD: ComponentType + GAME_TIME: ComponentType + GAME_SPEED: ComponentType + MODEL_INSTANCE_LIST: ComponentType + NAME: ComponentType + LINE: ComponentType + LOG_BOOK: ComponentType + MODEL_PERSON: ComponentType + MOVE_PATH: ComponentType + MOVE_PATH_AIRCRAFT: ComponentType + STATION: ComponentType + STATION_GROUP: ComponentType + SIM_PERSON: ComponentType + SIM_PERSON_AT_TERMINAL: ComponentType + SIM_PERSON_AT_VEHICLE: ComponentType + SIM_CARGO: ComponentType + SIM_ENTITY_AT_BUILDING: ComponentType + SIM_ENTITY_AT_VEHICLE: ComponentType + SIM_ENTITY_AT_TERMINAL: ComponentType + SIM_ENTITY_IDLE: ComponentType + SIM_ENTITY_MOVING: ComponentType + SIGNAL_LIST: ComponentType + TOWN: ComponentType + INDUSTRY: ComponentType + STOCK_LIST: ComponentType + TOWN_BUILDING: ComponentType + TRANSPORT_VEHICLE: ComponentType + TRAIN: ComponentType + CARRIAGE: ComponentType + CARRIAGE_LIST: ComponentType + VEHICLE_DEPOT: ComponentType + COLOR: ComponentType + BOUNDING_VOLUME: ComponentType + CONSTRUCTION: ComponentType + SUBCONSTRUCTION: ComponentType + PERSON_CAPACITY: ComponentType + PLAYER_OWNED: ComponentType + ACCOUNT: ComponentType + GAME_SCRIPT: ComponentType + WAREHOUSE: ComponentType + TRANSPORT_NETWORK: ComponentType + MAINTENANCE_COST: ComponentType + RAILROAD_CROSSING: ComponentType + PLAYER: ComponentType + WORLD: ComponentType + BRIDGE: ComponentType + BASE_NODE_CONFIG: ComponentType + LAND_VEHICLE: ComponentType + BASE_NODE_TRAFFIC_LIGHT: ComponentType + EDGE_OBJECT: ComponentType + EMISSION_GRID: ComponentType + TERRAIN: ComponentType +end +``` + +Represents a single component that can be attached to an entity. + +### Engine.ComponentType.AIRCRAFT[πŸ”—](#$api.engine~Engine.ComponentType.AIRCRAFT) + +``` +Engine.ComponentType.AIRCRAFT: ComponentType +``` + +### Engine.ComponentType.ANIMAL[πŸ”—](#$api.engine~Engine.ComponentType.ANIMAL) + +``` +Engine.ComponentType.ANIMAL: ComponentType +``` + +### Engine.ComponentType.ASSET\_GROUP[πŸ”—](#$api.engine~Engine.ComponentType.ASSET_GROUP) + +``` +Engine.ComponentType.ASSET_GROUP: ComponentType +``` + +### Engine.ComponentType.BASE\_EDGE[πŸ”—](#$api.engine~Engine.ComponentType.BASE_EDGE) + +``` +Engine.ComponentType.BASE_EDGE: ComponentType +``` + +### Engine.ComponentType.BASE\_EDGE\_STREET[πŸ”—](#$api.engine~Engine.ComponentType.BASE_EDGE_STREET) + +``` +Engine.ComponentType.BASE_EDGE_STREET: ComponentType +``` + +### Engine.ComponentType.BASE\_NODE[πŸ”—](#$api.engine~Engine.ComponentType.BASE_NODE) + +``` +Engine.ComponentType.BASE_NODE: ComponentType +``` + +### Engine.ComponentType.BASE\_PARALLEL\_STRIP[πŸ”—](#$api.engine~Engine.ComponentType.BASE_PARALLEL_STRIP) + +``` +Engine.ComponentType.BASE_PARALLEL_STRIP: ComponentType +``` + +### Engine.ComponentType.CUSTOM\_STATE[πŸ”—](#$api.engine~Engine.ComponentType.CUSTOM_STATE) + +``` +Engine.ComponentType.CUSTOM_STATE: ComponentType +``` + +### Engine.ComponentType.EMISSION\_EMITTER[πŸ”—](#$api.engine~Engine.ComponentType.EMISSION_EMITTER) + +``` +Engine.ComponentType.EMISSION_EMITTER: ComponentType +``` + +### Engine.ComponentType.FIELD[πŸ”—](#$api.engine~Engine.ComponentType.FIELD) + +``` +Engine.ComponentType.FIELD: ComponentType +``` + +### Engine.ComponentType.GAME\_TIME[πŸ”—](#$api.engine~Engine.ComponentType.GAME_TIME) + +``` +Engine.ComponentType.GAME_TIME: ComponentType +``` + +### Engine.ComponentType.GAME\_SPEED[πŸ”—](#$api.engine~Engine.ComponentType.GAME_SPEED) + +``` +Engine.ComponentType.GAME_SPEED: ComponentType +``` + +### Engine.ComponentType.MODEL\_INSTANCE\_LIST[πŸ”—](#$api.engine~Engine.ComponentType.MODEL_INSTANCE_LIST) + +``` +Engine.ComponentType.MODEL_INSTANCE_LIST: ComponentType +``` + +### Engine.ComponentType.NAME[πŸ”—](#$api.engine~Engine.ComponentType.NAME) + +``` +Engine.ComponentType.NAME: ComponentType +``` + +### Engine.ComponentType.LINE[πŸ”—](#$api.engine~Engine.ComponentType.LINE) + +``` +Engine.ComponentType.LINE: ComponentType +``` + +### Engine.ComponentType.LOG\_BOOK[πŸ”—](#$api.engine~Engine.ComponentType.LOG_BOOK) + +``` +Engine.ComponentType.LOG_BOOK: ComponentType +``` + +### Engine.ComponentType.MODEL\_PERSON[πŸ”—](#$api.engine~Engine.ComponentType.MODEL_PERSON) + +``` +Engine.ComponentType.MODEL_PERSON: ComponentType +``` + +### Engine.ComponentType.MOVE\_PATH[πŸ”—](#$api.engine~Engine.ComponentType.MOVE_PATH) + +``` +Engine.ComponentType.MOVE_PATH: ComponentType +``` + +### Engine.ComponentType.MOVE\_PATH\_AIRCRAFT[πŸ”—](#$api.engine~Engine.ComponentType.MOVE_PATH_AIRCRAFT) + +``` +Engine.ComponentType.MOVE_PATH_AIRCRAFT: ComponentType +``` + +### Engine.ComponentType.STATION[πŸ”—](#$api.engine~Engine.ComponentType.STATION) + +``` +Engine.ComponentType.STATION: ComponentType +``` + +### Engine.ComponentType.STATION\_GROUP[πŸ”—](#$api.engine~Engine.ComponentType.STATION_GROUP) + +``` +Engine.ComponentType.STATION_GROUP: ComponentType +``` + +### Engine.ComponentType.SIM\_PERSON[πŸ”—](#$api.engine~Engine.ComponentType.SIM_PERSON) + +``` +Engine.ComponentType.SIM_PERSON: ComponentType +``` + +### Engine.ComponentType.SIM\_PERSON\_AT\_TERMINAL[πŸ”—](#$api.engine~Engine.ComponentType.SIM_PERSON_AT_TERMINAL) + +``` +Engine.ComponentType.SIM_PERSON_AT_TERMINAL: ComponentType +``` + +### Engine.ComponentType.SIM\_PERSON\_AT\_VEHICLE[πŸ”—](#$api.engine~Engine.ComponentType.SIM_PERSON_AT_VEHICLE) + +``` +Engine.ComponentType.SIM_PERSON_AT_VEHICLE: ComponentType +``` + +### Engine.ComponentType.SIM\_CARGO[πŸ”—](#$api.engine~Engine.ComponentType.SIM_CARGO) + +``` +Engine.ComponentType.SIM_CARGO: ComponentType +``` + +### Engine.ComponentType.SIM\_ENTITY\_AT\_BUILDING[πŸ”—](#$api.engine~Engine.ComponentType.SIM_ENTITY_AT_BUILDING) + +``` +Engine.ComponentType.SIM_ENTITY_AT_BUILDING: ComponentType +``` + +### Engine.ComponentType.SIM\_ENTITY\_AT\_VEHICLE[πŸ”—](#$api.engine~Engine.ComponentType.SIM_ENTITY_AT_VEHICLE) + +``` +Engine.ComponentType.SIM_ENTITY_AT_VEHICLE: ComponentType +``` + +### Engine.ComponentType.SIM\_ENTITY\_AT\_TERMINAL[πŸ”—](#$api.engine~Engine.ComponentType.SIM_ENTITY_AT_TERMINAL) + +``` +Engine.ComponentType.SIM_ENTITY_AT_TERMINAL: ComponentType +``` + +### Engine.ComponentType.SIM\_ENTITY\_IDLE[πŸ”—](#$api.engine~Engine.ComponentType.SIM_ENTITY_IDLE) + +``` +Engine.ComponentType.SIM_ENTITY_IDLE: ComponentType +``` + +### Engine.ComponentType.SIM\_ENTITY\_MOVING[πŸ”—](#$api.engine~Engine.ComponentType.SIM_ENTITY_MOVING) + +``` +Engine.ComponentType.SIM_ENTITY_MOVING: ComponentType +``` + +### Engine.ComponentType.SIGNAL\_LIST[πŸ”—](#$api.engine~Engine.ComponentType.SIGNAL_LIST) + +``` +Engine.ComponentType.SIGNAL_LIST: ComponentType +``` + +### Engine.ComponentType.TOWN[πŸ”—](#$api.engine~Engine.ComponentType.TOWN) + +``` +Engine.ComponentType.TOWN: ComponentType +``` + +### Engine.ComponentType.INDUSTRY[πŸ”—](#$api.engine~Engine.ComponentType.INDUSTRY) + +``` +Engine.ComponentType.INDUSTRY: ComponentType +``` + +### Engine.ComponentType.STOCK\_LIST[πŸ”—](#$api.engine~Engine.ComponentType.STOCK_LIST) + +``` +Engine.ComponentType.STOCK_LIST: ComponentType +``` + +### Engine.ComponentType.TOWN\_BUILDING[πŸ”—](#$api.engine~Engine.ComponentType.TOWN_BUILDING) + +``` +Engine.ComponentType.TOWN_BUILDING: ComponentType +``` + +### Engine.ComponentType.TRANSPORT\_VEHICLE[πŸ”—](#$api.engine~Engine.ComponentType.TRANSPORT_VEHICLE) + +``` +Engine.ComponentType.TRANSPORT_VEHICLE: ComponentType +``` + +### Engine.ComponentType.TRAIN[πŸ”—](#$api.engine~Engine.ComponentType.TRAIN) + +``` +Engine.ComponentType.TRAIN: ComponentType +``` + +### Engine.ComponentType.CARRIAGE[πŸ”—](#$api.engine~Engine.ComponentType.CARRIAGE) + +``` +Engine.ComponentType.CARRIAGE: ComponentType +``` + +### Engine.ComponentType.CARRIAGE\_LIST[πŸ”—](#$api.engine~Engine.ComponentType.CARRIAGE_LIST) + +``` +Engine.ComponentType.CARRIAGE_LIST: ComponentType +``` + +### Engine.ComponentType.VEHICLE\_DEPOT[πŸ”—](#$api.engine~Engine.ComponentType.VEHICLE_DEPOT) + +``` +Engine.ComponentType.VEHICLE_DEPOT: ComponentType +``` + +### Engine.ComponentType.COLOR[πŸ”—](#$api.engine~Engine.ComponentType.COLOR) + +``` +Engine.ComponentType.COLOR: ComponentType +``` + +### Engine.ComponentType.BOUNDING\_VOLUME[πŸ”—](#$api.engine~Engine.ComponentType.BOUNDING_VOLUME) + +``` +Engine.ComponentType.BOUNDING_VOLUME: ComponentType +``` + +### Engine.ComponentType.CONSTRUCTION[πŸ”—](#$api.engine~Engine.ComponentType.CONSTRUCTION) + +``` +Engine.ComponentType.CONSTRUCTION: ComponentType +``` + +### Engine.ComponentType.SUBCONSTRUCTION[πŸ”—](#$api.engine~Engine.ComponentType.SUBCONSTRUCTION) + +``` +Engine.ComponentType.SUBCONSTRUCTION: ComponentType +``` + +### Engine.ComponentType.PERSON\_CAPACITY[πŸ”—](#$api.engine~Engine.ComponentType.PERSON_CAPACITY) + +``` +Engine.ComponentType.PERSON_CAPACITY: ComponentType +``` + +### Engine.ComponentType.PLAYER\_OWNED[πŸ”—](#$api.engine~Engine.ComponentType.PLAYER_OWNED) + +``` +Engine.ComponentType.PLAYER_OWNED: ComponentType +``` + +### Engine.ComponentType.ACCOUNT[πŸ”—](#$api.engine~Engine.ComponentType.ACCOUNT) + +``` +Engine.ComponentType.ACCOUNT: ComponentType +``` + +### Engine.ComponentType.GAME\_SCRIPT[πŸ”—](#$api.engine~Engine.ComponentType.GAME_SCRIPT) + +``` +Engine.ComponentType.GAME_SCRIPT: ComponentType +``` + +### Engine.ComponentType.WAREHOUSE[πŸ”—](#$api.engine~Engine.ComponentType.WAREHOUSE) + +``` +Engine.ComponentType.WAREHOUSE: ComponentType +``` + +### Engine.ComponentType.TRANSPORT\_NETWORK[πŸ”—](#$api.engine~Engine.ComponentType.TRANSPORT_NETWORK) + +``` +Engine.ComponentType.TRANSPORT_NETWORK: ComponentType +``` + +### Engine.ComponentType.MAINTENANCE\_COST[πŸ”—](#$api.engine~Engine.ComponentType.MAINTENANCE_COST) + +``` +Engine.ComponentType.MAINTENANCE_COST: ComponentType +``` + +### Engine.ComponentType.RAILROAD\_CROSSING[πŸ”—](#$api.engine~Engine.ComponentType.RAILROAD_CROSSING) + +``` +Engine.ComponentType.RAILROAD_CROSSING: ComponentType +``` + +### Engine.ComponentType.PLAYER[πŸ”—](#$api.engine~Engine.ComponentType.PLAYER) + +``` +Engine.ComponentType.PLAYER: ComponentType +``` + +### Engine.ComponentType.WORLD[πŸ”—](#$api.engine~Engine.ComponentType.WORLD) + +``` +Engine.ComponentType.WORLD: ComponentType +``` + +### Engine.ComponentType.BRIDGE[πŸ”—](#$api.engine~Engine.ComponentType.BRIDGE) + +``` +Engine.ComponentType.BRIDGE: ComponentType +``` + +### Engine.ComponentType.BASE\_NODE\_CONFIG[πŸ”—](#$api.engine~Engine.ComponentType.BASE_NODE_CONFIG) + +``` +Engine.ComponentType.BASE_NODE_CONFIG: ComponentType +``` + +### Engine.ComponentType.LAND\_VEHICLE[πŸ”—](#$api.engine~Engine.ComponentType.LAND_VEHICLE) + +``` +Engine.ComponentType.LAND_VEHICLE: ComponentType +``` + +### Engine.ComponentType.BASE\_NODE\_TRAFFIC\_LIGHT[πŸ”—](#$api.engine~Engine.ComponentType.BASE_NODE_TRAFFIC_LIGHT) + +``` +Engine.ComponentType.BASE_NODE_TRAFFIC_LIGHT: ComponentType +``` + +### Engine.ComponentType.EDGE\_OBJECT[πŸ”—](#$api.engine~Engine.ComponentType.EDGE_OBJECT) + +``` +Engine.ComponentType.EDGE_OBJECT: ComponentType +``` + +### Engine.ComponentType.EMISSION\_GRID[πŸ”—](#$api.engine~Engine.ComponentType.EMISSION_GRID) + +``` +Engine.ComponentType.EMISSION_GRID: ComponentType +``` + +### Engine.ComponentType.TERRAIN[πŸ”—](#$api.engine~Engine.ComponentType.TERRAIN) + +``` +Engine.ComponentType.TERRAIN: ComponentType +``` + +### Engine.getComponent[πŸ”—](#$api.engine~Engine.getComponent) + +``` +function Engine.getComponent(entity : Entity, type : ComponentType): T +``` + +Obtains a component from an entity, if available. + +##### Type Parameters + +* **`T`** + +**Parameters** + +* `entity` :`Entity` β€” the entity (must be a valid, existing entity) +* `type` :`ComponentType` β€” the component type to obtain + +**Returns** + +1. `T` β€” the component if the entity has one, or nil otherwise + +### Engine.EntityFilters[πŸ”—](#$api.engine~Engine.EntityFilters) + +``` +record Engine.EntityFilters requireOwnedByPlayer: Engine.Entity + filterFn: function(Engine.Entity): boolean +end +``` + +Optional filter configuration for `getEntitiesWithComponent`. + +### Engine.EntityFilters.requireOwnedByPlayer[πŸ”—](#$api.engine~Engine.EntityFilters.requireOwnedByPlayer) + +``` +Engine.EntityFilters.requireOwnedByPlayer: Engine.Entity +``` + +Only include entities owned by the given player entity. + +### Engine.EntityFilters.filterFn[πŸ”—](#$api.engine~Engine.EntityFilters.filterFn) + +``` +function Engine.EntityFilters.filterFn(Engine.Entity): boolean +``` + +Custom filter: Most flexible - but very slow. + +**Parameters** + +* `Engine.Entity` + +**Returns** + +1. `boolean` + +### Engine.forEachEntityWithComponent[πŸ”—](#$api.engine~Engine.forEachEntityWithComponent) + +``` +function Engine.forEachEntityWithComponent(fn : function(Entity), componentType : ComponentType) +``` + +Loop over each entity with a given component. + +**Parameters** + +* `fn` :`function(Entity)` β€” the callback called for each entity with the given component +* `componentType` :`ComponentType` β€” the component used to filter the entities + +### Engine.forEachEntity[πŸ”—](#$api.engine~Engine.forEachEntity) + +``` +function Engine.forEachEntity(callback : function(Entity)) +``` + +Loop over each entity in the engine. + +**Parameters** + +* `callback` :`function(Entity)` β€” the callback called for each entity + +### Engine.getEntitiesWithComponent[πŸ”—](#$api.engine~Engine.getEntitiesWithComponent) + +``` +function Engine.getEntitiesWithComponent(componentType : ComponentType, filters : EntityFilters): {Engine.Entity} +``` + +Get each entity with a given component. + +**Parameters** + +* `componentType` :`ComponentType` β€” the component used to filter the entities +* `filters` :`EntityFilters` β€” optional table with filter configuration (`requireOwnedByPlayer` and `filterFn`) + +**Returns** + +1. `{Engine.Entity}` + +### Engine.getRevision[πŸ”—](#$api.engine~Engine.getRevision) + +``` +function Engine.getRevision(entity : Entity): Revision +``` + +Returns the revision of the entity. + +**Parameters** + +* `entity` :`Entity` β€” the entity + +**Returns** + +1. `Revision` β€” the entity revision + +### Engine.entityExists[πŸ”—](#$api.engine~Engine.entityExists) + +``` +function Engine.entityExists(entity : Entity): boolean +``` + +Checks whether an entity exists. + +**Parameters** + +* `entity` :`Entity` β€” the entity + +**Returns** + +1. `boolean` β€” true if the entity exists + +### Engine.UtilTerrain[πŸ”—](#$api.engine~Engine.UtilTerrain) + +``` +record Engine.UtilTerrain isValidCoordinate: function(position : Vec2f): boolean + getHeightAt: function(position : Vec2f): number + getBaseHeightAt: function(position : Vec2f): number + isOnWater: function(position : Vec2f): boolean + getHeightmapEntity: function(position : Vec2i): Engine.Entity + getBoundingBox: function(): Box2f + makeMapFromGame: function(withHeightmap : boolean, withTowns : boolean, withIndustries : boolean, withAssets : boolean): GameMap + getTerrainEntityRevisions: function(): {Engine.Entity : Engine.Revision} + getBaseResolution: function(): Vec3f + getHighResolution: function(): Vec3f + ceilTerrainFragmentInTiles: function(percentage : number): integer +end +``` + +### Engine.UtilTerrain.isValidCoordinate[πŸ”—](#$api.engine~Engine.UtilTerrain.isValidCoordinate) + +``` +function Engine.UtilTerrain.isValidCoordinate(position : Vec2f): boolean +``` + +Check if coordinate is within bounds of world. + +**Parameters** + +* `position` :`Vec2f` β€” world position with x and y coordinate from center of the map + +**Returns** + +1. `boolean` β€” true if valid coordinate, false if non valid coordinate + +### Engine.UtilTerrain.getHeightAt[πŸ”—](#$api.engine~Engine.UtilTerrain.getHeightAt) + +``` +function Engine.UtilTerrain.getHeightAt(position : Vec2f): number +``` + +Fetches height at the world position. When the coordinates are outside the map, the value of the nearest position on the map is returned. + +**Parameters** + +* `position` :`Vec2f` β€” world position with x and y coordinate from center of the map + +**Returns** + +1. `number` β€” the height at the position + +### Engine.UtilTerrain.getBaseHeightAt[πŸ”—](#$api.engine~Engine.UtilTerrain.getBaseHeightAt) + +``` +function Engine.UtilTerrain.getBaseHeightAt(position : Vec2f): number +``` + +Fetches base height at the world position. Differently than `getHeightAt`, this does not include terrain alignments (non-permanent modifications) +and has a lower resolution of 4 meters. When the coordinates are outside the map, the value of the nearest position on the map is returned. + +**Parameters** + +* `position` :`Vec2f` β€” world position with x and y coordinate from center of the map + +**Returns** + +1. `number` β€” the height at the position + +### Engine.UtilTerrain.isOnWater[πŸ”—](#$api.engine~Engine.UtilTerrain.isOnWater) + +``` +function Engine.UtilTerrain.isOnWater(position : Vec2f): boolean +``` + +Returns whether the given world position is on water, i.e. below the water level. + +**Parameters** + +* `position` :`Vec2f` β€” world position with x and y coordinate from center of the map + +**Returns** + +1. `boolean` β€” true if the position is on water, false otherwise + +### Engine.UtilTerrain.getHeightmapEntity[πŸ”—](#$api.engine~Engine.UtilTerrain.getHeightmapEntity) + +``` +function Engine.UtilTerrain.getHeightmapEntity(position : Vec2i): Engine.Entity +``` + +Fetches the entity at the given tile position. + +**Parameters** + +* `position` :`Vec2i` β€” tile position + +**Returns** + +1. `Engine.Entity` β€” the heightmap entity at the position + +### Engine.UtilTerrain.getBoundingBox[πŸ”—](#$api.engine~Engine.UtilTerrain.getBoundingBox) + +``` +function Engine.UtilTerrain.getBoundingBox(): Box2f +``` + +Returns the bounding box of the terrain. + +**Returns** + +1. `Box2f` β€” bounding box of the terrain + +### Engine.UtilTerrain.makeMapFromGame[πŸ”—](#$api.engine~Engine.UtilTerrain.makeMapFromGame) + +``` +function Engine.UtilTerrain.makeMapFromGame(withHeightmap : boolean, withTowns : boolean, withIndustries : boolean, withAssets : boolean): GameMap +``` + +Creates a map data structure from the current game state. + +**Parameters** + +* `withHeightmap` :`boolean` β€” include heightmap data +* `withTowns` :`boolean` β€” include town data +* `withIndustries` :`boolean` β€” include industry data +* `withAssets` :`boolean` β€” include asset data + +**Returns** + +1. `GameMap` β€” the generated map + +### Engine.UtilTerrain.getTerrainEntityRevisions[πŸ”—](#$api.engine~Engine.UtilTerrain.getTerrainEntityRevisions) + +``` +function Engine.UtilTerrain.getTerrainEntityRevisions(): {Engine.Entity : Engine.Revision} +``` + +Gets the entity revision numbers for all terrain entities. + +**Returns** + +1. `{Engine.Entity : Engine.Revision}` β€” map of entity to revision number + +### Engine.UtilTerrain.getBaseResolution[πŸ”—](#$api.engine~Engine.UtilTerrain.getBaseResolution) + +``` +function Engine.UtilTerrain.getBaseResolution(): Vec3f +``` + +Gets the base resolution of the terrain. + +**Returns** + +1. `Vec3f` β€” the base resolution + +### Engine.UtilTerrain.getHighResolution[πŸ”—](#$api.engine~Engine.UtilTerrain.getHighResolution) + +``` +function Engine.UtilTerrain.getHighResolution(): Vec3f +``` + +Gets the high resolution of the terrain. + +**Returns** + +1. `Vec3f` β€” the high resolution + +### Engine.UtilTerrain.ceilTerrainFragmentInTiles[πŸ”—](#$api.engine~Engine.UtilTerrain.ceilTerrainFragmentInTiles) + +``` +function Engine.UtilTerrain.ceilTerrainFragmentInTiles(percentage : number): integer +``` + +Calculates the ceiling of terrain fragment size in tiles based on percentage. + +**Parameters** + +* `percentage` :`number` β€” the percentage value + +**Returns** + +1. `integer` β€” the calculated terrain fragment size in tiles + +### Engine.MapGen[πŸ”—](#$api.engine~Engine.MapGen) + +``` +record Engine.MapGen createTowns: function(string, {GameMap.Town}): TownResult + createIndustries: function(string, {GameMap.Industry}): IndustryResult + getDefaultTownConnections: function({GameMap.Town}): {{integer, integer}} + getMinMaxValidTerrainHeight: function(): {number, number} + getMinMaxValidNumTowns: function(): {integer, integer} + getMinMaxValidNumIndustries: function(): {integer, integer} +end +``` + +### Engine.MapGen.createTowns[πŸ”—](#$api.engine~Engine.MapGen.createTowns) + +``` +function Engine.MapGen.createTowns(string, {GameMap.Town}): TownResult +``` + +Create a town proposal from a town list. + +**Parameters** + +* `string` +* `{GameMap.Town}` + +**Returns** + +1. `TownResult` + +### Engine.MapGen.createIndustries[πŸ”—](#$api.engine~Engine.MapGen.createIndustries) + +``` +function Engine.MapGen.createIndustries(string, {GameMap.Industry}): IndustryResult +``` + +Create an industry proposal from an industry list. + +**Parameters** + +* `string` +* `{GameMap.Industry}` + +**Returns** + +1. `IndustryResult` + +### Engine.MapGen.getDefaultTownConnections[πŸ”—](#$api.engine~Engine.MapGen.getDefaultTownConnections) + +``` +function Engine.MapGen.getDefaultTownConnections({GameMap.Town}): {{integer, integer}} +``` + +Create default town connections. + +**Parameters** + +* `{GameMap.Town}` + +**Returns** + +1. `{{integer, integer}}` + +### Engine.MapGen.getMinMaxValidTerrainHeight[πŸ”—](#$api.engine~Engine.MapGen.getMinMaxValidTerrainHeight) + +``` +function Engine.MapGen.getMinMaxValidTerrainHeight(): {number, number} +``` + +Returns the absolute limits of terrain height ranges. + +**Returns** + +1. `{number, number}` + +### Engine.MapGen.getMinMaxValidNumTowns[πŸ”—](#$api.engine~Engine.MapGen.getMinMaxValidNumTowns) + +``` +function Engine.MapGen.getMinMaxValidNumTowns(): {integer, integer} +``` + +Returns the absolute limits of number of towns. + +**Returns** + +1. `{integer, integer}` + +### Engine.MapGen.getMinMaxValidNumIndustries[πŸ”—](#$api.engine~Engine.MapGen.getMinMaxValidNumIndustries) + +``` +function Engine.MapGen.getMinMaxValidNumIndustries(): {integer, integer} +``` + +Returns the absolute limits of number of industries. + +**Returns** + +1. `{integer, integer}` + +### Engine.Config[πŸ”—](#$api.engine~Engine.Config) + +``` +record Engine.Config getConfigDict: function(): {string : string} + getModParams: function(): {string : { : }} +end +``` + +### Engine.Config.getConfigDict[πŸ”—](#$api.engine~Engine.Config.getConfigDict) + +``` +function Engine.Config.getConfigDict(): {string : string} +``` + +Returns the config dict for the game. + +**Returns** + +1. `{string : string}` + +### Engine.Config.getModParams[πŸ”—](#$api.engine~Engine.Config.getModParams) + +``` +function Engine.Config.getModParams(): {string : { : }} +``` + +Returns the mod params for the game. + +**Returns** + +1. `{string : { : }}` + +### Engine.system[πŸ”—](#$api.engine~Engine.system) + +``` +Engine.system: System +``` + +### Engine.terrain[πŸ”—](#$api.engine~Engine.terrain) + +``` +Engine.terrain: UtilTerrain +``` + +### Engine.mapgen[πŸ”—](#$api.engine~Engine.mapgen) + +``` +Engine.mapgen: MapGen +``` + +### Engine.util[πŸ”—](#$api.engine~Engine.util) + +``` +Engine.util: EngineUtil +``` + +### Engine.config[πŸ”—](#$api.engine~Engine.config) + +``` +Engine.config: Config +``` diff --git a/docs/reference/script-doc/api_engine_system.md b/docs/reference/script-doc/api_engine_system.md new file mode 100644 index 0000000..422d00e --- /dev/null +++ b/docs/reference/script-doc/api_engine_system.md @@ -0,0 +1,3075 @@ + + +[index](../../index.html) / [api](../../api.html) / [engine](../engine.html) / system + +--- + +# Module api.engine.system[πŸ”—](#api.engine.system) + +Contains definitions for of api.engine.system + +``` +global record System animalMoveSystem: AnimalMoveSystem + aircraftMoveSystem: AircraftMoveSystem + baseParallelStripSystem: BaseParallelStripSystem + carriageListSystem: CarriageListSystem + catchmentAreaSystem: CatchmentAreaSystem + emissionGridSystem: EmissionGridSystem + gameScriptSystem: GameScriptSystem + landVehicleMoveSystem: LandVehicleMoveSystem + landmarkSystem: LandmarkSystem + lineSystem: LineSystem + octreeSystem: OctreeSystem + parcelSystem: ParcelSystem + railRoadCrossingSystem: RailRoadCrossingSystem + riverSystem: RiverSystem + runwaySystem: RunwaySystem + shipMoveSystem: ShipMoveSystem + signalSystem: SignalSystem + simCargoSystem: SimCargoSystem + simPersonSystem: SimPersonSystem + simPersonAtBuildingSystem: SimPersonAtBuildingSystem + simPersonAtTerminalSystem: SimPersonAtTerminalSystem + simPersonAtVehicleSystem: SimPersonAtVehicleSystem + simEntityAtStockSystem: SimEntityAtStockSystem + simEntityAtTerminalSystem: SimEntityAtTerminalSystem + simEntityAtVehicleSystem: SimEntityAtVehicleSystem + stationSystem: StationSystem + stationGroupSystem: StationGroupSystem + stockListSystem: StockListSystem + streetSystem: StreetSystem + streetConnectorSystem: StreetConnectorSystem + townBuildingSystem: TownBuildingSystem + tpNetLinkSystem: TpNetLinkSystem + transportNetworkSystem: TransportNetworkSystem + transportVehicleSystem: TransportVehicleSystem + vehicleDepotSystem: VehicleDepotSystem + gridCollision: GridCollision +end +global record AircraftMoveSystem getAirCraftInfo: function(vehicleEntity : Engine.Entity): AircraftInfo + isReserved: function(edgeId : EdgeId): boolean + forEach: function(Engine.Entity) +end +global record AnimalMoveSystem forEach: function(Engine.Entity) +end +global record BaseParallelStripSystem getStrips: function(edgeEntity : Engine.Entity): {Engine.Entity} +end + +[Expand All] [Collapse All] + +global record CarriageListSystem record CarriageInfo owningVehicle: Engine.Entity + index: integer + offset: number + reversed: boolean + crew: boolean +end + getVehicleInfo: function(vehicleEntity : Engine.Entity): CarriageInfo + getVehicleData: function(vehicleEntity : Engine.Entity): VehicleData + forEach: function(Engine.Entity) +end +global record CatchmentAreaSystem getEdge2stationsMap: function(): {EdgeId : {{Engine.Entity, integer}}} + getStation2edgesMap: function(): {Engine.Entity : {{EdgeId, integer}}} + getStation2stationsAndDistancesMap: function(): {Engine.Entity : {Engine.Entity : integer}} + getStationCatchables: function(stationEntity : Engine.Entity, cargo : boolean): {Engine.Entity} +end +global record EmissionGridSystem getInterpolatedEmission: function(pos : Vec2f, useAverage : boolean, type : Engine.Component.EmissionGrid.Type): number + getEmissionGridEntity: function(noise : boolean): Engine.Entity +end +global record GameScriptSystem getEntityForGameScript: function(name : string): Engine.Entity +end +global record GridCollision getGridCollisionSystem: function(index : integer): GridCollisionSystem + getPlayerInfrastructureCollisionSystem: function(): GridCollisionSystem +end +global record GridCollisionSystem getCollisionDataAt: function(GridCollisionSystem, Vec2f): number +end +global interface ISystem forEach: function(Engine.Entity) +end +global record LandVehicleMoveSystem getBlockedTrains: function(): {{Engine.Entity, Engine.Entity}} + getVehicleInfo: function(vehicleEntity : Engine.Entity): LandVehicleMoveInfo + isTrainWaitingForFreePath: function(trainEntity : Engine.Entity): boolean + forEach: function(Engine.Entity) +end +global record LandmarkSystem getLandmarkData: function(landmarkEntity : Engine.Entity): {EdgeId : number} +end +global record LineSystem getLines: function(): {Engine.Entity} + getLinesForPlayer: function(playerEntity : Engine.Entity): {Engine.Entity} + getLinesForWaypoint: function(waypointEntity : Engine.Entity): {Engine.Entity} + getLinesForWaypointLane: function(waypointEntity : Engine.Entity, signalIndex : integer): {{Engine.Entity, integer, integer}} + getLineStops: function(stationGroupEntity : Engine.Entity): {{Engine.Entity, integer}} + getLineStopsForStation: function(stationEntity : Engine.Entity): {{Engine.Entity, integer}} + getLineStopsForTerminal: function(stationEntity : Engine.Entity, terminal : integer): {{Engine.Entity, integer}} + getLinesForStationGroup: function(stationGroup : Engine.Entity): {Engine.Entity} + getProblemLines: function(playerEntity : Engine.Entity): {{Engine.Entity, LineProblem}} + getStationGroup2LineStopsMap: function(): {Engine.Entity : {{Engine.Entity, integer}}} + getTerminal2lineStops: function(): {{Engine.Entity, integer} : {{Engine.Entity, integer}}} + getBestLineAssignment: function(lineEntity : Engine.Entity, lineData : Engine.Component.Line, allowTerminalChanges : boolean): {StationTerminal} +end +global record OctreeSystem findIntersectingEntities: function(box : Box3f, callback : function(Engine.Entity, Engine.Component.BoundingVolume)) +end +global record ParcelSystem getParcelData: function(segmentEntity : Engine.Entity): any + getSegment2ParcelData: function(): {Engine.Entity : } +end +global record RailRoadCrossingSystem getRailroadCrossingForEdge: function(edgeEntity : Engine.Entity): Engine.Entity + getRailroadCrossingForNode: function(nodeEntity : Engine.Entity): Engine.Entity +end +global record RiverSystem getWaterMeshEntities: function(Vec2i, Vec2i): {Engine.Entity} +end +global record RunwaySystem getLandingNodeIdMap: function(): {NodeId : Engine.Entity} + getTakeoffNodeIdMap: function(): {NodeId : Engine.Entity} +end +global record ShipMoveSystem getShipInfo: function(vehicleEntity : Engine.Entity): ShipInfo + forEach: function(Engine.Entity) +end +global record SignalSystem getSignal: function(edgeId : EdgeId, reversed : boolean): SignalId +end +global record SimCargoSystemend +global record SimEntityAtStockSystem getStock2SimEntityMap: function(): {{Engine.Entity, StockId} : {Engine.Entity}} + getStockCount: function(stockEntity : Engine.Entity, stockId : StockId): integer + getStockCountForCargoType: function(stockEntity : Engine.Entity, stockId : StockId, cargoTypeId : CargoTypeId): integer + getStockEntities: function(stockEntity : Engine.Entity, stockId : StockId): {{integer, Engine.Entity}} + getStockSimEntity: function(stockEntity : Engine.Entity, stockId : StockId): Engine.Entity +end +global record SimEntityAtTerminalSystem getLineStopSimEntitiesCount: function(entity : Engine.Entity, stopIndex : integer, cargoType : CargoTypeId): integer + getLineStopSimEntities: function(entity : Engine.Entity, stopIndex : integer, cargoType : CargoTypeId): {Engine.Entity} +end +global record SimEntityAtVehicleSystem getVehicle2Cargo2SimEntitesMap: function(): {Engine.Entity : {CargoTypeId : {Engine.Entity}}} + getVehicleSimEntitiesCount: function(vehicleEntity : Engine.Entity): integer + getVehicleSimEntitiesCountForCargoType: function(vehicleEntity : Engine.Entity, cargoType : CargoTypeId): integer + getVehiclesWithRoundTripCount: function(): {Engine.Entity : integer} +end +global record SimPersonAtBuildingSystem getSimPersonAtBuilding: function(simBuildingEntity : Engine.Entity): {Engine.Entity} +end +global record SimPersonAtTerminalSystem getEdgeInfoMap: function(): {EdgeId : } + getNumFreePlaces: function(edgeId : EdgeId): integer + getPos01: function(edgeId : EdgeId, place : integer): {number, number} +end +global record SimPersonAtVehicleSystem getVehiclePartInfoList: function(vehicleEntity : Engine.Entity): {VehiclePartInfo} +end +global record SimPersonSystem getCount: function(): integer + getDestination2SpMap: function(): {Engine.Entity : {Engine.Entity}} + getSimPersonsAtTerminalForTransportNetwork: function(tnEntity : Engine.Entity): {Engine.Entity} + getSimPersonsForDestination: function(destination : Engine.Entity): {Engine.Entity} + getSimPersonsForLine: function(lineEntity : Engine.Entity): {Engine.Entity} + getSimPersonsForTarget: function(targetEntity : Engine.Entity): {Engine.Entity} + getSimPersonsIdleForTransportNetwork: function(tnEntity : Engine.Entity): {Engine.Entity} + getSimPersonsMovingForTransportNetwork: function(tnEntity : Engine.Entity): {Engine.Entity} +end +global record StationGroupSystem getExpiredStationGroups: function(time : integer): {Engine.Entity} + getExpiryProgress: function(stationGroupEntity : Engine.Entity, time : integer): number + getStationGroup: function(stationEntity : Engine.Entity): Engine.Entity + getCarriers: function(stationGroup : Engine.Entity, station : integer, terminal : integer): {{Carrier}, {TransportMode}} +end +global record StationSystem getPersonNodeId2StationTerminalsMap: function(): {NodeId : {{Engine.Entity, integer}}} + getStation2TownMap: function(): {Engine.Entity : Engine.Entity} + getStations: function(townEntity : Engine.Entity): {Engine.Entity} + getStationTerminalForVehicleNode: function(nodeId : NodeId): {Engine.Entity, integer} + getStationTerminalsForPersonEdge: function(nodeId : EdgeId): {{Engine.Entity, integer}} + getStationTerminalsForPersonNode: function(nodeId : NodeId): {{Engine.Entity, integer}} + getTown2StationsMap: function(): {Engine.Entity : {Engine.Entity}} + getTown: function(stationEntity : Engine.Entity): Engine.Entity + getVehicleNodeId2StationTerminalsMap: function(): {NodeId : {{Engine.Entity, integer}}} + forEach: function(Engine.Entity) +end +global record StockListSystemend +global record StreetConnectorSystem getConstructionEntityForDepot: function(depotEntity : Engine.Entity): Engine.Entity + getConstructionEntityForEdge: function(edgeEntity : Engine.Entity): Engine.Entity + getConstructionEntityForIndustry: function(industryEntity : Engine.Entity): Engine.Entity + getConstructionEntityForNode: function(nodeEntity : Engine.Entity): Engine.Entity + getConstructionEntityForSubconstruction: function(subconstruction : Engine.Entity): Engine.Entity + getConstructionEntityForStation: function(stationEntity : Engine.Entity): Engine.Entity + getConstructionEntityForTownBuilding: function(townBuilding : Engine.Entity): Engine.Entity + getNode2StreetConnectorMap: function(): {Engine.Entity : Engine.Entity} + getStation2ConstructionMap: function(): {Engine.Entity : Engine.Entity} + forEachConstructionWithMetadata: function(metadataKey : string, constructionDescMeta : boolean, constructionInstanceMeta : boolean, fn : function(Engine.Entity, Engine.Component.Construction, ConstructionId), playerOwnedOnly : boolean) + getConstructionIdIfStaticMetadata: function(constructionEntity : Engine.Entity, metadataKey : string): {ConstructionId, ResName} + getConstructionClosestTown: function(constructionEntity : Engine.Entity): Engine.Entity + getTownClosestConstructions: function(townEntity : Engine.Entity): {Engine.Entity} + forEach: function(Engine.Entity) +end +global record StreetSystem getEdgeForEdgeObject: function(edgeEntity : Engine.Entity): Engine.Entity + getEdgeObject2EdgeMap: function(): {Engine.Entity : Engine.Entity} + getNode2SegmentMap: function(): {Engine.Entity : {Engine.Entity}} + getNode2StreetEdgeMap: function(): {Engine.Entity : {Engine.Entity}} + getNode2TrackEdgeMap: function(): {Engine.Entity : {Engine.Entity}} + isTownCrossingNode: function(Engine.Entity): boolean + getNodeSegments: function(nodeEntity : Engine.Entity): {Engine.Entity} + getNodeStreetSegments: function(nodeEntity : Engine.Entity): {Engine.Entity} + getNodeTrackSegments: function(nodeEntity : Engine.Entity): {Engine.Entity} +end +global record TownBuildingSystem getBuilding: function(parcelEntity : Engine.Entity): Engine.Entity + getCargoSupplyAndLimit: function(townEntity : Engine.Entity, LandUseType): {CargoTypeId : {number, number, integer}} + getLandUsePersonCapacities: function(townEntity : Engine.Entity): {integer} + getParcel2BuildingMap: function(): {Engine.Entity : Engine.Entity} + getPersonCapacity2townBuildingMap: function(): {Engine.Entity : Engine.Entity} + getTown2BuildingMap: function(): {Engine.Entity : {Engine.Entity}} + getTown2personCapacitiesMap: function(): {Engine.Entity : {integer}} + hasBuilding: function(parcelEntity : Engine.Entity): boolean +end +global record TpNetLinkSystem getEdgeId2linkEntities: function(): {EdgeId : {Engine.Entity}} + getLinkEntities: function(edgeId : EdgeId): {Engine.Entity} +end +global record TransportNetworkSystem getIntersections: function(tnEntity : Engine.Entity): {} + getTpNetData: function(): TpNetData +end +global record TransportVehicleSystem getDepotVehicles: function(depotEntity : Engine.Entity): {Engine.Entity} + getGoingToDepotVehicles: function(depotEntity : Engine.Entity): {Engine.Entity} + getInfo: function(transportVehicleEntity : Engine.Entity): any + getLine2VehicleMap: function(): {Engine.Entity : {Engine.Entity}} + getLineStopVehicles: function(lineEntity : Engine.Entity, stopIndex : number): {Engine.Entity} + checkLineStopForVehicleOverlength: function(lineEntity : Engine.Entity, stopIndex : number): {StationTerminal : boolean} + getLineVehicles: function(lineEntity : Engine.Entity): {Engine.Entity} + getNoPathVehicles: function(): {Engine.Entity} + getVehicleNames: function(carrier : Carrier): {string} + getVehicles: function(tnEntities : {Engine.Entity}, wholePath : boolean): {Engine.Entity} + getVehiclesWithState: function(state : TransportVehicleState): {Engine.Entity} + getVehiclesForMaintenanceStation: function(maintenanceStation : Engine.Entity): {Engine.Entity} + isVehicleMaintainedByStation: function(vehicle : Engine.Entity, maintenanceStation : Engine.Entity): boolean + getLineCargoInfo: function(lineEntity : Engine.Entity, cargoTypeId : CargoTypeId): LineCargoInfo +end +global record VehicleDepotSystem getDepotForInNodeId: function(nodeId : NodeId): Engine.Entity + forEach: function(Engine.Entity) +end +``` + +## Category: main[πŸ”—](#category-main) + +### System[πŸ”—](#$api.engine.system~System) + +``` +global record System animalMoveSystem: AnimalMoveSystem + aircraftMoveSystem: AircraftMoveSystem + baseParallelStripSystem: BaseParallelStripSystem + carriageListSystem: CarriageListSystem + catchmentAreaSystem: CatchmentAreaSystem + emissionGridSystem: EmissionGridSystem + gameScriptSystem: GameScriptSystem + landVehicleMoveSystem: LandVehicleMoveSystem + landmarkSystem: LandmarkSystem + lineSystem: LineSystem + octreeSystem: OctreeSystem + parcelSystem: ParcelSystem + railRoadCrossingSystem: RailRoadCrossingSystem + riverSystem: RiverSystem + runwaySystem: RunwaySystem + shipMoveSystem: ShipMoveSystem + signalSystem: SignalSystem + simCargoSystem: SimCargoSystem + simPersonSystem: SimPersonSystem + simPersonAtBuildingSystem: SimPersonAtBuildingSystem + simPersonAtTerminalSystem: SimPersonAtTerminalSystem + simPersonAtVehicleSystem: SimPersonAtVehicleSystem + simEntityAtStockSystem: SimEntityAtStockSystem + simEntityAtTerminalSystem: SimEntityAtTerminalSystem + simEntityAtVehicleSystem: SimEntityAtVehicleSystem + stationSystem: StationSystem + stationGroupSystem: StationGroupSystem + stockListSystem: StockListSystem + streetSystem: StreetSystem + streetConnectorSystem: StreetConnectorSystem + townBuildingSystem: TownBuildingSystem + tpNetLinkSystem: TpNetLinkSystem + transportNetworkSystem: TransportNetworkSystem + transportVehicleSystem: TransportVehicleSystem + vehicleDepotSystem: VehicleDepotSystem + gridCollision: GridCollision +end +``` + +A system is a simulation object that controls entities with specific components or caches additional computed data +for entities after listening for component changes + +### System.animalMoveSystem[πŸ”—](#$api.engine.system~System.animalMoveSystem) + +``` +System.animalMoveSystem: AnimalMoveSystem +``` + +Controls animal simulation and movement + +### System.aircraftMoveSystem[πŸ”—](#$api.engine.system~System.aircraftMoveSystem) + +``` +System.aircraftMoveSystem: AircraftMoveSystem +``` + +Controls aircraft (helicopters and airplanes) simulation (reservation, pathing, ...) and movement + +### System.baseParallelStripSystem[πŸ”—](#$api.engine.system~System.baseParallelStripSystem) + +``` +System.baseParallelStripSystem: BaseParallelStripSystem +``` + +A cache of data that is computed from parallel strip data + +### System.carriageListSystem[πŸ”—](#$api.engine.system~System.carriageListSystem) + +``` +System.carriageListSystem: CarriageListSystem +``` + +A cache of data for carriage lists + +### System.catchmentAreaSystem[πŸ”—](#$api.engine.system~System.catchmentAreaSystem) + +``` +System.catchmentAreaSystem: CatchmentAreaSystem +``` + +### System.emissionGridSystem[πŸ”—](#$api.engine.system~System.emissionGridSystem) + +``` +System.emissionGridSystem: EmissionGridSystem +``` + +### System.gameScriptSystem[πŸ”—](#$api.engine.system~System.gameScriptSystem) + +``` +System.gameScriptSystem: GameScriptSystem +``` + +### System.landVehicleMoveSystem[πŸ”—](#$api.engine.system~System.landVehicleMoveSystem) + +``` +System.landVehicleMoveSystem: LandVehicleMoveSystem +``` + +### System.landmarkSystem[πŸ”—](#$api.engine.system~System.landmarkSystem) + +``` +System.landmarkSystem: LandmarkSystem +``` + +### System.lineSystem[πŸ”—](#$api.engine.system~System.lineSystem) + +``` +System.lineSystem: LineSystem +``` + +Manages all line data + +### System.octreeSystem[πŸ”—](#$api.engine.system~System.octreeSystem) + +``` +System.octreeSystem: OctreeSystem +``` + +Efficient way to collect entities in a specific region of space + +### System.parcelSystem[πŸ”—](#$api.engine.system~System.parcelSystem) + +``` +System.parcelSystem: ParcelSystem +``` + +Manages parcels for towns, and provides inverse relation from segment to parcels + +### System.railRoadCrossingSystem[πŸ”—](#$api.engine.system~System.railRoadCrossingSystem) + +``` +System.railRoadCrossingSystem: RailRoadCrossingSystem +``` + +### System.riverSystem[πŸ”—](#$api.engine.system~System.riverSystem) + +``` +System.riverSystem: RiverSystem +``` + +Create a vector field of waterfronts for street and construction alignment + +### System.runwaySystem[πŸ”—](#$api.engine.system~System.runwaySystem) + +``` +System.runwaySystem: RunwaySystem +``` + +### System.shipMoveSystem[πŸ”—](#$api.engine.system~System.shipMoveSystem) + +``` +System.shipMoveSystem: ShipMoveSystem +``` + +### System.signalSystem[πŸ”—](#$api.engine.system~System.signalSystem) + +``` +System.signalSystem: SignalSystem +``` + +### System.simCargoSystem[πŸ”—](#$api.engine.system~System.simCargoSystem) + +``` +System.simCargoSystem: SimCargoSystem +``` + +### System.simPersonSystem[πŸ”—](#$api.engine.system~System.simPersonSystem) + +``` +System.simPersonSystem: SimPersonSystem +``` + +### System.simPersonAtBuildingSystem[πŸ”—](#$api.engine.system~System.simPersonAtBuildingSystem) + +``` +System.simPersonAtBuildingSystem: SimPersonAtBuildingSystem +``` + +### System.simPersonAtTerminalSystem[πŸ”—](#$api.engine.system~System.simPersonAtTerminalSystem) + +``` +System.simPersonAtTerminalSystem: SimPersonAtTerminalSystem +``` + +### System.simPersonAtVehicleSystem[πŸ”—](#$api.engine.system~System.simPersonAtVehicleSystem) + +``` +System.simPersonAtVehicleSystem: SimPersonAtVehicleSystem +``` + +### System.simEntityAtStockSystem[πŸ”—](#$api.engine.system~System.simEntityAtStockSystem) + +``` +System.simEntityAtStockSystem: SimEntityAtStockSystem +``` + +### System.simEntityAtTerminalSystem[πŸ”—](#$api.engine.system~System.simEntityAtTerminalSystem) + +``` +System.simEntityAtTerminalSystem: SimEntityAtTerminalSystem +``` + +### System.simEntityAtVehicleSystem[πŸ”—](#$api.engine.system~System.simEntityAtVehicleSystem) + +``` +System.simEntityAtVehicleSystem: SimEntityAtVehicleSystem +``` + +### System.stationSystem[πŸ”—](#$api.engine.system~System.stationSystem) + +``` +System.stationSystem: StationSystem +``` + +### System.stationGroupSystem[πŸ”—](#$api.engine.system~System.stationGroupSystem) + +``` +System.stationGroupSystem: StationGroupSystem +``` + +### System.stockListSystem[πŸ”—](#$api.engine.system~System.stockListSystem) + +``` +System.stockListSystem: StockListSystem +``` + +### System.streetSystem[πŸ”—](#$api.engine.system~System.streetSystem) + +``` +System.streetSystem: StreetSystem +``` + +### System.streetConnectorSystem[πŸ”—](#$api.engine.system~System.streetConnectorSystem) + +``` +System.streetConnectorSystem: StreetConnectorSystem +``` + +Caches relations between constructions and base edges + +### System.townBuildingSystem[πŸ”—](#$api.engine.system~System.townBuildingSystem) + +``` +System.townBuildingSystem: TownBuildingSystem +``` + +### System.tpNetLinkSystem[πŸ”—](#$api.engine.system~System.tpNetLinkSystem) + +``` +System.tpNetLinkSystem: TpNetLinkSystem +``` + +### System.transportNetworkSystem[πŸ”—](#$api.engine.system~System.transportNetworkSystem) + +``` +System.transportNetworkSystem: TransportNetworkSystem +``` + +### System.transportVehicleSystem[πŸ”—](#$api.engine.system~System.transportVehicleSystem) + +``` +System.transportVehicleSystem: TransportVehicleSystem +``` + +Manages cargo loading and unloading, as well as arrival of any transport vehicle + +### System.vehicleDepotSystem[πŸ”—](#$api.engine.system~System.vehicleDepotSystem) + +``` +System.vehicleDepotSystem: VehicleDepotSystem +``` + +Manages door animation of depots + +### System.gridCollision[πŸ”—](#$api.engine.system~System.gridCollision) + +``` +System.gridCollision: GridCollision +``` + +A generic system representing a 2d grid in the world of miscelaneous data + +## Category: globals[πŸ”—](#category-globals) + +### AircraftMoveSystem[πŸ”—](#$api.engine.system~AircraftMoveSystem) + +``` +global record AircraftMoveSystem getAirCraftInfo: function(vehicleEntity : Engine.Entity): AircraftInfo + isReserved: function(edgeId : EdgeId): boolean + forEach: function(Engine.Entity) +end +``` + +Aircraft Move System. +System managing the movement of airplanes. + +### AircraftMoveSystem.getAirCraftInfo[πŸ”—](#$api.engine.system~AircraftMoveSystem.getAirCraftInfo) + +``` +function AircraftMoveSystem.getAirCraftInfo(vehicleEntity : Engine.Entity): AircraftInfo +``` + +Obtains Aircraft information for the given entity. + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” the entity id of the aircraft that should be inspected + +**Returns** + +1. `AircraftInfo` + +### AircraftMoveSystem.isReserved[πŸ”—](#$api.engine.system~AircraftMoveSystem.isReserved) + +``` +function AircraftMoveSystem.isReserved(edgeId : EdgeId): boolean +``` + +Checks if a given edge is reserved by an aircraft. + +**Parameters** + +* `edgeId` :`EdgeId` β€” the edgeId that should be inspected + +**Returns** + +1. `boolean` β€” true if reserved + +### AircraftMoveSystem.forEach[πŸ”—](#$api.engine.system~AircraftMoveSystem.forEach) + +``` +function AircraftMoveSystem.forEach(Engine.Entity) +``` + +Loops over all aircraft. + +**Parameters** + +* `Engine.Entity` + +### AnimalMoveSystem[πŸ”—](#$api.engine.system~AnimalMoveSystem) + +``` +global record AnimalMoveSystem forEach: function(Engine.Entity) +end +``` + +Animal Move System. +Manages animals. + +### AnimalMoveSystem.forEach[πŸ”—](#$api.engine.system~AnimalMoveSystem.forEach) + +``` +function AnimalMoveSystem.forEach(Engine.Entity) +``` + +Loops over all animals. + +**Parameters** + +* `Engine.Entity` + +### BaseParallelStripSystem[πŸ”—](#$api.engine.system~BaseParallelStripSystem) + +``` +global record BaseParallelStripSystem getStrips: function(edgeEntity : Engine.Entity): {Engine.Entity} +end +``` + +Base Parallel Strip System. +Contain information about parallel edge ranges. + +### BaseParallelStripSystem.getStrips[πŸ”—](#$api.engine.system~BaseParallelStripSystem.getStrips) + +``` +function BaseParallelStripSystem.getStrips(edgeEntity : Engine.Entity): {Engine.Entity} +``` + +Obtains all parallel strips of a base edge entity (there might be more than one parallel strip for each base edge). + +**Parameters** + +* `edgeEntity` :`Engine.Entity` β€” the entity of the edge that should be inspected + +**Returns** + +1. `{Engine.Entity}` + +### CarriageListSystem[πŸ”—](#$api.engine.system~CarriageListSystem) + +``` +[Expand All] [Collapse All] + +global record CarriageListSystem record CarriageInfo owningVehicle: Engine.Entity + index: integer + offset: number + reversed: boolean + crew: boolean +end + getVehicleInfo: function(vehicleEntity : Engine.Entity): CarriageInfo + getVehicleData: function(vehicleEntity : Engine.Entity): VehicleData + forEach: function(Engine.Entity) +end +``` + +Carriage list System. +Manages vehicles that are groups of multiple carriages. + +### CarriageListSystem.CarriageInfo[πŸ”—](#$api.engine.system~CarriageListSystem.CarriageInfo) + +``` +record CarriageListSystem.CarriageInfo owningVehicle: Engine.Entity + index: integer + offset: number + reversed: boolean + crew: boolean +end +``` + +### CarriageListSystem.CarriageInfo.owningVehicle[πŸ”—](#$api.engine.system~CarriageListSystem.CarriageInfo.owningVehicle) + +``` +CarriageListSystem.CarriageInfo.owningVehicle: Engine.Entity +``` + +### CarriageListSystem.CarriageInfo.index[πŸ”—](#$api.engine.system~CarriageListSystem.CarriageInfo.index) + +``` +CarriageListSystem.CarriageInfo.index: integer +``` + +### CarriageListSystem.CarriageInfo.offset[πŸ”—](#$api.engine.system~CarriageListSystem.CarriageInfo.offset) + +``` +CarriageListSystem.CarriageInfo.offset: number +``` + +### CarriageListSystem.CarriageInfo.reversed[πŸ”—](#$api.engine.system~CarriageListSystem.CarriageInfo.reversed) + +``` +CarriageListSystem.CarriageInfo.reversed: boolean +``` + +### CarriageListSystem.CarriageInfo.crew[πŸ”—](#$api.engine.system~CarriageListSystem.CarriageInfo.crew) + +``` +CarriageListSystem.CarriageInfo.crew: boolean +``` + +### CarriageListSystem.getVehicleInfo[πŸ”—](#$api.engine.system~CarriageListSystem.getVehicleInfo) + +``` +function CarriageListSystem.getVehicleInfo(vehicleEntity : Engine.Entity): CarriageInfo +``` + +Gets more information about a train carriage/engine. + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” the entity of the vehicle. + +**Returns** + +1. `CarriageInfo` + +### CarriageListSystem.getVehicleData[πŸ”—](#$api.engine.system~CarriageListSystem.getVehicleData) + +``` +function CarriageListSystem.getVehicleData(vehicleEntity : Engine.Entity): VehicleData +``` + +Gets more information about a train carriage/engine. + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” the entity of the vehicle. + +**Returns** + +1. `VehicleData` + +### CarriageListSystem.forEach[πŸ”—](#$api.engine.system~CarriageListSystem.forEach) + +``` +function CarriageListSystem.forEach(Engine.Entity) +``` + +Loops over all carriage lists. + +**Parameters** + +* `Engine.Entity` + +### CatchmentAreaSystem[πŸ”—](#$api.engine.system~CatchmentAreaSystem) + +``` +global record CatchmentAreaSystem getEdge2stationsMap: function(): {EdgeId : {{Engine.Entity, integer}}} + getStation2edgesMap: function(): {Engine.Entity : {{EdgeId, integer}}} + getStation2stationsAndDistancesMap: function(): {Engine.Entity : {Engine.Entity : integer}} + getStationCatchables: function(stationEntity : Engine.Entity, cargo : boolean): {Engine.Entity} +end +``` + +Catchment Area System. +Contains cached information about reachability of stations and destinations. + +### CatchmentAreaSystem.getEdge2stationsMap[πŸ”—](#$api.engine.system~CatchmentAreaSystem.getEdge2stationsMap) + +``` +function CatchmentAreaSystem.getEdge2stationsMap(): {EdgeId : {{Engine.Entity, integer}}} +``` + +Obtains a map mapping transport network edges to stations that can be reached from that edge. + +**Returns** + +1. `{EdgeId : {{Engine.Entity, integer}}}` + +### CatchmentAreaSystem.getStation2edgesMap[πŸ”—](#$api.engine.system~CatchmentAreaSystem.getStation2edgesMap) + +``` +function CatchmentAreaSystem.getStation2edgesMap(): {Engine.Entity : {{EdgeId, integer}}} +``` + +Obtains a map mapping stations to all reachable edges from that station (the actual catchment area of the station). + +**Returns** + +1. `{Engine.Entity : {{EdgeId, integer}}}` + +### CatchmentAreaSystem.getStation2stationsAndDistancesMap[πŸ”—](#$api.engine.system~CatchmentAreaSystem.getStation2stationsAndDistancesMap) + +``` +function CatchmentAreaSystem.getStation2stationsAndDistancesMap(): {Engine.Entity : {Engine.Entity : integer}} +``` + +Obtains a map, mapping station to all reachable stations in the catchment area, and, additionally, the distance of the +shortest path. + +**Returns** + +1. `{Engine.Entity : {Engine.Entity : integer}}` + +### CatchmentAreaSystem.getStationCatchables[πŸ”—](#$api.engine.system~CatchmentAreaSystem.getStationCatchables) + +``` +function CatchmentAreaSystem.getStationCatchables(stationEntity : Engine.Entity, cargo : boolean): {Engine.Entity} +``` + +Obtains a list of all catchables (entities holding a StockList or PersonCapacity component) for the station. + +**Parameters** + +* `stationEntity` :`Engine.Entity` β€” the entity of the station +* `cargo` :`boolean` β€” wether to return cargo or passenger catchables + +**Returns** + +1. `{Engine.Entity}` + +### EmissionGridSystem[πŸ”—](#$api.engine.system~EmissionGridSystem) + +``` +global record EmissionGridSystem getInterpolatedEmission: function(pos : Vec2f, useAverage : boolean, type : Engine.Component.EmissionGrid.Type): number + getEmissionGridEntity: function(noise : boolean): Engine.Entity +end +``` + +Emission grid system. +Manages emission grid data. + +### EmissionGridSystem.getInterpolatedEmission[πŸ”—](#$api.engine.system~EmissionGridSystem.getInterpolatedEmission) + +``` +function EmissionGridSystem.getInterpolatedEmission(pos : Vec2f, useAverage : boolean, type : Engine.Component.EmissionGrid.Type): number +``` + +Returns the interpolated emission at a given position. + +**Parameters** + +* `pos` :`Vec2f` β€” the position at which the emission should be sampled +* `useAverage` :`boolean` β€” whether to use average or not +* `type` :`Engine.Component.EmissionGrid.Type` β€” the type of emission to query + +**Returns** + +1. `number` β€” the interpolated emission value + +### EmissionGridSystem.getEmissionGridEntity[πŸ”—](#$api.engine.system~EmissionGridSystem.getEmissionGridEntity) + +``` +function EmissionGridSystem.getEmissionGridEntity(noise : boolean): Engine.Entity +``` + +Returns the EmissionGrid entity for the noise or pollution + +**Parameters** + +* `noise` :`boolean` β€” Which type of emission: noise or pollution + +**Returns** + +1. `Engine.Entity` β€” an entity with the EmissionGrid component + +### GameScriptSystem[πŸ”—](#$api.engine.system~GameScriptSystem) + +``` +global record GameScriptSystem getEntityForGameScript: function(name : string): Engine.Entity +end +``` + +Game Script System +Manages entities and components for gamescript. + +### GameScriptSystem.getEntityForGameScript[πŸ”—](#$api.engine.system~GameScriptSystem.getEntityForGameScript) + +``` +function GameScriptSystem.getEntityForGameScript(name : string): Engine.Entity +``` + +Gets the entity onto which the gamescript state is attached + +**Parameters** + +* `name` :`string` β€” the name of the gamescript + +**Returns** + +1. `Engine.Entity` + +### GridCollision[πŸ”—](#$api.engine.system~GridCollision) + +``` +global record GridCollision getGridCollisionSystem: function(index : integer): GridCollisionSystem + getPlayerInfrastructureCollisionSystem: function(): GridCollisionSystem +end +``` + +Contains multiple grids holding data +Contains multiple grids holding diverse data + +### GridCollision.getGridCollisionSystem[πŸ”—](#$api.engine.system~GridCollision.getGridCollisionSystem) + +``` +function GridCollision.getGridCollisionSystem(index : integer): GridCollisionSystem +``` + +Gets the grid collision system with the given index. + +**Parameters** + +* `index` :`integer` β€” the index of the system to get + +**Returns** + +1. `GridCollisionSystem` + +### GridCollision.getPlayerInfrastructureCollisionSystem[πŸ”—](#$api.engine.system~GridCollision.getPlayerInfrastructureCollisionSystem) + +``` +function GridCollision.getPlayerInfrastructureCollisionSystem(): GridCollisionSystem +``` + +Gets the grid collision system tracking player owned structures. + +**Returns** + +1. `GridCollisionSystem` + +### GridCollisionSystem[πŸ”—](#$api.engine.system~GridCollisionSystem) + +``` +global record GridCollisionSystem getCollisionDataAt: function(GridCollisionSystem, Vec2f): number +end +``` + +Grid Collision System. +Single instance of the grid collision system. + +### GridCollisionSystem.getCollisionDataAt[πŸ”—](#$api.engine.system~GridCollisionSystem.getCollisionDataAt) + +``` +function GridCollisionSystem.getCollisionDataAt(GridCollisionSystem, Vec2f): number +``` + +Gets collision data at a given position (0 = no collision) + +**Parameters** + +* `GridCollisionSystem` +* `Vec2f` + +**Returns** + +1. `number` + +### ISystem[πŸ”—](#$api.engine.system~ISystem) + +``` +global interface ISystem forEach: function(Engine.Entity) +end +``` + +### ISystem.forEach[πŸ”—](#$api.engine.system~ISystem.forEach) + +``` +function ISystem.forEach(Engine.Entity) +``` + +**Parameters** + +* `Engine.Entity` + +### LandVehicleMoveSystem[πŸ”—](#$api.engine.system~LandVehicleMoveSystem) + +``` +global record LandVehicleMoveSystem getBlockedTrains: function(): {{Engine.Entity, Engine.Entity}} + getVehicleInfo: function(vehicleEntity : Engine.Entity): LandVehicleMoveInfo + isTrainWaitingForFreePath: function(trainEntity : Engine.Entity): boolean + forEach: function(Engine.Entity) +end +``` + +Land Vehicle Move System. +Manages the movement of land vehicles. + +### LandVehicleMoveSystem.getBlockedTrains[πŸ”—](#$api.engine.system~LandVehicleMoveSystem.getBlockedTrains) + +``` +function LandVehicleMoveSystem.getBlockedTrains(): {{Engine.Entity, Engine.Entity}} +``` + +Gets all trains that are blocked by another train. + +**Returns** + +1. `{{Engine.Entity, Engine.Entity}}` + +### LandVehicleMoveSystem.getVehicleInfo[πŸ”—](#$api.engine.system~LandVehicleMoveSystem.getVehicleInfo) + +``` +function LandVehicleMoveSystem.getVehicleInfo(vehicleEntity : Engine.Entity): LandVehicleMoveInfo +``` + +Gets more information about a vehicle. + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” the entity of the vehicle. + +**Returns** + +1. `LandVehicleMoveInfo` + +### LandVehicleMoveSystem.isTrainWaitingForFreePath[πŸ”—](#$api.engine.system~LandVehicleMoveSystem.isTrainWaitingForFreePath) + +``` +function LandVehicleMoveSystem.isTrainWaitingForFreePath(trainEntity : Engine.Entity): boolean +``` + +Checks if a train is waiting for a free path. + +**Parameters** + +* `trainEntity` :`Engine.Entity` β€” the entity of the train. + +**Returns** + +1. `boolean` + +### LandVehicleMoveSystem.forEach[πŸ”—](#$api.engine.system~LandVehicleMoveSystem.forEach) + +``` +function LandVehicleMoveSystem.forEach(Engine.Entity) +``` + +Loops over all trains. + +**Parameters** + +* `Engine.Entity` + +### LandmarkSystem[πŸ”—](#$api.engine.system~LandmarkSystem) + +``` +global record LandmarkSystem getLandmarkData: function(landmarkEntity : Engine.Entity): {EdgeId : number} +end +``` + +Landmark system. +Manages landmarks data. + +### LandmarkSystem.getLandmarkData[πŸ”—](#$api.engine.system~LandmarkSystem.getLandmarkData) + +``` +function LandmarkSystem.getLandmarkData(landmarkEntity : Engine.Entity): {EdgeId : number} +``` + +Returns distances from landmark entity to transport network edges. + +**Parameters** + +* `landmarkEntity` :`Engine.Entity` β€” entity of the landmark + +**Returns** + +1. `{EdgeId : number}` + +### LineSystem[πŸ”—](#$api.engine.system~LineSystem) + +``` +global record LineSystem getLines: function(): {Engine.Entity} + getLinesForPlayer: function(playerEntity : Engine.Entity): {Engine.Entity} + getLinesForWaypoint: function(waypointEntity : Engine.Entity): {Engine.Entity} + getLinesForWaypointLane: function(waypointEntity : Engine.Entity, signalIndex : integer): {{Engine.Entity, integer, integer}} + getLineStops: function(stationGroupEntity : Engine.Entity): {{Engine.Entity, integer}} + getLineStopsForStation: function(stationEntity : Engine.Entity): {{Engine.Entity, integer}} + getLineStopsForTerminal: function(stationEntity : Engine.Entity, terminal : integer): {{Engine.Entity, integer}} + getLinesForStationGroup: function(stationGroup : Engine.Entity): {Engine.Entity} + getProblemLines: function(playerEntity : Engine.Entity): {{Engine.Entity, LineProblem}} + getStationGroup2LineStopsMap: function(): {Engine.Entity : {{Engine.Entity, integer}}} + getTerminal2lineStops: function(): {{Engine.Entity, integer} : {{Engine.Entity, integer}}} + getBestLineAssignment: function(lineEntity : Engine.Entity, lineData : Engine.Component.Line, allowTerminalChanges : boolean): {StationTerminal} +end +``` + +Line System. +Contains cached information about lines. + +### LineSystem.getLines[πŸ”—](#$api.engine.system~LineSystem.getLines) + +``` +function LineSystem.getLines(): {Engine.Entity} +``` + +Gets all lines on the map. + +**Returns** + +1. `{Engine.Entity}` β€” line entities + +### LineSystem.getLinesForPlayer[πŸ”—](#$api.engine.system~LineSystem.getLinesForPlayer) + +``` +function LineSystem.getLinesForPlayer(playerEntity : Engine.Entity): {Engine.Entity} +``` + +Gets all lines belonging to the player. + +**Parameters** + +* `playerEntity` :`Engine.Entity` β€” the player for which the lines should be fetched + +**Returns** + +1. `{Engine.Entity}` β€” line entities + +### LineSystem.getLinesForWaypoint[πŸ”—](#$api.engine.system~LineSystem.getLinesForWaypoint) + +``` +function LineSystem.getLinesForWaypoint(waypointEntity : Engine.Entity): {Engine.Entity} +``` + +Gets all lines going through a waypoint. + +**Parameters** + +* `waypointEntity` :`Engine.Entity` β€” the waypoint for which the lines should be fetched + +**Returns** + +1. `{Engine.Entity}` β€” line entities + +### LineSystem.getLinesForWaypointLane[πŸ”—](#$api.engine.system~LineSystem.getLinesForWaypointLane) + +``` +function LineSystem.getLinesForWaypointLane(waypointEntity : Engine.Entity, signalIndex : integer): {{Engine.Entity, integer, integer}} +``` + +Gets all line waypoints at the specific signal+lane + +**Parameters** + +* `waypointEntity` :`Engine.Entity` β€” the signalList entity +* `signalIndex` :`integer` β€” the signal index inside the SignalList + +**Returns** + +1. `{{Engine.Entity, integer, integer}}` + +### LineSystem.getLineStops[πŸ”—](#$api.engine.system~LineSystem.getLineStops) + +``` +function LineSystem.getLineStops(stationGroupEntity : Engine.Entity): {{Engine.Entity, integer}} +``` + +Gets all lines stopping at a station group. + +**Parameters** + +* `stationGroupEntity` :`Engine.Entity` β€” the stationGroup for which the lines should be fetched + +**Returns** + +1. `{{Engine.Entity, integer}}` + +### LineSystem.getLineStopsForStation[πŸ”—](#$api.engine.system~LineSystem.getLineStopsForStation) + +``` +function LineSystem.getLineStopsForStation(stationEntity : Engine.Entity): {{Engine.Entity, integer}} +``` + +Gets all lines stopping at a station. + +**Parameters** + +* `stationEntity` :`Engine.Entity` β€” the station for which the lines should be fetched + +**Returns** + +1. `{{Engine.Entity, integer}}` + +### LineSystem.getLineStopsForTerminal[πŸ”—](#$api.engine.system~LineSystem.getLineStopsForTerminal) + +``` +function LineSystem.getLineStopsForTerminal(stationEntity : Engine.Entity, terminal : integer): {{Engine.Entity, integer}} +``` + +Gets all lines stopping at a terminal. + +**Parameters** + +* `stationEntity` :`Engine.Entity` β€” the station for which the lines should be fetched +* `terminal` :`integer` β€” the terminal of the station for which the lines should be fetched + +**Returns** + +1. `{{Engine.Entity, integer}}` + +### LineSystem.getLinesForStationGroup[πŸ”—](#$api.engine.system~LineSystem.getLinesForStationGroup) + +``` +function LineSystem.getLinesForStationGroup(stationGroup : Engine.Entity): {Engine.Entity} +``` + +Gets all lines for the given station group. + +**Parameters** + +* `stationGroup` :`Engine.Entity` β€” the stationGroup for which the lines should be fetched + +**Returns** + +1. `{Engine.Entity}` β€” line entities + +### LineSystem.getProblemLines[πŸ”—](#$api.engine.system~LineSystem.getProblemLines) + +``` +function LineSystem.getProblemLines(playerEntity : Engine.Entity): {{Engine.Entity, LineProblem}} +``` + +Gets all lines having an issue, and the issue in question. + +**Parameters** + +* `playerEntity` :`Engine.Entity` β€” the player for which the lines should be fetched + +**Returns** + +1. `{{Engine.Entity, LineProblem}}` + +### LineSystem.getStationGroup2LineStopsMap[πŸ”—](#$api.engine.system~LineSystem.getStationGroup2LineStopsMap) + +``` +function LineSystem.getStationGroup2LineStopsMap(): {Engine.Entity : {{Engine.Entity, integer}}} +``` + +Gets all stops in a station group. + +**Returns** + +1. `{Engine.Entity : {{Engine.Entity, integer}}}` + +### LineSystem.getTerminal2lineStops[πŸ”—](#$api.engine.system~LineSystem.getTerminal2lineStops) + +``` +function LineSystem.getTerminal2lineStops(): {{Engine.Entity, integer} : {{Engine.Entity, integer}}} +``` + +Gets all stops in a terminal. + +**Returns** + +1. `{{Engine.Entity, integer} : {{Engine.Entity, integer}}}` + +### LineSystem.getBestLineAssignment[πŸ”—](#$api.engine.system~LineSystem.getBestLineAssignment) + +``` +function LineSystem.getBestLineAssignment(lineEntity : Engine.Entity, lineData : Engine.Component.Line, allowTerminalChanges : boolean): {StationTerminal} +``` + +Gets best terminal assignments for line. + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” the line for which the computation should happen +* `lineData` :`Engine.Component.Line` β€” the line component data, stops may have station = -1 and terminal = -1 +* `allowTerminalChanges` :`boolean` β€” + +**Returns** + +1. `{StationTerminal}` + +### OctreeSystem[πŸ”—](#$api.engine.system~OctreeSystem) + +``` +global record OctreeSystem findIntersectingEntities: function(box : Box3f, callback : function(Engine.Entity, Engine.Component.BoundingVolume)) +end +``` + +Octree System. +An octree that contains all entities with a bounding box. It enables fast query and location of entities in the map. + +### OctreeSystem.findIntersectingEntities[πŸ”—](#$api.engine.system~OctreeSystem.findIntersectingEntities) + +``` +function OctreeSystem.findIntersectingEntities(box : Box3f, callback : function(Engine.Entity, Engine.Component.BoundingVolume)) +``` + +Fetches all entities in a box and runs a callback for them. + +**Parameters** + +* `box` :`Box3f` β€” Box in which all entities are searched. +* `callback` :`function(Engine.Entity, Engine.Component.BoundingVolume)` β€” A function called for each matching entity within box. The callback obtains an entity and a bounding volume. + +### ParcelSystem[πŸ”—](#$api.engine.system~ParcelSystem) + +``` +global record ParcelSystem getParcelData: function(segmentEntity : Engine.Entity): any + getSegment2ParcelData: function(): {Engine.Entity : } +end +``` + +Parcel System. +Manages and returns information about parcels. + +### ParcelSystem.getParcelData[πŸ”—](#$api.engine.system~ParcelSystem.getParcelData) + +``` +function ParcelSystem.getParcelData(segmentEntity : Engine.Entity): any +``` + +Obtains all parcels belonging to a segment. + +**Parameters** + +* `segmentEntity` :`Engine.Entity` β€” the segment of which to obtain all attached parcels + +**Returns** + +1. `any` + +### ParcelSystem.getSegment2ParcelData[πŸ”—](#$api.engine.system~ParcelSystem.getSegment2ParcelData) + +``` +function ParcelSystem.getSegment2ParcelData(): {Engine.Entity : } +``` + +Obtains a map of all segments to the parcel data of the segment. + +**Returns** + +1. `{Engine.Entity : }` + +### RailRoadCrossingSystem[πŸ”—](#$api.engine.system~RailRoadCrossingSystem) + +``` +global record RailRoadCrossingSystem getRailroadCrossingForEdge: function(edgeEntity : Engine.Entity): Engine.Entity + getRailroadCrossingForNode: function(nodeEntity : Engine.Entity): Engine.Entity +end +``` + +Railroad Crossing System. +Contains information about raiload crossings. + +### RailRoadCrossingSystem.getRailroadCrossingForEdge[πŸ”—](#$api.engine.system~RailRoadCrossingSystem.getRailroadCrossingForEdge) + +``` +function RailRoadCrossingSystem.getRailroadCrossingForEdge(edgeEntity : Engine.Entity): Engine.Entity +``` + +Gets all railroad crossings of the given base edge entity. + +**Parameters** + +* `edgeEntity` :`Engine.Entity` β€” the entity id of the edge that should be inspected + +**Returns** + +1. `Engine.Entity` + +### RailRoadCrossingSystem.getRailroadCrossingForNode[πŸ”—](#$api.engine.system~RailRoadCrossingSystem.getRailroadCrossingForNode) + +``` +function RailRoadCrossingSystem.getRailroadCrossingForNode(nodeEntity : Engine.Entity): Engine.Entity +``` + +Gets all railroad crossings of the given base node entity. + +**Parameters** + +* `nodeEntity` :`Engine.Entity` β€” the entity id of the node that should be inspected + +**Returns** + +1. `Engine.Entity` + +### RiverSystem[πŸ”—](#$api.engine.system~RiverSystem) + +``` +global record RiverSystem getWaterMeshEntities: function(Vec2i, Vec2i): {Engine.Entity} +end +``` + +River System. +Contains information about water in the map. + +### RiverSystem.getWaterMeshEntities[πŸ”—](#$api.engine.system~RiverSystem.getWaterMeshEntities) + +``` +function RiverSystem.getWaterMeshEntities(Vec2i, Vec2i): {Engine.Entity} +``` + +Gets all water meshes within the bounds. + +**Parameters** + +* `Vec2i` +* `Vec2i` + +**Returns** + +1. `{Engine.Entity}` + +### RunwaySystem[πŸ”—](#$api.engine.system~RunwaySystem) + +``` +global record RunwaySystem getLandingNodeIdMap: function(): {NodeId : Engine.Entity} + getTakeoffNodeIdMap: function(): {NodeId : Engine.Entity} +end +``` + +Runway System. +Contains information about runway edges. + +### RunwaySystem.getLandingNodeIdMap[πŸ”—](#$api.engine.system~RunwaySystem.getLandingNodeIdMap) + +``` +function RunwaySystem.getLandingNodeIdMap(): {NodeId : Engine.Entity} +``` + +Gets all stations reachable from that landing node. + +**Returns** + +1. `{NodeId : Engine.Entity}` + +### RunwaySystem.getTakeoffNodeIdMap[πŸ”—](#$api.engine.system~RunwaySystem.getTakeoffNodeIdMap) + +``` +function RunwaySystem.getTakeoffNodeIdMap(): {NodeId : Engine.Entity} +``` + +Gets all station from which the takeoff node can reached. + +**Returns** + +1. `{NodeId : Engine.Entity}` + +### ShipMoveSystem[πŸ”—](#$api.engine.system~ShipMoveSystem) + +``` +global record ShipMoveSystem getShipInfo: function(vehicleEntity : Engine.Entity): ShipInfo + forEach: function(Engine.Entity) +end +``` + +Ship Move System. +Contains information about the movement of ships. + +### ShipMoveSystem.getShipInfo[πŸ”—](#$api.engine.system~ShipMoveSystem.getShipInfo) + +``` +function ShipMoveSystem.getShipInfo(vehicleEntity : Engine.Entity): ShipInfo +``` + +Gets more path and movement information about ships. + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” the entity id of the ship that should be inspected + +**Returns** + +1. `ShipInfo` + +### ShipMoveSystem.forEach[πŸ”—](#$api.engine.system~ShipMoveSystem.forEach) + +``` +function ShipMoveSystem.forEach(Engine.Entity) +``` + +Loops over all ships. + +**Parameters** + +* `Engine.Entity` + +### SignalSystem[πŸ”—](#$api.engine.system~SignalSystem) + +``` +global record SignalSystem getSignal: function(edgeId : EdgeId, reversed : boolean): SignalId +end +``` + +Signal System. +Contains information about Signals (waypoints, path and one way signals) + +### SignalSystem.getSignal[πŸ”—](#$api.engine.system~SignalSystem.getSignal) + +``` +function SignalSystem.getSignal(edgeId : EdgeId, reversed : boolean): SignalId +``` + +Gets the signal from an @{api.type.EdgeId} at the given direction. +Notice: there can be at most one signal per direction per transport network edge. + +**Parameters** + +* `edgeId` :`EdgeId` β€” the id of the edge hosting the signal +* `reversed` :`boolean` β€” false if signal in direction of edge is requested + +**Returns** + +1. `SignalId` + +### SimCargoSystem[πŸ”—](#$api.engine.system~SimCargoSystem) + +``` +global record SimCargoSystemend +``` + +Cargo System. +System managing cargo. + +### SimEntityAtStockSystem[πŸ”—](#$api.engine.system~SimEntityAtStockSystem) + +``` +global record SimEntityAtStockSystem getStock2SimEntityMap: function(): {{Engine.Entity, StockId} : {Engine.Entity}} + getStockCount: function(stockEntity : Engine.Entity, stockId : StockId): integer + getStockCountForCargoType: function(stockEntity : Engine.Entity, stockId : StockId, cargoTypeId : CargoTypeId): integer + getStockEntities: function(stockEntity : Engine.Entity, stockId : StockId): {{integer, Engine.Entity}} + getStockSimEntity: function(stockEntity : Engine.Entity, stockId : StockId): Engine.Entity +end +``` + +Sim Entity At Stock System. +System managing cargo produced by industries or transported to a warehouse. + +### SimEntityAtStockSystem.getStock2SimEntityMap[πŸ”—](#$api.engine.system~SimEntityAtStockSystem.getStock2SimEntityMap) + +``` +function SimEntityAtStockSystem.getStock2SimEntityMap(): {{Engine.Entity, StockId} : {Engine.Entity}} +``` + +Obtains a map, mapping the stock to the cargo waiting there. + +**Returns** + +1. `{{Engine.Entity, StockId} : {Engine.Entity}}` + +### SimEntityAtStockSystem.getStockCount[πŸ”—](#$api.engine.system~SimEntityAtStockSystem.getStockCount) + +``` +function SimEntityAtStockSystem.getStockCount(stockEntity : Engine.Entity, stockId : StockId): integer +``` + +Obtains the amount of specific item id waiting at a given stock. + +**Parameters** + +* `stockEntity` :`Engine.Entity` β€” the entity of the stock holding entity, e.g. industry +* `stockId` :`StockId` β€” the id of the stock + +**Returns** + +1. `integer` + +### SimEntityAtStockSystem.getStockCountForCargoType[πŸ”—](#$api.engine.system~SimEntityAtStockSystem.getStockCountForCargoType) + +``` +function SimEntityAtStockSystem.getStockCountForCargoType(stockEntity : Engine.Entity, stockId : StockId, cargoTypeId : CargoTypeId): integer +``` + +Obtains the amount of specific item id waiting at a given stock and cargo type. + +**Parameters** + +* `stockEntity` :`Engine.Entity` β€” the entity of the stock holding entity, e.g. industry +* `stockId` :`StockId` β€” the id of the stock +* `cargoTypeId` :`CargoTypeId` β€” the id of the cargo type + +**Returns** + +1. `integer` + +### SimEntityAtStockSystem.getStockEntities[πŸ”—](#$api.engine.system~SimEntityAtStockSystem.getStockEntities) + +``` +function SimEntityAtStockSystem.getStockEntities(stockEntity : Engine.Entity, stockId : StockId): {{integer, Engine.Entity}} +``` + +Obtains all entities waiting at a given stock. + +**Parameters** + +* `stockEntity` :`Engine.Entity` β€” the entity of the stock holding entity, e.g. industry +* `stockId` :`StockId` β€” the id of the stock + +**Returns** + +1. `{{integer, Engine.Entity}}` + +### SimEntityAtStockSystem.getStockSimEntity[πŸ”—](#$api.engine.system~SimEntityAtStockSystem.getStockSimEntity) + +``` +function SimEntityAtStockSystem.getStockSimEntity(stockEntity : Engine.Entity, stockId : StockId): Engine.Entity +``` + +Obtains the entity that was waiting longest at a given stock. + +**Parameters** + +* `stockEntity` :`Engine.Entity` β€” the entity of the stock holding entity, e.g. industry +* `stockId` :`StockId` β€” the id of the stock + +**Returns** + +1. `Engine.Entity` + +### SimEntityAtTerminalSystem[πŸ”—](#$api.engine.system~SimEntityAtTerminalSystem) + +``` +global record SimEntityAtTerminalSystem getLineStopSimEntitiesCount: function(entity : Engine.Entity, stopIndex : integer, cargoType : CargoTypeId): integer + getLineStopSimEntities: function(entity : Engine.Entity, stopIndex : integer, cargoType : CargoTypeId): {Engine.Entity} +end +``` + +Sim Entity At Terminal System. +System managing entities waiting at terminals. + +### SimEntityAtTerminalSystem.getLineStopSimEntitiesCount[πŸ”—](#$api.engine.system~SimEntityAtTerminalSystem.getLineStopSimEntitiesCount) + +``` +function SimEntityAtTerminalSystem.getLineStopSimEntitiesCount(entity : Engine.Entity, stopIndex : integer, cargoType : CargoTypeId): integer +``` + +Gets the count of entities (SimPersons) waiting at the terminal. + +**Parameters** + +* `entity` :`Engine.Entity` β€” the line entity +* `stopIndex` :`integer` β€” the index of the stop in the line +* `cargoType` :`CargoTypeId` β€” the id of the cargo type + +**Returns** + +1. `integer` β€” the count of entities at that line stop + +### SimEntityAtTerminalSystem.getLineStopSimEntities[πŸ”—](#$api.engine.system~SimEntityAtTerminalSystem.getLineStopSimEntities) + +``` +function SimEntityAtTerminalSystem.getLineStopSimEntities(entity : Engine.Entity, stopIndex : integer, cargoType : CargoTypeId): {Engine.Entity} +``` + +Gets the count of entities (SimPersons) waiting at the terminal for the given cargo type. + +**Parameters** + +* `entity` :`Engine.Entity` β€” the line entity +* `stopIndex` :`integer` β€” the index of the stop in the line +* `cargoType` :`CargoTypeId` β€” the id of the cargo type + +**Returns** + +1. `{Engine.Entity}` β€” the sim entities of the given cargo type at that line stop + +### SimEntityAtVehicleSystem[πŸ”—](#$api.engine.system~SimEntityAtVehicleSystem) + +``` +global record SimEntityAtVehicleSystem getVehicle2Cargo2SimEntitesMap: function(): {Engine.Entity : {CargoTypeId : {Engine.Entity}}} + getVehicleSimEntitiesCount: function(vehicleEntity : Engine.Entity): integer + getVehicleSimEntitiesCountForCargoType: function(vehicleEntity : Engine.Entity, cargoType : CargoTypeId): integer + getVehiclesWithRoundTripCount: function(): {Engine.Entity : integer} +end +``` + +Sim Entity At Vehicle System. +System managing entities travelling in a vehicle. + +### SimEntityAtVehicleSystem.getVehicle2Cargo2SimEntitesMap[πŸ”—](#$api.engine.system~SimEntityAtVehicleSystem.getVehicle2Cargo2SimEntitesMap) + +``` +function SimEntityAtVehicleSystem.getVehicle2Cargo2SimEntitesMap(): {Engine.Entity : {CargoTypeId : {Engine.Entity}}} +``` + +Gets a map from vehicle Entity to a map from cargo to all "Sim" entities in the vehicle of the given cargo type. + +**Returns** + +1. `{Engine.Entity : {CargoTypeId : {Engine.Entity}}}` + +### SimEntityAtVehicleSystem.getVehicleSimEntitiesCount[πŸ”—](#$api.engine.system~SimEntityAtVehicleSystem.getVehicleSimEntitiesCount) + +``` +function SimEntityAtVehicleSystem.getVehicleSimEntitiesCount(vehicleEntity : Engine.Entity): integer +``` + +Gets the count of entities in the vehicle. + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” the entity of the vehicle that should be inspected + +**Returns** + +1. `integer` β€” the count of entities + +### SimEntityAtVehicleSystem.getVehicleSimEntitiesCountForCargoType[πŸ”—](#$api.engine.system~SimEntityAtVehicleSystem.getVehicleSimEntitiesCountForCargoType) + +``` +function SimEntityAtVehicleSystem.getVehicleSimEntitiesCountForCargoType(vehicleEntity : Engine.Entity, cargoType : CargoTypeId): integer +``` + +Gets the count of entities in the vehicle for the given cargo type. + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” the entity of the vehicle that should be inspected +* `cargoType` :`CargoTypeId` β€” the id of the cargo type + +**Returns** + +1. `integer` β€” the count of entities + +### SimEntityAtVehicleSystem.getVehiclesWithRoundTripCount[πŸ”—](#$api.engine.system~SimEntityAtVehicleSystem.getVehiclesWithRoundTripCount) + +``` +function SimEntityAtVehicleSystem.getVehiclesWithRoundTripCount(): {Engine.Entity : integer} +``` + +Gets the vehicles with their round trip cargo counts. + +**Returns** + +1. `{Engine.Entity : integer}` β€” the vehicles with their round trip cargo counts + +### SimPersonAtBuildingSystem[πŸ”—](#$api.engine.system~SimPersonAtBuildingSystem) + +``` +global record SimPersonAtBuildingSystem getSimPersonAtBuilding: function(simBuildingEntity : Engine.Entity): {Engine.Entity} +end +``` + +Person At Building System. +System managing persons at a building. + +### SimPersonAtBuildingSystem.getSimPersonAtBuilding[πŸ”—](#$api.engine.system~SimPersonAtBuildingSystem.getSimPersonAtBuilding) + +``` +function SimPersonAtBuildingSystem.getSimPersonAtBuilding(simBuildingEntity : Engine.Entity): {Engine.Entity} +``` + +Gets list of entities currently at the building + +**Parameters** + +* `simBuildingEntity` :`Engine.Entity` β€” the entity of the building that should be inspected + +**Returns** + +1. `{Engine.Entity}` + +### SimPersonAtTerminalSystem[πŸ”—](#$api.engine.system~SimPersonAtTerminalSystem) + +``` +global record SimPersonAtTerminalSystem getEdgeInfoMap: function(): {EdgeId : } + getNumFreePlaces: function(edgeId : EdgeId): integer + getPos01: function(edgeId : EdgeId, place : integer): {number, number} +end +``` + +Person At Terminal System. +System managing persons waiting at terminal. + +### SimPersonAtTerminalSystem.getEdgeInfoMap[πŸ”—](#$api.engine.system~SimPersonAtTerminalSystem.getEdgeInfoMap) + +``` +function SimPersonAtTerminalSystem.getEdgeInfoMap(): {EdgeId : } +``` + +Gets information about persons waiting at the terminals. + +**Returns** + +1. `{EdgeId : }` + +### SimPersonAtTerminalSystem.getNumFreePlaces[πŸ”—](#$api.engine.system~SimPersonAtTerminalSystem.getNumFreePlaces) + +``` +function SimPersonAtTerminalSystem.getNumFreePlaces(edgeId : EdgeId): integer +``` + +Gets number of free waiting places for the given transport network edge. + +**Parameters** + +* `edgeId` :`EdgeId` β€” the id of the edge that should be inspected + +**Returns** + +1. `integer` + +### SimPersonAtTerminalSystem.getPos01[πŸ”—](#$api.engine.system~SimPersonAtTerminalSystem.getPos01) + +``` +function SimPersonAtTerminalSystem.getPos01(edgeId : EdgeId, place : integer): {number, number} +``` + +Gets the position on the transport network edge for the given place. + +**Parameters** + +* `edgeId` :`EdgeId` β€” the id of the edge that should be inspected +* `place` :`integer` β€” the waiting place number + +**Returns** + +1. `{number, number}` β€” the position + +### SimPersonAtVehicleSystem[πŸ”—](#$api.engine.system~SimPersonAtVehicleSystem) + +``` +global record SimPersonAtVehicleSystem getVehiclePartInfoList: function(vehicleEntity : Engine.Entity): {VehiclePartInfo} +end +``` + +Sim Person At Vehicle System. +System managing persons travelling on a vehicle. + +### SimPersonAtVehicleSystem.getVehiclePartInfoList[πŸ”—](#$api.engine.system~SimPersonAtVehicleSystem.getVehiclePartInfoList) + +``` +function SimPersonAtVehicleSystem.getVehiclePartInfoList(vehicleEntity : Engine.Entity): {VehiclePartInfo} +``` + +Gets information about persons traveling on the given vehicle. + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” the entity of the vehicle that should be inspected + +**Returns** + +1. `{VehiclePartInfo}` β€” Information about each vehicle part + +### SimPersonSystem[πŸ”—](#$api.engine.system~SimPersonSystem) + +``` +global record SimPersonSystem getCount: function(): integer + getDestination2SpMap: function(): {Engine.Entity : {Engine.Entity}} + getSimPersonsAtTerminalForTransportNetwork: function(tnEntity : Engine.Entity): {Engine.Entity} + getSimPersonsForDestination: function(destination : Engine.Entity): {Engine.Entity} + getSimPersonsForLine: function(lineEntity : Engine.Entity): {Engine.Entity} + getSimPersonsForTarget: function(targetEntity : Engine.Entity): {Engine.Entity} + getSimPersonsIdleForTransportNetwork: function(tnEntity : Engine.Entity): {Engine.Entity} + getSimPersonsMovingForTransportNetwork: function(tnEntity : Engine.Entity): {Engine.Entity} +end +``` + +Sim Person System. +System managing persons. + +### SimPersonSystem.getCount[πŸ”—](#$api.engine.system~SimPersonSystem.getCount) + +``` +function SimPersonSystem.getCount(): integer +``` + +Gets number of people on the map. + +**Returns** + +1. `integer` β€” number of people + +### SimPersonSystem.getDestination2SpMap[πŸ”—](#$api.engine.system~SimPersonSystem.getDestination2SpMap) + +``` +function SimPersonSystem.getDestination2SpMap(): {Engine.Entity : {Engine.Entity}} +``` + +Gets list of people for every destination. + +**Returns** + +1. `{Engine.Entity : {Engine.Entity}}` + +### SimPersonSystem.getSimPersonsAtTerminalForTransportNetwork[πŸ”—](#$api.engine.system~SimPersonSystem.getSimPersonsAtTerminalForTransportNetwork) + +``` +function SimPersonSystem.getSimPersonsAtTerminalForTransportNetwork(tnEntity : Engine.Entity): {Engine.Entity} +``` + +Gets all persons waiting at the given transport network. + +**Parameters** + +* `tnEntity` :`Engine.Entity` β€” the entity of the transport network + +**Returns** + +1. `{Engine.Entity}` + +### SimPersonSystem.getSimPersonsForDestination[πŸ”—](#$api.engine.system~SimPersonSystem.getSimPersonsForDestination) + +``` +function SimPersonSystem.getSimPersonsForDestination(destination : Engine.Entity): {Engine.Entity} +``` + +Gets all persons that have an entity as one of their destination. +Destinations are a home, a work and a shopping destination. + +**Parameters** + +* `destination` :`Engine.Entity` β€” the destination entity + +**Returns** + +1. `{Engine.Entity}` + +### SimPersonSystem.getSimPersonsForLine[πŸ”—](#$api.engine.system~SimPersonSystem.getSimPersonsForLine) + +``` +function SimPersonSystem.getSimPersonsForLine(lineEntity : Engine.Entity): {Engine.Entity} +``` + +Gets all persons travelling with the given line. + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” the entity of the line + +**Returns** + +1. `{Engine.Entity}` + +### SimPersonSystem.getSimPersonsForTarget[πŸ”—](#$api.engine.system~SimPersonSystem.getSimPersonsForTarget) + +``` +function SimPersonSystem.getSimPersonsForTarget(targetEntity : Engine.Entity): {Engine.Entity} +``` + +Gets all persons currently trying to reach given target. + +**Parameters** + +* `targetEntity` :`Engine.Entity` β€” the entity of the target + +**Returns** + +1. `{Engine.Entity}` + +### SimPersonSystem.getSimPersonsIdleForTransportNetwork[πŸ”—](#$api.engine.system~SimPersonSystem.getSimPersonsIdleForTransportNetwork) + +``` +function SimPersonSystem.getSimPersonsIdleForTransportNetwork(tnEntity : Engine.Entity): {Engine.Entity} +``` + +Gets all idle persons on a transport network. + +**Parameters** + +* `tnEntity` :`Engine.Entity` β€” the entity of the transport network + +**Returns** + +1. `{Engine.Entity}` + +### SimPersonSystem.getSimPersonsMovingForTransportNetwork[πŸ”—](#$api.engine.system~SimPersonSystem.getSimPersonsMovingForTransportNetwork) + +``` +function SimPersonSystem.getSimPersonsMovingForTransportNetwork(tnEntity : Engine.Entity): {Engine.Entity} +``` + +Gets all moving persons over a transport network. + +**Parameters** + +* `tnEntity` :`Engine.Entity` β€” the entity of the transport network + +**Returns** + +1. `{Engine.Entity}` + +### StationGroupSystem[πŸ”—](#$api.engine.system~StationGroupSystem) + +``` +global record StationGroupSystem getExpiredStationGroups: function(time : integer): {Engine.Entity} + getExpiryProgress: function(stationGroupEntity : Engine.Entity, time : integer): number + getStationGroup: function(stationEntity : Engine.Entity): Engine.Entity + getCarriers: function(stationGroup : Engine.Entity, station : integer, terminal : integer): {{Carrier}, {TransportMode}} +end +``` + +Station Group System. +Contains cached information about station groups. + +### StationGroupSystem.getExpiredStationGroups[πŸ”—](#$api.engine.system~StationGroupSystem.getExpiredStationGroups) + +``` +function StationGroupSystem.getExpiredStationGroups(time : integer): {Engine.Entity} +``` + +Gets station groups that no longer contain stations and are thus about to be removed. + +**Parameters** + +* `time` :`integer` β€” the time stamp until when the stations with this condition are removed + +**Returns** + +1. `{Engine.Entity}` + +### StationGroupSystem.getExpiryProgress[πŸ”—](#$api.engine.system~StationGroupSystem.getExpiryProgress) + +``` +function StationGroupSystem.getExpiryProgress(stationGroupEntity : Engine.Entity, time : integer): number +``` + +Gets progress on the removal of station groups. + +**Parameters** + +* `stationGroupEntity` :`Engine.Entity` β€” the entity of the station group that is about to be removed +* `time` :`integer` β€” the time for which th progress is requested + +**Returns** + +1. `number` + +### StationGroupSystem.getStationGroup[πŸ”—](#$api.engine.system~StationGroupSystem.getStationGroup) + +``` +function StationGroupSystem.getStationGroup(stationEntity : Engine.Entity): Engine.Entity +``` + +Obtains the station group to which the station belongs. + +**Parameters** + +* `stationEntity` :`Engine.Entity` β€” the entity of the station for which the parent station group is queried + +**Returns** + +1. `Engine.Entity` + +### StationGroupSystem.getCarriers[πŸ”—](#$api.engine.system~StationGroupSystem.getCarriers) + +``` +function StationGroupSystem.getCarriers(stationGroup : Engine.Entity, station : integer, terminal : integer): {{Carrier}, {TransportMode}} +``` + +Gets the carriers of the station / terminal. + +**Parameters** + +* `stationGroup` :`Engine.Entity` β€” entity +* `station` :`integer` β€” The station index (or -1 to get superset over all terminals) +* `terminal` :`integer` β€” The terminal index inside the station (or -1 if station == -1) + +**Returns** + +1. `{{Carrier}, {TransportMode}}` + +### StationSystem[πŸ”—](#$api.engine.system~StationSystem) + +``` +global record StationSystem getPersonNodeId2StationTerminalsMap: function(): {NodeId : {{Engine.Entity, integer}}} + getStation2TownMap: function(): {Engine.Entity : Engine.Entity} + getStations: function(townEntity : Engine.Entity): {Engine.Entity} + getStationTerminalForVehicleNode: function(nodeId : NodeId): {Engine.Entity, integer} + getStationTerminalsForPersonEdge: function(nodeId : EdgeId): {{Engine.Entity, integer}} + getStationTerminalsForPersonNode: function(nodeId : NodeId): {{Engine.Entity, integer}} + getTown2StationsMap: function(): {Engine.Entity : {Engine.Entity}} + getTown: function(stationEntity : Engine.Entity): Engine.Entity + getVehicleNodeId2StationTerminalsMap: function(): {NodeId : {{Engine.Entity, integer}}} + forEach: function(Engine.Entity) +end +``` + +Station System. +Contains cached information about stations. + +### StationSystem.getPersonNodeId2StationTerminalsMap[πŸ”—](#$api.engine.system~StationSystem.getPersonNodeId2StationTerminalsMap) + +``` +function StationSystem.getPersonNodeId2StationTerminalsMap(): {NodeId : {{Engine.Entity, integer}}} +``` + +Gets all transport network nodes associated with a station terminal. + +**Returns** + +1. `{NodeId : {{Engine.Entity, integer}}}` + +### StationSystem.getStation2TownMap[πŸ”—](#$api.engine.system~StationSystem.getStation2TownMap) + +``` +function StationSystem.getStation2TownMap(): {Engine.Entity : Engine.Entity} +``` + +Gets a map from stations to towns. + +**Returns** + +1. `{Engine.Entity : Engine.Entity}` + +### StationSystem.getStations[πŸ”—](#$api.engine.system~StationSystem.getStations) + +``` +function StationSystem.getStations(townEntity : Engine.Entity): {Engine.Entity} +``` + +Gets all stations in a town. + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” the entity of the town that is queried for + +**Returns** + +1. `{Engine.Entity}` + +### StationSystem.getStationTerminalForVehicleNode[πŸ”—](#$api.engine.system~StationSystem.getStationTerminalForVehicleNode) + +``` +function StationSystem.getStationTerminalForVehicleNode(nodeId : NodeId): {Engine.Entity, integer} +``` + +Gets the station terminal to which the node belongs. + +**Parameters** + +* `nodeId` :`NodeId` β€” the vehicle node id that is queried for + +**Returns** + +1. `{Engine.Entity, integer}` + +### StationSystem.getStationTerminalsForPersonEdge[πŸ”—](#$api.engine.system~StationSystem.getStationTerminalsForPersonEdge) + +``` +function StationSystem.getStationTerminalsForPersonEdge(nodeId : EdgeId): {{Engine.Entity, integer}} +``` + +Gets the station terminals to which the person edge belongs. + +**Parameters** + +* `nodeId` :`EdgeId` β€” the edge id that is queried for + +**Returns** + +1. `{{Engine.Entity, integer}}` + +### StationSystem.getStationTerminalsForPersonNode[πŸ”—](#$api.engine.system~StationSystem.getStationTerminalsForPersonNode) + +``` +function StationSystem.getStationTerminalsForPersonNode(nodeId : NodeId): {{Engine.Entity, integer}} +``` + +Gets the station terminals to which the person node belongs. + +**Parameters** + +* `nodeId` :`NodeId` β€” the person node id that is queried for + +**Returns** + +1. `{{Engine.Entity, integer}}` + +### StationSystem.getTown2StationsMap[πŸ”—](#$api.engine.system~StationSystem.getTown2StationsMap) + +``` +function StationSystem.getTown2StationsMap(): {Engine.Entity : {Engine.Entity}} +``` + +Gets all station grouped by towns. + +**Returns** + +1. `{Engine.Entity : {Engine.Entity}}` + +### StationSystem.getTown[πŸ”—](#$api.engine.system~StationSystem.getTown) + +``` +function StationSystem.getTown(stationEntity : Engine.Entity): Engine.Entity +``` + +Gets a the town of the station. + +**Parameters** + +* `stationEntity` :`Engine.Entity` β€” the entity of the station that is queried for + +**Returns** + +1. `Engine.Entity` + +### StationSystem.getVehicleNodeId2StationTerminalsMap[πŸ”—](#$api.engine.system~StationSystem.getVehicleNodeId2StationTerminalsMap) + +``` +function StationSystem.getVehicleNodeId2StationTerminalsMap(): {NodeId : {{Engine.Entity, integer}}} +``` + +Gets the mapping from vehicle node to station terminal. + +**Returns** + +1. `{NodeId : {{Engine.Entity, integer}}}` + +### StationSystem.forEach[πŸ”—](#$api.engine.system~StationSystem.forEach) + +``` +function StationSystem.forEach(Engine.Entity) +``` + +Loops over all stations. + +**Parameters** + +* `Engine.Entity` + +### StockListSystem[πŸ”—](#$api.engine.system~StockListSystem) + +``` +global record StockListSystemend +``` + +Stock List System. +Manages stocks. + +### StreetConnectorSystem[πŸ”—](#$api.engine.system~StreetConnectorSystem) + +``` +global record StreetConnectorSystem getConstructionEntityForDepot: function(depotEntity : Engine.Entity): Engine.Entity + getConstructionEntityForEdge: function(edgeEntity : Engine.Entity): Engine.Entity + getConstructionEntityForIndustry: function(industryEntity : Engine.Entity): Engine.Entity + getConstructionEntityForNode: function(nodeEntity : Engine.Entity): Engine.Entity + getConstructionEntityForSubconstruction: function(subconstruction : Engine.Entity): Engine.Entity + getConstructionEntityForStation: function(stationEntity : Engine.Entity): Engine.Entity + getConstructionEntityForTownBuilding: function(townBuilding : Engine.Entity): Engine.Entity + getNode2StreetConnectorMap: function(): {Engine.Entity : Engine.Entity} + getStation2ConstructionMap: function(): {Engine.Entity : Engine.Entity} + forEachConstructionWithMetadata: function(metadataKey : string, constructionDescMeta : boolean, constructionInstanceMeta : boolean, fn : function(Engine.Entity, Engine.Component.Construction, ConstructionId), playerOwnedOnly : boolean) + getConstructionIdIfStaticMetadata: function(constructionEntity : Engine.Entity, metadataKey : string): {ConstructionId, ResName} + getConstructionClosestTown: function(constructionEntity : Engine.Entity): Engine.Entity + getTownClosestConstructions: function(townEntity : Engine.Entity): {Engine.Entity} + forEach: function(Engine.Entity) +end +``` + +Street Connector System. +Manages street connections. + +### StreetConnectorSystem.getConstructionEntityForDepot[πŸ”—](#$api.engine.system~StreetConnectorSystem.getConstructionEntityForDepot) + +``` +function StreetConnectorSystem.getConstructionEntityForDepot(depotEntity : Engine.Entity): Engine.Entity +``` + +Gets all sources for the destination entity. + +**Parameters** + +* `depotEntity` :`Engine.Entity` β€” the entity for which the containing construction should be fetched + +**Returns** + +1. `Engine.Entity` + +### StreetConnectorSystem.getConstructionEntityForEdge[πŸ”—](#$api.engine.system~StreetConnectorSystem.getConstructionEntityForEdge) + +``` +function StreetConnectorSystem.getConstructionEntityForEdge(edgeEntity : Engine.Entity): Engine.Entity +``` + +Gets the construction that "owns" the given edge. + +**Parameters** + +* `edgeEntity` :`Engine.Entity` β€” the entity for which the containing construction should be fetched + +**Returns** + +1. `Engine.Entity` + +### StreetConnectorSystem.getConstructionEntityForIndustry[πŸ”—](#$api.engine.system~StreetConnectorSystem.getConstructionEntityForIndustry) + +``` +function StreetConnectorSystem.getConstructionEntityForIndustry(industryEntity : Engine.Entity): Engine.Entity +``` + +Gets the construction for the industry. + +**Parameters** + +* `industryEntity` :`Engine.Entity` β€” the entity for which the containing construction should be fetched + +**Returns** + +1. `Engine.Entity` + +### StreetConnectorSystem.getConstructionEntityForNode[πŸ”—](#$api.engine.system~StreetConnectorSystem.getConstructionEntityForNode) + +``` +function StreetConnectorSystem.getConstructionEntityForNode(nodeEntity : Engine.Entity): Engine.Entity +``` + +Gets the construction to which the node (a frozen node in the construction) belongs. + +**Parameters** + +* `nodeEntity` :`Engine.Entity` β€” the entity for which the containing construction should be fetched + +**Returns** + +1. `Engine.Entity` + +### StreetConnectorSystem.getConstructionEntityForSubconstruction[πŸ”—](#$api.engine.system~StreetConnectorSystem.getConstructionEntityForSubconstruction) + +``` +function StreetConnectorSystem.getConstructionEntityForSubconstruction(subconstruction : Engine.Entity): Engine.Entity +``` + +Gets the construction for the subconstruction. + +**Parameters** + +* `subconstruction` :`Engine.Entity` β€” the entity for which the containing construction should be fetched + +**Returns** + +1. `Engine.Entity` + +### StreetConnectorSystem.getConstructionEntityForStation[πŸ”—](#$api.engine.system~StreetConnectorSystem.getConstructionEntityForStation) + +``` +function StreetConnectorSystem.getConstructionEntityForStation(stationEntity : Engine.Entity): Engine.Entity +``` + +Gets the construction for the station. + +**Parameters** + +* `stationEntity` :`Engine.Entity` β€” the entity for which the containing construction should be fetched + +**Returns** + +1. `Engine.Entity` + +### StreetConnectorSystem.getConstructionEntityForTownBuilding[πŸ”—](#$api.engine.system~StreetConnectorSystem.getConstructionEntityForTownBuilding) + +``` +function StreetConnectorSystem.getConstructionEntityForTownBuilding(townBuilding : Engine.Entity): Engine.Entity +``` + +Gets the construction for the town building. + +**Parameters** + +* `townBuilding` :`Engine.Entity` β€” the entity for which the containing construction should be fetched + +**Returns** + +1. `Engine.Entity` + +### StreetConnectorSystem.getNode2StreetConnectorMap[πŸ”—](#$api.engine.system~StreetConnectorSystem.getNode2StreetConnectorMap) + +``` +function StreetConnectorSystem.getNode2StreetConnectorMap(): {Engine.Entity : Engine.Entity} +``` + +Gets a mapping from frozen nodes to the construction they belong. + +**Returns** + +1. `{Engine.Entity : Engine.Entity}` + +### StreetConnectorSystem.getStation2ConstructionMap[πŸ”—](#$api.engine.system~StreetConnectorSystem.getStation2ConstructionMap) + +``` +function StreetConnectorSystem.getStation2ConstructionMap(): {Engine.Entity : Engine.Entity} +``` + +Gets a mapping from stations to constructions. + +**Returns** + +1. `{Engine.Entity : Engine.Entity}` + +### StreetConnectorSystem.forEachConstructionWithMetadata[πŸ”—](#$api.engine.system~StreetConnectorSystem.forEachConstructionWithMetadata) + +``` +function StreetConnectorSystem.forEachConstructionWithMetadata(metadataKey : string, constructionDescMeta : boolean, constructionInstanceMeta : boolean, fn : function(Engine.Entity, Engine.Component.Construction, ConstructionId), playerOwnedOnly : boolean) +``` + +Loop over all constructions that have the specified metadata key in their static description. + +**Parameters** + +* `metadataKey` :`string` β€” metadata key +* `constructionDescMeta` :`boolean` β€” if static metadata should be checked (on match, the callback's constructionId is >= 0) +* `constructionInstanceMeta` :`boolean` β€” if instance metadata should be checked +* `fn` :`function(Engine.Entity, Engine.Component.Construction, ConstructionId)` β€” the callback called for each entity with the given component and its entry in constructionRep +* `playerOwnedOnly` :`boolean` β€” if true, then skip constructions owned by other player or not owned at all + +### StreetConnectorSystem.getConstructionIdIfStaticMetadata[πŸ”—](#$api.engine.system~StreetConnectorSystem.getConstructionIdIfStaticMetadata) + +``` +function StreetConnectorSystem.getConstructionIdIfStaticMetadata(constructionEntity : Engine.Entity, metadataKey : string): {ConstructionId, ResName} +``` + +Loop over all constructions that have the specified metadata key in their static description. + +**Parameters** + +* `constructionEntity` :`Engine.Entity` β€” the entity to check +* `metadataKey` :`string` β€” metadata key + +**Returns** + +1. `{ConstructionId, ResName}` + +### StreetConnectorSystem.getConstructionClosestTown[πŸ”—](#$api.engine.system~StreetConnectorSystem.getConstructionClosestTown) + +``` +function StreetConnectorSystem.getConstructionClosestTown(constructionEntity : Engine.Entity): Engine.Entity +``` + +Gets the closest town to the construction. + +**Parameters** + +* `constructionEntity` :`Engine.Entity` β€” the entity for which the closest town should be fetched + +**Returns** + +1. `Engine.Entity` + +### StreetConnectorSystem.getTownClosestConstructions[πŸ”—](#$api.engine.system~StreetConnectorSystem.getTownClosestConstructions) + +``` +function StreetConnectorSystem.getTownClosestConstructions(townEntity : Engine.Entity): {Engine.Entity} +``` + +Gets constructions for which the town is the closest. + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” the entity for which the closest constructions should be fetched + +**Returns** + +1. `{Engine.Entity}` + +### StreetConnectorSystem.forEach[πŸ”—](#$api.engine.system~StreetConnectorSystem.forEach) + +``` +function StreetConnectorSystem.forEach(Engine.Entity) +``` + +Loops over all constructions. + +**Parameters** + +* `Engine.Entity` + +### StreetSystem[πŸ”—](#$api.engine.system~StreetSystem) + +``` +global record StreetSystem getEdgeForEdgeObject: function(edgeEntity : Engine.Entity): Engine.Entity + getEdgeObject2EdgeMap: function(): {Engine.Entity : Engine.Entity} + getNode2SegmentMap: function(): {Engine.Entity : {Engine.Entity}} + getNode2StreetEdgeMap: function(): {Engine.Entity : {Engine.Entity}} + getNode2TrackEdgeMap: function(): {Engine.Entity : {Engine.Entity}} + isTownCrossingNode: function(Engine.Entity): boolean + getNodeSegments: function(nodeEntity : Engine.Entity): {Engine.Entity} + getNodeStreetSegments: function(nodeEntity : Engine.Entity): {Engine.Entity} + getNodeTrackSegments: function(nodeEntity : Engine.Entity): {Engine.Entity} +end +``` + +Street System. +Manages base edges. + +### StreetSystem.getEdgeForEdgeObject[πŸ”—](#$api.engine.system~StreetSystem.getEdgeForEdgeObject) + +``` +function StreetSystem.getEdgeForEdgeObject(edgeEntity : Engine.Entity): Engine.Entity +``` + +Obtains the edge to which the edge object belongs. + +**Parameters** + +* `edgeEntity` :`Engine.Entity` β€” the entity of the edge object + +**Returns** + +1. `Engine.Entity` + +### StreetSystem.getEdgeObject2EdgeMap[πŸ”—](#$api.engine.system~StreetSystem.getEdgeObject2EdgeMap) + +``` +function StreetSystem.getEdgeObject2EdgeMap(): {Engine.Entity : Engine.Entity} +``` + +Obtains the mapping from edge object to edges they belong. + +**Returns** + +1. `{Engine.Entity : Engine.Entity}` + +### StreetSystem.getNode2SegmentMap[πŸ”—](#$api.engine.system~StreetSystem.getNode2SegmentMap) + +``` +function StreetSystem.getNode2SegmentMap(): {Engine.Entity : {Engine.Entity}} +``` + +Obtains a map from all base nodes to base segments they are connected with. + +**Returns** + +1. `{Engine.Entity : {Engine.Entity}}` + +### StreetSystem.getNode2StreetEdgeMap[πŸ”—](#$api.engine.system~StreetSystem.getNode2StreetEdgeMap) + +``` +function StreetSystem.getNode2StreetEdgeMap(): {Engine.Entity : {Engine.Entity}} +``` + +Obtains a map from all base nodes to base street segments they are connected with. + +**Returns** + +1. `{Engine.Entity : {Engine.Entity}}` + +### StreetSystem.getNode2TrackEdgeMap[πŸ”—](#$api.engine.system~StreetSystem.getNode2TrackEdgeMap) + +``` +function StreetSystem.getNode2TrackEdgeMap(): {Engine.Entity : {Engine.Entity}} +``` + +Obtains a map from all base nodes to base track segments they are connected with. + +**Returns** + +1. `{Engine.Entity : {Engine.Entity}}` + +### StreetSystem.isTownCrossingNode[πŸ”—](#$api.engine.system~StreetSystem.isTownCrossingNode) + +``` +function StreetSystem.isTownCrossingNode(Engine.Entity): boolean +``` + +Checks if the node is a town crossing. + +**Parameters** + +* `Engine.Entity` + +**Returns** + +1. `boolean` + +### StreetSystem.getNodeSegments[πŸ”—](#$api.engine.system~StreetSystem.getNodeSegments) + +``` +function StreetSystem.getNodeSegments(nodeEntity : Engine.Entity): {Engine.Entity} +``` + +Returns the node segments. + +**Parameters** + +* `nodeEntity` :`Engine.Entity` β€” the entity of the node + +**Returns** + +1. `{Engine.Entity}` + +### StreetSystem.getNodeStreetSegments[πŸ”—](#$api.engine.system~StreetSystem.getNodeStreetSegments) + +``` +function StreetSystem.getNodeStreetSegments(nodeEntity : Engine.Entity): {Engine.Entity} +``` + +Returns the node street segments. + +**Parameters** + +* `nodeEntity` :`Engine.Entity` β€” the entity of the node + +**Returns** + +1. `{Engine.Entity}` + +### StreetSystem.getNodeTrackSegments[πŸ”—](#$api.engine.system~StreetSystem.getNodeTrackSegments) + +``` +function StreetSystem.getNodeTrackSegments(nodeEntity : Engine.Entity): {Engine.Entity} +``` + +Returns the node track segments. + +**Parameters** + +* `nodeEntity` :`Engine.Entity` β€” the entity of the node + +**Returns** + +1. `{Engine.Entity}` + +### TownBuildingSystem[πŸ”—](#$api.engine.system~TownBuildingSystem) + +``` +global record TownBuildingSystem getBuilding: function(parcelEntity : Engine.Entity): Engine.Entity + getCargoSupplyAndLimit: function(townEntity : Engine.Entity, LandUseType): {CargoTypeId : {number, number, integer}} + getLandUsePersonCapacities: function(townEntity : Engine.Entity): {integer} + getParcel2BuildingMap: function(): {Engine.Entity : Engine.Entity} + getPersonCapacity2townBuildingMap: function(): {Engine.Entity : Engine.Entity} + getTown2BuildingMap: function(): {Engine.Entity : {Engine.Entity}} + getTown2personCapacitiesMap: function(): {Engine.Entity : {integer}} + hasBuilding: function(parcelEntity : Engine.Entity): boolean +end +``` + +Town Building System. +Manages town buildings and parcels. + +### TownBuildingSystem.getBuilding[πŸ”—](#$api.engine.system~TownBuildingSystem.getBuilding) + +``` +function TownBuildingSystem.getBuilding(parcelEntity : Engine.Entity): Engine.Entity +``` + +Obtains the building (if any) that is placed on the given parcel. + +**Parameters** + +* `parcelEntity` :`Engine.Entity` β€” the entity of the parcel + +**Returns** + +1. `Engine.Entity` + +### TownBuildingSystem.getCargoSupplyAndLimit[πŸ”—](#$api.engine.system~TownBuildingSystem.getCargoSupplyAndLimit) + +``` +function TownBuildingSystem.getCargoSupplyAndLimit(townEntity : Engine.Entity, LandUseType): {CargoTypeId : {number, number, integer}} +``` + +Obtains information about towns and cargo. + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” the entity of the town +* `LandUseType` + +**Returns** + +1. `{CargoTypeId : {number, number, integer}}` + +### TownBuildingSystem.getLandUsePersonCapacities[πŸ”—](#$api.engine.system~TownBuildingSystem.getLandUsePersonCapacities) + +``` +function TownBuildingSystem.getLandUsePersonCapacities(townEntity : Engine.Entity): {integer} +``` + +Obtains information about land use and person capacities. + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” the entity of the town + +**Returns** + +1. `{integer}` + +### TownBuildingSystem.getParcel2BuildingMap[πŸ”—](#$api.engine.system~TownBuildingSystem.getParcel2BuildingMap) + +``` +function TownBuildingSystem.getParcel2BuildingMap(): {Engine.Entity : Engine.Entity} +``` + +Obtains map from parcel to building occupying the parcel. + +**Returns** + +1. `{Engine.Entity : Engine.Entity}` + +### TownBuildingSystem.getPersonCapacity2townBuildingMap[πŸ”—](#$api.engine.system~TownBuildingSystem.getPersonCapacity2townBuildingMap) + +``` +function TownBuildingSystem.getPersonCapacity2townBuildingMap(): {Engine.Entity : Engine.Entity} +``` + +Obtains map from person capacities to town buildings. + +**Returns** + +1. `{Engine.Entity : Engine.Entity}` + +### TownBuildingSystem.getTown2BuildingMap[πŸ”—](#$api.engine.system~TownBuildingSystem.getTown2BuildingMap) + +``` +function TownBuildingSystem.getTown2BuildingMap(): {Engine.Entity : {Engine.Entity}} +``` + +Obtains map from town to town buildings of the town. + +**Returns** + +1. `{Engine.Entity : {Engine.Entity}}` + +### TownBuildingSystem.getTown2personCapacitiesMap[πŸ”—](#$api.engine.system~TownBuildingSystem.getTown2personCapacitiesMap) + +``` +function TownBuildingSystem.getTown2personCapacitiesMap(): {Engine.Entity : {integer}} +``` + +Obtains map from town to person capacities of the town. + +**Returns** + +1. `{Engine.Entity : {integer}}` β€” a map of town to an array of integer. {integer} is an array of 3 ints capa per landuse: { RESIDENTIAL, COMMERCIAL, INDUSTRIAL } + +### TownBuildingSystem.hasBuilding[πŸ”—](#$api.engine.system~TownBuildingSystem.hasBuilding) + +``` +function TownBuildingSystem.hasBuilding(parcelEntity : Engine.Entity): boolean +``` + +Checks if parcel is occupied by building. + +**Parameters** + +* `parcelEntity` :`Engine.Entity` β€” the entity of the parcel + +**Returns** + +1. `boolean` + +### TpNetLinkSystem[πŸ”—](#$api.engine.system~TpNetLinkSystem) + +``` +global record TpNetLinkSystem getEdgeId2linkEntities: function(): {EdgeId : {Engine.Entity}} + getLinkEntities: function(edgeId : EdgeId): {Engine.Entity} +end +``` + +Transport Network Link System. +Manages transport networks links (small links between roads and constructions). + +### TpNetLinkSystem.getEdgeId2linkEntities[πŸ”—](#$api.engine.system~TpNetLinkSystem.getEdgeId2linkEntities) + +``` +function TpNetLinkSystem.getEdgeId2linkEntities(): {EdgeId : {Engine.Entity}} +``` + +Gets a map from all edges to the links touching the edge. + +**Returns** + +1. `{EdgeId : {Engine.Entity}}` + +### TpNetLinkSystem.getLinkEntities[πŸ”—](#$api.engine.system~TpNetLinkSystem.getLinkEntities) + +``` +function TpNetLinkSystem.getLinkEntities(edgeId : EdgeId): {Engine.Entity} +``` + +Gets all links within a transport network edge. + +**Parameters** + +* `edgeId` :`EdgeId` β€” the edge id for which the links should be fetched + +**Returns** + +1. `{Engine.Entity}` + +### TransportNetworkSystem[πŸ”—](#$api.engine.system~TransportNetworkSystem) + +``` +global record TransportNetworkSystem getIntersections: function(tnEntity : Engine.Entity): {} + getTpNetData: function(): TpNetData +end +``` + +Transport Network System. +Manages transport networks (and transport network edges and nodes). + +### TransportNetworkSystem.getIntersections[πŸ”—](#$api.engine.system~TransportNetworkSystem.getIntersections) + +``` +function TransportNetworkSystem.getIntersections(tnEntity : Engine.Entity): {} +``` + +Gets all intersections within a transport network (e.g. all intersections in a base node). + +**Parameters** + +* `tnEntity` :`Engine.Entity` β€” the entity of the transport network + +**Returns** + +1. `{}` + +### TransportNetworkSystem.getTpNetData[πŸ”—](#$api.engine.system~TransportNetworkSystem.getTpNetData) + +``` +function TransportNetworkSystem.getTpNetData(): TpNetData +``` + +Gets a structure representing the graph of the transport network. + +**Returns** + +1. `TpNetData` + +### TransportVehicleSystem[πŸ”—](#$api.engine.system~TransportVehicleSystem) + +``` +global record TransportVehicleSystem getDepotVehicles: function(depotEntity : Engine.Entity): {Engine.Entity} + getGoingToDepotVehicles: function(depotEntity : Engine.Entity): {Engine.Entity} + getInfo: function(transportVehicleEntity : Engine.Entity): any + getLine2VehicleMap: function(): {Engine.Entity : {Engine.Entity}} + getLineStopVehicles: function(lineEntity : Engine.Entity, stopIndex : number): {Engine.Entity} + checkLineStopForVehicleOverlength: function(lineEntity : Engine.Entity, stopIndex : number): {StationTerminal : boolean} + getLineVehicles: function(lineEntity : Engine.Entity): {Engine.Entity} + getNoPathVehicles: function(): {Engine.Entity} + getVehicleNames: function(carrier : Carrier): {string} + getVehicles: function(tnEntities : {Engine.Entity}, wholePath : boolean): {Engine.Entity} + getVehiclesWithState: function(state : TransportVehicleState): {Engine.Entity} + getVehiclesForMaintenanceStation: function(maintenanceStation : Engine.Entity): {Engine.Entity} + isVehicleMaintainedByStation: function(vehicle : Engine.Entity, maintenanceStation : Engine.Entity): boolean + getLineCargoInfo: function(lineEntity : Engine.Entity, cargoTypeId : CargoTypeId): LineCargoInfo +end +``` + +Transport Vehicle System. +Manages the movement and behaviour of transport vehicles. This covers all vehicles transporting cargo and passengers. + +### TransportVehicleSystem.getDepotVehicles[πŸ”—](#$api.engine.system~TransportVehicleSystem.getDepotVehicles) + +``` +function TransportVehicleSystem.getDepotVehicles(depotEntity : Engine.Entity): {Engine.Entity} +``` + +Gets all vehicles that are in a depot. + +**Parameters** + +* `depotEntity` :`Engine.Entity` β€” the entity of the depot + +**Returns** + +1. `{Engine.Entity}` + +### TransportVehicleSystem.getGoingToDepotVehicles[πŸ”—](#$api.engine.system~TransportVehicleSystem.getGoingToDepotVehicles) + +``` +function TransportVehicleSystem.getGoingToDepotVehicles(depotEntity : Engine.Entity): {Engine.Entity} +``` + +Gets all vehicles heading for the depot. + +**Parameters** + +* `depotEntity` :`Engine.Entity` β€” the entity of the depot + +**Returns** + +1. `{Engine.Entity}` + +### TransportVehicleSystem.getInfo[πŸ”—](#$api.engine.system~TransportVehicleSystem.getInfo) + +``` +function TransportVehicleSystem.getInfo(transportVehicleEntity : Engine.Entity): any +``` + +Gets additional information about the vehicle. + +**Parameters** + +* `transportVehicleEntity` :`Engine.Entity` β€” the entity of the transport vehicle + +**Returns** + +1. `any` β€” info about the transport vehicle + +### TransportVehicleSystem.getLine2VehicleMap[πŸ”—](#$api.engine.system~TransportVehicleSystem.getLine2VehicleMap) + +``` +function TransportVehicleSystem.getLine2VehicleMap(): {Engine.Entity : {Engine.Entity}} +``` + +Gets a map of lines to the vehicles using the line. + +**Returns** + +1. `{Engine.Entity : {Engine.Entity}}` + +### TransportVehicleSystem.getLineStopVehicles[πŸ”—](#$api.engine.system~TransportVehicleSystem.getLineStopVehicles) + +``` +function TransportVehicleSystem.getLineStopVehicles(lineEntity : Engine.Entity, stopIndex : number): {Engine.Entity} +``` + +Gets the vehicle stopped at the stop of a line. + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” the entity of the line +* `stopIndex` :`number` β€” the index of the stop on the line + +**Returns** + +1. `{Engine.Entity}` + +### TransportVehicleSystem.checkLineStopForVehicleOverlength[πŸ”—](#$api.engine.system~TransportVehicleSystem.checkLineStopForVehicleOverlength) + +``` +function TransportVehicleSystem.checkLineStopForVehicleOverlength(lineEntity : Engine.Entity, stopIndex : number): {StationTerminal : boolean} +``` + +Checks whether the specified stop has terminals that are too short for optimal loading. + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” the entity of the line +* `stopIndex` :`number` β€” the index of the stop on the line + +**Returns** + +1. `{StationTerminal : boolean}` + +### TransportVehicleSystem.getLineVehicles[πŸ”—](#$api.engine.system~TransportVehicleSystem.getLineVehicles) + +``` +function TransportVehicleSystem.getLineVehicles(lineEntity : Engine.Entity): {Engine.Entity} +``` + +Gets all vehicles using a given line. + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” the entity of the line + +**Returns** + +1. `{Engine.Entity}` + +### TransportVehicleSystem.getNoPathVehicles[πŸ”—](#$api.engine.system~TransportVehicleSystem.getNoPathVehicles) + +``` +function TransportVehicleSystem.getNoPathVehicles(): {Engine.Entity} +``` + +Gets all vehicles that cannot find a path to their destination. + +**Returns** + +1. `{Engine.Entity}` + +### TransportVehicleSystem.getVehicleNames[πŸ”—](#$api.engine.system~TransportVehicleSystem.getVehicleNames) + +``` +function TransportVehicleSystem.getVehicleNames(carrier : Carrier): {string} +``` + +Gets the vehicle names of all vehicles for the given carrier. + +**Parameters** + +* `carrier` :`Carrier` β€” the carrier for which the names should be fetched + +**Returns** + +1. `{string}` + +### TransportVehicleSystem.getVehicles[πŸ”—](#$api.engine.system~TransportVehicleSystem.getVehicles) + +``` +function TransportVehicleSystem.getVehicles(tnEntities : {Engine.Entity}, wholePath : boolean): {Engine.Entity} +``` + +Gets the vehicle using a certain transport network. + +**Parameters** + +* `tnEntities` :`{Engine.Entity}` β€” list of transport network entities +* `wholePath` :`boolean` β€” true if the vehicle has to use the whole path + +**Returns** + +1. `{Engine.Entity}` + +### TransportVehicleSystem.getVehiclesWithState[πŸ”—](#$api.engine.system~TransportVehicleSystem.getVehiclesWithState) + +``` +function TransportVehicleSystem.getVehiclesWithState(state : TransportVehicleState): {Engine.Entity} +``` + +Gets all vehicles that are in the given state. This can be used, for instance, to obtain a list of all vehicles +currently waiting at a terminal. + +**Parameters** + +* `state` :`TransportVehicleState` β€” A state to filter the vehicles + +**Returns** + +1. `{Engine.Entity}` + +### TransportVehicleSystem.getVehiclesForMaintenanceStation[πŸ”—](#$api.engine.system~TransportVehicleSystem.getVehiclesForMaintenanceStation) + +``` +function TransportVehicleSystem.getVehiclesForMaintenanceStation(maintenanceStation : Engine.Entity): {Engine.Entity} +``` + +Gets all vehicles that are maintained by the given maintenance station. + +**Parameters** + +* `maintenanceStation` :`Engine.Entity` β€” the entity of the maintenance station + +**Returns** + +1. `{Engine.Entity}` + +### TransportVehicleSystem.isVehicleMaintainedByStation[πŸ”—](#$api.engine.system~TransportVehicleSystem.isVehicleMaintainedByStation) + +``` +function TransportVehicleSystem.isVehicleMaintainedByStation(vehicle : Engine.Entity, maintenanceStation : Engine.Entity): boolean +``` + +Checks if the vehicle is maintained by the given maintenance station. + +**Parameters** + +* `vehicle` :`Engine.Entity` β€” the entity of the vehicle +* `maintenanceStation` :`Engine.Entity` β€” the entity of the maintenance station + +**Returns** + +1. `boolean` + +### TransportVehicleSystem.getLineCargoInfo[πŸ”—](#$api.engine.system~TransportVehicleSystem.getLineCargoInfo) + +``` +function TransportVehicleSystem.getLineCargoInfo(lineEntity : Engine.Entity, cargoTypeId : CargoTypeId): LineCargoInfo +``` + +Gets cargo info for a line. + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” the entity of the line +* `cargoTypeId` :`CargoTypeId` β€” the id of the cargo type + +**Returns** + +1. `LineCargoInfo` + +### VehicleDepotSystem[πŸ”—](#$api.engine.system~VehicleDepotSystem) + +``` +global record VehicleDepotSystem getDepotForInNodeId: function(nodeId : NodeId): Engine.Entity + forEach: function(Engine.Entity) +end +``` + +Vehicle Depot System. +Manages depots and vehicles in depots. + +### VehicleDepotSystem.getDepotForInNodeId[πŸ”—](#$api.engine.system~VehicleDepotSystem.getDepotForInNodeId) + +``` +function VehicleDepotSystem.getDepotForInNodeId(nodeId : NodeId): Engine.Entity +``` + +Gets the depot entity to which the node belongs. + +**Parameters** + +* `nodeId` :`NodeId` β€” the id of the node for which the depot should be fetched + +**Returns** + +1. `Engine.Entity` + +### VehicleDepotSystem.forEach[πŸ”—](#$api.engine.system~VehicleDepotSystem.forEach) + +``` +function VehicleDepotSystem.forEach(Engine.Entity) +``` + +Loops over all depots. + +**Parameters** + +* `Engine.Entity` diff --git a/docs/reference/script-doc/api_engine_util.md b/docs/reference/script-doc/api_engine_util.md new file mode 100644 index 0000000..2476845 --- /dev/null +++ b/docs/reference/script-doc/api_engine_util.md @@ -0,0 +1,4382 @@ + + +[index](../../index.html) / [api](../../api.html) / [engine](../engine.html) / util + +--- + +# Module api.engine.util[πŸ”—](#api.engine.util) + +Contains definitions for of api.engine.util + +``` +global record EngineUtil getPlayer: function(): Engine.Entity + getWorld: function(): Engine.Entity + getCalendarDate: function(gameTime : number): Date + getYear: function(): integer + hasStartedAsMission: function(): boolean + getEntityName: function(Engine.Entity): string + getEntityNameStem: function(Engine.Entity): {string, Engine.Entity} + cargo: UtilCargo + construction: UtilConstruction + chart: UtilChart + finance: UtilFinance + headquarters: UtilHeadquarters + line: UtilLine + logbook: UtilLogbook + maintenance: UtilMaintenance + octree: UtilOctree + parallelStrip: UtilParallelStrip + pathfinding: UtilPathfinding + station: UtilStation + stock: UtilStock + town: UtilTown + transport: UtilTransport + vehicle: UtilVehicle + industry: UtilIndustry + proposal: UtilProposal + emission: UtilEmission + formatAge: function(begin : integer, end : integer): string +end + +[Expand All] [Collapse All] + +global record UtilCargo isGoodQuality: function(sim : Engine.Entity): boolean + record CargoQualityData clone: function(CargoQualityData): CargoQualityData + countBad: integer + countTotal: integer + averageQuality: number | nil + isVeryBad: boolean +end + record SummarizedCargoQualityData clone: function(SummarizedCargoQualityData): SummarizedCargoQualityData + passengers: CargoQualityData + cargo: CargoQualityData +end + getCargoQualityDataForLine: function(lineEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataForVehicle: function(vehicleEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataAtStation: function(stationEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataAtStationGroup: function(stationGroupEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataAtStop: function(lineEntity : Engine.Entity, stopIndex : integer, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataAtTerminal: function(stationGroupEntity : Engine.Entity, stationTerminal : StationTerminal, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataForStockList: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataForStock: function(stockListEntity : Engine.Entity, stockId : StockId, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getSummarizedCargoQualityDataForStockList: function(stockListEntity : Engine.Entity): UtilCargo.SummarizedCargoQualityData + getSummarizedCargoQualityDataForLine: function(lineEntity : Engine.Entity): UtilCargo.SummarizedCargoQualityData + getSummarizedCargoQualityDataForVehicle: function(vehicleEntity : Engine.Entity): UtilCargo.SummarizedCargoQualityData + getNumCargoPerTypeInVehicle: function(vehicleEntity : Engine.Entity): {integer} +end +global record UtilChart getChartLabel: function(config : ChartConfig, index : integer, abbreviated : boolean): string + setLastValue: function(chartResult : ChartResult, series : integer, value : number) +end +global record UtilConstruction getNumAndFilledAutoFillSlots: function(entity : Engine.Entity): {integer, integer} + getConstructionEntity: function(depotEntity : Engine.Entity): Engine.Entity + getSlotTypes: function(entity : Engine.Entity): {string} + getConstructionResult: function(constructionResName : ResName, constructionTemplate : integer, parameters : { : }): ConstructionResult + getGlobalConstructionParams: function(): {string : number} + getCostMultiplierForYear: function(costMultipliers : {integer : number}, currentYear : integer): number + findSegmentsToDelete: function(constructionEntity : Engine.Entity, keepIndustryRoads : boolean): {Engine.Entity} +end +global record UtilEmission getCurrentEmission: function(entity : Engine.Entity, type : Engine.Component.EmissionGrid.Type): number + getPollutionEmittersInSettlementArea: function(entity : Engine.Entity): {{Engine.Entity, number}} + getNoiseEmittersNearSettlementLandUses: function(entity : Engine.Entity, distance : number, landUseTypes : {LandUseType}): {{Engine.Entity, number}} +end +global record UtilFinance getAccountChart: function(entity : Engine.Entity, config : ChartConfig): ChartResult + getDebtChart: function(entity : Engine.Entity, config : ChartConfig, integer): ChartResult + calculateBalance: function(entities : {Engine.Entity}, begin : integer, end : integer, true : boolean, only : JournalEntry.Maintenance): integer + calculateEarnings: function(playerEntity : Engine.Entity): integer + computeFinanceTable: function(playerEntity : Engine.Entity, config : ChartConfig): FinanceData + getPlayersBalance: function(playerEntity : Engine.Entity): integer + calcIncomeSince: function(current : number, playerEntity : Engine.Entity): number + getLastIncomeTime: function(playerEntity : Engine.Entity): integer + getFirstIncomeTime: function(playerEntity : Engine.Entity): integer +end +global record UtilHeadquarters getTransportedData: function(): TransportationStats + getCompaniesValue: function(): CompanyValue +end + +[Expand All] [Collapse All] + +global record UtilIndustry record IndustryProductivityInfo producing: boolean + boostFromRule: boolean + boostFromPersonCapacity: boolean +end + getIndustryProductivityInfo: function(entity : Engine.Entity): IndustryProductivityInfo + getClosingIndustries: function(): {{Engine.Entity, ResName}} + getEconomyCargoDependencies: function(economyId : integer): {string : {string : number}} +end + +[Expand All] [Collapse All] + +global record UtilLine record LineCapacityUsage used: number + capacity: number +end + record PathProblemLocation edgeIndex: integer + node: NodeId + nodePosition: Vec3f + okModes: {TransportMode : boolean} + relaxedModes: {TransportMode : boolean} + allowedModes: {TransportMode : boolean} +end + record TerminalCapacityUsage equals: function(TerminalCapacityUsage, TerminalCapacityUsage): boolean + used: number + capacity: number +end + record StopState empty: boolean + noPath: boolean + noPathFromAlternative: {integer, PathProblemLocation} + noPathToAlternative: {integer, PathProblemLocation} + duplicateStop: boolean + incompatibleStop: boolean + noPathLocation: PathProblemLocation +end + getLineCapacityUsages: function(line : Engine.Entity, allCapacities : boolean): {CargoTypeId : LineCapacityUsage} + calcLineStationThroughput: function(lineEntity : Engine.Entity): integer + getMaxFrequency: function(lineEntity : Engine.Entity): number + getDetailedLineProblems: function(lineEntity : Engine.Entity): {{StopState}} + getLineProblems: function(): {{Engine.Entity, integer, PathProblemLocation}} + getLineStationProblems: function(): {{Engine.Entity, Engine.Entity, LineStationProblem}} + isLineCompatibleWithCarrier: function(lineEntity : Engine.Entity, carrier : Carrier, distinguishTramFromRoad : boolean): boolean + isLineCompatibleWithAnyCarrier: function(lineEntity : Engine.Entity, carriers : {Carrier}, distinguishTramFromRoad : boolean): boolean + supportsReservation: function(lineEntity : Engine.Entity): boolean + getLineIssues: function(lineEntity : Engine.Entity, allIssues : boolean): {LineIssue} + getLinesIssues: function(playerEntity : Engine.Entity, allIssues : boolean): {Engine.Entity : {LineIssue}} + getFailedPathReason: function(vehicle : Engine.Entity, line : Engine.Entity, fullLine : boolean): Failure + getNoRoadConnectionProblems: function(): {Engine.Entity} +end +global record UtilLogbook getLogValuePerYear: function(entity : Engine.Entity, logName : string): integer + getLogValueMostRecent: function(entity : Engine.Entity, logName : string): integer + getLogValueOldest: function(entity : Engine.Entity, logName : string): integer + logValue: function(entity : Engine.Entity, logName : string, value : integer) + getChart: function(logbookEntity : Engine.Entity, logNames : {string}, xMin : number, xMax : number, yMin : number, yMax : number, ChartConfig : ChartConfig): ChartResult + getChartDiff: function(entity : Engine.Entity, logNames : {string}, config : ChartConfig): ChartResult +end +global record UtilMaintenance calcMaintenanceForStationGroup: function(stationGroupEntity : Engine.Entity): integer + calcMaintenanceForSubconstruction: function(subconstructionEntity : Engine.Entity): integer +end +global record UtilOctree findEntitiesInCircle: function(center : Vec2f, radius : number, componentType : Engine.ComponentType): {Engine.Entity} + findTransportNetworkNodesInCircle: function(center : Vec2f, radius : number): {NodeId} + areWaypointsOnLine: function(waypoints : {Vec2f}, lineEntity : Engine.Entity, tolerance : number): boolean +end + +[Expand All] [Collapse All] + +global record UtilParallelStrip record StripInfo carrier: Carrier + edgeType: BaseEdgeType + edgeTypeIndex: integer +end + getStripInfo: function(entity : Engine.Entity): StripInfo + isBridge: function(entity : Engine.Entity): boolean + isTunnel: function(entity : Engine.Entity): boolean +end + +[Expand All] [Collapse All] + +global record UtilPathfinding record EdgeIdDirAndLength edgeId: EdgeId + dir: boolean + length: number + new: function(EdgeId, boolean, number): EdgeIdDirAndLength +end + record EdgeIdDir edgeId: EdgeId + dir: boolean + new: function(EdgeId, boolean): EdgeIdDir +end + findPath: function(startingEdgesAndLengths : {EdgeIdDirAndLength}, destinationNodes : {NodeId}, transportModeSet : {TransportMode}, maxLength : number): {{EdgeId, boolean}} + findPathNodeToNode: function(startNodes : {NodeId}, destinationNodes : {NodeId}, transportModeSet : {TransportMode}): {{EdgeId, boolean}} + getTargetsByLandUse: function(): { : } + findDubinsPath: function(p0 : Vec3f, t0 : Vec3f, p1 : Vec3f, t1 : Vec3f, turnRadius : number): {{EdgeGeometry, boolean}} +end +global record UtilProposal makeProposalData: function(Proposal, Context): ProposalData + makeIndustrySpawnProposal: function(industryTypeTag : string, townEntity : Engine.Entity): Proposal + makeSegmentsRemoveProposal: function(segmentsToRemove : {Engine.Entity}): Proposal + createProposalRemove: function(entity : Engine.Entity, context : Context): Proposal + createProposalReplaceConstruction: function(entity : Engine.Entity, params : { : }, newResName : ResName): Proposal + createIndustryProposal: function(seed : string, industryRectangle : IndustryInfo, context : Context): Proposal + createBridgeOrTunnelProposal: function(parallelStripEntity : Engine.Entity, newTypeIndex : integer): Proposal + createDoubleSlipSwitchProposal: function(entity : Engine.Entity, doubleSlipSwitch : boolean): Proposal + createTrafficLightProposal: function(entity : Engine.Entity, trafficLightConfig : Engine.Component.TrafficLightConfig, trafficLightPreference : TrafficLightPreference): Proposal + getBridgeOrTunnelRelatedRevisions: function(parallelStripEntity : Engine.Entity): {Engine.Entity : Engine.Revision} + didBridgeOrTunnelRelatedRevisionsChange: function(parallelStripEntity : Engine.Entity, revisions : {Engine.Entity : Engine.Revision}): boolean + makeReforestationProposal: function(seed : integer, numTilesToUpdate : integer, maxTreesPerTile : integer): Proposal + refreshConstruction: function(entity : Engine.Entity, constructionFilepath : string): Proposal + replaceSegment: function(entity : Engine.Entity, streetTemplate : ResName): Proposal + checkProposalConnectsNodes: function(startNode : Engine.Entity, startEdge : Engine.Entity, targetNode : Engine.Entity, streetProposal : Proposal.StreetProposal, isApply : boolean, maxDepth : number): boolean + makeIndustryExtendProposal: function(industry : Engine.Entity, trySlots : integer, numExtendSlots : integer): {Proposal, {integer}} + createSubconstructionLotList: function(Proposal.Subconstruction, Mat4f): Engine.Component.LotList + getConstructionArea: function(proposal : Proposal): number +end + +[Expand All] [Collapse All] + +global record UtilStation record StationUsage totalUsed: integer + overflow: integer + poolCapacity: integer + terminalCapacity: integer +end + calculateStationUsage: function(station : Engine.Entity): StationUsage + calculateStationTerminalUsage: function(station : Engine.Entity, terminalIndex : integer): UtilLine.TerminalCapacityUsage + record StationGroupCapacityUsage equals: function(StationGroupCapacityUsage, StationGroupCapacityUsage): boolean + capacity: integer + waitingHallCapacity: integer + used: integer + overflow: boolean +end + calculateStationGroupCargo: function(stationGroup : Engine.Entity, flatTerminalIndex : integer): StationGroupCapacityUsage + isStationOfType: function(stationEntity : Engine.Entity, cargo : boolean): boolean + findStationGroupWithOverlappingCatchmentOfDifferentCarriers: function(): {{Engine.Entity, Engine.Entity}} +end +global record UtilStock getStockCargoTypes: function(stockListEntity : Engine.Entity, stockId : StockId): {CargoTypeId} + getCargoTypeShippedPerYear: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer + getCargoShippedPerYear: function(stockListEntity : Engine.Entity): integer + getCargoTypeDeliveredPerYear: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer + getCargoDeliveredPerYear: function(stockListEntity : Engine.Entity): integer + getCargoConsumedPerYear: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer + getCargoProducedPerYear: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer + getCargoMaxProductionPerYear: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer + getCargoMaxConsumptionPerYear: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer + getInputsOutputsFromRules: function(stockListEntity : Engine.Entity): {{CargoTypeId}, {CargoTypeId}} + getCargoOutputPerYear: function(stockListEntity : Engine.Entity): integer + getCargoLogValueDiffPerYear: function(stockListEntity : Engine.Entity, logType : string, cargoTypeId : CargoTypeId): integer + getCargoLogPerYearForTarget: function(sourceStockListEntity : Engine.Entity, targetStockListEntity : Engine.Entity, logType : string, cargoTypeId : CargoTypeId): integer + getCargoLogPerYearForTargetFilter: function(sourceStockListEntity : Engine.Entity, targetFilter : function(Engine.Entity) : boolean, logType : string, cargoTypeId : CargoTypeId): integer + getProductionRating: function(stockListEntity : Engine.Entity): number + getStockGroupsByTypeAndCargoTypes: function(stockListEntity : Engine.Entity, sortByType : boolean, showEmpty : boolean): {{StockListType, {StockId}, {CargoTypeId}, integer}} + getStockListsWithThrownAwayCargo: function(): {Engine.Entity : integer} + hasAnyCompatibleStock: function(entities : {Engine.Entity}, cargoTypeId : CargoTypeId, load : boolean): boolean + getAdjustedDeliveryTime: function(cargoTypeId : CargoTypeId): integer + isCargoTypeCurrentlyProduced: function(cargoTypeId : CargoTypeId): boolean +end + +[Expand All] [Collapse All] + +global record UtilTown record TownReachability commercialPrivate: integer + commercialPublic: integer + industrialPrivate: integer + industrialPublic: integer +end + record TownCapacityUsage used: integer + capacity: integer +end + record TownEmission noise: number + pollution: number + areaSquareKm: number +end + record DestinationUseCount count: integer + linesUseCount: integer +end + record TownHappinessStats record ByResident resident: {integer, integer} + nonResident: {integer, integer} +end + travellingInside: {integer, integer} + travellingTo: ByResident + travellingFrom: ByResident + atBuilding: {integer, integer} + byCar: {integer, integer} + walking: {integer, integer} + byLine: {{Engine.Entity, ByResident}} +end + computeWeightedTargetTownBuildingCapacityPerType: function(townEntity : Engine.Entity): {{integer, integer, integer, integer}} + computeUnweightedTargetTownBuildingCapacityPerType: function(townEntity : Engine.Entity): {{integer, integer, integer, integer}} + computeActualTownBuildingCapacityPerType: function(townEntity : Engine.Entity): {{integer, integer, integer, integer}} + getLandUse2CargoTypes: function(): {LandUseType : {CargoTypeId}} + getTownReachability: function(townEntity : Engine.Entity): TownReachability + getTownEmission: function(townEntity : Engine.Entity): TownEmission + getTownEmissionDB: function(townEntity : Engine.Entity): TownEmission + getTownCapacityUsage: function(townEntity : Engine.Entity): {TownCapacityUsage} + getTownHappinessStats: function(townEntity : Engine.Entity, numTopLines : integer): TownHappinessStats + getTownDeliveriesStats: function(townEntity : Engine.Entity, interval : integer, perLine : boolean, perCargoType : boolean): {Engine.Entity : {CargoTypeId : {integer, integer}}} + getTownStockCargo: function(townEntity : Engine.Entity): {CargoTypeId : {integer, integer}} + getTerrainBrushVolumeImpact: function(proposal : Proposal): {Engine.Entity : {number, number}} + getTerrainAlignmentImpact: function(proposalData : ProposalData): {Engine.Entity : {number, number}} + getAutoRemovalEntityImpact: function(proposalData : ProposalData): {Engine.Entity : {number, number}} + getTownNoisePerDistrict: function(townEntity : Engine.Entity, landUseTypes : {LandUseType}): {LandUseType : {number, integer}} + getImpactFromDistance: function(distance : number): number + computeTownsTrafficSpeedMap: function(samplesCoefficient : number): {Engine.Entity : {number, {integer}}} + getTownProblems: function(): {{{Engine.Entity}, TownProblem}} + isNeighbourTown: function(townEntity1 : Engine.Entity, townEntity2 : Engine.Entity): boolean + getClosestTown: function(position : Vec3f): Engine.Entity + getRandomTownPosition: function(townEntity : Engine.Entity, seed : integer): Vec2f + isLineStoppingInTown: function(lineEntity : Engine.Entity, townEntity : Engine.Entity): boolean + getTownLineUsage: function(townEntity : Engine.Entity): number + getSourceToDestinationCount: function(townEntitiy : Engine.Entity, destinationIsTownMap : {Engine.Entity : boolean}, selectLandUse : integer): {Engine.Entity : DestinationUseCount} + getTownDistrictCenter: function(entity : Engine.Entity, landUseTypes : LandUseType): Vec3f +end +global record UtilTransport calcPosition: function(eg : EdgeGeometry, t : number): Vec3f + calcPositionAndDirection: function(eg : EdgeGeometry, t : number, forward : boolean): {Vec3f} + transportModesToCarriers: function(transportModes : {TransportMode}): {Carrier} + getStartPort: function(edge : {EdgeId, boolean}): PortId + getEndPort: function(edge : {EdgeId, boolean}): PortId + isPortLocked: function(port : integer): boolean +end +global record UtilVehicle findBestLineAndDepotForVehicle: function(vehicleEntity : Engine.Entity): {Engine.Entity, Engine.Entity} + findBestDepotForLine: function(carrier : Carrier, transportModes : {TransportMode}, lineEntity : Engine.Entity, position : Vec3f): Engine.Entity + getSpeed: function(vehicleEntity : Engine.Entity): number + getPosition: function(vehicleEntity : Engine.Entity): Vec3f + calcPathPosData: function(vehicleEntity : Engine.Entity): PathPosData + getDirection: function(vehicleEntity : Engine.Entity): Vec3f + getVehiclesByCarrier: function(carrier : Carrier): {Engine.Entity} + getVehicles: function(): {Engine.Entity} + getRunningCost: function(vehicleEntity : Engine.Entity): number + getDepreciatedValue: function(vehicleEntity : Engine.Entity): integer + getPartPrice: function(part : TransportVehiclePart): integer + getLength: function(modelAsset : Model): number + getAllCargoForCargoTypeSet: function(cargoTypeSet : CargoTypeSet): {CargoTypeId} + getVehicleLoadedCargoTypes: function(vehicleEntity : Engine.Entity): {CargoTypeId} + getVehicleProblems: function(): {{{Engine.Entity}, VehicleProblem}} + getMaintenanceEmissionPenalty: function(maintenanceState : number): number + getMaintenanceComfortPenalty: function(maintenanceState : number): number + getMaintenanceTopSpeedPenalty: function(topSpeedMaintenanceFactorPenaltyPerLevel : number, maintenanceState : number): number + getMaintenanceRunningCostPenalty: function(maintenanceState : number): number + getVehicleType: function(vehicleEntity : Engine.Entity): integer + getVehicleCapacities: function(vehicleEntity : Engine.Entity): {integer} + getVehicleUnsetCapacities: function(vehicleEntity : Engine.Entity): {{integer}} +end +``` + +## Category: main[πŸ”—](#category-main) + +### EngineUtil[πŸ”—](#$api.engine.util~EngineUtil) + +``` +global record EngineUtil getPlayer: function(): Engine.Entity + getWorld: function(): Engine.Entity + getCalendarDate: function(gameTime : number): Date + getYear: function(): integer + hasStartedAsMission: function(): boolean + getEntityName: function(Engine.Entity): string + getEntityNameStem: function(Engine.Entity): {string, Engine.Entity} + cargo: UtilCargo + construction: UtilConstruction + chart: UtilChart + finance: UtilFinance + headquarters: UtilHeadquarters + line: UtilLine + logbook: UtilLogbook + maintenance: UtilMaintenance + octree: UtilOctree + parallelStrip: UtilParallelStrip + pathfinding: UtilPathfinding + station: UtilStation + stock: UtilStock + town: UtilTown + transport: UtilTransport + vehicle: UtilVehicle + industry: UtilIndustry + proposal: UtilProposal + emission: UtilEmission + formatAge: function(begin : integer, end : integer): string +end +``` + +Collection of engine specific utils grouped by system + +### EngineUtil.getPlayer[πŸ”—](#$api.engine.util~EngineUtil.getPlayer) + +``` +function EngineUtil.getPlayer(): Engine.Entity +``` + +Obtains the player entity. + +**Returns** + +1. `Engine.Entity` β€” entity id + +### EngineUtil.getWorld[πŸ”—](#$api.engine.util~EngineUtil.getWorld) + +``` +function EngineUtil.getWorld(): Engine.Entity +``` + +Obtains the world entity. + +**Returns** + +1. `Engine.Entity` β€” entity id + +### EngineUtil.getCalendarDate[πŸ”—](#$api.engine.util~EngineUtil.getCalendarDate) + +``` +function EngineUtil.getCalendarDate(gameTime : number): Date +``` + +Return the calendar date of the gametime, assuming current ingame speed. + +**Parameters** + +* `gameTime` :`number` β€” gametime for which to obtain the date + +**Returns** + +1. `Date` β€” calendar date matching the game time at the current speed + +### EngineUtil.getYear[πŸ”—](#$api.engine.util~EngineUtil.getYear) + +``` +function EngineUtil.getYear(): integer +``` + +**Returns** + +1. `integer` + +### EngineUtil.hasStartedAsMission[πŸ”—](#$api.engine.util~EngineUtil.hasStartedAsMission) + +``` +function EngineUtil.hasStartedAsMission(): boolean +``` + +Returns true if currently an active mission, started from the menu, is running + +**Returns** + +1. `boolean` β€” true if mission is running + +### EngineUtil.getEntityName[πŸ”—](#$api.engine.util~EngineUtil.getEntityName) + +``` +function EngineUtil.getEntityName(Engine.Entity): string +``` + +Get name of an (existing) entity, computing it from the base construction if needed. + +**Parameters** + +* `Engine.Entity` + +**Returns** + +1. `string` β€” string Entity name, or nil + +### EngineUtil.getEntityNameStem[πŸ”—](#$api.engine.util~EngineUtil.getEntityNameStem) + +``` +function EngineUtil.getEntityNameStem(Engine.Entity): {string, Engine.Entity} +``` + +Get name stem of an (existing) entity + +**Parameters** + +* `Engine.Entity` + +**Returns** + +1. `{string, Engine.Entity}` β€” string Entity name and Entity where the stem came from (both can be nil) + +### EngineUtil.cargo[πŸ”—](#$api.engine.util~EngineUtil.cargo) + +``` +EngineUtil.cargo: UtilCargo +``` + +### EngineUtil.construction[πŸ”—](#$api.engine.util~EngineUtil.construction) + +``` +EngineUtil.construction: UtilConstruction +``` + +### EngineUtil.chart[πŸ”—](#$api.engine.util~EngineUtil.chart) + +``` +EngineUtil.chart: UtilChart +``` + +### EngineUtil.finance[πŸ”—](#$api.engine.util~EngineUtil.finance) + +``` +EngineUtil.finance: UtilFinance +``` + +### EngineUtil.headquarters[πŸ”—](#$api.engine.util~EngineUtil.headquarters) + +``` +EngineUtil.headquarters: UtilHeadquarters +``` + +### EngineUtil.line[πŸ”—](#$api.engine.util~EngineUtil.line) + +``` +EngineUtil.line: UtilLine +``` + +### EngineUtil.logbook[πŸ”—](#$api.engine.util~EngineUtil.logbook) + +``` +EngineUtil.logbook: UtilLogbook +``` + +### EngineUtil.maintenance[πŸ”—](#$api.engine.util~EngineUtil.maintenance) + +``` +EngineUtil.maintenance: UtilMaintenance +``` + +### EngineUtil.octree[πŸ”—](#$api.engine.util~EngineUtil.octree) + +``` +EngineUtil.octree: UtilOctree +``` + +### EngineUtil.parallelStrip[πŸ”—](#$api.engine.util~EngineUtil.parallelStrip) + +``` +EngineUtil.parallelStrip: UtilParallelStrip +``` + +### EngineUtil.pathfinding[πŸ”—](#$api.engine.util~EngineUtil.pathfinding) + +``` +EngineUtil.pathfinding: UtilPathfinding +``` + +### EngineUtil.station[πŸ”—](#$api.engine.util~EngineUtil.station) + +``` +EngineUtil.station: UtilStation +``` + +### EngineUtil.stock[πŸ”—](#$api.engine.util~EngineUtil.stock) + +``` +EngineUtil.stock: UtilStock +``` + +### EngineUtil.town[πŸ”—](#$api.engine.util~EngineUtil.town) + +``` +EngineUtil.town: UtilTown +``` + +### EngineUtil.transport[πŸ”—](#$api.engine.util~EngineUtil.transport) + +``` +EngineUtil.transport: UtilTransport +``` + +### EngineUtil.vehicle[πŸ”—](#$api.engine.util~EngineUtil.vehicle) + +``` +EngineUtil.vehicle: UtilVehicle +``` + +### EngineUtil.industry[πŸ”—](#$api.engine.util~EngineUtil.industry) + +``` +EngineUtil.industry: UtilIndustry +``` + +### EngineUtil.proposal[πŸ”—](#$api.engine.util~EngineUtil.proposal) + +``` +EngineUtil.proposal: UtilProposal +``` + +### EngineUtil.emission[πŸ”—](#$api.engine.util~EngineUtil.emission) + +``` +EngineUtil.emission: UtilEmission +``` + +### EngineUtil.formatAge[πŸ”—](#$api.engine.util~EngineUtil.formatAge) + +``` +function EngineUtil.formatAge(begin : integer, end : integer): string +``` + +Format age of a vehicle using current ingame speed. + +**Parameters** + +* `begin` :`integer` β€” timestamp of the time interval +* `end` :`integer` β€” timestamp of the time interval + +**Returns** + +1. `string` β€” formatted output, e.g. "6 years" + +## Category: globals[πŸ”—](#category-globals) + +### UtilCargo[πŸ”—](#$api.engine.util~UtilCargo) + +``` +[Expand All] [Collapse All] + +global record UtilCargo isGoodQuality: function(sim : Engine.Entity): boolean + record CargoQualityData clone: function(CargoQualityData): CargoQualityData + countBad: integer + countTotal: integer + averageQuality: number | nil + isVeryBad: boolean +end + record SummarizedCargoQualityData clone: function(SummarizedCargoQualityData): SummarizedCargoQualityData + passengers: CargoQualityData + cargo: CargoQualityData +end + getCargoQualityDataForLine: function(lineEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataForVehicle: function(vehicleEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataAtStation: function(stationEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataAtStationGroup: function(stationGroupEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataAtStop: function(lineEntity : Engine.Entity, stopIndex : integer, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataAtTerminal: function(stationGroupEntity : Engine.Entity, stationTerminal : StationTerminal, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataForStockList: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getCargoQualityDataForStock: function(stockListEntity : Engine.Entity, stockId : StockId, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData + getSummarizedCargoQualityDataForStockList: function(stockListEntity : Engine.Entity): UtilCargo.SummarizedCargoQualityData + getSummarizedCargoQualityDataForLine: function(lineEntity : Engine.Entity): UtilCargo.SummarizedCargoQualityData + getSummarizedCargoQualityDataForVehicle: function(vehicleEntity : Engine.Entity): UtilCargo.SummarizedCargoQualityData + getNumCargoPerTypeInVehicle: function(vehicleEntity : Engine.Entity): {integer} +end +``` + +### UtilCargo.isGoodQuality[πŸ”—](#$api.engine.util~UtilCargo.isGoodQuality) + +``` +function UtilCargo.isGoodQuality(sim : Engine.Entity): boolean +``` + +Check if a cargo is in time / a person is happy + +**Parameters** + +* `sim` :`Engine.Entity` β€” cargo or person entity + +**Returns** + +1. `boolean` β€” true if good quality + +### UtilCargo.CargoQualityData[πŸ”—](#$api.engine.util~UtilCargo.CargoQualityData) + +``` +record UtilCargo.CargoQualityData clone: function(CargoQualityData): CargoQualityData + countBad: integer + countTotal: integer + averageQuality: number | nil + isVeryBad: boolean +end +``` + +### UtilCargo.CargoQualityData.clone[πŸ”—](#$api.engine.util~UtilCargo.CargoQualityData.clone) + +``` +function UtilCargo.CargoQualityData.clone(CargoQualityData): CargoQualityData +``` + +**Parameters** + +* `CargoQualityData` + +**Returns** + +1. `CargoQualityData` + +### UtilCargo.CargoQualityData.countBad[πŸ”—](#$api.engine.util~UtilCargo.CargoQualityData.countBad) + +``` +UtilCargo.CargoQualityData.countBad: integer +``` + +### UtilCargo.CargoQualityData.countTotal[πŸ”—](#$api.engine.util~UtilCargo.CargoQualityData.countTotal) + +``` +UtilCargo.CargoQualityData.countTotal: integer +``` + +### UtilCargo.CargoQualityData.averageQuality[πŸ”—](#$api.engine.util~UtilCargo.CargoQualityData.averageQuality) + +``` +UtilCargo.CargoQualityData.averageQuality: number | nil +``` + +### UtilCargo.CargoQualityData.isVeryBad[πŸ”—](#$api.engine.util~UtilCargo.CargoQualityData.isVeryBad) + +``` +UtilCargo.CargoQualityData.isVeryBad: boolean +``` + +### UtilCargo.SummarizedCargoQualityData[πŸ”—](#$api.engine.util~UtilCargo.SummarizedCargoQualityData) + +``` +record UtilCargo.SummarizedCargoQualityData clone: function(SummarizedCargoQualityData): SummarizedCargoQualityData + passengers: CargoQualityData + cargo: CargoQualityData +end +``` + +### UtilCargo.SummarizedCargoQualityData.clone[πŸ”—](#$api.engine.util~UtilCargo.SummarizedCargoQualityData.clone) + +``` +function UtilCargo.SummarizedCargoQualityData.clone(SummarizedCargoQualityData): SummarizedCargoQualityData +``` + +**Parameters** + +* `SummarizedCargoQualityData` + +**Returns** + +1. `SummarizedCargoQualityData` + +### UtilCargo.SummarizedCargoQualityData.passengers[πŸ”—](#$api.engine.util~UtilCargo.SummarizedCargoQualityData.passengers) + +``` +UtilCargo.SummarizedCargoQualityData.passengers: CargoQualityData +``` + +### UtilCargo.SummarizedCargoQualityData.cargo[πŸ”—](#$api.engine.util~UtilCargo.SummarizedCargoQualityData.cargo) + +``` +UtilCargo.SummarizedCargoQualityData.cargo: CargoQualityData +``` + +### UtilCargo.getCargoQualityDataForLine[πŸ”—](#$api.engine.util~UtilCargo.getCargoQualityDataForLine) + +``` +function UtilCargo.getCargoQualityDataForLine(lineEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData +``` + +Get cargo type quality data in a line. + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” line entity +* `cargoTypeId` :`CargoTypeId` β€” cargo type (passengers allowed) + +**Returns** + +1. `UtilCargo.CargoQualityData` β€” data about cargo quality + +### UtilCargo.getCargoQualityDataForVehicle[πŸ”—](#$api.engine.util~UtilCargo.getCargoQualityDataForVehicle) + +``` +function UtilCargo.getCargoQualityDataForVehicle(vehicleEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData +``` + +Get cargo type quality data in a vehicle. + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity +* `cargoTypeId` :`CargoTypeId` β€” cargo type (passengers allowed) + +**Returns** + +1. `UtilCargo.CargoQualityData` β€” data about cargo quality + +### UtilCargo.getCargoQualityDataAtStation[πŸ”—](#$api.engine.util~UtilCargo.getCargoQualityDataAtStation) + +``` +function UtilCargo.getCargoQualityDataAtStation(stationEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData +``` + +Get all persons waiting at a station plus the number of unhappy ones. + +**Parameters** + +* `stationEntity` :`Engine.Entity` β€” station entity +* `cargoTypeId` :`CargoTypeId` β€” the cargo type (passengers allowed) + +**Returns** + +1. `UtilCargo.CargoQualityData` β€” cargo quality data + +### UtilCargo.getCargoQualityDataAtStationGroup[πŸ”—](#$api.engine.util~UtilCargo.getCargoQualityDataAtStationGroup) + +``` +function UtilCargo.getCargoQualityDataAtStationGroup(stationGroupEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData +``` + +Get all persons waiting at station group plus the number of unhappy ones. + +**Parameters** + +* `stationGroupEntity` :`Engine.Entity` β€” station group entity +* `cargoTypeId` :`CargoTypeId` β€” the cargo type (passengers allowed) + +**Returns** + +1. `UtilCargo.CargoQualityData` β€” cargo quality data + +### UtilCargo.getCargoQualityDataAtStop[πŸ”—](#$api.engine.util~UtilCargo.getCargoQualityDataAtStop) + +``` +function UtilCargo.getCargoQualityDataAtStop(lineEntity : Engine.Entity, stopIndex : integer, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData +``` + +Get all persons waiting at a certain line stop plus the number of unhappy ones. + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” line entity +* `stopIndex` :`integer` β€” index of stop +* `cargoTypeId` :`CargoTypeId` β€” the cargo type (passengers allowed) + +**Returns** + +1. `UtilCargo.CargoQualityData` β€” cargo quality data + +### UtilCargo.getCargoQualityDataAtTerminal[πŸ”—](#$api.engine.util~UtilCargo.getCargoQualityDataAtTerminal) + +``` +function UtilCargo.getCargoQualityDataAtTerminal(stationGroupEntity : Engine.Entity, stationTerminal : StationTerminal, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData +``` + +Get all persons waiting at a certain terminal plus the number of unhappy ones. + +**Parameters** + +* `stationGroupEntity` :`Engine.Entity` β€” station group entity +* `stationTerminal` :`StationTerminal` β€” the affected station and terminal indices +* `cargoTypeId` :`CargoTypeId` β€” the cargo type (passengers allowed) + +**Returns** + +1. `UtilCargo.CargoQualityData` β€” cargo quality data + +### UtilCargo.getCargoQualityDataForStockList[πŸ”—](#$api.engine.util~UtilCargo.getCargoQualityDataForStockList) + +``` +function UtilCargo.getCargoQualityDataForStockList(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData +``` + +Get stock list cargo type quality. + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” stockList entity +* `cargoTypeId` :`CargoTypeId` β€” the cargo type (passengers allowed but doesn't make sense) + +**Returns** + +1. `UtilCargo.CargoQualityData` β€” cargo quality data + +### UtilCargo.getCargoQualityDataForStock[πŸ”—](#$api.engine.util~UtilCargo.getCargoQualityDataForStock) + +``` +function UtilCargo.getCargoQualityDataForStock(stockListEntity : Engine.Entity, stockId : StockId, cargoTypeId : CargoTypeId): UtilCargo.CargoQualityData +``` + +Get stock cargo type quality (over all cargo types). + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” stockList entity +* `stockId` :`StockId` β€” stock id inside the stock list +* `cargoTypeId` :`CargoTypeId` β€” the cargo type (passing nil will aggregate over all cargo types) + +**Returns** + +1. `UtilCargo.CargoQualityData` β€” cargo quality data + +### UtilCargo.getSummarizedCargoQualityDataForStockList[πŸ”—](#$api.engine.util~UtilCargo.getSummarizedCargoQualityDataForStockList) + +``` +function UtilCargo.getSummarizedCargoQualityDataForStockList(stockListEntity : Engine.Entity): UtilCargo.SummarizedCargoQualityData +``` + +Get stock list cargo type quality (over all cargo types). + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” stockList entity + +**Returns** + +1. `UtilCargo.SummarizedCargoQualityData` β€” cargo quality data + +### UtilCargo.getSummarizedCargoQualityDataForLine[πŸ”—](#$api.engine.util~UtilCargo.getSummarizedCargoQualityDataForLine) + +``` +function UtilCargo.getSummarizedCargoQualityDataForLine(lineEntity : Engine.Entity): UtilCargo.SummarizedCargoQualityData +``` + +Get cargo type quality summary. + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” line entity + +**Returns** + +1. `UtilCargo.SummarizedCargoQualityData` β€” cargo quality data + +### UtilCargo.getSummarizedCargoQualityDataForVehicle[πŸ”—](#$api.engine.util~UtilCargo.getSummarizedCargoQualityDataForVehicle) + +``` +function UtilCargo.getSummarizedCargoQualityDataForVehicle(vehicleEntity : Engine.Entity): UtilCargo.SummarizedCargoQualityData +``` + +Get cargo type quality summary. + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity + +**Returns** + +1. `UtilCargo.SummarizedCargoQualityData` β€” cargo quality data + +### UtilCargo.getNumCargoPerTypeInVehicle[πŸ”—](#$api.engine.util~UtilCargo.getNumCargoPerTypeInVehicle) + +``` +function UtilCargo.getNumCargoPerTypeInVehicle(vehicleEntity : Engine.Entity): {integer} +``` + +Get total amount of cargo loaded in the vehicle + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity + +**Returns** + +1. `{integer}` β€” number of cargo items per type + +### UtilChart[πŸ”—](#$api.engine.util~UtilChart) + +``` +global record UtilChart getChartLabel: function(config : ChartConfig, index : integer, abbreviated : boolean): string + setLastValue: function(chartResult : ChartResult, series : integer, value : number) +end +``` + +### UtilChart.getChartLabel[πŸ”—](#$api.engine.util~UtilChart.getChartLabel) + +``` +function UtilChart.getChartLabel(config : ChartConfig, index : integer, abbreviated : boolean): string +``` + +Get label for X axis of date charts. + +**Parameters** + +* `config` :`ChartConfig` β€” chart config +* `index` :`integer` β€” group index of which the label should be returned +* `abbreviated` :`boolean` β€” if label should be for range (true) or point (false) + +**Returns** + +1. `string` β€” chart label string + +### UtilChart.setLastValue[πŸ”—](#$api.engine.util~UtilChart.setLastValue) + +``` +function UtilChart.setLastValue(chartResult : ChartResult, series : integer, value : number) +``` + +Set the last value for a chart result. + +**Parameters** + +* `chartResult` :`ChartResult` β€” chart result containing the series to be updated +* `series` :`integer` β€” series index of which the last value should be set +* `value` :`number` β€” value to set as the last value of the series + +### UtilConstruction[πŸ”—](#$api.engine.util~UtilConstruction) + +``` +global record UtilConstruction getNumAndFilledAutoFillSlots: function(entity : Engine.Entity): {integer, integer} + getConstructionEntity: function(depotEntity : Engine.Entity): Engine.Entity + getSlotTypes: function(entity : Engine.Entity): {string} + getConstructionResult: function(constructionResName : ResName, constructionTemplate : integer, parameters : { : }): ConstructionResult + getGlobalConstructionParams: function(): {string : number} + getCostMultiplierForYear: function(costMultipliers : {integer : number}, currentYear : integer): number + findSegmentsToDelete: function(constructionEntity : Engine.Entity, keepIndustryRoads : boolean): {Engine.Entity} +end +``` + +### UtilConstruction.getNumAndFilledAutoFillSlots[πŸ”—](#$api.engine.util~UtilConstruction.getNumAndFilledAutoFillSlots) + +``` +function UtilConstruction.getNumAndFilledAutoFillSlots(entity : Engine.Entity): {integer, integer} +``` + +Get total number of auto fill slots and number of filled auto fill slots. + +**Parameters** + +* `entity` :`Engine.Entity` β€” construction entity + +**Returns** + +1. `{integer, integer}` β€” num filled auto fill slots + +### UtilConstruction.getConstructionEntity[πŸ”—](#$api.engine.util~UtilConstruction.getConstructionEntity) + +``` +function UtilConstruction.getConstructionEntity(depotEntity : Engine.Entity): Engine.Entity +``` + +Gets construction entity for the entity. + +**Parameters** + +* `depotEntity` :`Engine.Entity` β€” the entity for which the containing construction should be fetched + +**Returns** + +1. `Engine.Entity` β€” construction entity + +### UtilConstruction.getSlotTypes[πŸ”—](#$api.engine.util~UtilConstruction.getSlotTypes) + +``` +function UtilConstruction.getSlotTypes(entity : Engine.Entity): {string} +``` + +Get slot types of construction. + +**Parameters** + +* `entity` :`Engine.Entity` β€” construction entity + +**Returns** + +1. `{string}` β€” slot types + +### UtilConstruction.getConstructionResult[πŸ”—](#$api.engine.util~UtilConstruction.getConstructionResult) + +``` +function UtilConstruction.getConstructionResult(constructionResName : ResName, constructionTemplate : integer, parameters : { : }): ConstructionResult +``` + +Get construction result for a given construction. + +**Parameters** + +* `constructionResName` :`ResName` β€” resource name of the construction +* `constructionTemplate` :`integer` β€” template index +* `parameters` :`{ : }` β€” parameters for the updateFn + +**Returns** + +1. `ConstructionResult` β€” construction result + +### UtilConstruction.getGlobalConstructionParams[πŸ”—](#$api.engine.util~UtilConstruction.getGlobalConstructionParams) + +``` +function UtilConstruction.getGlobalConstructionParams(): {string : number} +``` + +Get global construction params + +**Returns** + +1. `{string : number}` β€” global construction parameters + +### UtilConstruction.getCostMultiplierForYear[πŸ”—](#$api.engine.util~UtilConstruction.getCostMultiplierForYear) + +``` +function UtilConstruction.getCostMultiplierForYear(costMultipliers : {integer : number}, currentYear : integer): number +``` + +Get cost multiplier for year + +**Parameters** + +* `costMultipliers` :`{integer : number}` β€” cost multipliers by year +* `currentYear` :`integer` β€” current year + +**Returns** + +1. `number` β€” cost multiplier + +### UtilConstruction.findSegmentsToDelete[πŸ”—](#$api.engine.util~UtilConstruction.findSegmentsToDelete) + +``` +function UtilConstruction.findSegmentsToDelete(constructionEntity : Engine.Entity, keepIndustryRoads : boolean): {Engine.Entity} +``` + +Get street segments to remove when a construction entity is removed + +**Parameters** + +* `constructionEntity` :`Engine.Entity` β€” the construction entity we want to find segments for +* `keepIndustryRoads` :`boolean` β€” (default = false) whether to keep the segments that are built with the industry + +**Returns** + +1. `{Engine.Entity}` β€” the street segments to remove + +### UtilEmission[πŸ”—](#$api.engine.util~UtilEmission) + +``` +global record UtilEmission getCurrentEmission: function(entity : Engine.Entity, type : Engine.Component.EmissionGrid.Type): number + getPollutionEmittersInSettlementArea: function(entity : Engine.Entity): {{Engine.Entity, number}} + getNoiseEmittersNearSettlementLandUses: function(entity : Engine.Entity, distance : number, landUseTypes : {LandUseType}): {{Engine.Entity, number}} +end +``` + +### UtilEmission.getCurrentEmission[πŸ”—](#$api.engine.util~UtilEmission.getCurrentEmission) + +``` +function UtilEmission.getCurrentEmission(entity : Engine.Entity, type : Engine.Component.EmissionGrid.Type): number +``` + +Get current emission at entity. + +**Parameters** + +* `entity` :`Engine.Entity` β€” the entity with Emission component +* `type` :`Engine.Component.EmissionGrid.Type` β€” emission type + +**Returns** + +1. `number` β€” emission value + +### UtilEmission.getPollutionEmittersInSettlementArea[πŸ”—](#$api.engine.util~UtilEmission.getPollutionEmittersInSettlementArea) + +``` +function UtilEmission.getPollutionEmittersInSettlementArea(entity : Engine.Entity): {{Engine.Entity, number}} +``` + +Get all pollution emitters in settlement area. + +**Parameters** + +* `entity` :`Engine.Entity` β€” the town entity + +**Returns** + +1. `{{Engine.Entity, number}}` β€” list of emitters with emission values + +### UtilEmission.getNoiseEmittersNearSettlementLandUses[πŸ”—](#$api.engine.util~UtilEmission.getNoiseEmittersNearSettlementLandUses) + +``` +function UtilEmission.getNoiseEmittersNearSettlementLandUses(entity : Engine.Entity, distance : number, landUseTypes : {LandUseType}): {{Engine.Entity, number}} +``` + +Get all noise emitters near land uses of a settlement. + +**Parameters** + +* `entity` :`Engine.Entity` β€” the settlement entity +* `distance` :`number` β€” maximum distance +* `landUseTypes` :`{LandUseType}` β€” land use type filter + +**Returns** + +1. `{{Engine.Entity, number}}` β€” list of emitters with emission values + +### UtilFinance[πŸ”—](#$api.engine.util~UtilFinance) + +``` +global record UtilFinance getAccountChart: function(entity : Engine.Entity, config : ChartConfig): ChartResult + getDebtChart: function(entity : Engine.Entity, config : ChartConfig, integer): ChartResult + calculateBalance: function(entities : {Engine.Entity}, begin : integer, end : integer, true : boolean, only : JournalEntry.Maintenance): integer + calculateEarnings: function(playerEntity : Engine.Entity): integer + computeFinanceTable: function(playerEntity : Engine.Entity, config : ChartConfig): FinanceData + getPlayersBalance: function(playerEntity : Engine.Entity): integer + calcIncomeSince: function(current : number, playerEntity : Engine.Entity): number + getLastIncomeTime: function(playerEntity : Engine.Entity): integer + getFirstIncomeTime: function(playerEntity : Engine.Entity): integer +end +``` + +### UtilFinance.getAccountChart[πŸ”—](#$api.engine.util~UtilFinance.getAccountChart) + +``` +function UtilFinance.getAccountChart(entity : Engine.Entity, config : ChartConfig): ChartResult +``` + +Get chart for account (income and costs). + +**Parameters** + +* `entity` :`Engine.Entity` β€” entity with account component +* `config` :`ChartConfig` β€” chart config + +**Returns** + +1. `ChartResult` β€” chart result + +### UtilFinance.getDebtChart[πŸ”—](#$api.engine.util~UtilFinance.getDebtChart) + +``` +function UtilFinance.getDebtChart(entity : Engine.Entity, config : ChartConfig, integer): ChartResult +``` + +Get chart for debts. + +**Parameters** + +* `entity` :`Engine.Entity` β€” entity with account component +* `config` :`ChartConfig` β€” chart config +* `integer` + +**Returns** + +1. `ChartResult` β€” chart result + +### UtilFinance.calculateBalance[πŸ”—](#$api.engine.util~UtilFinance.calculateBalance) + +``` +function UtilFinance.calculateBalance(entities : {Engine.Entity}, begin : integer, end : integer, true : boolean, only : JournalEntry.Maintenance): integer +``` + +Get (summed) balance of entities + +**Parameters** + +* `entities` :`{Engine.Entity}` β€” (having an account) +* `begin` :`integer` β€” time (interval) +* `end` :`integer` β€” time (interval) +* `true` :`boolean` β€” if only maintenance/income entries are to be considered +* `only` :`JournalEntry.Maintenance` β€” consider for given maintenance type (use nil for all) + +**Returns** + +1. `integer` β€” (summed) balance over given interval's time + +### UtilFinance.calculateEarnings[πŸ”—](#$api.engine.util~UtilFinance.calculateEarnings) + +``` +function UtilFinance.calculateEarnings(playerEntity : Engine.Entity): integer +``` + +Get the earnings from beginning of the year to now + +**Parameters** + +* `playerEntity` :`Engine.Entity` β€” player entity + +**Returns** + +1. `integer` β€” earnings + +### UtilFinance.computeFinanceTable[πŸ”—](#$api.engine.util~UtilFinance.computeFinanceTable) + +``` +function UtilFinance.computeFinanceTable(playerEntity : Engine.Entity, config : ChartConfig): FinanceData +``` + +Get current state of fincance table. + +**Parameters** + +* `playerEntity` :`Engine.Entity` β€” player entity +* `config` :`ChartConfig` β€” config of chart behind the table + +**Returns** + +1. `FinanceData` β€” struct holding all the relevant values + +### UtilFinance.getPlayersBalance[πŸ”—](#$api.engine.util~UtilFinance.getPlayersBalance) + +``` +function UtilFinance.getPlayersBalance(playerEntity : Engine.Entity): integer +``` + +Get balance of the player's bank account. + +**Parameters** + +* `playerEntity` :`Engine.Entity` β€” the player entity + +**Returns** + +1. `integer` β€” balance or nil, if player has won the lottery and money is infinite + +### UtilFinance.calcIncomeSince[πŸ”—](#$api.engine.util~UtilFinance.calcIncomeSince) + +``` +function UtilFinance.calcIncomeSince(current : number, playerEntity : Engine.Entity): number +``` + +The income since the specified time (non-inclusive). + +**Parameters** + +* `current` :`number` β€” game time +* `playerEntity` :`Engine.Entity` β€” the player entity + +**Returns** + +1. `number` β€” The income + +### UtilFinance.getLastIncomeTime[πŸ”—](#$api.engine.util~UtilFinance.getLastIncomeTime) + +``` +function UtilFinance.getLastIncomeTime(playerEntity : Engine.Entity): integer +``` + +The time of the last income. + +**Parameters** + +* `playerEntity` :`Engine.Entity` β€” the player entity + +**Returns** + +1. `integer` β€” The time of the last income entry + +### UtilFinance.getFirstIncomeTime[πŸ”—](#$api.engine.util~UtilFinance.getFirstIncomeTime) + +``` +function UtilFinance.getFirstIncomeTime(playerEntity : Engine.Entity): integer +``` + +The time of the first income. + +**Parameters** + +* `playerEntity` :`Engine.Entity` β€” the player entity + +**Returns** + +1. `integer` β€” The time of the first income entry + +### UtilHeadquarters[πŸ”—](#$api.engine.util~UtilHeadquarters) + +``` +global record UtilHeadquarters getTransportedData: function(): TransportationStats + getCompaniesValue: function(): CompanyValue +end +``` + +### UtilHeadquarters.getTransportedData[πŸ”—](#$api.engine.util~UtilHeadquarters.getTransportedData) + +``` +function UtilHeadquarters.getTransportedData(): TransportationStats +``` + +Obtains the transportation data. + +**Returns** + +1. `TransportationStats` β€” some transportation statistics for the company + +### UtilHeadquarters.getCompaniesValue[πŸ”—](#$api.engine.util~UtilHeadquarters.getCompaniesValue) + +``` +function UtilHeadquarters.getCompaniesValue(): CompanyValue +``` + +Obtains the companie's value + +**Returns** + +1. `CompanyValue` β€” company value data + +### UtilIndustry[πŸ”—](#$api.engine.util~UtilIndustry) + +``` +[Expand All] [Collapse All] + +global record UtilIndustry record IndustryProductivityInfo producing: boolean + boostFromRule: boolean + boostFromPersonCapacity: boolean +end + getIndustryProductivityInfo: function(entity : Engine.Entity): IndustryProductivityInfo + getClosingIndustries: function(): {{Engine.Entity, ResName}} + getEconomyCargoDependencies: function(economyId : integer): {string : {string : number}} +end +``` + +### UtilIndustry.IndustryProductivityInfo[πŸ”—](#$api.engine.util~UtilIndustry.IndustryProductivityInfo) + +``` +record UtilIndustry.IndustryProductivityInfo producing: boolean + boostFromRule: boolean + boostFromPersonCapacity: boolean +end +``` + +### UtilIndustry.IndustryProductivityInfo.producing[πŸ”—](#$api.engine.util~UtilIndustry.IndustryProductivityInfo.producing) + +``` +UtilIndustry.IndustryProductivityInfo.producing: boolean +``` + +### UtilIndustry.IndustryProductivityInfo.boostFromRule[πŸ”—](#$api.engine.util~UtilIndustry.IndustryProductivityInfo.boostFromRule) + +``` +UtilIndustry.IndustryProductivityInfo.boostFromRule: boolean +``` + +### UtilIndustry.IndustryProductivityInfo.boostFromPersonCapacity[πŸ”—](#$api.engine.util~UtilIndustry.IndustryProductivityInfo.boostFromPersonCapacity) + +``` +UtilIndustry.IndustryProductivityInfo.boostFromPersonCapacity: boolean +``` + +### UtilIndustry.getIndustryProductivityInfo[πŸ”—](#$api.engine.util~UtilIndustry.getIndustryProductivityInfo) + +``` +function UtilIndustry.getIndustryProductivityInfo(entity : Engine.Entity): IndustryProductivityInfo +``` + +Get the industry's productivity + +**Parameters** + +* `entity` :`Engine.Entity` β€” the industry entity + +**Returns** + +1. `IndustryProductivityInfo` β€” productivity info + +### UtilIndustry.getClosingIndustries[πŸ”—](#$api.engine.util~UtilIndustry.getClosingIndustries) + +``` +function UtilIndustry.getClosingIndustries(): {{Engine.Entity, ResName}} +``` + +Get list of industries that are closing + +**Returns** + +1. `{{Engine.Entity, ResName}}` β€” list of industry entities and their resource names + +### UtilIndustry.getEconomyCargoDependencies[πŸ”—](#$api.engine.util~UtilIndustry.getEconomyCargoDependencies) + +``` +function UtilIndustry.getEconomyCargoDependencies(economyId : integer): {string : {string : number}} +``` + +Get the cargo dependencies of an economy + +**Parameters** + +* `economyId` :`integer` β€” the economy id + +**Returns** + +1. `{string : {string : number}}` β€” A map from cargoTag to a map of industryTag to count + +### UtilLine[πŸ”—](#$api.engine.util~UtilLine) + +``` +[Expand All] [Collapse All] + +global record UtilLine record LineCapacityUsage used: number + capacity: number +end + record PathProblemLocation edgeIndex: integer + node: NodeId + nodePosition: Vec3f + okModes: {TransportMode : boolean} + relaxedModes: {TransportMode : boolean} + allowedModes: {TransportMode : boolean} +end + record TerminalCapacityUsage equals: function(TerminalCapacityUsage, TerminalCapacityUsage): boolean + used: number + capacity: number +end + record StopState empty: boolean + noPath: boolean + noPathFromAlternative: {integer, PathProblemLocation} + noPathToAlternative: {integer, PathProblemLocation} + duplicateStop: boolean + incompatibleStop: boolean + noPathLocation: PathProblemLocation +end + getLineCapacityUsages: function(line : Engine.Entity, allCapacities : boolean): {CargoTypeId : LineCapacityUsage} + calcLineStationThroughput: function(lineEntity : Engine.Entity): integer + getMaxFrequency: function(lineEntity : Engine.Entity): number + getDetailedLineProblems: function(lineEntity : Engine.Entity): {{StopState}} + getLineProblems: function(): {{Engine.Entity, integer, PathProblemLocation}} + getLineStationProblems: function(): {{Engine.Entity, Engine.Entity, LineStationProblem}} + isLineCompatibleWithCarrier: function(lineEntity : Engine.Entity, carrier : Carrier, distinguishTramFromRoad : boolean): boolean + isLineCompatibleWithAnyCarrier: function(lineEntity : Engine.Entity, carriers : {Carrier}, distinguishTramFromRoad : boolean): boolean + supportsReservation: function(lineEntity : Engine.Entity): boolean + getLineIssues: function(lineEntity : Engine.Entity, allIssues : boolean): {LineIssue} + getLinesIssues: function(playerEntity : Engine.Entity, allIssues : boolean): {Engine.Entity : {LineIssue}} + getFailedPathReason: function(vehicle : Engine.Entity, line : Engine.Entity, fullLine : boolean): Failure + getNoRoadConnectionProblems: function(): {Engine.Entity} +end +``` + +### UtilLine.LineCapacityUsage[πŸ”—](#$api.engine.util~UtilLine.LineCapacityUsage) + +``` +record UtilLine.LineCapacityUsage used: number + capacity: number +end +``` + +### UtilLine.LineCapacityUsage.used[πŸ”—](#$api.engine.util~UtilLine.LineCapacityUsage.used) + +``` +UtilLine.LineCapacityUsage.used: number +``` + +Currently used capacity + +### UtilLine.LineCapacityUsage.capacity[πŸ”—](#$api.engine.util~UtilLine.LineCapacityUsage.capacity) + +``` +UtilLine.LineCapacityUsage.capacity: number +``` + +Total capacity + +### UtilLine.PathProblemLocation[πŸ”—](#$api.engine.util~UtilLine.PathProblemLocation) + +``` +record UtilLine.PathProblemLocation edgeIndex: integer + node: NodeId + nodePosition: Vec3f + okModes: {TransportMode : boolean} + relaxedModes: {TransportMode : boolean} + allowedModes: {TransportMode : boolean} +end +``` + +### UtilLine.PathProblemLocation.edgeIndex[πŸ”—](#$api.engine.util~UtilLine.PathProblemLocation.edgeIndex) + +``` +UtilLine.PathProblemLocation.edgeIndex: integer +``` + +### UtilLine.PathProblemLocation.node[πŸ”—](#$api.engine.util~UtilLine.PathProblemLocation.node) + +``` +UtilLine.PathProblemLocation.node: NodeId +``` + +### UtilLine.PathProblemLocation.nodePosition[πŸ”—](#$api.engine.util~UtilLine.PathProblemLocation.nodePosition) + +``` +UtilLine.PathProblemLocation.nodePosition: Vec3f +``` + +### UtilLine.PathProblemLocation.okModes[πŸ”—](#$api.engine.util~UtilLine.PathProblemLocation.okModes) + +``` +UtilLine.PathProblemLocation.okModes: {TransportMode : boolean} +``` + +compatible transport modes present on the last compatible edge (e.g. ELECTRIC\_TRAIN) + +### UtilLine.PathProblemLocation.relaxedModes[πŸ”—](#$api.engine.util~UtilLine.PathProblemLocation.relaxedModes) + +``` +UtilLine.PathProblemLocation.relaxedModes: {TransportMode : boolean} +``` + +compatible relaxed transport modes on the first incompatible edge. +Example 1: okModes[ELECTRIC\_TRAIN], relaxedModes[TRAIN] -> relaxation allowed the use of non-electric train, indicating missing catenaries +Example 2: okModes[TRAM], relaxedModes[ROAD] -> relaxation allowed the use of road instead of tram, indicating missing tram lanes +note that this can never overlap with okModes (otherwise there would not be a problem here) + +### UtilLine.PathProblemLocation.allowedModes[πŸ”—](#$api.engine.util~UtilLine.PathProblemLocation.allowedModes) + +``` +UtilLine.PathProblemLocation.allowedModes: {TransportMode : boolean} +``` + +Allowed modes for the line / vehicle in general + +### UtilLine.TerminalCapacityUsage[πŸ”—](#$api.engine.util~UtilLine.TerminalCapacityUsage) + +``` +record UtilLine.TerminalCapacityUsage equals: function(TerminalCapacityUsage, TerminalCapacityUsage): boolean + used: number + capacity: number +end +``` + +### UtilLine.TerminalCapacityUsage.equals[πŸ”—](#$api.engine.util~UtilLine.TerminalCapacityUsage.equals) + +``` +function UtilLine.TerminalCapacityUsage.equals(TerminalCapacityUsage, TerminalCapacityUsage): boolean +``` + +**Parameters** + +* `TerminalCapacityUsage` +* `TerminalCapacityUsage` + +**Returns** + +1. `boolean` + +### UtilLine.TerminalCapacityUsage.used[πŸ”—](#$api.engine.util~UtilLine.TerminalCapacityUsage.used) + +``` +UtilLine.TerminalCapacityUsage.used: number +``` + +Currently used capacity + +### UtilLine.TerminalCapacityUsage.capacity[πŸ”—](#$api.engine.util~UtilLine.TerminalCapacityUsage.capacity) + +``` +UtilLine.TerminalCapacityUsage.capacity: number +``` + +Total capacity + +### UtilLine.StopState[πŸ”—](#$api.engine.util~UtilLine.StopState) + +``` +record UtilLine.StopState empty: boolean + noPath: boolean + noPathFromAlternative: {integer, PathProblemLocation} + noPathToAlternative: {integer, PathProblemLocation} + duplicateStop: boolean + incompatibleStop: boolean + noPathLocation: PathProblemLocation +end +``` + +Information about the problem of a line. + +### UtilLine.StopState.empty[πŸ”—](#$api.engine.util~UtilLine.StopState.empty) + +``` +UtilLine.StopState.empty: boolean +``` + +No vehicles and less than 2 stops + +### UtilLine.StopState.noPath[πŸ”—](#$api.engine.util~UtilLine.StopState.noPath) + +``` +UtilLine.StopState.noPath: boolean +``` + +No path between stops + +### UtilLine.StopState.noPathFromAlternative[πŸ”—](#$api.engine.util~UtilLine.StopState.noPathFromAlternative) + +``` +UtilLine.StopState.noPathFromAlternative: {integer, PathProblemLocation} +``` + +No path from an alternative stop {flattenedTerminalIndex, optional problem location} + +### UtilLine.StopState.noPathToAlternative[πŸ”—](#$api.engine.util~UtilLine.StopState.noPathToAlternative) + +``` +UtilLine.StopState.noPathToAlternative: {integer, PathProblemLocation} +``` + +No path to an alternative stop {flattenedTerminalIndex, optional problem location} + +### UtilLine.StopState.duplicateStop[πŸ”—](#$api.engine.util~UtilLine.StopState.duplicateStop) + +``` +UtilLine.StopState.duplicateStop: boolean +``` + +Stop is a duplicate + +### UtilLine.StopState.incompatibleStop[πŸ”—](#$api.engine.util~UtilLine.StopState.incompatibleStop) + +``` +UtilLine.StopState.incompatibleStop: boolean +``` + +Stop is incompatible with the line's transport mode + +### UtilLine.StopState.noPathLocation[πŸ”—](#$api.engine.util~UtilLine.StopState.noPathLocation) + +``` +UtilLine.StopState.noPathLocation: PathProblemLocation +``` + +Optional problem location in case of noPath + +### UtilLine.getLineCapacityUsages[πŸ”—](#$api.engine.util~UtilLine.getLineCapacityUsages) + +``` +function UtilLine.getLineCapacityUsages(line : Engine.Entity, allCapacities : boolean): {CargoTypeId : LineCapacityUsage} +``` + +Get line capacity usages. + +**Parameters** + +* `line` :`Engine.Entity` β€” line entity +* `allCapacities` :`boolean` β€” whether to return all capacities or the capacities for the vehicles current load config + +**Returns** + +1. `{CargoTypeId : LineCapacityUsage}` β€” map of cargo type to capacity usage + +### UtilLine.calcLineStationThroughput[πŸ”—](#$api.engine.util~UtilLine.calcLineStationThroughput) + +``` +function UtilLine.calcLineStationThroughput(lineEntity : Engine.Entity): integer +``` + +Calc line throughput + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” line entity + +**Returns** + +1. `integer` β€” throughput value + +### UtilLine.getMaxFrequency[πŸ”—](#$api.engine.util~UtilLine.getMaxFrequency) + +``` +function UtilLine.getMaxFrequency(lineEntity : Engine.Entity): number +``` + +Get line max frequency + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” line entity + +**Returns** + +1. `number` β€” max frequency + +### UtilLine.getDetailedLineProblems[πŸ”—](#$api.engine.util~UtilLine.getDetailedLineProblems) + +``` +function UtilLine.getDetailedLineProblems(lineEntity : Engine.Entity): {{StopState}} +``` + +Get lines with detailed problems per stop + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” line entity + +**Returns** + +1. `{{StopState}}` β€” list of stop problems + +### UtilLine.getLineProblems[πŸ”—](#$api.engine.util~UtilLine.getLineProblems) + +``` +function UtilLine.getLineProblems(): {{Engine.Entity, integer, PathProblemLocation}} +``` + +Get lines with problems + +**Returns** + +1. `{{Engine.Entity, integer, PathProblemLocation}}` β€” list of {line entity, problem type, optional info about 1st problem and its location} + +### UtilLine.getLineStationProblems[πŸ”—](#$api.engine.util~UtilLine.getLineStationProblems) + +``` +function UtilLine.getLineStationProblems(): {{Engine.Entity, Engine.Entity, LineStationProblem}} +``` + +Get station problems with lines + +**Returns** + +1. `{{Engine.Entity, Engine.Entity, LineStationProblem}}` β€” list of line entity, station group entity and problem type + +### UtilLine.isLineCompatibleWithCarrier[πŸ”—](#$api.engine.util~UtilLine.isLineCompatibleWithCarrier) + +``` +function UtilLine.isLineCompatibleWithCarrier(lineEntity : Engine.Entity, carrier : Carrier, distinguishTramFromRoad : boolean): boolean +``` + +Check if line is ok with provided carrier + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” line entity +* `carrier` :`Carrier` β€” carrier type +* `distinguishTramFromRoad` :`boolean` β€” if tram should not be counted as road + +**Returns** + +1. `boolean` β€” true if the line is compatible with the specified carrier + +### UtilLine.isLineCompatibleWithAnyCarrier[πŸ”—](#$api.engine.util~UtilLine.isLineCompatibleWithAnyCarrier) + +``` +function UtilLine.isLineCompatibleWithAnyCarrier(lineEntity : Engine.Entity, carriers : {Carrier}, distinguishTramFromRoad : boolean): boolean +``` + +Check if line is ok with any of provided carriers + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” line entity +* `carriers` :`{Carrier}` β€” list of carrier types +* `distinguishTramFromRoad` :`boolean` β€” if tram should not be counted as road + +**Returns** + +1. `boolean` β€” true if the line is compatible with any of the specified carriers + +### UtilLine.supportsReservation[πŸ”—](#$api.engine.util~UtilLine.supportsReservation) + +``` +function UtilLine.supportsReservation(lineEntity : Engine.Entity): boolean +``` + +Check if line supports reservations + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” line entity + +**Returns** + +1. `boolean` β€” whether line supports reservations + +### UtilLine.getLineIssues[πŸ”—](#$api.engine.util~UtilLine.getLineIssues) + +``` +function UtilLine.getLineIssues(lineEntity : Engine.Entity, allIssues : boolean): {LineIssue} +``` + +Get line configuration problems for the line + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” line entity +* `allIssues` :`boolean` β€” whether to return all issues + +**Returns** + +1. `{LineIssue}` β€” all line issues of the line + +### UtilLine.getLinesIssues[πŸ”—](#$api.engine.util~UtilLine.getLinesIssues) + +``` +function UtilLine.getLinesIssues(playerEntity : Engine.Entity, allIssues : boolean): {Engine.Entity : {LineIssue}} +``` + +Get line configuration problems for the player lines + +**Parameters** + +* `playerEntity` :`Engine.Entity` β€” player entity +* `allIssues` :`boolean` β€” whether to return all issues + +**Returns** + +1. `{Engine.Entity : {LineIssue}}` β€” all line issues of the lines belonging to the player + +### UtilLine.getFailedPathReason[πŸ”—](#$api.engine.util~UtilLine.getFailedPathReason) + +``` +function UtilLine.getFailedPathReason(vehicle : Engine.Entity, line : Engine.Entity, fullLine : boolean): Failure +``` + +Get the reason for failed pathfinding search + +**Parameters** + +* `vehicle` :`Engine.Entity` β€” vehicle entity +* `line` :`Engine.Entity` β€” line entity +* `fullLine` :`boolean` β€” whether to check full line + +**Returns** + +1. `Failure` β€” failure reason + +### UtilLine.getNoRoadConnectionProblems[πŸ”—](#$api.engine.util~UtilLine.getNoRoadConnectionProblems) + +``` +function UtilLine.getNoRoadConnectionProblems(): {Engine.Entity} +``` + +Get nodes (construction entities) without any road connection + +**Returns** + +1. `{Engine.Entity}` β€” list of node entities + +### UtilLogbook[πŸ”—](#$api.engine.util~UtilLogbook) + +``` +global record UtilLogbook getLogValuePerYear: function(entity : Engine.Entity, logName : string): integer + getLogValueMostRecent: function(entity : Engine.Entity, logName : string): integer + getLogValueOldest: function(entity : Engine.Entity, logName : string): integer + logValue: function(entity : Engine.Entity, logName : string, value : integer) + getChart: function(logbookEntity : Engine.Entity, logNames : {string}, xMin : number, xMax : number, yMin : number, yMax : number, ChartConfig : ChartConfig): ChartResult + getChartDiff: function(entity : Engine.Entity, logNames : {string}, config : ChartConfig): ChartResult +end +``` + +### UtilLogbook.getLogValuePerYear[πŸ”—](#$api.engine.util~UtilLogbook.getLogValuePerYear) + +``` +function UtilLogbook.getLogValuePerYear(entity : Engine.Entity, logName : string): integer +``` + +Get log value difference in the last year for cargo type + +**Parameters** + +* `entity` :`Engine.Entity` β€” entity with logbook component +* `logName` :`string` β€” log entry name + +**Returns** + +1. `integer` β€” log value difference in the last year for cargo type + +### UtilLogbook.getLogValueMostRecent[πŸ”—](#$api.engine.util~UtilLogbook.getLogValueMostRecent) + +``` +function UtilLogbook.getLogValueMostRecent(entity : Engine.Entity, logName : string): integer +``` + +Get most recent log value + +**Parameters** + +* `entity` :`Engine.Entity` β€” entity with logbook component +* `logName` :`string` β€” log entry name + +**Returns** + +1. `integer` β€” log value difference in the last year for cargo type + +### UtilLogbook.getLogValueOldest[πŸ”—](#$api.engine.util~UtilLogbook.getLogValueOldest) + +``` +function UtilLogbook.getLogValueOldest(entity : Engine.Entity, logName : string): integer +``` + +Get oldest log value + +**Parameters** + +* `entity` :`Engine.Entity` β€” entity with logbook component +* `logName` :`string` β€” log entry name + +**Returns** + +1. `integer` β€” oldest log value + +### UtilLogbook.logValue[πŸ”—](#$api.engine.util~UtilLogbook.logValue) + +``` +function UtilLogbook.logValue(entity : Engine.Entity, logName : string, value : integer) +``` + +Log a value + +**Parameters** + +* `entity` :`Engine.Entity` β€” entity with logbook component +* `logName` :`string` β€” log entry name +* `value` :`integer` β€” value to log + +### UtilLogbook.getChart[πŸ”—](#$api.engine.util~UtilLogbook.getChart) + +``` +function UtilLogbook.getChart(logbookEntity : Engine.Entity, logNames : {string}, xMin : number, xMax : number, yMin : number, yMax : number, ChartConfig : ChartConfig): ChartResult +``` + +Get chart for logbook + +**Parameters** + +* `logbookEntity` :`Engine.Entity` β€” entity with logbook component +* `logNames` :`{string}` β€” log types +* `xMin` :`number` β€” Starting value of x-axis (automatically reduced to the lowest x in the data) +* `xMax` :`number` β€” End value of x-axis (automatically increased to the highest x in the data) +* `yMin` :`number` β€” Starting value of y-axis (automatically reduced to the lowest y in the data) +* `yMax` :`number` β€” End value of y-axis (automatically increased to the highest y in the data) +* `ChartConfig` :`ChartConfig` β€” config of the chart to get + +**Returns** + +1. `ChartResult` β€” chart result + +### UtilLogbook.getChartDiff[πŸ”—](#$api.engine.util~UtilLogbook.getChartDiff) + +``` +function UtilLogbook.getChartDiff(entity : Engine.Entity, logNames : {string}, config : ChartConfig): ChartResult +``` + +Get diff chart for logbooks + +**Parameters** + +* `entity` :`Engine.Entity` β€” entity with logbook component +* `logNames` :`{string}` β€” log types +* `config` :`ChartConfig` β€” chart config + +**Returns** + +1. `ChartResult` β€” chart result + +### UtilMaintenance[πŸ”—](#$api.engine.util~UtilMaintenance) + +``` +global record UtilMaintenance calcMaintenanceForStationGroup: function(stationGroupEntity : Engine.Entity): integer + calcMaintenanceForSubconstruction: function(subconstructionEntity : Engine.Entity): integer +end +``` + +### UtilMaintenance.calcMaintenanceForStationGroup[πŸ”—](#$api.engine.util~UtilMaintenance.calcMaintenanceForStationGroup) + +``` +function UtilMaintenance.calcMaintenanceForStationGroup(stationGroupEntity : Engine.Entity): integer +``` + +Calculate maintenance cost for a station group + +**Parameters** + +* `stationGroupEntity` :`Engine.Entity` β€” station group entity + +**Returns** + +1. `integer` β€” maintenance cost + +### UtilMaintenance.calcMaintenanceForSubconstruction[πŸ”—](#$api.engine.util~UtilMaintenance.calcMaintenanceForSubconstruction) + +``` +function UtilMaintenance.calcMaintenanceForSubconstruction(subconstructionEntity : Engine.Entity): integer +``` + +Calculate maintenance cost for a subconstruction + +**Parameters** + +* `subconstructionEntity` :`Engine.Entity` β€” subconstruction entity + +**Returns** + +1. `integer` β€” maintenance cost + +### UtilOctree[πŸ”—](#$api.engine.util~UtilOctree) + +``` +global record UtilOctree findEntitiesInCircle: function(center : Vec2f, radius : number, componentType : Engine.ComponentType): {Engine.Entity} + findTransportNetworkNodesInCircle: function(center : Vec2f, radius : number): {NodeId} + areWaypointsOnLine: function(waypoints : {Vec2f}, lineEntity : Engine.Entity, tolerance : number): boolean +end +``` + +### UtilOctree.findEntitiesInCircle[πŸ”—](#$api.engine.util~UtilOctree.findEntitiesInCircle) + +``` +function UtilOctree.findEntitiesInCircle(center : Vec2f, radius : number, componentType : Engine.ComponentType): {Engine.Entity} +``` + +Get entities in given radius and component type + +**Parameters** + +* `center` :`Vec2f` β€” center position +* `radius` :`number` β€” search radius +* `componentType` :`Engine.ComponentType` β€” component type + +**Returns** + +1. `{Engine.Entity}` β€” list of entities + +### UtilOctree.findTransportNetworkNodesInCircle[πŸ”—](#$api.engine.util~UtilOctree.findTransportNetworkNodesInCircle) + +``` +function UtilOctree.findTransportNetworkNodesInCircle(center : Vec2f, radius : number): {NodeId} +``` + +Get transport network nodes in given radius + +**Parameters** + +* `center` :`Vec2f` β€” center position +* `radius` :`number` β€” search radius + +**Returns** + +1. `{NodeId}` β€” list of node IDs + +### UtilOctree.areWaypointsOnLine[πŸ”—](#$api.engine.util~UtilOctree.areWaypointsOnLine) + +``` +function UtilOctree.areWaypointsOnLine(waypoints : {Vec2f}, lineEntity : Engine.Entity, tolerance : number): boolean +``` + +Check if waypoints are on a line + +**Parameters** + +* `waypoints` :`{Vec2f}` β€” list of positions +* `lineEntity` :`Engine.Entity` β€” the line entity +* `tolerance` :`number` β€” distance tolerance + +**Returns** + +1. `boolean` β€” true if waypoints are on line + +### UtilParallelStrip[πŸ”—](#$api.engine.util~UtilParallelStrip) + +``` +[Expand All] [Collapse All] + +global record UtilParallelStrip record StripInfo carrier: Carrier + edgeType: BaseEdgeType + edgeTypeIndex: integer +end + getStripInfo: function(entity : Engine.Entity): StripInfo + isBridge: function(entity : Engine.Entity): boolean + isTunnel: function(entity : Engine.Entity): boolean +end +``` + +### UtilParallelStrip.StripInfo[πŸ”—](#$api.engine.util~UtilParallelStrip.StripInfo) + +``` +record UtilParallelStrip.StripInfo carrier: Carrier + edgeType: BaseEdgeType + edgeTypeIndex: integer +end +``` + +### UtilParallelStrip.StripInfo.carrier[πŸ”—](#$api.engine.util~UtilParallelStrip.StripInfo.carrier) + +``` +UtilParallelStrip.StripInfo.carrier: Carrier +``` + +### UtilParallelStrip.StripInfo.edgeType[πŸ”—](#$api.engine.util~UtilParallelStrip.StripInfo.edgeType) + +``` +UtilParallelStrip.StripInfo.edgeType: BaseEdgeType +``` + +### UtilParallelStrip.StripInfo.edgeTypeIndex[πŸ”—](#$api.engine.util~UtilParallelStrip.StripInfo.edgeTypeIndex) + +``` +UtilParallelStrip.StripInfo.edgeTypeIndex: integer +``` + +### UtilParallelStrip.getStripInfo[πŸ”—](#$api.engine.util~UtilParallelStrip.getStripInfo) + +``` +function UtilParallelStrip.getStripInfo(entity : Engine.Entity): StripInfo +``` + +Get strip information for a parallel strip entity + +**Parameters** + +* `entity` :`Engine.Entity` β€” parallel strip entity + +**Returns** + +1. `StripInfo` β€” strip information + +### UtilParallelStrip.isBridge[πŸ”—](#$api.engine.util~UtilParallelStrip.isBridge) + +``` +function UtilParallelStrip.isBridge(entity : Engine.Entity): boolean +``` + +Check if entity is a bridge + +**Parameters** + +* `entity` :`Engine.Entity` β€” parallel strip entity + +**Returns** + +1. `boolean` β€” true if bridge + +### UtilParallelStrip.isTunnel[πŸ”—](#$api.engine.util~UtilParallelStrip.isTunnel) + +``` +function UtilParallelStrip.isTunnel(entity : Engine.Entity): boolean +``` + +Check if entity is a tunnel + +**Parameters** + +* `entity` :`Engine.Entity` β€” parallel strip entity + +**Returns** + +1. `boolean` β€” true if tunnel + +### UtilPathfinding[πŸ”—](#$api.engine.util~UtilPathfinding) + +``` +[Expand All] [Collapse All] + +global record UtilPathfinding record EdgeIdDirAndLength edgeId: EdgeId + dir: boolean + length: number + new: function(EdgeId, boolean, number): EdgeIdDirAndLength +end + record EdgeIdDir edgeId: EdgeId + dir: boolean + new: function(EdgeId, boolean): EdgeIdDir +end + findPath: function(startingEdgesAndLengths : {EdgeIdDirAndLength}, destinationNodes : {NodeId}, transportModeSet : {TransportMode}, maxLength : number): {{EdgeId, boolean}} + findPathNodeToNode: function(startNodes : {NodeId}, destinationNodes : {NodeId}, transportModeSet : {TransportMode}): {{EdgeId, boolean}} + getTargetsByLandUse: function(): { : } + findDubinsPath: function(p0 : Vec3f, t0 : Vec3f, p1 : Vec3f, t1 : Vec3f, turnRadius : number): {{EdgeGeometry, boolean}} +end +``` + +### UtilPathfinding.EdgeIdDirAndLength[πŸ”—](#$api.engine.util~UtilPathfinding.EdgeIdDirAndLength) + +``` +record UtilPathfinding.EdgeIdDirAndLength edgeId: EdgeId + dir: boolean + length: number + new: function(EdgeId, boolean, number): EdgeIdDirAndLength +end +``` + +### UtilPathfinding.EdgeIdDirAndLength.edgeId[πŸ”—](#$api.engine.util~UtilPathfinding.EdgeIdDirAndLength.edgeId) + +``` +UtilPathfinding.EdgeIdDirAndLength.edgeId: EdgeId +``` + +Edge ID + +### UtilPathfinding.EdgeIdDirAndLength.dir[πŸ”—](#$api.engine.util~UtilPathfinding.EdgeIdDirAndLength.dir) + +``` +UtilPathfinding.EdgeIdDirAndLength.dir: boolean +``` + +Direction + +### UtilPathfinding.EdgeIdDirAndLength.length[πŸ”—](#$api.engine.util~UtilPathfinding.EdgeIdDirAndLength.length) + +``` +UtilPathfinding.EdgeIdDirAndLength.length: number +``` + +Length + +### UtilPathfinding.EdgeIdDirAndLength.new[πŸ”—](#$api.engine.util~UtilPathfinding.EdgeIdDirAndLength.new) + +``` +function UtilPathfinding.EdgeIdDirAndLength.new(EdgeId, boolean, number): EdgeIdDirAndLength +``` + +Generates a new item. + +**Parameters** + +* `EdgeId` +* `boolean` +* `number` + +**Returns** + +1. `EdgeIdDirAndLength` + +### UtilPathfinding.EdgeIdDir[πŸ”—](#$api.engine.util~UtilPathfinding.EdgeIdDir) + +``` +record UtilPathfinding.EdgeIdDir edgeId: EdgeId + dir: boolean + new: function(EdgeId, boolean): EdgeIdDir +end +``` + +### UtilPathfinding.EdgeIdDir.edgeId[πŸ”—](#$api.engine.util~UtilPathfinding.EdgeIdDir.edgeId) + +``` +UtilPathfinding.EdgeIdDir.edgeId: EdgeId +``` + +Edge ID + +### UtilPathfinding.EdgeIdDir.dir[πŸ”—](#$api.engine.util~UtilPathfinding.EdgeIdDir.dir) + +``` +UtilPathfinding.EdgeIdDir.dir: boolean +``` + +Direction + +### UtilPathfinding.EdgeIdDir.new[πŸ”—](#$api.engine.util~UtilPathfinding.EdgeIdDir.new) + +``` +function UtilPathfinding.EdgeIdDir.new(EdgeId, boolean): EdgeIdDir +``` + +Generates a new item. + +**Parameters** + +* `EdgeId` +* `boolean` + +**Returns** + +1. `EdgeIdDir` + +### UtilPathfinding.findPath[πŸ”—](#$api.engine.util~UtilPathfinding.findPath) + +``` +function UtilPathfinding.findPath(startingEdgesAndLengths : {EdgeIdDirAndLength}, destinationNodes : {NodeId}, transportModeSet : {TransportMode}, maxLength : number): {{EdgeId, boolean}} +``` + +Find a path between starting edges and end destination nodes, using a given set of transport modes. + +**Parameters** + +* `startingEdgesAndLengths` :`{EdgeIdDirAndLength}` β€” Vector of EdgeIdDirAndLength +* `destinationNodes` :`{NodeId}` β€” Vector of NodeId +* `transportModeSet` :`{TransportMode}` β€” Vector of TransportMode +* `maxLength` :`number` β€” maximum path length + +**Returns** + +1. `{{EdgeId, boolean}}` β€” a vector with pairs of EdgeId and bool values + +### UtilPathfinding.findPathNodeToNode[πŸ”—](#$api.engine.util~UtilPathfinding.findPathNodeToNode) + +``` +function UtilPathfinding.findPathNodeToNode(startNodes : {NodeId}, destinationNodes : {NodeId}, transportModeSet : {TransportMode}): {{EdgeId, boolean}} +``` + +Find a path between starting nodes and end destination nodes, using a given set of transport modes. + +**Parameters** + +* `startNodes` :`{NodeId}` β€” Vector of NodeId +* `destinationNodes` :`{NodeId}` β€” Vector of NodeId +* `transportModeSet` :`{TransportMode}` β€” Vector of TransportMode + +**Returns** + +1. `{{EdgeId, boolean}}` β€” a vector with pairs of EdgeId and bool values + +### UtilPathfinding.getTargetsByLandUse[πŸ”—](#$api.engine.util~UtilPathfinding.getTargetsByLandUse) + +``` +function UtilPathfinding.getTargetsByLandUse(): { : } +``` + +**Returns** + +1. `{ : }` + +### UtilPathfinding.findDubinsPath[πŸ”—](#$api.engine.util~UtilPathfinding.findDubinsPath) + +``` +function UtilPathfinding.findDubinsPath(p0 : Vec3f, t0 : Vec3f, p1 : Vec3f, t1 : Vec3f, turnRadius : number): {{EdgeGeometry, boolean}} +``` + +Find a Dubins path between two points with directions + +**Parameters** + +* `p0` :`Vec3f` β€” first point +* `t0` :`Vec3f` β€” tangent at p0 +* `p1` :`Vec3f` β€” second point +* `t1` :`Vec3f` β€” tangent at p1 +* `turnRadius` :`number` β€” maximal turn radius + +**Returns** + +1. `{{EdgeGeometry, boolean}}` β€” A list of EdgeGeometries and direction + +### UtilProposal[πŸ”—](#$api.engine.util~UtilProposal) + +``` +global record UtilProposal makeProposalData: function(Proposal, Context): ProposalData + makeIndustrySpawnProposal: function(industryTypeTag : string, townEntity : Engine.Entity): Proposal + makeSegmentsRemoveProposal: function(segmentsToRemove : {Engine.Entity}): Proposal + createProposalRemove: function(entity : Engine.Entity, context : Context): Proposal + createProposalReplaceConstruction: function(entity : Engine.Entity, params : { : }, newResName : ResName): Proposal + createIndustryProposal: function(seed : string, industryRectangle : IndustryInfo, context : Context): Proposal + createBridgeOrTunnelProposal: function(parallelStripEntity : Engine.Entity, newTypeIndex : integer): Proposal + createDoubleSlipSwitchProposal: function(entity : Engine.Entity, doubleSlipSwitch : boolean): Proposal + createTrafficLightProposal: function(entity : Engine.Entity, trafficLightConfig : Engine.Component.TrafficLightConfig, trafficLightPreference : TrafficLightPreference): Proposal + getBridgeOrTunnelRelatedRevisions: function(parallelStripEntity : Engine.Entity): {Engine.Entity : Engine.Revision} + didBridgeOrTunnelRelatedRevisionsChange: function(parallelStripEntity : Engine.Entity, revisions : {Engine.Entity : Engine.Revision}): boolean + makeReforestationProposal: function(seed : integer, numTilesToUpdate : integer, maxTreesPerTile : integer): Proposal + refreshConstruction: function(entity : Engine.Entity, constructionFilepath : string): Proposal + replaceSegment: function(entity : Engine.Entity, streetTemplate : ResName): Proposal + checkProposalConnectsNodes: function(startNode : Engine.Entity, startEdge : Engine.Entity, targetNode : Engine.Entity, streetProposal : Proposal.StreetProposal, isApply : boolean, maxDepth : number): boolean + makeIndustryExtendProposal: function(industry : Engine.Entity, trySlots : integer, numExtendSlots : integer): {Proposal, {integer}} + createSubconstructionLotList: function(Proposal.Subconstruction, Mat4f): Engine.Component.LotList + getConstructionArea: function(proposal : Proposal): number +end +``` + +### UtilProposal.makeProposalData[πŸ”—](#$api.engine.util~UtilProposal.makeProposalData) + +``` +function UtilProposal.makeProposalData(Proposal, Context): ProposalData +``` + +**Parameters** + +* `Proposal` +* `Context` + +**Returns** + +1. `ProposalData` + +### UtilProposal.makeIndustrySpawnProposal[πŸ”—](#$api.engine.util~UtilProposal.makeIndustrySpawnProposal) + +``` +function UtilProposal.makeIndustrySpawnProposal(industryTypeTag : string, townEntity : Engine.Entity): Proposal +``` + +Tries to generate a proposal for randomly placing an industry. + +**Parameters** + +* `industryTypeTag` :`string` β€” The type of the industry +* `townEntity` :`Engine.Entity` β€” the town designating the target voronoi cell (or nil to spawn anywhere in the world) + +**Returns** + +1. `Proposal` β€” the generated proposal, or nil + +### UtilProposal.makeSegmentsRemoveProposal[πŸ”—](#$api.engine.util~UtilProposal.makeSegmentsRemoveProposal) + +``` +function UtilProposal.makeSegmentsRemoveProposal(segmentsToRemove : {Engine.Entity}): Proposal +``` + +Makes a proposal to remove segments + +**Parameters** + +* `segmentsToRemove` :`{Engine.Entity}` β€” list of segments to remove + +**Returns** + +1. `Proposal` β€” the generated proposal + +### UtilProposal.createProposalRemove[πŸ”—](#$api.engine.util~UtilProposal.createProposalRemove) + +``` +function UtilProposal.createProposalRemove(entity : Engine.Entity, context : Context): Proposal +``` + +Tries to generate a proposal to remove a construction + +**Parameters** + +* `entity` :`Engine.Entity` β€” the entity to remove +* `context` :`Context` β€” construction context + +**Returns** + +1. `Proposal` β€” the generated proposal, or nil + +### UtilProposal.createProposalReplaceConstruction[πŸ”—](#$api.engine.util~UtilProposal.createProposalReplaceConstruction) + +``` +function UtilProposal.createProposalReplaceConstruction(entity : Engine.Entity, params : { : }, newResName : ResName): Proposal +``` + +Replaces an existing construction with a new one + +**Parameters** + +* `entity` :`Engine.Entity` β€” the entity to replace +* `params` :`{ : }` β€” parameters for the new construction +* `newResName` :`ResName` β€” resource name of the new construction (if nil, the same as the old one is used) + +**Returns** + +1. `Proposal` β€” the generated proposal, or nil + +### UtilProposal.createIndustryProposal[πŸ”—](#$api.engine.util~UtilProposal.createIndustryProposal) + +``` +function UtilProposal.createIndustryProposal(seed : string, industryRectangle : IndustryInfo, context : Context): Proposal +``` + +Tries to generate a proposal to build an industry + +**Parameters** + +* `seed` :`string` β€” random seed +* `industryRectangle` :`IndustryInfo` β€” industry rectangle data +* `context` :`Context` β€” construction context + +**Returns** + +1. `Proposal` β€” the generated proposal, or nil + +### UtilProposal.createBridgeOrTunnelProposal[πŸ”—](#$api.engine.util~UtilProposal.createBridgeOrTunnelProposal) + +``` +function UtilProposal.createBridgeOrTunnelProposal(parallelStripEntity : Engine.Entity, newTypeIndex : integer): Proposal +``` + +Creates a bridge or tunnel proposal for changing the type of a parallel strip entity. + +**Parameters** + +* `parallelStripEntity` :`Engine.Entity` β€” parallel strip entity +* `newTypeIndex` :`integer` β€” new resource type index for bridge or tunnel + +**Returns** + +1. `Proposal` β€” the generated proposal + +### UtilProposal.createDoubleSlipSwitchProposal[πŸ”—](#$api.engine.util~UtilProposal.createDoubleSlipSwitchProposal) + +``` +function UtilProposal.createDoubleSlipSwitchProposal(entity : Engine.Entity, doubleSlipSwitch : boolean): Proposal +``` + +Creates a double slip switch proposal for changing the switch type of a base node configuration entity. + +**Parameters** + +* `entity` :`Engine.Entity` β€” base node entity +* `doubleSlipSwitch` :`boolean` β€” double slip switch true to create double slip switch, false for single slip switch + +**Returns** + +1. `Proposal` + +### UtilProposal.createTrafficLightProposal[πŸ”—](#$api.engine.util~UtilProposal.createTrafficLightProposal) + +``` +function UtilProposal.createTrafficLightProposal(entity : Engine.Entity, trafficLightConfig : Engine.Component.TrafficLightConfig, trafficLightPreference : TrafficLightPreference): Proposal +``` + +Creates a proposal that changes the traffic light configuration of a base node + +**Parameters** + +* `entity` :`Engine.Entity` β€” base node entity +* `trafficLightConfig` :`Engine.Component.TrafficLightConfig` β€” the configuration of traffic light, including phases and type +* `trafficLightPreference` :`TrafficLightPreference` β€” whether a traffic light should be generated or not (or automtically decided) + +**Returns** + +1. `Proposal` + +### UtilProposal.getBridgeOrTunnelRelatedRevisions[πŸ”—](#$api.engine.util~UtilProposal.getBridgeOrTunnelRelatedRevisions) + +``` +function UtilProposal.getBridgeOrTunnelRelatedRevisions(parallelStripEntity : Engine.Entity): {Engine.Entity : Engine.Revision} +``` + +Gets bridge or tunnel related revisions for a parallel strip entity. + +**Parameters** + +* `parallelStripEntity` :`Engine.Entity` β€” parallel strip entity + +**Returns** + +1. `{Engine.Entity : Engine.Revision}` β€” map of entity to revision + +### UtilProposal.didBridgeOrTunnelRelatedRevisionsChange[πŸ”—](#$api.engine.util~UtilProposal.didBridgeOrTunnelRelatedRevisionsChange) + +``` +function UtilProposal.didBridgeOrTunnelRelatedRevisionsChange(parallelStripEntity : Engine.Entity, revisions : {Engine.Entity : Engine.Revision}): boolean +``` + +Checks if bridge or tunnel related revisions changed for a parallel strip entity. + +**Parameters** + +* `parallelStripEntity` :`Engine.Entity` β€” parallel strip entity +* `revisions` :`{Engine.Entity : Engine.Revision}` β€” map of entity to revision + +**Returns** + +1. `boolean` β€” true if any related revision changed + +### UtilProposal.makeReforestationProposal[πŸ”—](#$api.engine.util~UtilProposal.makeReforestationProposal) + +``` +function UtilProposal.makeReforestationProposal(seed : integer, numTilesToUpdate : integer, maxTreesPerTile : integer): Proposal +``` + +Creates a reforestation proposal. + +**Parameters** + +* `seed` :`integer` β€” random seed +* `numTilesToUpdate` :`integer` β€” maximum number of tiles being updated +* `maxTreesPerTile` :`integer` β€” maximum number of trees planted per tile + +**Returns** + +1. `Proposal` β€” the generated proposal + +### UtilProposal.refreshConstruction[πŸ”—](#$api.engine.util~UtilProposal.refreshConstruction) + +``` +function UtilProposal.refreshConstruction(entity : Engine.Entity, constructionFilepath : string): Proposal +``` + +Refreshes a construction. This returns a proposal that needs to be applied with a `makeWorldBuildProposalCmd` + +**Parameters** + +* `entity` :`Engine.Entity` β€” the entity with a construction to refresh +* `constructionFilepath` :`string` β€” the construction to refresh the entity with + +**Returns** + +1. `Proposal` β€” a proposal for the refreshed construction + +### UtilProposal.replaceSegment[πŸ”—](#$api.engine.util~UtilProposal.replaceSegment) + +``` +function UtilProposal.replaceSegment(entity : Engine.Entity, streetTemplate : ResName): Proposal +``` + +Refreshes a street/track segment (base edge). This returns a proposal that needs to be applied with a `makeWorldBuildProposalCmd` + +**Parameters** + +* `entity` :`Engine.Entity` β€” the entity with a construction to refresh +* `streetTemplate` :`ResName` β€” the street template file path to refresh the entity with (optionally). Use with caution. + +**Returns** + +1. `Proposal` β€” a proposal for the refreshed segment + +### UtilProposal.checkProposalConnectsNodes[πŸ”—](#$api.engine.util~UtilProposal.checkProposalConnectsNodes) + +``` +function UtilProposal.checkProposalConnectsNodes(startNode : Engine.Entity, startEdge : Engine.Entity, targetNode : Engine.Entity, streetProposal : Proposal.StreetProposal, isApply : boolean, maxDepth : number): boolean +``` + +Check if a street proposal connects the start node to the target node. + +**Parameters** + +* `startNode` :`Engine.Entity` β€” the starting base node entity +* `startEdge` :`Engine.Entity` β€” the starting base edge entity +* `targetNode` :`Engine.Entity` β€” the target node entity +* `streetProposal` :`Proposal.StreetProposal` β€” the street proposal to check +* `isApply` :`boolean` β€” whether the proposal is being applied +* `maxDepth` :`number` β€” (optional) specify a maximum distance which is traversed in the network + +**Returns** + +1. `boolean` β€” true if the proposal connects the nodes + +### UtilProposal.makeIndustryExtendProposal[πŸ”—](#$api.engine.util~UtilProposal.makeIndustryExtendProposal) + +``` +function UtilProposal.makeIndustryExtendProposal(industry : Engine.Entity, trySlots : integer, numExtendSlots : integer): {Proposal, {integer}} +``` + +Create proposal to extend industry + +**Parameters** + +* `industry` :`Engine.Entity` β€” industry entity +* `trySlots` :`integer` β€” number of slots to try extending to +* `numExtendSlots` :`integer` β€” number of slots to extend + +**Returns** + +1. `{Proposal, {integer}}` β€” the proposal and (if it is colliding) indices of colliding subconstructions + +### UtilProposal.createSubconstructionLotList[πŸ”—](#$api.engine.util~UtilProposal.createSubconstructionLotList) + +``` +function UtilProposal.createSubconstructionLotList(Proposal.Subconstruction, Mat4f): Engine.Component.LotList +``` + +**Parameters** + +* `Proposal.Subconstruction` +* `Mat4f` + +**Returns** + +1. `Engine.Component.LotList` + +### UtilProposal.getConstructionArea[πŸ”—](#$api.engine.util~UtilProposal.getConstructionArea) + +``` +function UtilProposal.getConstructionArea(proposal : Proposal): number +``` + +Calculate the area of new constructions in the proposal. + +**Parameters** + +* `proposal` :`Proposal` β€” the proposal to calculate the area for + +**Returns** + +1. `number` β€” the approximate area of new constructions in the proposal in square meters + +### UtilStation[πŸ”—](#$api.engine.util~UtilStation) + +``` +[Expand All] [Collapse All] + +global record UtilStation record StationUsage totalUsed: integer + overflow: integer + poolCapacity: integer + terminalCapacity: integer +end + calculateStationUsage: function(station : Engine.Entity): StationUsage + calculateStationTerminalUsage: function(station : Engine.Entity, terminalIndex : integer): UtilLine.TerminalCapacityUsage + record StationGroupCapacityUsage equals: function(StationGroupCapacityUsage, StationGroupCapacityUsage): boolean + capacity: integer + waitingHallCapacity: integer + used: integer + overflow: boolean +end + calculateStationGroupCargo: function(stationGroup : Engine.Entity, flatTerminalIndex : integer): StationGroupCapacityUsage + isStationOfType: function(stationEntity : Engine.Entity, cargo : boolean): boolean + findStationGroupWithOverlappingCatchmentOfDifferentCarriers: function(): {{Engine.Entity, Engine.Entity}} +end +``` + +### UtilStation.StationUsage[πŸ”—](#$api.engine.util~UtilStation.StationUsage) + +``` +record UtilStation.StationUsage totalUsed: integer + overflow: integer + poolCapacity: integer + terminalCapacity: integer +end +``` + +### UtilStation.StationUsage.totalUsed[πŸ”—](#$api.engine.util~UtilStation.StationUsage.totalUsed) + +``` +UtilStation.StationUsage.totalUsed: integer +``` + +### UtilStation.StationUsage.overflow[πŸ”—](#$api.engine.util~UtilStation.StationUsage.overflow) + +``` +UtilStation.StationUsage.overflow: integer +``` + +### UtilStation.StationUsage.poolCapacity[πŸ”—](#$api.engine.util~UtilStation.StationUsage.poolCapacity) + +``` +UtilStation.StationUsage.poolCapacity: integer +``` + +### UtilStation.StationUsage.terminalCapacity[πŸ”—](#$api.engine.util~UtilStation.StationUsage.terminalCapacity) + +``` +UtilStation.StationUsage.terminalCapacity: integer +``` + +### UtilStation.calculateStationUsage[πŸ”—](#$api.engine.util~UtilStation.calculateStationUsage) + +``` +function UtilStation.calculateStationUsage(station : Engine.Entity): StationUsage +``` + +Get station usages + +**Parameters** + +* `station` :`Engine.Entity` β€” station entity + +**Returns** + +1. `StationUsage` β€” total usage, overflow and pool capacity for station + +### UtilStation.calculateStationTerminalUsage[πŸ”—](#$api.engine.util~UtilStation.calculateStationTerminalUsage) + +``` +function UtilStation.calculateStationTerminalUsage(station : Engine.Entity, terminalIndex : integer): UtilLine.TerminalCapacityUsage +``` + +Get station terminal usages + +**Parameters** + +* `station` :`Engine.Entity` β€” station entity +* `terminalIndex` :`integer` β€” terminal index + +**Returns** + +1. `UtilLine.TerminalCapacityUsage` β€” capacity and usage for a terminal (or the pool if terminal is -1) + +### UtilStation.StationGroupCapacityUsage[πŸ”—](#$api.engine.util~UtilStation.StationGroupCapacityUsage) + +``` +record UtilStation.StationGroupCapacityUsage equals: function(StationGroupCapacityUsage, StationGroupCapacityUsage): boolean + capacity: integer + waitingHallCapacity: integer + used: integer + overflow: boolean +end +``` + +### UtilStation.StationGroupCapacityUsage.equals[πŸ”—](#$api.engine.util~UtilStation.StationGroupCapacityUsage.equals) + +``` +function UtilStation.StationGroupCapacityUsage.equals(StationGroupCapacityUsage, StationGroupCapacityUsage): boolean +``` + +**Parameters** + +* `StationGroupCapacityUsage` +* `StationGroupCapacityUsage` + +**Returns** + +1. `boolean` + +### UtilStation.StationGroupCapacityUsage.capacity[πŸ”—](#$api.engine.util~UtilStation.StationGroupCapacityUsage.capacity) + +``` +UtilStation.StationGroupCapacityUsage.capacity: integer +``` + +### UtilStation.StationGroupCapacityUsage.waitingHallCapacity[πŸ”—](#$api.engine.util~UtilStation.StationGroupCapacityUsage.waitingHallCapacity) + +``` +UtilStation.StationGroupCapacityUsage.waitingHallCapacity: integer +``` + +### UtilStation.StationGroupCapacityUsage.used[πŸ”—](#$api.engine.util~UtilStation.StationGroupCapacityUsage.used) + +``` +UtilStation.StationGroupCapacityUsage.used: integer +``` + +### UtilStation.StationGroupCapacityUsage.overflow[πŸ”—](#$api.engine.util~UtilStation.StationGroupCapacityUsage.overflow) + +``` +UtilStation.StationGroupCapacityUsage.overflow: boolean +``` + +### UtilStation.calculateStationGroupCargo[πŸ”—](#$api.engine.util~UtilStation.calculateStationGroupCargo) + +``` +function UtilStation.calculateStationGroupCargo(stationGroup : Engine.Entity, flatTerminalIndex : integer): StationGroupCapacityUsage +``` + +Get station group cargo usage + +**Parameters** + +* `stationGroup` :`Engine.Entity` β€” station group entity +* `flatTerminalIndex` :`integer` β€” terminal index + +**Returns** + +1. `StationGroupCapacityUsage` β€” capacity and usage + overflow for a StationGroup + +### UtilStation.isStationOfType[πŸ”—](#$api.engine.util~UtilStation.isStationOfType) + +``` +function UtilStation.isStationOfType(stationEntity : Engine.Entity, cargo : boolean): boolean +``` + +Check if station supports cargo/passengers + +**Parameters** + +* `stationEntity` :`Engine.Entity` β€” station entity +* `cargo` :`boolean` β€” check for cargo support or passenger support + +**Returns** + +1. `boolean` β€” whether station supports cargo/passengers + +### UtilStation.findStationGroupWithOverlappingCatchmentOfDifferentCarriers[πŸ”—](#$api.engine.util~UtilStation.findStationGroupWithOverlappingCatchmentOfDifferentCarriers) + +``` +function UtilStation.findStationGroupWithOverlappingCatchmentOfDifferentCarriers(): {{Engine.Entity, Engine.Entity}} +``` + +Check for stations with overlapping catchment areas + +**Returns** + +1. `{{Engine.Entity, Engine.Entity}}` β€” list of station group entity pairs + +### UtilStock[πŸ”—](#$api.engine.util~UtilStock) + +``` +global record UtilStock getStockCargoTypes: function(stockListEntity : Engine.Entity, stockId : StockId): {CargoTypeId} + getCargoTypeShippedPerYear: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer + getCargoShippedPerYear: function(stockListEntity : Engine.Entity): integer + getCargoTypeDeliveredPerYear: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer + getCargoDeliveredPerYear: function(stockListEntity : Engine.Entity): integer + getCargoConsumedPerYear: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer + getCargoProducedPerYear: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer + getCargoMaxProductionPerYear: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer + getCargoMaxConsumptionPerYear: function(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer + getInputsOutputsFromRules: function(stockListEntity : Engine.Entity): {{CargoTypeId}, {CargoTypeId}} + getCargoOutputPerYear: function(stockListEntity : Engine.Entity): integer + getCargoLogValueDiffPerYear: function(stockListEntity : Engine.Entity, logType : string, cargoTypeId : CargoTypeId): integer + getCargoLogPerYearForTarget: function(sourceStockListEntity : Engine.Entity, targetStockListEntity : Engine.Entity, logType : string, cargoTypeId : CargoTypeId): integer + getCargoLogPerYearForTargetFilter: function(sourceStockListEntity : Engine.Entity, targetFilter : function(Engine.Entity) : boolean, logType : string, cargoTypeId : CargoTypeId): integer + getProductionRating: function(stockListEntity : Engine.Entity): number + getStockGroupsByTypeAndCargoTypes: function(stockListEntity : Engine.Entity, sortByType : boolean, showEmpty : boolean): {{StockListType, {StockId}, {CargoTypeId}, integer}} + getStockListsWithThrownAwayCargo: function(): {Engine.Entity : integer} + hasAnyCompatibleStock: function(entities : {Engine.Entity}, cargoTypeId : CargoTypeId, load : boolean): boolean + getAdjustedDeliveryTime: function(cargoTypeId : CargoTypeId): integer + isCargoTypeCurrentlyProduced: function(cargoTypeId : CargoTypeId): boolean +end +``` + +### UtilStock.getStockCargoTypes[πŸ”—](#$api.engine.util~UtilStock.getStockCargoTypes) + +``` +function UtilStock.getStockCargoTypes(stockListEntity : Engine.Entity, stockId : StockId): {CargoTypeId} +``` + +Get stock cargo types. + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” entity containting the stocklist component +* `stockId` :`StockId` β€” stock id + +**Returns** + +1. `{CargoTypeId}` β€” set of CargoTypeId + +### UtilStock.getCargoTypeShippedPerYear[πŸ”—](#$api.engine.util~UtilStock.getCargoTypeShippedPerYear) + +``` +function UtilStock.getCargoTypeShippedPerYear(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer +``` + +Get num cargo shipped per year + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” list entity +* `cargoTypeId` :`CargoTypeId` β€” cargo type id + +**Returns** + +1. `integer` β€” num cargo shipped per year + +### UtilStock.getCargoShippedPerYear[πŸ”—](#$api.engine.util~UtilStock.getCargoShippedPerYear) + +``` +function UtilStock.getCargoShippedPerYear(stockListEntity : Engine.Entity): integer +``` + +Get num cargo shipped per year + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” list entity + +**Returns** + +1. `integer` β€” num cargo shipped per year + +### UtilStock.getCargoTypeDeliveredPerYear[πŸ”—](#$api.engine.util~UtilStock.getCargoTypeDeliveredPerYear) + +``` +function UtilStock.getCargoTypeDeliveredPerYear(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer +``` + +Get num cargo delivered per year + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” list entity +* `cargoTypeId` :`CargoTypeId` β€” cargo type id + +**Returns** + +1. `integer` β€” num cargo delivered per year + +### UtilStock.getCargoDeliveredPerYear[πŸ”—](#$api.engine.util~UtilStock.getCargoDeliveredPerYear) + +``` +function UtilStock.getCargoDeliveredPerYear(stockListEntity : Engine.Entity): integer +``` + +Get num cargo delivered (to entity) per year + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” stock list entity + +**Returns** + +1. `integer` β€” num cargo delivered per year + +### UtilStock.getCargoConsumedPerYear[πŸ”—](#$api.engine.util~UtilStock.getCargoConsumedPerYear) + +``` +function UtilStock.getCargoConsumedPerYear(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer +``` + +Get num cargo consumed per year + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” list entity +* `cargoTypeId` :`CargoTypeId` β€” cargo type id + +**Returns** + +1. `integer` β€” num cargo consumed per year + +### UtilStock.getCargoProducedPerYear[πŸ”—](#$api.engine.util~UtilStock.getCargoProducedPerYear) + +``` +function UtilStock.getCargoProducedPerYear(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer +``` + +Get num cargo produced per year + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” list entity +* `cargoTypeId` :`CargoTypeId` β€” cargo type id + +**Returns** + +1. `integer` β€” num cargo produced per year + +### UtilStock.getCargoMaxProductionPerYear[πŸ”—](#$api.engine.util~UtilStock.getCargoMaxProductionPerYear) + +``` +function UtilStock.getCargoMaxProductionPerYear(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer +``` + +Get num cargo max production per year + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” list entity +* `cargoTypeId` :`CargoTypeId` β€” cargo type id + +**Returns** + +1. `integer` β€” num cargo max production per year + +### UtilStock.getCargoMaxConsumptionPerYear[πŸ”—](#$api.engine.util~UtilStock.getCargoMaxConsumptionPerYear) + +``` +function UtilStock.getCargoMaxConsumptionPerYear(stockListEntity : Engine.Entity, cargoTypeId : CargoTypeId): integer +``` + +Get num cargo max consumption per year + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” list entity +* `cargoTypeId` :`CargoTypeId` β€” cargo type id + +**Returns** + +1. `integer` β€” num cargo max consumption per year + +### UtilStock.getInputsOutputsFromRules[πŸ”—](#$api.engine.util~UtilStock.getInputsOutputsFromRules) + +``` +function UtilStock.getInputsOutputsFromRules(stockListEntity : Engine.Entity): {{CargoTypeId}, {CargoTypeId}} +``` + +Get inputs and outputs from rules + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” list entity + +**Returns** + +1. `{{CargoTypeId}, {CargoTypeId}}` β€” inputs and outputs cargo types + +### UtilStock.getCargoOutputPerYear[πŸ”—](#$api.engine.util~UtilStock.getCargoOutputPerYear) + +``` +function UtilStock.getCargoOutputPerYear(stockListEntity : Engine.Entity): integer +``` + +Get the total number of cargo produced per year + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” list entity + +**Returns** + +1. `integer` β€” num cargo produced per year + +### UtilStock.getCargoLogValueDiffPerYear[πŸ”—](#$api.engine.util~UtilStock.getCargoLogValueDiffPerYear) + +``` +function UtilStock.getCargoLogValueDiffPerYear(stockListEntity : Engine.Entity, logType : string, cargoTypeId : CargoTypeId): integer +``` + +Get cargo log value in the last year for cargo type + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” stock list entity +* `logType` :`string` β€” the logbook type +* `cargoTypeId` :`CargoTypeId` β€” cargo type + +**Returns** + +1. `integer` β€” cargo log value difference in the last year for cargo type + +### UtilStock.getCargoLogPerYearForTarget[πŸ”—](#$api.engine.util~UtilStock.getCargoLogPerYearForTarget) + +``` +function UtilStock.getCargoLogPerYearForTarget(sourceStockListEntity : Engine.Entity, targetStockListEntity : Engine.Entity, logType : string, cargoTypeId : CargoTypeId): integer +``` + +Get num cargo log per year + +**Parameters** + +* `sourceStockListEntity` :`Engine.Entity` β€” stock list entity +* `targetStockListEntity` :`Engine.Entity` β€” stock list entity +* `logType` :`string` β€” the logbook type +* `cargoTypeId` :`CargoTypeId` β€” the cargo type + +**Returns** + +1. `integer` β€” num cargo shipped per year + +### UtilStock.getCargoLogPerYearForTargetFilter[πŸ”—](#$api.engine.util~UtilStock.getCargoLogPerYearForTargetFilter) + +``` +function UtilStock.getCargoLogPerYearForTargetFilter(sourceStockListEntity : Engine.Entity, targetFilter : function(Engine.Entity) : boolean, logType : string, cargoTypeId : CargoTypeId): integer +``` + +Get num cargo log per year + +**Parameters** + +* `sourceStockListEntity` :`Engine.Entity` β€” stock list entity +* `targetFilter` :`function(Engine.Entity): boolean` β€” filter function to filter target entities +* `logType` :`string` β€” the logbook type +* `cargoTypeId` :`CargoTypeId` β€” the cargo type + +**Returns** + +1. `integer` β€” num cargo shipped per year + +### UtilStock.getProductionRating[πŸ”—](#$api.engine.util~UtilStock.getProductionRating) + +``` +function UtilStock.getProductionRating(stockListEntity : Engine.Entity): number +``` + +Get stocklist production rating + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” list entity + +**Returns** + +1. `number` β€” production rating + +### UtilStock.getStockGroupsByTypeAndCargoTypes[πŸ”—](#$api.engine.util~UtilStock.getStockGroupsByTypeAndCargoTypes) + +``` +function UtilStock.getStockGroupsByTypeAndCargoTypes(stockListEntity : Engine.Entity, sortByType : boolean, showEmpty : boolean): {{StockListType, {StockId}, {CargoTypeId}, integer}} +``` + +Get stock groups by type and cargo types + +**Parameters** + +* `stockListEntity` :`Engine.Entity` β€” list entity +* `sortByType` :`boolean` β€” sort by type +* `showEmpty` :`boolean` β€” show empty groups + +**Returns** + +1. `{{StockListType, {StockId}, {CargoTypeId}, integer}}` β€” {StockListType, {StockId}, {CargoTypeId}, int} list of stock list type, stock ids, cargo types and count per group + +### UtilStock.getStockListsWithThrownAwayCargo[πŸ”—](#$api.engine.util~UtilStock.getStockListsWithThrownAwayCargo) + +``` +function UtilStock.getStockListsWithThrownAwayCargo(): {Engine.Entity : integer} +``` + +Get stock lists with thrown away cargo + +**Returns** + +1. `{Engine.Entity : integer}` β€” map of entity to amount thrown away + +### UtilStock.hasAnyCompatibleStock[πŸ”—](#$api.engine.util~UtilStock.hasAnyCompatibleStock) + +``` +function UtilStock.hasAnyCompatibleStock(entities : {Engine.Entity}, cargoTypeId : CargoTypeId, load : boolean): boolean +``` + +Check if any stock is compatible + +**Parameters** + +* `entities` :`{Engine.Entity}` β€” list of entities to check +* `cargoTypeId` :`CargoTypeId` β€” cargo type +* `load` :`boolean` β€” whether to check for loading/input (true) or unloading/output (false) + +**Returns** + +1. `boolean` β€” true if any stock is compatible + +### UtilStock.getAdjustedDeliveryTime[πŸ”—](#$api.engine.util~UtilStock.getAdjustedDeliveryTime) + +``` +function UtilStock.getAdjustedDeliveryTime(cargoTypeId : CargoTypeId): integer +``` + +Get adjusted delivery time + +**Parameters** + +* `cargoTypeId` :`CargoTypeId` β€” cargo type + +**Returns** + +1. `integer` β€” adjusted delivery time in seconds + +### UtilStock.isCargoTypeCurrentlyProduced[πŸ”—](#$api.engine.util~UtilStock.isCargoTypeCurrentlyProduced) + +``` +function UtilStock.isCargoTypeCurrentlyProduced(cargoTypeId : CargoTypeId): boolean +``` + +Check if cargo type is currently produced + +**Parameters** + +* `cargoTypeId` :`CargoTypeId` β€” cargo type + +**Returns** + +1. `boolean` β€” true if cargo type is currently produced + +### UtilTown[πŸ”—](#$api.engine.util~UtilTown) + +``` +[Expand All] [Collapse All] + +global record UtilTown record TownReachability commercialPrivate: integer + commercialPublic: integer + industrialPrivate: integer + industrialPublic: integer +end + record TownCapacityUsage used: integer + capacity: integer +end + record TownEmission noise: number + pollution: number + areaSquareKm: number +end + record DestinationUseCount count: integer + linesUseCount: integer +end + record TownHappinessStats record ByResident resident: {integer, integer} + nonResident: {integer, integer} +end + travellingInside: {integer, integer} + travellingTo: ByResident + travellingFrom: ByResident + atBuilding: {integer, integer} + byCar: {integer, integer} + walking: {integer, integer} + byLine: {{Engine.Entity, ByResident}} +end + computeWeightedTargetTownBuildingCapacityPerType: function(townEntity : Engine.Entity): {{integer, integer, integer, integer}} + computeUnweightedTargetTownBuildingCapacityPerType: function(townEntity : Engine.Entity): {{integer, integer, integer, integer}} + computeActualTownBuildingCapacityPerType: function(townEntity : Engine.Entity): {{integer, integer, integer, integer}} + getLandUse2CargoTypes: function(): {LandUseType : {CargoTypeId}} + getTownReachability: function(townEntity : Engine.Entity): TownReachability + getTownEmission: function(townEntity : Engine.Entity): TownEmission + getTownEmissionDB: function(townEntity : Engine.Entity): TownEmission + getTownCapacityUsage: function(townEntity : Engine.Entity): {TownCapacityUsage} + getTownHappinessStats: function(townEntity : Engine.Entity, numTopLines : integer): TownHappinessStats + getTownDeliveriesStats: function(townEntity : Engine.Entity, interval : integer, perLine : boolean, perCargoType : boolean): {Engine.Entity : {CargoTypeId : {integer, integer}}} + getTownStockCargo: function(townEntity : Engine.Entity): {CargoTypeId : {integer, integer}} + getTerrainBrushVolumeImpact: function(proposal : Proposal): {Engine.Entity : {number, number}} + getTerrainAlignmentImpact: function(proposalData : ProposalData): {Engine.Entity : {number, number}} + getAutoRemovalEntityImpact: function(proposalData : ProposalData): {Engine.Entity : {number, number}} + getTownNoisePerDistrict: function(townEntity : Engine.Entity, landUseTypes : {LandUseType}): {LandUseType : {number, integer}} + getImpactFromDistance: function(distance : number): number + computeTownsTrafficSpeedMap: function(samplesCoefficient : number): {Engine.Entity : {number, {integer}}} + getTownProblems: function(): {{{Engine.Entity}, TownProblem}} + isNeighbourTown: function(townEntity1 : Engine.Entity, townEntity2 : Engine.Entity): boolean + getClosestTown: function(position : Vec3f): Engine.Entity + getRandomTownPosition: function(townEntity : Engine.Entity, seed : integer): Vec2f + isLineStoppingInTown: function(lineEntity : Engine.Entity, townEntity : Engine.Entity): boolean + getTownLineUsage: function(townEntity : Engine.Entity): number + getSourceToDestinationCount: function(townEntitiy : Engine.Entity, destinationIsTownMap : {Engine.Entity : boolean}, selectLandUse : integer): {Engine.Entity : DestinationUseCount} + getTownDistrictCenter: function(entity : Engine.Entity, landUseTypes : LandUseType): Vec3f +end +``` + +### UtilTown.TownReachability[πŸ”—](#$api.engine.util~UtilTown.TownReachability) + +``` +record UtilTown.TownReachability commercialPrivate: integer + commercialPublic: integer + industrialPrivate: integer + industrialPublic: integer +end +``` + +### UtilTown.TownReachability.commercialPrivate[πŸ”—](#$api.engine.util~UtilTown.TownReachability.commercialPrivate) + +``` +UtilTown.TownReachability.commercialPrivate: integer +``` + +### UtilTown.TownReachability.commercialPublic[πŸ”—](#$api.engine.util~UtilTown.TownReachability.commercialPublic) + +``` +UtilTown.TownReachability.commercialPublic: integer +``` + +### UtilTown.TownReachability.industrialPrivate[πŸ”—](#$api.engine.util~UtilTown.TownReachability.industrialPrivate) + +``` +UtilTown.TownReachability.industrialPrivate: integer +``` + +### UtilTown.TownReachability.industrialPublic[πŸ”—](#$api.engine.util~UtilTown.TownReachability.industrialPublic) + +``` +UtilTown.TownReachability.industrialPublic: integer +``` + +### UtilTown.TownCapacityUsage[πŸ”—](#$api.engine.util~UtilTown.TownCapacityUsage) + +``` +record UtilTown.TownCapacityUsage used: integer + capacity: integer +end +``` + +### UtilTown.TownCapacityUsage.used[πŸ”—](#$api.engine.util~UtilTown.TownCapacityUsage.used) + +``` +UtilTown.TownCapacityUsage.used: integer +``` + +### UtilTown.TownCapacityUsage.capacity[πŸ”—](#$api.engine.util~UtilTown.TownCapacityUsage.capacity) + +``` +UtilTown.TownCapacityUsage.capacity: integer +``` + +### UtilTown.TownEmission[πŸ”—](#$api.engine.util~UtilTown.TownEmission) + +``` +record UtilTown.TownEmission noise: number + pollution: number + areaSquareKm: number +end +``` + +### UtilTown.TownEmission.noise[πŸ”—](#$api.engine.util~UtilTown.TownEmission.noise) + +``` +UtilTown.TownEmission.noise: number +``` + +### UtilTown.TownEmission.pollution[πŸ”—](#$api.engine.util~UtilTown.TownEmission.pollution) + +``` +UtilTown.TownEmission.pollution: number +``` + +### UtilTown.TownEmission.areaSquareKm[πŸ”—](#$api.engine.util~UtilTown.TownEmission.areaSquareKm) + +``` +UtilTown.TownEmission.areaSquareKm: number +``` + +### UtilTown.DestinationUseCount[πŸ”—](#$api.engine.util~UtilTown.DestinationUseCount) + +``` +record UtilTown.DestinationUseCount count: integer + linesUseCount: integer +end +``` + +### UtilTown.DestinationUseCount.count[πŸ”—](#$api.engine.util~UtilTown.DestinationUseCount.count) + +``` +UtilTown.DestinationUseCount.count: integer +``` + +### UtilTown.DestinationUseCount.linesUseCount[πŸ”—](#$api.engine.util~UtilTown.DestinationUseCount.linesUseCount) + +``` +UtilTown.DestinationUseCount.linesUseCount: integer +``` + +### UtilTown.TownHappinessStats[πŸ”—](#$api.engine.util~UtilTown.TownHappinessStats) + +``` +[Expand All] [Collapse All] + +record UtilTown.TownHappinessStats record ByResident resident: {integer, integer} + nonResident: {integer, integer} +end + travellingInside: {integer, integer} + travellingTo: ByResident + travellingFrom: ByResident + atBuilding: {integer, integer} + byCar: {integer, integer} + walking: {integer, integer} + byLine: {{Engine.Entity, ByResident}} +end +``` + +### UtilTown.TownHappinessStats.ByResident[πŸ”—](#$api.engine.util~UtilTown.TownHappinessStats.ByResident) + +``` +record UtilTown.TownHappinessStats.ByResident resident: {integer, integer} + nonResident: {integer, integer} +end +``` + +### UtilTown.TownHappinessStats.ByResident.resident[πŸ”—](#$api.engine.util~UtilTown.TownHappinessStats.ByResident.resident) + +``` +UtilTown.TownHappinessStats.ByResident.resident: {integer, integer} +``` + +### UtilTown.TownHappinessStats.ByResident.nonResident[πŸ”—](#$api.engine.util~UtilTown.TownHappinessStats.ByResident.nonResident) + +``` +UtilTown.TownHappinessStats.ByResident.nonResident: {integer, integer} +``` + +### UtilTown.TownHappinessStats.travellingInside[πŸ”—](#$api.engine.util~UtilTown.TownHappinessStats.travellingInside) + +``` +UtilTown.TownHappinessStats.travellingInside: {integer, integer} +``` + +### UtilTown.TownHappinessStats.travellingTo[πŸ”—](#$api.engine.util~UtilTown.TownHappinessStats.travellingTo) + +``` +UtilTown.TownHappinessStats.travellingTo: ByResident +``` + +### UtilTown.TownHappinessStats.travellingFrom[πŸ”—](#$api.engine.util~UtilTown.TownHappinessStats.travellingFrom) + +``` +UtilTown.TownHappinessStats.travellingFrom: ByResident +``` + +### UtilTown.TownHappinessStats.atBuilding[πŸ”—](#$api.engine.util~UtilTown.TownHappinessStats.atBuilding) + +``` +UtilTown.TownHappinessStats.atBuilding: {integer, integer} +``` + +### UtilTown.TownHappinessStats.byCar[πŸ”—](#$api.engine.util~UtilTown.TownHappinessStats.byCar) + +``` +UtilTown.TownHappinessStats.byCar: {integer, integer} +``` + +### UtilTown.TownHappinessStats.walking[πŸ”—](#$api.engine.util~UtilTown.TownHappinessStats.walking) + +``` +UtilTown.TownHappinessStats.walking: {integer, integer} +``` + +### UtilTown.TownHappinessStats.byLine[πŸ”—](#$api.engine.util~UtilTown.TownHappinessStats.byLine) + +``` +UtilTown.TownHappinessStats.byLine: {{Engine.Entity, ByResident}} +``` + +### UtilTown.computeWeightedTargetTownBuildingCapacityPerType[πŸ”—](#$api.engine.util~UtilTown.computeWeightedTargetTownBuildingCapacityPerType) + +``` +function UtilTown.computeWeightedTargetTownBuildingCapacityPerType(townEntity : Engine.Entity): {{integer, integer, integer, integer}} +``` + +Get weighted target level to capacities distribution for each land use type for the town + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” town entity + +**Returns** + +1. `{{integer, integer, integer, integer}}` β€” level to capacities distribution + +### UtilTown.computeUnweightedTargetTownBuildingCapacityPerType[πŸ”—](#$api.engine.util~UtilTown.computeUnweightedTargetTownBuildingCapacityPerType) + +``` +function UtilTown.computeUnweightedTargetTownBuildingCapacityPerType(townEntity : Engine.Entity): {{integer, integer, integer, integer}} +``` + +Get unweighted target level to capacities distribution for each land use type for the town + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” town entity + +**Returns** + +1. `{{integer, integer, integer, integer}}` β€” level to capacities distribution + +### UtilTown.computeActualTownBuildingCapacityPerType[πŸ”—](#$api.engine.util~UtilTown.computeActualTownBuildingCapacityPerType) + +``` +function UtilTown.computeActualTownBuildingCapacityPerType(townEntity : Engine.Entity): {{integer, integer, integer, integer}} +``` + +Get actual level to capacities distribution for each land use type for the town + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” town entity + +**Returns** + +1. `{{integer, integer, integer, integer}}` β€” level to capacities distribution + +### UtilTown.getLandUse2CargoTypes[πŸ”—](#$api.engine.util~UtilTown.getLandUse2CargoTypes) + +``` +function UtilTown.getLandUse2CargoTypes(): {LandUseType : {CargoTypeId}} +``` + +Get town available cargo needs + +**Returns** + +1. `{LandUseType : {CargoTypeId}}` β€” map of land use to cargo types + +### UtilTown.getTownReachability[πŸ”—](#$api.engine.util~UtilTown.getTownReachability) + +``` +function UtilTown.getTownReachability(townEntity : Engine.Entity): TownReachability +``` + +Get town reachability + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” town entity + +**Returns** + +1. `TownReachability` β€” reachability data + +### UtilTown.getTownEmission[πŸ”—](#$api.engine.util~UtilTown.getTownEmission) + +``` +function UtilTown.getTownEmission(townEntity : Engine.Entity): TownEmission +``` + +Get town emission in power + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” town entity + +**Returns** + +1. `TownEmission` β€” emission data in power + +### UtilTown.getTownEmissionDB[πŸ”—](#$api.engine.util~UtilTown.getTownEmissionDB) + +``` +function UtilTown.getTownEmissionDB(townEntity : Engine.Entity): TownEmission +``` + +Get town emission in decibel + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” town entity + +**Returns** + +1. `TownEmission` β€” emission data in decibel + +### UtilTown.getTownCapacityUsage[πŸ”—](#$api.engine.util~UtilTown.getTownCapacityUsage) + +``` +function UtilTown.getTownCapacityUsage(townEntity : Engine.Entity): {TownCapacityUsage} +``` + +Get town capacity usage + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” town entity + +**Returns** + +1. `{TownCapacityUsage}` β€” capacity usage per land use type + +### UtilTown.getTownHappinessStats[πŸ”—](#$api.engine.util~UtilTown.getTownHappinessStats) + +``` +function UtilTown.getTownHappinessStats(townEntity : Engine.Entity, numTopLines : integer): TownHappinessStats +``` + +Get number of unhappy people travelling by lines to or from the town + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” town entity +* `numTopLines` :`integer` β€” number of top lines to consider for the stat + +**Returns** + +1. `TownHappinessStats` β€” number of unhappy and total people travelling by lines + +### UtilTown.getTownDeliveriesStats[πŸ”—](#$api.engine.util~UtilTown.getTownDeliveriesStats) + +``` +function UtilTown.getTownDeliveriesStats(townEntity : Engine.Entity, interval : integer, perLine : boolean, perCargoType : boolean): {Engine.Entity : {CargoTypeId : {integer, integer}}} +``` + +Get town cargo deliveries stats + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” town entity +* `interval` :`integer` β€” time interval in miliseconds for the stats +* `perLine` :`boolean` β€” whether to get stats per line +* `perCargoType` :`boolean` β€” whether to get stats per cargo type + +**Returns** + +1. `{Engine.Entity : {CargoTypeId : {integer, integer}}}` β€” delivery stats + +### UtilTown.getTownStockCargo[πŸ”—](#$api.engine.util~UtilTown.getTownStockCargo) + +``` +function UtilTown.getTownStockCargo(townEntity : Engine.Entity): {CargoTypeId : {integer, integer}} +``` + +Obtains information about towns and cargo + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” the entity of the town + +**Returns** + +1. `{CargoTypeId : {integer, integer}}` β€” map of cargo type to stock and capacity + +### UtilTown.getTerrainBrushVolumeImpact[πŸ”—](#$api.engine.util~UtilTown.getTerrainBrushVolumeImpact) + +``` +function UtilTown.getTerrainBrushVolumeImpact(proposal : Proposal): {Engine.Entity : {number, number}} +``` + +Get the impact of using terrain brush on towns reputation + +**Parameters** + +* `proposal` :`Proposal` β€” the terrain change proposal + +**Returns** + +1. `{Engine.Entity : {number, number}}` β€” the impact change for volume added and volume removed for each town + +### UtilTown.getTerrainAlignmentImpact[πŸ”—](#$api.engine.util~UtilTown.getTerrainAlignmentImpact) + +``` +function UtilTown.getTerrainAlignmentImpact(proposalData : ProposalData): {Engine.Entity : {number, number}} +``` + +Get the terrain alignment impact on towns reputation + +**Parameters** + +* `proposalData` :`ProposalData` β€” the proposal data + +**Returns** + +1. `{Engine.Entity : {number, number}}` β€” the impact change for volume added and volume removed for each town + +### UtilTown.getAutoRemovalEntityImpact[πŸ”—](#$api.engine.util~UtilTown.getAutoRemovalEntityImpact) + +``` +function UtilTown.getAutoRemovalEntityImpact(proposalData : ProposalData): {Engine.Entity : {number, number}} +``` + +Get the impact from auto removal of trees and rocks on towns reputation + +**Parameters** + +* `proposalData` :`ProposalData` β€” the proposal data + +**Returns** + +1. `{Engine.Entity : {number, number}}` β€” the impact change for removed trees and rocks for each town + +### UtilTown.getTownNoisePerDistrict[πŸ”—](#$api.engine.util~UtilTown.getTownNoisePerDistrict) + +``` +function UtilTown.getTownNoisePerDistrict(townEntity : Engine.Entity, landUseTypes : {LandUseType}): {LandUseType : {number, integer}} +``` + +Get town noise per district + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” town entity +* `landUseTypes` :`{LandUseType}` β€” land use types to check + +**Returns** + +1. `{LandUseType : {number, integer}}` β€” average noise and affected capacity per district + +### UtilTown.getImpactFromDistance[πŸ”—](#$api.engine.util~UtilTown.getImpactFromDistance) + +``` +function UtilTown.getImpactFromDistance(distance : number): number +``` + +Get the impact for reputation the distance has for towns + +**Parameters** + +* `distance` :`number` β€” distance value + +**Returns** + +1. `number` β€” the impact from the distance + +### UtilTown.computeTownsTrafficSpeedMap[πŸ”—](#$api.engine.util~UtilTown.computeTownsTrafficSpeedMap) + +``` +function UtilTown.computeTownsTrafficSpeedMap(samplesCoefficient : number): {Engine.Entity : {number, {integer}}} +``` + +Get traffic speed for all towns + +**Parameters** + +* `samplesCoefficient` :`number` β€” coefficient to adjust the number of samples of streets used for traffic rating calculation + +**Returns** + +1. `{Engine.Entity : {number, {integer}}}` β€” traffic speed and number of streets per congestion level + +### UtilTown.getTownProblems[πŸ”—](#$api.engine.util~UtilTown.getTownProblems) + +``` +function UtilTown.getTownProblems(): {{{Engine.Entity}, TownProblem}} +``` + +Get towns with problems + +**Returns** + +1. `{{{Engine.Entity}, TownProblem}}` β€” town entity and problem + +### UtilTown.isNeighbourTown[πŸ”—](#$api.engine.util~UtilTown.isNeighbourTown) + +``` +function UtilTown.isNeighbourTown(townEntity1 : Engine.Entity, townEntity2 : Engine.Entity): boolean +``` + +Check if town is neighbor town + +**Parameters** + +* `townEntity1` :`Engine.Entity` β€” town entity +* `townEntity2` :`Engine.Entity` β€” town entity + +**Returns** + +1. `boolean` β€” whether town is neighbor + +### UtilTown.getClosestTown[πŸ”—](#$api.engine.util~UtilTown.getClosestTown) + +``` +function UtilTown.getClosestTown(position : Vec3f): Engine.Entity +``` + +Get closest town to position + +**Parameters** + +* `position` :`Vec3f` β€” world position + +**Returns** + +1. `Engine.Entity` β€” closest town entity + +### UtilTown.getRandomTownPosition[πŸ”—](#$api.engine.util~UtilTown.getRandomTownPosition) + +``` +function UtilTown.getRandomTownPosition(townEntity : Engine.Entity, seed : integer): Vec2f +``` + +Get a random 2d point inside the voronoi cell of the town + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” the town in which to search +* `seed` :`integer` β€” a random seed for the generation + +**Returns** + +1. `Vec2f` β€” a point inside the town voronoi cell + +### UtilTown.isLineStoppingInTown[πŸ”—](#$api.engine.util~UtilTown.isLineStoppingInTown) + +``` +function UtilTown.isLineStoppingInTown(lineEntity : Engine.Entity, townEntity : Engine.Entity): boolean +``` + +Check if Line has at least 1 stop in the town's area + +**Parameters** + +* `lineEntity` :`Engine.Entity` β€” line entity +* `townEntity` :`Engine.Entity` β€” town entity + +**Returns** + +1. `boolean` β€” whether line stops in town + +### UtilTown.getTownLineUsage[πŸ”—](#$api.engine.util~UtilTown.getTownLineUsage) + +``` +function UtilTown.getTownLineUsage(townEntity : Engine.Entity): number +``` + +Get town line usage + +**Parameters** + +* `townEntity` :`Engine.Entity` β€” town entity + +**Returns** + +1. `number` β€” fraction of people using lines in the town + +### UtilTown.getSourceToDestinationCount[πŸ”—](#$api.engine.util~UtilTown.getSourceToDestinationCount) + +``` +function UtilTown.getSourceToDestinationCount(townEntitiy : Engine.Entity, destinationIsTownMap : {Engine.Entity : boolean}, selectLandUse : integer): {Engine.Entity : DestinationUseCount} +``` + +Get town destinations table content (work, shop and line usage info) + +**Parameters** + +* `townEntitiy` :`Engine.Entity` β€” town entity +* `destinationIsTownMap` :`{Engine.Entity : boolean}` β€” map of entity to isTown (destinations of town) +* `selectLandUse` :`integer` β€” 0 (Usage), 1 (Shopping), 2 (Work) + +**Returns** + +1. `{Engine.Entity : DestinationUseCount}` β€” destination use counts + +### UtilTown.getTownDistrictCenter[πŸ”—](#$api.engine.util~UtilTown.getTownDistrictCenter) + +``` +function UtilTown.getTownDistrictCenter(entity : Engine.Entity, landUseTypes : LandUseType): Vec3f +``` + +Get the district center of the town entity + +**Parameters** + +* `entity` :`Engine.Entity` β€” town entity +* `landUseTypes` :`LandUseType` β€” land use types to check + +**Returns** + +1. `Vec3f` β€” destination use counts + +### UtilTransport[πŸ”—](#$api.engine.util~UtilTransport) + +``` +global record UtilTransport calcPosition: function(eg : EdgeGeometry, t : number): Vec3f + calcPositionAndDirection: function(eg : EdgeGeometry, t : number, forward : boolean): {Vec3f} + transportModesToCarriers: function(transportModes : {TransportMode}): {Carrier} + getStartPort: function(edge : {EdgeId, boolean}): PortId + getEndPort: function(edge : {EdgeId, boolean}): PortId + isPortLocked: function(port : integer): boolean +end +``` + +### UtilTransport.calcPosition[πŸ”—](#$api.engine.util~UtilTransport.calcPosition) + +``` +function UtilTransport.calcPosition(eg : EdgeGeometry, t : number): Vec3f +``` + +Calc position along a transport edge. + +**Parameters** + +* `eg` :`EdgeGeometry` β€” edge geometry +* `t` :`number` β€” progress along the edge [ 0, 1] + +**Returns** + +1. `Vec3f` β€” position on the edge + +### UtilTransport.calcPositionAndDirection[πŸ”—](#$api.engine.util~UtilTransport.calcPositionAndDirection) + +``` +function UtilTransport.calcPositionAndDirection(eg : EdgeGeometry, t : number, forward : boolean): {Vec3f} +``` + +Calc position along a transport edge. + +**Parameters** + +* `eg` :`EdgeGeometry` β€” edge geometry +* `t` :`number` β€” progress along the edge [ 0, 1] +* `forward` :`boolean` β€” optional bool (forward or backward t -> t - 1.0) + +**Returns** + +1. `{Vec3f}` β€” position on the edge and direction + +### UtilTransport.transportModesToCarriers[πŸ”—](#$api.engine.util~UtilTransport.transportModesToCarriers) + +``` +function UtilTransport.transportModesToCarriers(transportModes : {TransportMode}): {Carrier} +``` + +Transform list of transport modes to a vector of carriers. + +**Parameters** + +* `transportModes` :`{TransportMode}` β€” list of transport modes + +**Returns** + +1. `{Carrier}` β€” carriers for a given set of transport modes + +### UtilTransport.getStartPort[πŸ”—](#$api.engine.util~UtilTransport.getStartPort) + +``` +function UtilTransport.getStartPort(edge : {EdgeId, boolean}): PortId +``` + +Obtains the start connection of this edge. + +**Parameters** + +* `edge` :`{EdgeId, boolean}` β€” the edge with direction + +**Returns** + +1. `PortId` β€” PortId at the edge's start + +### UtilTransport.getEndPort[πŸ”—](#$api.engine.util~UtilTransport.getEndPort) + +``` +function UtilTransport.getEndPort(edge : {EdgeId, boolean}): PortId +``` + +Obtains the end connection of this edge. + +**Parameters** + +* `edge` :`{EdgeId, boolean}` β€” the edge with direction + +**Returns** + +1. `PortId` β€” PortId at the edge's end + +### UtilTransport.isPortLocked[πŸ”—](#$api.engine.util~UtilTransport.isPortLocked) + +``` +function UtilTransport.isPortLocked(port : integer): boolean +``` + +Check if a port is locked. + +**Parameters** + +* `port` :`integer` β€” the port + +**Returns** + +1. `boolean` β€” true if the port is locked, false otherwise + +### UtilVehicle[πŸ”—](#$api.engine.util~UtilVehicle) + +``` +global record UtilVehicle findBestLineAndDepotForVehicle: function(vehicleEntity : Engine.Entity): {Engine.Entity, Engine.Entity} + findBestDepotForLine: function(carrier : Carrier, transportModes : {TransportMode}, lineEntity : Engine.Entity, position : Vec3f): Engine.Entity + getSpeed: function(vehicleEntity : Engine.Entity): number + getPosition: function(vehicleEntity : Engine.Entity): Vec3f + calcPathPosData: function(vehicleEntity : Engine.Entity): PathPosData + getDirection: function(vehicleEntity : Engine.Entity): Vec3f + getVehiclesByCarrier: function(carrier : Carrier): {Engine.Entity} + getVehicles: function(): {Engine.Entity} + getRunningCost: function(vehicleEntity : Engine.Entity): number + getDepreciatedValue: function(vehicleEntity : Engine.Entity): integer + getPartPrice: function(part : TransportVehiclePart): integer + getLength: function(modelAsset : Model): number + getAllCargoForCargoTypeSet: function(cargoTypeSet : CargoTypeSet): {CargoTypeId} + getVehicleLoadedCargoTypes: function(vehicleEntity : Engine.Entity): {CargoTypeId} + getVehicleProblems: function(): {{{Engine.Entity}, VehicleProblem}} + getMaintenanceEmissionPenalty: function(maintenanceState : number): number + getMaintenanceComfortPenalty: function(maintenanceState : number): number + getMaintenanceTopSpeedPenalty: function(topSpeedMaintenanceFactorPenaltyPerLevel : number, maintenanceState : number): number + getMaintenanceRunningCostPenalty: function(maintenanceState : number): number + getVehicleType: function(vehicleEntity : Engine.Entity): integer + getVehicleCapacities: function(vehicleEntity : Engine.Entity): {integer} + getVehicleUnsetCapacities: function(vehicleEntity : Engine.Entity): {{integer}} +end +``` + +### UtilVehicle.findBestLineAndDepotForVehicle[πŸ”—](#$api.engine.util~UtilVehicle.findBestLineAndDepotForVehicle) + +``` +function UtilVehicle.findBestLineAndDepotForVehicle(vehicleEntity : Engine.Entity): {Engine.Entity, Engine.Entity} +``` + +Searches the best line and depot for the vehicle + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” the vehicle for which to search the best line and depot + +**Returns** + +1. `{Engine.Entity, Engine.Entity}` β€” line and depot entities, if found + +### UtilVehicle.findBestDepotForLine[πŸ”—](#$api.engine.util~UtilVehicle.findBestDepotForLine) + +``` +function UtilVehicle.findBestDepotForLine(carrier : Carrier, transportModes : {TransportMode}, lineEntity : Engine.Entity, position : Vec3f): Engine.Entity +``` + +Searches the best depot for the line or position (in case of air vehicles) + +**Parameters** + +* `carrier` :`Carrier` β€” the carrier to search for +* `transportModes` :`{TransportMode}` β€” the transport modes to check for connectivity +* `lineEntity` :`Engine.Entity` β€” the line to search the depot for +* `position` :`Vec3f` β€” the position from which to search (air/water vehicles only) + +**Returns** + +1. `Engine.Entity` β€” best depot, if any + +### UtilVehicle.getSpeed[πŸ”—](#$api.engine.util~UtilVehicle.getSpeed) + +``` +function UtilVehicle.getSpeed(vehicleEntity : Engine.Entity): number +``` + +Get speed of the vehicle + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity + +**Returns** + +1. `number` β€” speed + +### UtilVehicle.getPosition[πŸ”—](#$api.engine.util~UtilVehicle.getPosition) + +``` +function UtilVehicle.getPosition(vehicleEntity : Engine.Entity): Vec3f +``` + +Get the position of the vehicle + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity + +**Returns** + +1. `Vec3f` β€” world position + +### UtilVehicle.calcPathPosData[πŸ”—](#$api.engine.util~UtilVehicle.calcPathPosData) + +``` +function UtilVehicle.calcPathPosData(vehicleEntity : Engine.Entity): PathPosData +``` + +Get the position, direction and curvature of the vehicle + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity + +**Returns** + +1. `PathPosData` β€” position and direction information for the vehicle + +### UtilVehicle.getDirection[πŸ”—](#$api.engine.util~UtilVehicle.getDirection) + +``` +function UtilVehicle.getDirection(vehicleEntity : Engine.Entity): Vec3f +``` + +Get the direction of the vehicle + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity + +**Returns** + +1. `Vec3f` β€” direction + +### UtilVehicle.getVehiclesByCarrier[πŸ”—](#$api.engine.util~UtilVehicle.getVehiclesByCarrier) + +``` +function UtilVehicle.getVehiclesByCarrier(carrier : Carrier): {Engine.Entity} +``` + +Gets all vehicles using by a given carrier + +**Parameters** + +* `carrier` :`Carrier` β€” kind of carrier + +**Returns** + +1. `{Engine.Entity}` β€” list of vehicle entities + +### UtilVehicle.getVehicles[πŸ”—](#$api.engine.util~UtilVehicle.getVehicles) + +``` +function UtilVehicle.getVehicles(): {Engine.Entity} +``` + +Gets all vehicles + +**Returns** + +1. `{Engine.Entity}` β€” list of vehicle entities + +### UtilVehicle.getRunningCost[πŸ”—](#$api.engine.util~UtilVehicle.getRunningCost) + +``` +function UtilVehicle.getRunningCost(vehicleEntity : Engine.Entity): number +``` + +Get running cost of the vehicle per year + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity + +**Returns** + +1. `number` β€” running cost + +### UtilVehicle.getDepreciatedValue[πŸ”—](#$api.engine.util~UtilVehicle.getDepreciatedValue) + +``` +function UtilVehicle.getDepreciatedValue(vehicleEntity : Engine.Entity): integer +``` + +Get vehicle depreciated value + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity + +**Returns** + +1. `integer` β€” depreciated value + +### UtilVehicle.getPartPrice[πŸ”—](#$api.engine.util~UtilVehicle.getPartPrice) + +``` +function UtilVehicle.getPartPrice(part : TransportVehiclePart): integer +``` + +Get vehicle part value + +**Parameters** + +* `part` :`TransportVehiclePart` β€” transport vehicle part + +**Returns** + +1. `integer` β€” value + +### UtilVehicle.getLength[πŸ”—](#$api.engine.util~UtilVehicle.getLength) + +``` +function UtilVehicle.getLength(modelAsset : Model): number +``` + +Get length of the vehicle model + +**Parameters** + +* `modelAsset` :`Model` β€” model asset + +**Returns** + +1. `number` β€” length + +### UtilVehicle.getAllCargoForCargoTypeSet[πŸ”—](#$api.engine.util~UtilVehicle.getAllCargoForCargoTypeSet) + +``` +function UtilVehicle.getAllCargoForCargoTypeSet(cargoTypeSet : CargoTypeSet): {CargoTypeId} +``` + +Get cargo in CargoTypeSet + +**Parameters** + +* `cargoTypeSet` :`CargoTypeSet` β€” cargo type set + +**Returns** + +1. `{CargoTypeId}` β€” CargoTypeId in the set + +### UtilVehicle.getVehicleLoadedCargoTypes[πŸ”—](#$api.engine.util~UtilVehicle.getVehicleLoadedCargoTypes) + +``` +function UtilVehicle.getVehicleLoadedCargoTypes(vehicleEntity : Engine.Entity): {CargoTypeId} +``` + +Get list of cargo types loaded in the vehicle + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity + +**Returns** + +1. `{CargoTypeId}` β€” list of cargo types loaded in the vehicle + +### UtilVehicle.getVehicleProblems[πŸ”—](#$api.engine.util~UtilVehicle.getVehicleProblems) + +``` +function UtilVehicle.getVehicleProblems(): {{{Engine.Entity}, VehicleProblem}} +``` + +Get vehicles with problems + +**Returns** + +1. `{{{Engine.Entity}, VehicleProblem}}` β€” vehicle entity and problem + +### UtilVehicle.getMaintenanceEmissionPenalty[πŸ”—](#$api.engine.util~UtilVehicle.getMaintenanceEmissionPenalty) + +``` +function UtilVehicle.getMaintenanceEmissionPenalty(maintenanceState : number): number +``` + +Get vehicle emission penalty in percent + +**Parameters** + +* `maintenanceState` :`number` β€” maintenance state + +**Returns** + +1. `number` β€” emission penalty in percent + +### UtilVehicle.getMaintenanceComfortPenalty[πŸ”—](#$api.engine.util~UtilVehicle.getMaintenanceComfortPenalty) + +``` +function UtilVehicle.getMaintenanceComfortPenalty(maintenanceState : number): number +``` + +Get vehicle comfort penalty in percent + +**Parameters** + +* `maintenanceState` :`number` β€” maintenance state + +**Returns** + +1. `number` β€” comfort penalty in percent + +### UtilVehicle.getMaintenanceTopSpeedPenalty[πŸ”—](#$api.engine.util~UtilVehicle.getMaintenanceTopSpeedPenalty) + +``` +function UtilVehicle.getMaintenanceTopSpeedPenalty(topSpeedMaintenanceFactorPenaltyPerLevel : number, maintenanceState : number): number +``` + +Get vehicle top speed penalty in percent + +**Parameters** + +* `topSpeedMaintenanceFactorPenaltyPerLevel` :`number` β€” penalty factor per level +* `maintenanceState` :`number` β€” maintenance state + +**Returns** + +1. `number` β€” top speed penalty in percent + +### UtilVehicle.getMaintenanceRunningCostPenalty[πŸ”—](#$api.engine.util~UtilVehicle.getMaintenanceRunningCostPenalty) + +``` +function UtilVehicle.getMaintenanceRunningCostPenalty(maintenanceState : number): number +``` + +Get vehicle running cost penalty in percent + +**Parameters** + +* `maintenanceState` :`number` β€” maintenance state + +**Returns** + +1. `number` β€” running cost penalty in percent + +### UtilVehicle.getVehicleType[πŸ”—](#$api.engine.util~UtilVehicle.getVehicleType) + +``` +function UtilVehicle.getVehicleType(vehicleEntity : Engine.Entity): integer +``` + +Get the vehicle's type + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity + +**Returns** + +1. `integer` β€” vehicle type + +### UtilVehicle.getVehicleCapacities[πŸ”—](#$api.engine.util~UtilVehicle.getVehicleCapacities) + +``` +function UtilVehicle.getVehicleCapacities(vehicleEntity : Engine.Entity): {integer} +``` + +Get vehicle capacities + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity + +**Returns** + +1. `{integer}` β€” vehicle capacities + +### UtilVehicle.getVehicleUnsetCapacities[πŸ”—](#$api.engine.util~UtilVehicle.getVehicleUnsetCapacities) + +``` +function UtilVehicle.getVehicleUnsetCapacities(vehicleEntity : Engine.Entity): {{integer}} +``` + +Get vehicle unset capacities + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” vehicle entity + +**Returns** + +1. `{{integer}}` β€” vehicle unset capacities for each unset capacity diff --git a/docs/reference/script-doc/api_gui.md b/docs/reference/script-doc/api_gui.md new file mode 100644 index 0000000..5dca1f2 --- /dev/null +++ b/docs/reference/script-doc/api_gui.md @@ -0,0 +1,4654 @@ + + +[index](../index.html) / [api](../api.html) / gui + +--- + +# Module api.gui[πŸ”—](#api.gui) + +Contains all GUI functionality apart from react. + +``` +[Expand All] [Collapse All] + +global record Gui fireReactEvent: function(name : string, param : any) + fireGuiScriptEvent: function(id : string, name : string, param : any): any + record HighlightStyle Square: HighlightStyle + Circle: HighlightStyle +end + record SpawnHudImageParams iconPath: FilePath + color: Vec4f + entity: Engine.Entity + position: Vec3f +end + spawnEphemeralHudImage: function(iconPath : FilePath, entity : Engine.Entity, color : Vec4f, position : Vec3f, overrideDuration : number, fadeIn : boolean, fadeOut : boolean, rev0 : integer) + spawnEphemeralHudImageOnPath: function(iconPath : FilePath, pos0 : Vec3f, pos1 : Vec3f, pos0 : Vec3f, pos1 : Vec3f, speed : number, scale : number, maxDistance : number) + closeAllWindows: function() + record SelectionDetails new: function(): SelectionDetails + + record Type None: Type + Line: Type + Station: Type + Signal: Type + Stop: Type + Waypoint: Type + TransportNetworkEdge: Type + World: Type + Marker: Type + Town: Type +end + interface DataType kind: Type +end + record Line line: Engine.Entity + stop: integer + waypoint: integer +end + record Station new: function(): Station + stationGroup: Engine.Entity + flatStationTerminalIndex: integer + stationTerminal: StationTerminal +end + record Signal signalList: Engine.Entity + signalIndex: integer +end + record Stop new: function(): Stop + station: SelectionDetails.Station + line: Engine.Entity + stopIndex: integer +end + record Waypoint line: Engine.Entity + stopIndex: integer + waypointIndex: integer + tag: integer +end + record TransportNetworkEdge new: function(): TransportNetworkEdge + snap: EdgePos +end + record World new: function(): World + pos: Vec3f + water: boolean +end + record Marker new: function(): Marker + marker: string + fireSelectEntity: boolean + pos: Vec3f + entity: Engine.Entity +end + record Town new: function(): Town + townEntity: Engine.Entity + districtType: LandUseType + districtCenter: Vec3f +end + data: DataType +end + record WorldEvent pos: {number, number, number} + water: boolean +end + record Mouse record Event record Type Pressed: Type + Released: Type + Clicked: Type + Entered: Type + Exited: Type + Moved: Type + Wheel: Type + DoubleClicked: Type + PressedOutside: Type +end + type: Type + button: integer + x: integer + y: integer + xrel: integer + yrel: integer + handled: boolean +end + getTerrainPosition: function(): Vec3f + hasTerrainPosition: function(): boolean +end + record Key record State Up: State + Pressed: State +end + record InputEvent dir: State + repeated: boolean + isGamepadEvent: function(InputEvent): boolean + isKeyboardEvent: function(InputEvent): boolean + getKey: function(InputEvent): integer + getKeyMod: function(InputEvent): integer +end + record Event data: InputEvent + isPressed: function(Event): boolean +end +end + record DataTransferItem new: function(ResName, any): DataTransferItem + type: ResName + data: any +end + record DnD record Event record Type Drop: Type + DragStarted: Type + DragEntered: Type + DragExited: Type +end + type: Type +end + setCursor: function(cursor : integer) + addTransferData: function(dragStartEvent : Event, item : DataTransferItem) + getAllTransferData: function(): {DataTransferItem} +end + record InputAction record InputActionState Disabled: InputActionState + Inactive: InputActionState + Enabled: InputActionState +end + record InvokeData record Status Triggered: Status + Repeat: Status + PressedStep: Status + EndReleased: Status + EndAborted: Status +end + status: Status +end + modifierOnlyActionIsActive: function(inputActionId : string): boolean + hasConflicts: function(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): string + findDuplicatesOf: function(inputActionId : string): {string} + getFixedKeyCmdDefs: function(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): {string : {KeyComboDef}} +end + record ById setVisibilityByClass: function(idOrTag : string, visible : boolean, idOnly : boolean) + setEnabled: function(idOrTag : string, enabled : boolean, idOnly : boolean) + setHighlighted: function(idOrTag : string, highlighted : boolean, style : HighlightStyle, color : Vec3f, idOnly : boolean) + isVisible: function(id : string): boolean + isVisibleRecursive: function(id : string): boolean + setVisible: function(id : string, visible : boolean) + resetMovedWindowPosition: function(id : string) + getSize: function(id : string): Vec2f +end + record Camera setManualCamera: function(center : Vec2f, distance : number) + getCameraData: function(): Vec5f + setCameraData: function(Vec5f : Vec5f) + getHeightAboveTerrain: function(): number + focusEntity: function(entity : Engine.Entity) + focusPosition: function(position : Vec3f, distance : number) + takeScreenshot: function(scale : integer) + getFollowEntity: function(): {Engine.Entity, Engine.Revision} + followEntity: function(entity : Engine.Entity, jump : boolean) + enterFollowCameraCockpit: function(entity : Engine.Entity) + leaveFollowCameraCockpit: function() + isFreeCameraMouseAttached: function(): boolean + toggleFreeCameraMouseAttachment: function() + toggleFreeCamera: function() + world2Screen: function(Vec3f): Vec2i + screen2World: function(Vec3f): Vec3f + getEye: function(): Vec3f + getCenter: function(): Vec3f + getNearFar: function(): Vec2f + getSize: function(): Vec2i + traceToTerrain: function(worldPos : Vec3f, farPos : Vec3f, zOffset : number, numSteps : integer): Vec3f | nil +end + record Sound letVehicleHorn: function(vehicleEntity : Engine.Entity) + playRandomSoundEffect: function(paths : {FilePath}) +end + record MusicPlayer goBack: function() + goForward: function() + togglePause: function() + getTitle: function(): string + getArtist: function(): string + hasPlaylist: function(): boolean + getPlaylistIndex: function(): integer + setTrackListFromPlayList: function(playlist : string, startPaused : boolean, offset : number) + setPlaylist: function(playlist : string) + getPlaylist: function(): string + isPlaying: function(): boolean + playTrack: function(trackName : string, offset : number) + playTrackFile: function(filePath : string, offset : number) + getTrackLength: function(): number + getTrackElapsedTime: function(): number + getGain: function(): number + setGain: function(gain : number) + setTrackList: function(trackList : {{string, string, boolean}}, enableRepeat : boolean) + addTrackList: function(trackList : {{string, string, boolean}}, enableRepeat : boolean) + setContextTag: function(contextTag : string) +end + record VoiceOverManager stop: function() + play: function(voiceOverRes : string, delayInSeconds : number) + isPlaying: function(voiceOverRes : string): boolean + isPlayingAny: function(): boolean + getPlaying: function(): ResName +end + record ByEntity isLineEmptyOrVisible: function(Engine.Entity : Engine.Entity): boolean + isVisible: function(Engine.Entity : Engine.Entity): boolean + isVehicleVisible: function(Engine.Entity : Engine.Entity): boolean +end + record ContextHelper record SubjectState Visible: SubjectState + Focused: SubjectState +end + collectSubjectStates: function(idsOfInterest : {string}): {string : SubjectState} + getIdsOfActiveTool: function(): {string} +end + record Construction setAngle: function(angle : number) + modify: function(construction : Engine.Entity) + getBrushIcons: function(): {string} + provideDustWheneverPossible: function(proposal : Proposal, proposalData : ProposalData) + getRefundableEntities: function(): {{Engine.Entity, integer}, {Engine.Revision, integer}} + updateRefundableEntities: function(resultEntities : {Engine.Entity}, proposal : Proposal.StreetProposal) +end + record Mission getMission: function(): string + getCampaign: function(): string + setZone: function(key : string, polygon : {Vec2f}, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number) + setZoneCircle: function(key : string, center : Vec2f, radius : number, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number) + removeZone: function(key : string) + setMarkerAtPosition: function(key : string, pos : Vec3f, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean) + setMarkerAtEntity: function(key : string, entity : Engine.Entity, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean) + removeMarker: function(key : string) + setMovePathVisualizationAtEntity: function(key : string, entity : Engine.Entity, color : Vec3f) + removeMovePathVisualization: function(key : string) + playCutscene: function(filePath : string, resolveLanguageFolder : boolean, entityToEntityMap : {Engine.Entity : Engine.Entity}) + isCutscenePlaying: function(): boolean + getCutsceneElapsedTime: function(): number +end + record Game isSavegameUIBlocked: function(): boolean + setInGameMenuPause: function(pause : boolean) + getGuiSaveData: function(modId : string): { : } + setGuiSaveData: function(modId : string, data : { : }) + getEstimatedMaximumGameSpeed: function(): integer + isMapEditor: function(): boolean + getDefaultSavegameId: function(): string + setEnvironment: function(environment : ResName) + getEnvironment: function(): ResName +end + record Guide record GuidePosition Left: GuidePosition + Right: GuidePosition + Above: GuidePosition + Below: GuidePosition +end + record FreeGuidePosition High: FreeGuidePosition + Low: FreeGuidePosition +end + record GuideTarget new: function(string, GuidePosition): GuideTarget + idOrTag: string + position: GuidePosition +end + trySpawnGuideById: function({GuideTarget}, string, string): boolean + trySpawnGuideFree: function(FreeGuidePosition, string, string): boolean + completeGuideById: function({GuideTarget}): boolean +end + record Rendering setEnvironment: function(environment : Environment) + getEnvironment: function(): Environment + spawnDust: function(bbMin : Vec3f, bbMax : Vec3f, transf : Mat4f) + getFrameTime01: function(): number +end + record Map setMapSeedText: function(seed : string) + reloadMaterialIndexManagerPipeline: function() + openTerrainEditor: function() + closeTerrainEditor: function() +end + record BenchMark record SimTime frameTime: integer + gameTime: integer +end + getBeginFrameTimes: function(): {integer} + getEventTimes: function(): {integer} + getCoreStepTimes: function(): {integer} + getRenderTimes: function(): {integer} + getSwapTimes: function(): {integer} + getReplicateTimes: function(): {SimTime} + getCommandTimes: function(): {SimTime} + getGameStepTimes: function(): {SimTime} +end + record Debug selectEntity: function(entity : Engine.Entity) +end + record Achievements areStatsDisabled: function(): boolean + unlockAchievement: function(achievement : string) + isAchievementUnlockable: function(achievement : string): boolean + isAchievementUnlocked: function(achievement : string): boolean + updateStat: function(playerStat : string, value : number) + setStat: function(playerStat : string, value : number) + getStatValue: function(playerStat : string): number + setStatExtraData: function(playerStat : string, data : { : }) + getStatExtraData: function(playerStat : string): { : } + setEarnedSFX: function(sfx : {FilePath}) +end + record GenericRep getAllOfType: function(typeName : string, includeInvisible : boolean): {integer} +end + record Backend record LegalDocument title: string + text: string +end + isInitialized: function(): boolean + hasLegalDocuments: function() + getLegalDocuments: function(): {PdxLegalDocumentType} + isAccountLoggedIn: function(): boolean + loginAccount: function(string, string): PdxFuture + logoutAccount: function(): PdxFuture + getAccountInfo: function(): PdxFuture + getProfile: function(boolean): PdxFuture + createProfile: function(string, boolean): PdxFuture + renameProfile: function(string, boolean): PdxFuture + getCountries: function(): {PdxCountry} + getLegalDocument: function(PdxLegalDocumentType): PdxFuture + createAccount: function(string, string, string, integer, boolean): PdxFuture + supportsAccountLinking: function(): boolean + getThirdPartyLinkState: function(): PdxFuture + getThirdPartyAutoLoginPromptState: function(): PdxThirdPartyAutoLoginPromptState + setThirdPartyAutoLoginPromptState: function(PdxThirdPartyAutoLoginPromptState) + linkThirdPartyAccount: function(): PdxFuture + unlinkThirdPartyAccount: function(): PdxFuture + loginThirdPartyAccount: function(): PdxFuture +end + mouse: Mouse + key: Key + dnd: DnD + inputAction: InputAction + byId: ById + camera: Camera + sound: Sound + musicPlayer: MusicPlayer + backend: Backend + voiceOverManager: VoiceOverManager + byEntity: ByEntity + contextHelper: ContextHelper + construction: Construction + mission: Mission + guide: Guide + game: Game + map: Map + benchMark: BenchMark + rendering: Rendering + debug: Debug + achievements: Achievements + genericRep: GenericRep + StyleSheet: StyleSheet + NinePatch: NinePatch +end +global record NinePatch new: function(): NinePatch + fileName: string + horizontal: {integer} + vertical: {integer} + flipHorizontally: boolean + repeatHorizontally: boolean + repeatVertically: boolean + repeatFactor: number +end +global record StyleSheet new: function(): StyleSheet + backgroundColor: Vec4f + backgroundColor1: Vec4f + backgroundColor2: Vec4f + backgroundImage1: NinePatch + backgroundImage2: NinePatch + borderWidth: Vec4f + borderColor: Vec4f + color: Vec4f + size: Vec2f + padding: Vec4f + fontSize: integer + borderImage: NinePatch + anchorPoint: Vec2f +end +``` + +## Category: main[πŸ”—](#category-main) + +### Gui[πŸ”—](#$api.gui~Gui) + +``` +[Expand All] [Collapse All] + +global record Gui fireReactEvent: function(name : string, param : any) + fireGuiScriptEvent: function(id : string, name : string, param : any): any + record HighlightStyle Square: HighlightStyle + Circle: HighlightStyle +end + record SpawnHudImageParams iconPath: FilePath + color: Vec4f + entity: Engine.Entity + position: Vec3f +end + spawnEphemeralHudImage: function(iconPath : FilePath, entity : Engine.Entity, color : Vec4f, position : Vec3f, overrideDuration : number, fadeIn : boolean, fadeOut : boolean, rev0 : integer) + spawnEphemeralHudImageOnPath: function(iconPath : FilePath, pos0 : Vec3f, pos1 : Vec3f, pos0 : Vec3f, pos1 : Vec3f, speed : number, scale : number, maxDistance : number) + closeAllWindows: function() + record SelectionDetails new: function(): SelectionDetails + + record Type None: Type + Line: Type + Station: Type + Signal: Type + Stop: Type + Waypoint: Type + TransportNetworkEdge: Type + World: Type + Marker: Type + Town: Type +end + interface DataType kind: Type +end + record Line line: Engine.Entity + stop: integer + waypoint: integer +end + record Station new: function(): Station + stationGroup: Engine.Entity + flatStationTerminalIndex: integer + stationTerminal: StationTerminal +end + record Signal signalList: Engine.Entity + signalIndex: integer +end + record Stop new: function(): Stop + station: SelectionDetails.Station + line: Engine.Entity + stopIndex: integer +end + record Waypoint line: Engine.Entity + stopIndex: integer + waypointIndex: integer + tag: integer +end + record TransportNetworkEdge new: function(): TransportNetworkEdge + snap: EdgePos +end + record World new: function(): World + pos: Vec3f + water: boolean +end + record Marker new: function(): Marker + marker: string + fireSelectEntity: boolean + pos: Vec3f + entity: Engine.Entity +end + record Town new: function(): Town + townEntity: Engine.Entity + districtType: LandUseType + districtCenter: Vec3f +end + data: DataType +end + record WorldEvent pos: {number, number, number} + water: boolean +end + record Mouse record Event record Type Pressed: Type + Released: Type + Clicked: Type + Entered: Type + Exited: Type + Moved: Type + Wheel: Type + DoubleClicked: Type + PressedOutside: Type +end + type: Type + button: integer + x: integer + y: integer + xrel: integer + yrel: integer + handled: boolean +end + getTerrainPosition: function(): Vec3f + hasTerrainPosition: function(): boolean +end + record Key record State Up: State + Pressed: State +end + record InputEvent dir: State + repeated: boolean + isGamepadEvent: function(InputEvent): boolean + isKeyboardEvent: function(InputEvent): boolean + getKey: function(InputEvent): integer + getKeyMod: function(InputEvent): integer +end + record Event data: InputEvent + isPressed: function(Event): boolean +end +end + record DataTransferItem new: function(ResName, any): DataTransferItem + type: ResName + data: any +end + record DnD record Event record Type Drop: Type + DragStarted: Type + DragEntered: Type + DragExited: Type +end + type: Type +end + setCursor: function(cursor : integer) + addTransferData: function(dragStartEvent : Event, item : DataTransferItem) + getAllTransferData: function(): {DataTransferItem} +end + record InputAction record InputActionState Disabled: InputActionState + Inactive: InputActionState + Enabled: InputActionState +end + record InvokeData record Status Triggered: Status + Repeat: Status + PressedStep: Status + EndReleased: Status + EndAborted: Status +end + status: Status +end + modifierOnlyActionIsActive: function(inputActionId : string): boolean + hasConflicts: function(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): string + findDuplicatesOf: function(inputActionId : string): {string} + getFixedKeyCmdDefs: function(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): {string : {KeyComboDef}} +end + record ById setVisibilityByClass: function(idOrTag : string, visible : boolean, idOnly : boolean) + setEnabled: function(idOrTag : string, enabled : boolean, idOnly : boolean) + setHighlighted: function(idOrTag : string, highlighted : boolean, style : HighlightStyle, color : Vec3f, idOnly : boolean) + isVisible: function(id : string): boolean + isVisibleRecursive: function(id : string): boolean + setVisible: function(id : string, visible : boolean) + resetMovedWindowPosition: function(id : string) + getSize: function(id : string): Vec2f +end + record Camera setManualCamera: function(center : Vec2f, distance : number) + getCameraData: function(): Vec5f + setCameraData: function(Vec5f : Vec5f) + getHeightAboveTerrain: function(): number + focusEntity: function(entity : Engine.Entity) + focusPosition: function(position : Vec3f, distance : number) + takeScreenshot: function(scale : integer) + getFollowEntity: function(): {Engine.Entity, Engine.Revision} + followEntity: function(entity : Engine.Entity, jump : boolean) + enterFollowCameraCockpit: function(entity : Engine.Entity) + leaveFollowCameraCockpit: function() + isFreeCameraMouseAttached: function(): boolean + toggleFreeCameraMouseAttachment: function() + toggleFreeCamera: function() + world2Screen: function(Vec3f): Vec2i + screen2World: function(Vec3f): Vec3f + getEye: function(): Vec3f + getCenter: function(): Vec3f + getNearFar: function(): Vec2f + getSize: function(): Vec2i + traceToTerrain: function(worldPos : Vec3f, farPos : Vec3f, zOffset : number, numSteps : integer): Vec3f | nil +end + record Sound letVehicleHorn: function(vehicleEntity : Engine.Entity) + playRandomSoundEffect: function(paths : {FilePath}) +end + record MusicPlayer goBack: function() + goForward: function() + togglePause: function() + getTitle: function(): string + getArtist: function(): string + hasPlaylist: function(): boolean + getPlaylistIndex: function(): integer + setTrackListFromPlayList: function(playlist : string, startPaused : boolean, offset : number) + setPlaylist: function(playlist : string) + getPlaylist: function(): string + isPlaying: function(): boolean + playTrack: function(trackName : string, offset : number) + playTrackFile: function(filePath : string, offset : number) + getTrackLength: function(): number + getTrackElapsedTime: function(): number + getGain: function(): number + setGain: function(gain : number) + setTrackList: function(trackList : {{string, string, boolean}}, enableRepeat : boolean) + addTrackList: function(trackList : {{string, string, boolean}}, enableRepeat : boolean) + setContextTag: function(contextTag : string) +end + record VoiceOverManager stop: function() + play: function(voiceOverRes : string, delayInSeconds : number) + isPlaying: function(voiceOverRes : string): boolean + isPlayingAny: function(): boolean + getPlaying: function(): ResName +end + record ByEntity isLineEmptyOrVisible: function(Engine.Entity : Engine.Entity): boolean + isVisible: function(Engine.Entity : Engine.Entity): boolean + isVehicleVisible: function(Engine.Entity : Engine.Entity): boolean +end + record ContextHelper record SubjectState Visible: SubjectState + Focused: SubjectState +end + collectSubjectStates: function(idsOfInterest : {string}): {string : SubjectState} + getIdsOfActiveTool: function(): {string} +end + record Construction setAngle: function(angle : number) + modify: function(construction : Engine.Entity) + getBrushIcons: function(): {string} + provideDustWheneverPossible: function(proposal : Proposal, proposalData : ProposalData) + getRefundableEntities: function(): {{Engine.Entity, integer}, {Engine.Revision, integer}} + updateRefundableEntities: function(resultEntities : {Engine.Entity}, proposal : Proposal.StreetProposal) +end + record Mission getMission: function(): string + getCampaign: function(): string + setZone: function(key : string, polygon : {Vec2f}, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number) + setZoneCircle: function(key : string, center : Vec2f, radius : number, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number) + removeZone: function(key : string) + setMarkerAtPosition: function(key : string, pos : Vec3f, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean) + setMarkerAtEntity: function(key : string, entity : Engine.Entity, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean) + removeMarker: function(key : string) + setMovePathVisualizationAtEntity: function(key : string, entity : Engine.Entity, color : Vec3f) + removeMovePathVisualization: function(key : string) + playCutscene: function(filePath : string, resolveLanguageFolder : boolean, entityToEntityMap : {Engine.Entity : Engine.Entity}) + isCutscenePlaying: function(): boolean + getCutsceneElapsedTime: function(): number +end + record Game isSavegameUIBlocked: function(): boolean + setInGameMenuPause: function(pause : boolean) + getGuiSaveData: function(modId : string): { : } + setGuiSaveData: function(modId : string, data : { : }) + getEstimatedMaximumGameSpeed: function(): integer + isMapEditor: function(): boolean + getDefaultSavegameId: function(): string + setEnvironment: function(environment : ResName) + getEnvironment: function(): ResName +end + record Guide record GuidePosition Left: GuidePosition + Right: GuidePosition + Above: GuidePosition + Below: GuidePosition +end + record FreeGuidePosition High: FreeGuidePosition + Low: FreeGuidePosition +end + record GuideTarget new: function(string, GuidePosition): GuideTarget + idOrTag: string + position: GuidePosition +end + trySpawnGuideById: function({GuideTarget}, string, string): boolean + trySpawnGuideFree: function(FreeGuidePosition, string, string): boolean + completeGuideById: function({GuideTarget}): boolean +end + record Rendering setEnvironment: function(environment : Environment) + getEnvironment: function(): Environment + spawnDust: function(bbMin : Vec3f, bbMax : Vec3f, transf : Mat4f) + getFrameTime01: function(): number +end + record Map setMapSeedText: function(seed : string) + reloadMaterialIndexManagerPipeline: function() + openTerrainEditor: function() + closeTerrainEditor: function() +end + record BenchMark record SimTime frameTime: integer + gameTime: integer +end + getBeginFrameTimes: function(): {integer} + getEventTimes: function(): {integer} + getCoreStepTimes: function(): {integer} + getRenderTimes: function(): {integer} + getSwapTimes: function(): {integer} + getReplicateTimes: function(): {SimTime} + getCommandTimes: function(): {SimTime} + getGameStepTimes: function(): {SimTime} +end + record Debug selectEntity: function(entity : Engine.Entity) +end + record Achievements areStatsDisabled: function(): boolean + unlockAchievement: function(achievement : string) + isAchievementUnlockable: function(achievement : string): boolean + isAchievementUnlocked: function(achievement : string): boolean + updateStat: function(playerStat : string, value : number) + setStat: function(playerStat : string, value : number) + getStatValue: function(playerStat : string): number + setStatExtraData: function(playerStat : string, data : { : }) + getStatExtraData: function(playerStat : string): { : } + setEarnedSFX: function(sfx : {FilePath}) +end + record GenericRep getAllOfType: function(typeName : string, includeInvisible : boolean): {integer} +end + record Backend record LegalDocument title: string + text: string +end + isInitialized: function(): boolean + hasLegalDocuments: function() + getLegalDocuments: function(): {PdxLegalDocumentType} + isAccountLoggedIn: function(): boolean + loginAccount: function(string, string): PdxFuture + logoutAccount: function(): PdxFuture + getAccountInfo: function(): PdxFuture + getProfile: function(boolean): PdxFuture + createProfile: function(string, boolean): PdxFuture + renameProfile: function(string, boolean): PdxFuture + getCountries: function(): {PdxCountry} + getLegalDocument: function(PdxLegalDocumentType): PdxFuture + createAccount: function(string, string, string, integer, boolean): PdxFuture + supportsAccountLinking: function(): boolean + getThirdPartyLinkState: function(): PdxFuture + getThirdPartyAutoLoginPromptState: function(): PdxThirdPartyAutoLoginPromptState + setThirdPartyAutoLoginPromptState: function(PdxThirdPartyAutoLoginPromptState) + linkThirdPartyAccount: function(): PdxFuture + unlinkThirdPartyAccount: function(): PdxFuture + loginThirdPartyAccount: function(): PdxFuture +end + mouse: Mouse + key: Key + dnd: DnD + inputAction: InputAction + byId: ById + camera: Camera + sound: Sound + musicPlayer: MusicPlayer + backend: Backend + voiceOverManager: VoiceOverManager + byEntity: ByEntity + contextHelper: ContextHelper + construction: Construction + mission: Mission + guide: Guide + game: Game + map: Map + benchMark: BenchMark + rendering: Rendering + debug: Debug + achievements: Achievements + genericRep: GenericRep + StyleSheet: StyleSheet + NinePatch: NinePatch +end +``` + +Main GUI interface + +### Gui.fireReactEvent[πŸ”—](#$api.gui~Gui.fireReactEvent) + +``` +function Gui.fireReactEvent(name : string, param : any) +``` + +Fire a react event (same as react.fireEvent() but from outside of react) + +**Parameters** + +* `name` :`string` β€” the event name +* `param` :`any` β€” the event parameter + +### Gui.fireGuiScriptEvent[πŸ”—](#$api.gui~Gui.fireGuiScriptEvent) + +``` +function Gui.fireGuiScriptEvent(id : string, name : string, param : any): any +``` + +Fire a game gui script event. +This event is meant to be handled by game scripts (guiHandleEvent), not by react.onEvent(). +It differs from react.fireEvent in that it allows to return a value (like an error string to prevent the operation) + +**Parameters** + +* `id` :`string` β€” the component id +* `name` :`string` β€” the event name +* `param` :`any` β€” event-specific parameters + +**Returns** + +1. `any` β€” the result from the event handler + +### Gui.HighlightStyle[πŸ”—](#$api.gui~Gui.HighlightStyle) + +``` +record Gui.HighlightStyle Square: HighlightStyle + Circle: HighlightStyle +end +``` + +### Gui.HighlightStyle.Square[πŸ”—](#$api.gui~Gui.HighlightStyle.Square) + +``` +Gui.HighlightStyle.Square: HighlightStyle +``` + +### Gui.HighlightStyle.Circle[πŸ”—](#$api.gui~Gui.HighlightStyle.Circle) + +``` +Gui.HighlightStyle.Circle: HighlightStyle +``` + +### Gui.SpawnHudImageParams[πŸ”—](#$api.gui~Gui.SpawnHudImageParams) + +``` +record Gui.SpawnHudImageParams iconPath: FilePath + color: Vec4f + entity: Engine.Entity + position: Vec3f +end +``` + +### Gui.SpawnHudImageParams.iconPath[πŸ”—](#$api.gui~Gui.SpawnHudImageParams.iconPath) + +``` +Gui.SpawnHudImageParams.iconPath: FilePath +``` + +Mandatory path to the icon + +### Gui.SpawnHudImageParams.color[πŸ”—](#$api.gui~Gui.SpawnHudImageParams.color) + +``` +Gui.SpawnHudImageParams.color: Vec4f +``` + +Optional color. If set, the icon is expected to be grayscale. + +### Gui.SpawnHudImageParams.entity[πŸ”—](#$api.gui~Gui.SpawnHudImageParams.entity) + +``` +Gui.SpawnHudImageParams.entity: Engine.Entity +``` + +Optional entity (if not used, specify position) + +### Gui.SpawnHudImageParams.position[πŸ”—](#$api.gui~Gui.SpawnHudImageParams.position) + +``` +Gui.SpawnHudImageParams.position: Vec3f +``` + +Optional position (if not used, position of the entity is used) + +### Gui.spawnEphemeralHudImage[πŸ”—](#$api.gui~Gui.spawnEphemeralHudImage) + +``` +function Gui.spawnEphemeralHudImage(iconPath : FilePath, entity : Engine.Entity, color : Vec4f, position : Vec3f, overrideDuration : number, fadeIn : boolean, fadeOut : boolean, rev0 : integer) +``` + +Spawn a short-lived floating image as a hud-icon + +**Parameters** + +* `iconPath` :`FilePath` β€” The icon to be used +* `entity` :`Engine.Entity` β€” Optional entity (if not used, you must specify position instead) +* `color` :`Vec4f` β€” Optional color (if not used, the icon is expected to have color channels) +* `position` :`Vec3f` β€” Optional position (if not used, position is obtained from the entity) +* `overrideDuration` :`number` β€” Optional duration in seconds +* `fadeIn` :`boolean` β€” Optional: Start invisible and fade in (default: false) +* `fadeOut` :`boolean` β€” Optional: Slowly fade out at the end (default: true) +* `rev0` :`integer` β€” Optional revision0 (if not used, defaults to api.engine.getRevision(entity).num[1]) + +### Gui.spawnEphemeralHudImageOnPath[πŸ”—](#$api.gui~Gui.spawnEphemeralHudImageOnPath) + +``` +function Gui.spawnEphemeralHudImageOnPath(iconPath : FilePath, pos0 : Vec3f, pos1 : Vec3f, pos0 : Vec3f, pos1 : Vec3f, speed : number, scale : number, maxDistance : number) +``` + +Spawns a short icon that follows a path + +**Parameters** + +* `iconPath` :`FilePath` β€” The icon to be used +* `pos0` :`Vec3f` β€” The starting position of the icon +* `pos1` :`Vec3f` β€” The end position of the icon +* `pos0` :`Vec3f` β€” The starting tangent of the icon +* `pos1` :`Vec3f` β€” The end tangent of the icon +* `speed` :`number` β€” The speed (in m/s) of the icon +* `scale` :`number` β€” A scaling factor for the size of the icon +* `maxDistance` :`number` β€” The maximal distance at which the icon will be rendered + +### Gui.closeAllWindows[πŸ”—](#$api.gui~Gui.closeAllWindows) + +``` +function Gui.closeAllWindows() +``` + +Close all windows + +### Gui.SelectionDetails[πŸ”—](#$api.gui~Gui.SelectionDetails) + +``` +[Expand All] [Collapse All] + +record Gui.SelectionDetails new: function(): SelectionDetails + + record Type None: Type + Line: Type + Station: Type + Signal: Type + Stop: Type + Waypoint: Type + TransportNetworkEdge: Type + World: Type + Marker: Type + Town: Type +end + interface DataType kind: Type +end + record Line line: Engine.Entity + stop: integer + waypoint: integer +end + record Station new: function(): Station + stationGroup: Engine.Entity + flatStationTerminalIndex: integer + stationTerminal: StationTerminal +end + record Signal signalList: Engine.Entity + signalIndex: integer +end + record Stop new: function(): Stop + station: SelectionDetails.Station + line: Engine.Entity + stopIndex: integer +end + record Waypoint line: Engine.Entity + stopIndex: integer + waypointIndex: integer + tag: integer +end + record TransportNetworkEdge new: function(): TransportNetworkEdge + snap: EdgePos +end + record World new: function(): World + pos: Vec3f + water: boolean +end + record Marker new: function(): Marker + marker: string + fireSelectEntity: boolean + pos: Vec3f + entity: Engine.Entity +end + record Town new: function(): Town + townEntity: Engine.Entity + districtType: LandUseType + districtCenter: Vec3f +end + data: DataType +end +``` + +Carries details about selection event + +### Gui.SelectionDetails.new()[πŸ”—](#$api.gui~Gui.SelectionDetails.new()) + +``` +function Gui.SelectionDetails.new()(): SelectionDetails +``` + +**Returns** + +1. `SelectionDetails` + +### Gui.SelectionDetails.new(SelectionDetails)[πŸ”—](#$api.gui~Gui.SelectionDetails.new(SelectionDetails)) + +``` +function Gui.SelectionDetails.new(SelectionDetails)(SelectionDetails): SelectionDetails +``` + +**Parameters** + +* `SelectionDetails` + +**Returns** + +1. `SelectionDetails` + +### Gui.SelectionDetails.Type[πŸ”—](#$api.gui~Gui.SelectionDetails.Type) + +``` +record Gui.SelectionDetails.Type None: Type + Line: Type + Station: Type + Signal: Type + Stop: Type + Waypoint: Type + TransportNetworkEdge: Type + World: Type + Marker: Type + Town: Type +end +``` + +### Gui.SelectionDetails.Type.None[πŸ”—](#$api.gui~Gui.SelectionDetails.Type.None) + +``` +Gui.SelectionDetails.Type.None: Type +``` + +### Gui.SelectionDetails.Type.Line[πŸ”—](#$api.gui~Gui.SelectionDetails.Type.Line) + +``` +Gui.SelectionDetails.Type.Line: Type +``` + +### Gui.SelectionDetails.Type.Station[πŸ”—](#$api.gui~Gui.SelectionDetails.Type.Station) + +``` +Gui.SelectionDetails.Type.Station: Type +``` + +### Gui.SelectionDetails.Type.Signal[πŸ”—](#$api.gui~Gui.SelectionDetails.Type.Signal) + +``` +Gui.SelectionDetails.Type.Signal: Type +``` + +### Gui.SelectionDetails.Type.Stop[πŸ”—](#$api.gui~Gui.SelectionDetails.Type.Stop) + +``` +Gui.SelectionDetails.Type.Stop: Type +``` + +### Gui.SelectionDetails.Type.Waypoint[πŸ”—](#$api.gui~Gui.SelectionDetails.Type.Waypoint) + +``` +Gui.SelectionDetails.Type.Waypoint: Type +``` + +### Gui.SelectionDetails.Type.TransportNetworkEdge[πŸ”—](#$api.gui~Gui.SelectionDetails.Type.TransportNetworkEdge) + +``` +Gui.SelectionDetails.Type.TransportNetworkEdge: Type +``` + +### Gui.SelectionDetails.Type.World[πŸ”—](#$api.gui~Gui.SelectionDetails.Type.World) + +``` +Gui.SelectionDetails.Type.World: Type +``` + +### Gui.SelectionDetails.Type.Marker[πŸ”—](#$api.gui~Gui.SelectionDetails.Type.Marker) + +``` +Gui.SelectionDetails.Type.Marker: Type +``` + +### Gui.SelectionDetails.Type.Town[πŸ”—](#$api.gui~Gui.SelectionDetails.Type.Town) + +``` +Gui.SelectionDetails.Type.Town: Type +``` + +### Gui.SelectionDetails.DataType[πŸ”—](#$api.gui~Gui.SelectionDetails.DataType) + +``` +interface Gui.SelectionDetails.DataType kind: Type +end +``` + +### Gui.SelectionDetails.DataType.kind[πŸ”—](#$api.gui~Gui.SelectionDetails.DataType.kind) + +``` +Gui.SelectionDetails.DataType.kind: Type +``` + +### Gui.SelectionDetails.Line[πŸ”—](#$api.gui~Gui.SelectionDetails.Line) + +``` +record Gui.SelectionDetails.Line line: Engine.Entity + stop: integer + waypoint: integer +end +``` + +Carries details about selection event for a Line. + +### Gui.SelectionDetails.Line.line[πŸ”—](#$api.gui~Gui.SelectionDetails.Line.line) + +``` +Gui.SelectionDetails.Line.line: Engine.Entity +``` + +The line entity + +### Gui.SelectionDetails.Line.stop[πŸ”—](#$api.gui~Gui.SelectionDetails.Line.stop) + +``` +Gui.SelectionDetails.Line.stop: integer +``` + +Stop index where the selected line segment starts + +### Gui.SelectionDetails.Line.waypoint[πŸ”—](#$api.gui~Gui.SelectionDetails.Line.waypoint) + +``` +Gui.SelectionDetails.Line.waypoint: integer +``` + +Waypoint index identifying the selected subsegment (-1: no waypoints, 0 = begins at stop, numWaypoints = ends at next stop) + +### Gui.SelectionDetails.Station[πŸ”—](#$api.gui~Gui.SelectionDetails.Station) + +``` +record Gui.SelectionDetails.Station new: function(): Station + stationGroup: Engine.Entity + flatStationTerminalIndex: integer + stationTerminal: StationTerminal +end +``` + +Carries details about selection event for a Station, StationGroup or Terminal + +### Gui.SelectionDetails.Station.new[πŸ”—](#$api.gui~Gui.SelectionDetails.Station.new) + +``` +function Gui.SelectionDetails.Station.new(): Station +``` + +**Returns** + +1. `Station` + +### Gui.SelectionDetails.Station.stationGroup[πŸ”—](#$api.gui~Gui.SelectionDetails.Station.stationGroup) + +``` +Gui.SelectionDetails.Station.stationGroup: Engine.Entity +``` + +The station group entity + +### Gui.SelectionDetails.Station.flatStationTerminalIndex[πŸ”—](#$api.gui~Gui.SelectionDetails.Station.flatStationTerminalIndex) + +``` +Gui.SelectionDetails.Station.flatStationTerminalIndex: integer +``` + +Index in the the StationGroup's flattened list of station/terminals + +### Gui.SelectionDetails.Station.stationTerminal[πŸ”—](#$api.gui~Gui.SelectionDetails.Station.stationTerminal) + +``` +Gui.SelectionDetails.Station.stationTerminal: StationTerminal +``` + +### Gui.SelectionDetails.Signal[πŸ”—](#$api.gui~Gui.SelectionDetails.Signal) + +``` +record Gui.SelectionDetails.Signal signalList: Engine.Entity + signalIndex: integer +end +``` + +Carries details about selection event for a Signal + +### Gui.SelectionDetails.Signal.signalList[πŸ”—](#$api.gui~Gui.SelectionDetails.Signal.signalList) + +``` +Gui.SelectionDetails.Signal.signalList: Engine.Entity +``` + +The signalList entity + +### Gui.SelectionDetails.Signal.signalIndex[πŸ”—](#$api.gui~Gui.SelectionDetails.Signal.signalIndex) + +``` +Gui.SelectionDetails.Signal.signalIndex: integer +``` + +Index of the actual signal in the the SignalList + +### Gui.SelectionDetails.Stop[πŸ”—](#$api.gui~Gui.SelectionDetails.Stop) + +``` +record Gui.SelectionDetails.Stop new: function(): Stop + station: SelectionDetails.Station + line: Engine.Entity + stopIndex: integer +end +``` + +Carries details about selection event for a Stop (terminal) inside a line + +### Gui.SelectionDetails.Stop.new[πŸ”—](#$api.gui~Gui.SelectionDetails.Stop.new) + +``` +function Gui.SelectionDetails.Stop.new(): Stop +``` + +**Returns** + +1. `Stop` + +### Gui.SelectionDetails.Stop.station[πŸ”—](#$api.gui~Gui.SelectionDetails.Stop.station) + +``` +Gui.SelectionDetails.Stop.station: SelectionDetails.Station +``` + +The station / terminal + +### Gui.SelectionDetails.Stop.line[πŸ”—](#$api.gui~Gui.SelectionDetails.Stop.line) + +``` +Gui.SelectionDetails.Stop.line: Engine.Entity +``` + +The line entity + +### Gui.SelectionDetails.Stop.stopIndex[πŸ”—](#$api.gui~Gui.SelectionDetails.Stop.stopIndex) + +``` +Gui.SelectionDetails.Stop.stopIndex: integer +``` + +Index of the stop in the line + +### Gui.SelectionDetails.Waypoint[πŸ”—](#$api.gui~Gui.SelectionDetails.Waypoint) + +``` +record Gui.SelectionDetails.Waypoint line: Engine.Entity + stopIndex: integer + waypointIndex: integer + tag: integer +end +``` + +Carries details about selection event for a waypoint inside a line + +### Gui.SelectionDetails.Waypoint.line[πŸ”—](#$api.gui~Gui.SelectionDetails.Waypoint.line) + +``` +Gui.SelectionDetails.Waypoint.line: Engine.Entity +``` + +The line entity + +### Gui.SelectionDetails.Waypoint.stopIndex[πŸ”—](#$api.gui~Gui.SelectionDetails.Waypoint.stopIndex) + +``` +Gui.SelectionDetails.Waypoint.stopIndex: integer +``` + +Index of the stop in the line + +### Gui.SelectionDetails.Waypoint.waypointIndex[πŸ”—](#$api.gui~Gui.SelectionDetails.Waypoint.waypointIndex) + +``` +Gui.SelectionDetails.Waypoint.waypointIndex: integer +``` + +Index of the waypoint in the line (index in stop.waypoints) + +### Gui.SelectionDetails.Waypoint.tag[πŸ”—](#$api.gui~Gui.SelectionDetails.Waypoint.tag) + +``` +Gui.SelectionDetails.Waypoint.tag: integer +``` + +### Gui.SelectionDetails.TransportNetworkEdge[πŸ”—](#$api.gui~Gui.SelectionDetails.TransportNetworkEdge) + +``` +record Gui.SelectionDetails.TransportNetworkEdge new: function(): TransportNetworkEdge + snap: EdgePos +end +``` + +Carries details about selection event for a Transport Network Edge + +### Gui.SelectionDetails.TransportNetworkEdge.new[πŸ”—](#$api.gui~Gui.SelectionDetails.TransportNetworkEdge.new) + +``` +function Gui.SelectionDetails.TransportNetworkEdge.new(): TransportNetworkEdge +``` + +**Returns** + +1. `TransportNetworkEdge` + +### Gui.SelectionDetails.TransportNetworkEdge.snap[πŸ”—](#$api.gui~Gui.SelectionDetails.TransportNetworkEdge.snap) + +``` +Gui.SelectionDetails.TransportNetworkEdge.snap: EdgePos +``` + +### Gui.SelectionDetails.World[πŸ”—](#$api.gui~Gui.SelectionDetails.World) + +``` +record Gui.SelectionDetails.World new: function(): World + pos: Vec3f + water: boolean +end +``` + +Carries details about the cursor location in the world. + +### Gui.SelectionDetails.World.new[πŸ”—](#$api.gui~Gui.SelectionDetails.World.new) + +``` +function Gui.SelectionDetails.World.new(): World +``` + +**Returns** + +1. `World` + +### Gui.SelectionDetails.World.pos[πŸ”—](#$api.gui~Gui.SelectionDetails.World.pos) + +``` +Gui.SelectionDetails.World.pos: Vec3f +``` + +### Gui.SelectionDetails.World.water[πŸ”—](#$api.gui~Gui.SelectionDetails.World.water) + +``` +Gui.SelectionDetails.World.water: boolean +``` + +### Gui.SelectionDetails.Marker[πŸ”—](#$api.gui~Gui.SelectionDetails.Marker) + +``` +record Gui.SelectionDetails.Marker new: function(): Marker + marker: string + fireSelectEntity: boolean + pos: Vec3f + entity: Engine.Entity +end +``` + +Carries details about selection event for a Marker. + +### Gui.SelectionDetails.Marker.new[πŸ”—](#$api.gui~Gui.SelectionDetails.Marker.new) + +``` +function Gui.SelectionDetails.Marker.new(): Marker +``` + +**Returns** + +1. `Marker` + +### Gui.SelectionDetails.Marker.marker[πŸ”—](#$api.gui~Gui.SelectionDetails.Marker.marker) + +``` +Gui.SelectionDetails.Marker.marker: string +``` + +### Gui.SelectionDetails.Marker.fireSelectEntity[πŸ”—](#$api.gui~Gui.SelectionDetails.Marker.fireSelectEntity) + +``` +Gui.SelectionDetails.Marker.fireSelectEntity: boolean +``` + +If true, select the underlying entity of the marker (default = true) + +### Gui.SelectionDetails.Marker.pos[πŸ”—](#$api.gui~Gui.SelectionDetails.Marker.pos) + +``` +Gui.SelectionDetails.Marker.pos: Vec3f +``` + +Get the marker position (if it is a position marker) + +### Gui.SelectionDetails.Marker.entity[πŸ”—](#$api.gui~Gui.SelectionDetails.Marker.entity) + +``` +Gui.SelectionDetails.Marker.entity: Engine.Entity +``` + +Get the marked entity (if it is an entity marker) + +### Gui.SelectionDetails.Town[πŸ”—](#$api.gui~Gui.SelectionDetails.Town) + +``` +record Gui.SelectionDetails.Town new: function(): Town + townEntity: Engine.Entity + districtType: LandUseType + districtCenter: Vec3f +end +``` + +Carries details about selection event for a Town. + +### Gui.SelectionDetails.Town.new[πŸ”—](#$api.gui~Gui.SelectionDetails.Town.new) + +``` +function Gui.SelectionDetails.Town.new(): Town +``` + +**Returns** + +1. `Town` + +### Gui.SelectionDetails.Town.townEntity[πŸ”—](#$api.gui~Gui.SelectionDetails.Town.townEntity) + +``` +Gui.SelectionDetails.Town.townEntity: Engine.Entity +``` + +### Gui.SelectionDetails.Town.districtType[πŸ”—](#$api.gui~Gui.SelectionDetails.Town.districtType) + +``` +Gui.SelectionDetails.Town.districtType: LandUseType +``` + +### Gui.SelectionDetails.Town.districtCenter[πŸ”—](#$api.gui~Gui.SelectionDetails.Town.districtCenter) + +``` +Gui.SelectionDetails.Town.districtCenter: Vec3f +``` + +### Gui.SelectionDetails.data[πŸ”—](#$api.gui~Gui.SelectionDetails.data) + +``` +Gui.SelectionDetails.data: DataType +``` + +### Gui.WorldEvent[πŸ”—](#$api.gui~Gui.WorldEvent) + +``` +record Gui.WorldEvent pos: {number, number, number} + water: boolean +end +``` + +### Gui.WorldEvent.pos[πŸ”—](#$api.gui~Gui.WorldEvent.pos) + +``` +Gui.WorldEvent.pos: {number, number, number} +``` + +### Gui.WorldEvent.water[πŸ”—](#$api.gui~Gui.WorldEvent.water) + +``` +Gui.WorldEvent.water: boolean +``` + +### Gui.Mouse[πŸ”—](#$api.gui~Gui.Mouse) + +``` +[Expand All] [Collapse All] + +record Gui.Mouse record Event record Type Pressed: Type + Released: Type + Clicked: Type + Entered: Type + Exited: Type + Moved: Type + Wheel: Type + DoubleClicked: Type + PressedOutside: Type +end + type: Type + button: integer + x: integer + y: integer + xrel: integer + yrel: integer + handled: boolean +end + getTerrainPosition: function(): Vec3f + hasTerrainPosition: function(): boolean +end +``` + +### Gui.Mouse.Event[πŸ”—](#$api.gui~Gui.Mouse.Event) + +``` +[Expand All] [Collapse All] + +record Gui.Mouse.Event record Type Pressed: Type + Released: Type + Clicked: Type + Entered: Type + Exited: Type + Moved: Type + Wheel: Type + DoubleClicked: Type + PressedOutside: Type +end + type: Type + button: integer + x: integer + y: integer + xrel: integer + yrel: integer + handled: boolean +end +``` + +Represents a mouse event + +### Gui.Mouse.Event.Type[πŸ”—](#$api.gui~Gui.Mouse.Event.Type) + +``` +record Gui.Mouse.Event.Type Pressed: Type + Released: Type + Clicked: Type + Entered: Type + Exited: Type + Moved: Type + Wheel: Type + DoubleClicked: Type + PressedOutside: Type +end +``` + +### Gui.Mouse.Event.Type.Pressed[πŸ”—](#$api.gui~Gui.Mouse.Event.Type.Pressed) + +``` +Gui.Mouse.Event.Type.Pressed: Type +``` + +### Gui.Mouse.Event.Type.Released[πŸ”—](#$api.gui~Gui.Mouse.Event.Type.Released) + +``` +Gui.Mouse.Event.Type.Released: Type +``` + +### Gui.Mouse.Event.Type.Clicked[πŸ”—](#$api.gui~Gui.Mouse.Event.Type.Clicked) + +``` +Gui.Mouse.Event.Type.Clicked: Type +``` + +### Gui.Mouse.Event.Type.Entered[πŸ”—](#$api.gui~Gui.Mouse.Event.Type.Entered) + +``` +Gui.Mouse.Event.Type.Entered: Type +``` + +### Gui.Mouse.Event.Type.Exited[πŸ”—](#$api.gui~Gui.Mouse.Event.Type.Exited) + +``` +Gui.Mouse.Event.Type.Exited: Type +``` + +### Gui.Mouse.Event.Type.Moved[πŸ”—](#$api.gui~Gui.Mouse.Event.Type.Moved) + +``` +Gui.Mouse.Event.Type.Moved: Type +``` + +### Gui.Mouse.Event.Type.Wheel[πŸ”—](#$api.gui~Gui.Mouse.Event.Type.Wheel) + +``` +Gui.Mouse.Event.Type.Wheel: Type +``` + +### Gui.Mouse.Event.Type.DoubleClicked[πŸ”—](#$api.gui~Gui.Mouse.Event.Type.DoubleClicked) + +``` +Gui.Mouse.Event.Type.DoubleClicked: Type +``` + +### Gui.Mouse.Event.Type.PressedOutside[πŸ”—](#$api.gui~Gui.Mouse.Event.Type.PressedOutside) + +``` +Gui.Mouse.Event.Type.PressedOutside: Type +``` + +### Gui.Mouse.Event.type[πŸ”—](#$api.gui~Gui.Mouse.Event.type) + +``` +Gui.Mouse.Event.type: Type +``` + +Event type. + +### Gui.Mouse.Event.button[πŸ”—](#$api.gui~Gui.Mouse.Event.button) + +``` +Gui.Mouse.Event.button: integer +``` + +Mouse button: 0 = left, 1 = middle, 2 = right. + +### Gui.Mouse.Event.x[πŸ”—](#$api.gui~Gui.Mouse.Event.x) + +``` +Gui.Mouse.Event.x: integer +``` + +Horizontal position of the mouse when event was triggered + +### Gui.Mouse.Event.y[πŸ”—](#$api.gui~Gui.Mouse.Event.y) + +``` +Gui.Mouse.Event.y: integer +``` + +Vertical position of the mouse when event was triggered + +### Gui.Mouse.Event.xrel[πŸ”—](#$api.gui~Gui.Mouse.Event.xrel) + +``` +Gui.Mouse.Event.xrel: integer +``` + +Relative horizontal movement. + +### Gui.Mouse.Event.yrel[πŸ”—](#$api.gui~Gui.Mouse.Event.yrel) + +``` +Gui.Mouse.Event.yrel: integer +``` + +Relative vertical movement. + +### Gui.Mouse.Event.handled[πŸ”—](#$api.gui~Gui.Mouse.Event.handled) + +``` +Gui.Mouse.Event.handled: boolean +``` + +Whether the event was already handled by a child component. + +### Gui.Mouse.getTerrainPosition[πŸ”—](#$api.gui~Gui.Mouse.getTerrainPosition) + +``` +function Gui.Mouse.getTerrainPosition(): Vec3f +``` + +Gets the last valid terrain position pointed by the mouse. + +**Returns** + +1. `Vec3f` β€” coordinates of the terrain position + +### Gui.Mouse.hasTerrainPosition[πŸ”—](#$api.gui~Gui.Mouse.hasTerrainPosition) + +``` +function Gui.Mouse.hasTerrainPosition(): boolean +``` + +Returns whether a valid terrain position is currently available. + +**Returns** + +1. `boolean` β€” boolean true if the mouse is pointing at the terrain + +### Gui.Key[πŸ”—](#$api.gui~Gui.Key) + +``` +[Expand All] [Collapse All] + +record Gui.Key record State Up: State + Pressed: State +end + record InputEvent dir: State + repeated: boolean + isGamepadEvent: function(InputEvent): boolean + isKeyboardEvent: function(InputEvent): boolean + getKey: function(InputEvent): integer + getKeyMod: function(InputEvent): integer +end + record Event data: InputEvent + isPressed: function(Event): boolean +end +end +``` + +### Gui.Key.State[πŸ”—](#$api.gui~Gui.Key.State) + +``` +record Gui.Key.State Up: State + Pressed: State +end +``` + +### Gui.Key.State.Up[πŸ”—](#$api.gui~Gui.Key.State.Up) + +``` +Gui.Key.State.Up: State +``` + +### Gui.Key.State.Pressed[πŸ”—](#$api.gui~Gui.Key.State.Pressed) + +``` +Gui.Key.State.Pressed: State +``` + +### Gui.Key.InputEvent[πŸ”—](#$api.gui~Gui.Key.InputEvent) + +``` +record Gui.Key.InputEvent dir: State + repeated: boolean + isGamepadEvent: function(InputEvent): boolean + isKeyboardEvent: function(InputEvent): boolean + getKey: function(InputEvent): integer + getKeyMod: function(InputEvent): integer +end +``` + +### Gui.Key.InputEvent.dir[πŸ”—](#$api.gui~Gui.Key.InputEvent.dir) + +``` +Gui.Key.InputEvent.dir: State +``` + +### Gui.Key.InputEvent.repeated[πŸ”—](#$api.gui~Gui.Key.InputEvent.repeated) + +``` +Gui.Key.InputEvent.repeated: boolean +``` + +### Gui.Key.InputEvent.isGamepadEvent[πŸ”—](#$api.gui~Gui.Key.InputEvent.isGamepadEvent) + +``` +function Gui.Key.InputEvent.isGamepadEvent(InputEvent): boolean +``` + +Returns whether this is a gamepad event. + +**Parameters** + +* `InputEvent` + +**Returns** + +1. `boolean` + +### Gui.Key.InputEvent.isKeyboardEvent[πŸ”—](#$api.gui~Gui.Key.InputEvent.isKeyboardEvent) + +``` +function Gui.Key.InputEvent.isKeyboardEvent(InputEvent): boolean +``` + +Returns whether this is a keyboard event. + +**Parameters** + +* `InputEvent` + +**Returns** + +1. `boolean` + +### Gui.Key.InputEvent.getKey[πŸ”—](#$api.gui~Gui.Key.InputEvent.getKey) + +``` +function Gui.Key.InputEvent.getKey(InputEvent): integer +``` + +Returns the key code. + +**Parameters** + +* `InputEvent` + +**Returns** + +1. `integer` + +### Gui.Key.InputEvent.getKeyMod[πŸ”—](#$api.gui~Gui.Key.InputEvent.getKeyMod) + +``` +function Gui.Key.InputEvent.getKeyMod(InputEvent): integer +``` + +Returns key modifiers. + +**Parameters** + +* `InputEvent` + +**Returns** + +1. `integer` + +### Gui.Key.Event[πŸ”—](#$api.gui~Gui.Key.Event) + +``` +record Gui.Key.Event data: InputEvent + isPressed: function(Event): boolean +end +``` + +Represents a key press event. + +### Gui.Key.Event.data[πŸ”—](#$api.gui~Gui.Key.Event.data) + +``` +Gui.Key.Event.data: InputEvent +``` + +### Gui.Key.Event.isPressed[πŸ”—](#$api.gui~Gui.Key.Event.isPressed) + +``` +function Gui.Key.Event.isPressed(Event): boolean +``` + +Returns whether the key is pressed. + +**Parameters** + +* `Event` + +**Returns** + +1. `boolean` + +### Gui.DataTransferItem[πŸ”—](#$api.gui~Gui.DataTransferItem) + +``` +record Gui.DataTransferItem new: function(ResName, any): DataTransferItem + type: ResName + data: any +end +``` + +### Gui.DataTransferItem.new[πŸ”—](#$api.gui~Gui.DataTransferItem.new) + +``` +function Gui.DataTransferItem.new(ResName, any): DataTransferItem +``` + +**Parameters** + +* `ResName` +* `any` + +**Returns** + +1. `DataTransferItem` + +### Gui.DataTransferItem.type[πŸ”—](#$api.gui~Gui.DataTransferItem.type) + +``` +Gui.DataTransferItem.type: ResName +``` + +### Gui.DataTransferItem.data[πŸ”—](#$api.gui~Gui.DataTransferItem.data) + +``` +Gui.DataTransferItem.data: any +``` + +### Gui.DnD[πŸ”—](#$api.gui~Gui.DnD) + +``` +[Expand All] [Collapse All] + +record Gui.DnD record Event record Type Drop: Type + DragStarted: Type + DragEntered: Type + DragExited: Type +end + type: Type +end + setCursor: function(cursor : integer) + addTransferData: function(dragStartEvent : Event, item : DataTransferItem) + getAllTransferData: function(): {DataTransferItem} +end +``` + +### Gui.DnD.Event[πŸ”—](#$api.gui~Gui.DnD.Event) + +``` +[Expand All] [Collapse All] + +record Gui.DnD.Event record Type Drop: Type + DragStarted: Type + DragEntered: Type + DragExited: Type +end + type: Type +end +``` + +Represents drag & drop event + +### Gui.DnD.Event.Type[πŸ”—](#$api.gui~Gui.DnD.Event.Type) + +``` +record Gui.DnD.Event.Type Drop: Type + DragStarted: Type + DragEntered: Type + DragExited: Type +end +``` + +### Gui.DnD.Event.Type.Drop[πŸ”—](#$api.gui~Gui.DnD.Event.Type.Drop) + +``` +Gui.DnD.Event.Type.Drop: Type +``` + +### Gui.DnD.Event.Type.DragStarted[πŸ”—](#$api.gui~Gui.DnD.Event.Type.DragStarted) + +``` +Gui.DnD.Event.Type.DragStarted: Type +``` + +### Gui.DnD.Event.Type.DragEntered[πŸ”—](#$api.gui~Gui.DnD.Event.Type.DragEntered) + +``` +Gui.DnD.Event.Type.DragEntered: Type +``` + +### Gui.DnD.Event.Type.DragExited[πŸ”—](#$api.gui~Gui.DnD.Event.Type.DragExited) + +``` +Gui.DnD.Event.Type.DragExited: Type +``` + +### Gui.DnD.Event.type[πŸ”—](#$api.gui~Gui.DnD.Event.type) + +``` +Gui.DnD.Event.type: Type +``` + +Event type. + +### Gui.DnD.setCursor[πŸ”—](#$api.gui~Gui.DnD.setCursor) + +``` +function Gui.DnD.setCursor(cursor : integer) +``` + +Set cursor while dragging (will get reset when a new drag starts). + +**Parameters** + +* `cursor` :`integer` β€” the cursor id + +### Gui.DnD.addTransferData[πŸ”—](#$api.gui~Gui.DnD.addTransferData) + +``` +function Gui.DnD.addTransferData(dragStartEvent : Event, item : DataTransferItem) +``` + +Add transfer data to the current drag & drop operation. + +**Parameters** + +* `dragStartEvent` :`Event` β€” drag start event (must be Event.Type.DragStarted) +* `item` :`DataTransferItem` β€” transferable item + +### Gui.DnD.getAllTransferData[πŸ”—](#$api.gui~Gui.DnD.getAllTransferData) + +``` +function Gui.DnD.getAllTransferData(): {DataTransferItem} +``` + +Get current drag & drop data. + +**Returns** + +1. `{DataTransferItem}` β€” current transfer data list + +### Gui.InputAction[πŸ”—](#$api.gui~Gui.InputAction) + +``` +[Expand All] [Collapse All] + +record Gui.InputAction record InputActionState Disabled: InputActionState + Inactive: InputActionState + Enabled: InputActionState +end + record InvokeData record Status Triggered: Status + Repeat: Status + PressedStep: Status + EndReleased: Status + EndAborted: Status +end + status: Status +end + modifierOnlyActionIsActive: function(inputActionId : string): boolean + hasConflicts: function(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): string + findDuplicatesOf: function(inputActionId : string): {string} + getFixedKeyCmdDefs: function(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): {string : {KeyComboDef}} +end +``` + +### Gui.InputAction.InputActionState[πŸ”—](#$api.gui~Gui.InputAction.InputActionState) + +``` +record Gui.InputAction.InputActionState Disabled: InputActionState + Inactive: InputActionState + Enabled: InputActionState +end +``` + +### Gui.InputAction.InputActionState.Disabled[πŸ”—](#$api.gui~Gui.InputAction.InputActionState.Disabled) + +``` +Gui.InputAction.InputActionState.Disabled: InputActionState +``` + +### Gui.InputAction.InputActionState.Inactive[πŸ”—](#$api.gui~Gui.InputAction.InputActionState.Inactive) + +``` +Gui.InputAction.InputActionState.Inactive: InputActionState +``` + +### Gui.InputAction.InputActionState.Enabled[πŸ”—](#$api.gui~Gui.InputAction.InputActionState.Enabled) + +``` +Gui.InputAction.InputActionState.Enabled: InputActionState +``` + +### Gui.InputAction.InvokeData[πŸ”—](#$api.gui~Gui.InputAction.InvokeData) + +``` +[Expand All] [Collapse All] + +record Gui.InputAction.InvokeData record Status Triggered: Status + Repeat: Status + PressedStep: Status + EndReleased: Status + EndAborted: Status +end + status: Status +end +``` + +Additional info about the invocation of an input action event + +### Gui.InputAction.InvokeData.Status[πŸ”—](#$api.gui~Gui.InputAction.InvokeData.Status) + +``` +record Gui.InputAction.InvokeData.Status Triggered: Status + Repeat: Status + PressedStep: Status + EndReleased: Status + EndAborted: Status +end +``` + +Status type of the InputActionInvokeData + +### Gui.InputAction.InvokeData.Status.Triggered[πŸ”—](#$api.gui~Gui.InputAction.InvokeData.Status.Triggered) + +``` +Gui.InputAction.InvokeData.Status.Triggered: Status +``` + +### Gui.InputAction.InvokeData.Status.Repeat[πŸ”—](#$api.gui~Gui.InputAction.InvokeData.Status.Repeat) + +``` +Gui.InputAction.InvokeData.Status.Repeat: Status +``` + +### Gui.InputAction.InvokeData.Status.PressedStep[πŸ”—](#$api.gui~Gui.InputAction.InvokeData.Status.PressedStep) + +``` +Gui.InputAction.InvokeData.Status.PressedStep: Status +``` + +### Gui.InputAction.InvokeData.Status.EndReleased[πŸ”—](#$api.gui~Gui.InputAction.InvokeData.Status.EndReleased) + +``` +Gui.InputAction.InvokeData.Status.EndReleased: Status +``` + +### Gui.InputAction.InvokeData.Status.EndAborted[πŸ”—](#$api.gui~Gui.InputAction.InvokeData.Status.EndAborted) + +``` +Gui.InputAction.InvokeData.Status.EndAborted: Status +``` + +### Gui.InputAction.InvokeData.status[πŸ”—](#$api.gui~Gui.InputAction.InvokeData.status) + +``` +Gui.InputAction.InvokeData.status: Status +``` + +status of the action. + +### Gui.InputAction.modifierOnlyActionIsActive[πŸ”—](#$api.gui~Gui.InputAction.modifierOnlyActionIsActive) + +``` +function Gui.InputAction.modifierOnlyActionIsActive(inputActionId : string): boolean +``` + +Checks if a modifier-only action is currently active. + +**Parameters** + +* `inputActionId` :`string` β€” the input action identifier + +**Returns** + +1. `boolean` β€” True if active. + +### Gui.InputAction.hasConflicts[πŸ”—](#$api.gui~Gui.InputAction.hasConflicts) + +``` +function Gui.InputAction.hasConflicts(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): string +``` + +Checks for key binding conflicts. + +**Parameters** + +* `keyCmdDefinitions` :`{string : {KeyComboDef}}` β€” Key command definitions. +* `inputActionId` :`string` β€” Input action id. +* `keyComboDef` :`KeyComboDef` β€” Key combo definition. + +**Returns** + +1. `string` β€” Conflict description (empty if no conflict). + +### Gui.InputAction.findDuplicatesOf[πŸ”—](#$api.gui~Gui.InputAction.findDuplicatesOf) + +``` +function Gui.InputAction.findDuplicatesOf(inputActionId : string): {string} +``` + +Recursively find list of all IAs that should are duplicates of this one (i.e. duplicateOf == inputActionId and duplicatedKeybindings == true) + +**Parameters** + +* `inputActionId` :`string` β€” Input action id. + +**Returns** + +1. `{string}` β€” Duplications of the IA + +### Gui.InputAction.getFixedKeyCmdDefs[πŸ”—](#$api.gui~Gui.InputAction.getFixedKeyCmdDefs) + +``` +function Gui.InputAction.getFixedKeyCmdDefs(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): {string : {KeyComboDef}} +``` + +Resolves key binding conflicts and returns updated key command definitions. + +**Parameters** + +* `keyCmdDefinitions` :`{string : {KeyComboDef}}` β€” Key command definitions. +* `inputActionId` :`string` β€” Input action id. +* `keyComboDef` :`KeyComboDef` β€” Key combo definition. + +**Returns** + +1. `{string : {KeyComboDef}}` β€” Fixed key command definitions or empty table if change not allowed. + +### Gui.ById[πŸ”—](#$api.gui~Gui.ById) + +``` +record Gui.ById setVisibilityByClass: function(idOrTag : string, visible : boolean, idOnly : boolean) + setEnabled: function(idOrTag : string, enabled : boolean, idOnly : boolean) + setHighlighted: function(idOrTag : string, highlighted : boolean, style : HighlightStyle, color : Vec3f, idOnly : boolean) + isVisible: function(id : string): boolean + isVisibleRecursive: function(id : string): boolean + setVisible: function(id : string, visible : boolean) + resetMovedWindowPosition: function(id : string) + getSize: function(id : string): Vec2f +end +``` + +### Gui.ById.setVisibilityByClass[πŸ”—](#$api.gui~Gui.ById.setVisibilityByClass) + +``` +function Gui.ById.setVisibilityByClass(idOrTag : string, visible : boolean, idOnly : boolean) +``` + +Shows or hides a component. + +**Parameters** + +* `idOrTag` :`string` β€” the component identifier or a tag +* `visible` :`boolean` β€” whether visible or not (nil to reset the rule +* `idOnly` :`boolean` β€” idOnly -> do not consider tags + +### Gui.ById.setEnabled[πŸ”—](#$api.gui~Gui.ById.setEnabled) + +``` +function Gui.ById.setEnabled(idOrTag : string, enabled : boolean, idOnly : boolean) +``` + +Enables or disables a component. + +**Parameters** + +* `idOrTag` :`string` β€” the component identifier or a tag +* `enabled` :`boolean` β€” whether enabled or not (nil sets to enabled and removes the rule) +* `idOnly` :`boolean` β€” idOnly -> do not consider tags + +### Gui.ById.setHighlighted[πŸ”—](#$api.gui~Gui.ById.setHighlighted) + +``` +function Gui.ById.setHighlighted(idOrTag : string, highlighted : boolean, style : HighlightStyle, color : Vec3f, idOnly : boolean) +``` + +Sets the highlighted state of a component. + +**Parameters** + +* `idOrTag` :`string` β€” the component identifier or a tag +* `highlighted` :`boolean` β€” whether highlighted or not (nil sets to not highlighted and removes the rule) +* `style` :`HighlightStyle` β€” defaults to HighlightStyle::Circle +* `color` :`Vec3f` β€” the color of the highlight, defaults to yellow +* `idOnly` :`boolean` β€” idOnly -> do not consider tags + +### Gui.ById.isVisible[πŸ”—](#$api.gui~Gui.ById.isVisible) + +``` +function Gui.ById.isVisible(id : string): boolean +``` + +Checks if a UI component is visible by its id. + +**Parameters** + +* `id` :`string` β€” the component identifier + +**Returns** + +1. `boolean` β€” true if the component is visible + +### Gui.ById.isVisibleRecursive[πŸ”—](#$api.gui~Gui.ById.isVisibleRecursive) + +``` +function Gui.ById.isVisibleRecursive(id : string): boolean +``` + +Checks if a UI component and all its parents are visible by id. + +**Parameters** + +* `id` :`string` β€” the component identifier + +**Returns** + +1. `boolean` β€” true if the component and all parents are visible + +### Gui.ById.setVisible[πŸ”—](#$api.gui~Gui.ById.setVisible) + +``` +function Gui.ById.setVisible(id : string, visible : boolean) +``` + +Sets the visibility of a UI component by its ID. + +**Parameters** + +* `id` :`string` β€” the component identifier +* `visible` :`boolean` β€” if the component should be visible + +### Gui.ById.resetMovedWindowPosition[πŸ”—](#$api.gui~Gui.ById.resetMovedWindowPosition) + +``` +function Gui.ById.resetMovedWindowPosition(id : string) +``` + +Resets a window to its original position if it was moved by the user. + +**Parameters** + +* `id` :`string` β€” string id the window identifier + +### Gui.ById.getSize[πŸ”—](#$api.gui~Gui.ById.getSize) + +``` +function Gui.ById.getSize(id : string): Vec2f +``` + +Get width and height of UI component + +**Parameters** + +* `id` :`string` β€” string id the window identifier + +**Returns** + +1. `Vec2f` β€” width and height + +### Gui.Camera[πŸ”—](#$api.gui~Gui.Camera) + +``` +record Gui.Camera setManualCamera: function(center : Vec2f, distance : number) + getCameraData: function(): Vec5f + setCameraData: function(Vec5f : Vec5f) + getHeightAboveTerrain: function(): number + focusEntity: function(entity : Engine.Entity) + focusPosition: function(position : Vec3f, distance : number) + takeScreenshot: function(scale : integer) + getFollowEntity: function(): {Engine.Entity, Engine.Revision} + followEntity: function(entity : Engine.Entity, jump : boolean) + enterFollowCameraCockpit: function(entity : Engine.Entity) + leaveFollowCameraCockpit: function() + isFreeCameraMouseAttached: function(): boolean + toggleFreeCameraMouseAttachment: function() + toggleFreeCamera: function() + world2Screen: function(Vec3f): Vec2i + screen2World: function(Vec3f): Vec3f + getEye: function(): Vec3f + getCenter: function(): Vec3f + getNearFar: function(): Vec2f + getSize: function(): Vec2i + traceToTerrain: function(worldPos : Vec3f, farPos : Vec3f, zOffset : number, numSteps : integer): Vec3f | nil +end +``` + +### Gui.Camera.setManualCamera[πŸ”—](#$api.gui~Gui.Camera.setManualCamera) + +``` +function Gui.Camera.setManualCamera(center : Vec2f, distance : number) +``` + +Sets camera to a given position/orientation. + +**Parameters** + +* `center` :`Vec2f` β€” position on the map where the camera should point to +* `distance` :`number` β€” the distance from the position + +### Gui.Camera.getCameraData[πŸ”—](#$api.gui~Gui.Camera.getCameraData) + +``` +function Gui.Camera.getCameraData(): Vec5f +``` + +Obtains the current camera data. + +**Returns** + +1. `Vec5f` β€” the current camera data as a Vec5f {center.x, center.y, distance, angle, pitch} + +### Gui.Camera.setCameraData[πŸ”—](#$api.gui~Gui.Camera.setCameraData) + +``` +function Gui.Camera.setCameraData(Vec5f : Vec5f) +``` + +Set the camera data. + +**Parameters** + +* `Vec5f` :`Vec5f` β€” set the camera data as a Vec5f {center.x, center.y, distance, angle, pitch} + +### Gui.Camera.getHeightAboveTerrain[πŸ”—](#$api.gui~Gui.Camera.getHeightAboveTerrain) + +``` +function Gui.Camera.getHeightAboveTerrain(): number +``` + +Obtains the current height above terrain. + +**Returns** + +1. `number` β€” the height of the camera above the terrain + +### Gui.Camera.focusEntity[πŸ”—](#$api.gui~Gui.Camera.focusEntity) + +``` +function Gui.Camera.focusEntity(entity : Engine.Entity) +``` + +Focuses the camera on an entity. + +**Parameters** + +* `entity` :`Engine.Entity` β€” the id of the entity that should be focused on + +### Gui.Camera.focusPosition[πŸ”—](#$api.gui~Gui.Camera.focusPosition) + +``` +function Gui.Camera.focusPosition(position : Vec3f, distance : number) +``` + +Focuses the camera on a position. + +**Parameters** + +* `position` :`Vec3f` β€” the position that should be focused +* `distance` :`number` β€” the distance of the camera from the target + +### Gui.Camera.takeScreenshot[πŸ”—](#$api.gui~Gui.Camera.takeScreenshot) + +``` +function Gui.Camera.takeScreenshot(scale : integer) +``` + +Takes a screenshot and stores it in userdata folder + +**Parameters** + +* `scale` :`integer` β€” image resolution + +### Gui.Camera.getFollowEntity[πŸ”—](#$api.gui~Gui.Camera.getFollowEntity) + +``` +function Gui.Camera.getFollowEntity(): {Engine.Entity, Engine.Revision} +``` + +Gets the entity currently being followed. + +**Returns** + +1. `{Engine.Entity, Engine.Revision}` β€” the entity being followed (and the entity revision) + +### Gui.Camera.followEntity[πŸ”—](#$api.gui~Gui.Camera.followEntity) + +``` +function Gui.Camera.followEntity(entity : Engine.Entity, jump : boolean) +``` + +Sets camera to follow an Entity. + +**Parameters** + +* `entity` :`Engine.Entity` β€” the id of the entity that should be followed +* `jump` :`boolean` β€” true if the camera should directly jump to the entity and not slide there + +### Gui.Camera.enterFollowCameraCockpit[πŸ”—](#$api.gui~Gui.Camera.enterFollowCameraCockpit) + +``` +function Gui.Camera.enterFollowCameraCockpit(entity : Engine.Entity) +``` + +Enters the cockpit of an entity. + +**Parameters** + +* `entity` :`Engine.Entity` β€” entity of the object to enter + +### Gui.Camera.leaveFollowCameraCockpit[πŸ”—](#$api.gui~Gui.Camera.leaveFollowCameraCockpit) + +``` +function Gui.Camera.leaveFollowCameraCockpit() +``` + +Leave the cockpit of an entity. + +### Gui.Camera.isFreeCameraMouseAttached[πŸ”—](#$api.gui~Gui.Camera.isFreeCameraMouseAttached) + +``` +function Gui.Camera.isFreeCameraMouseAttached(): boolean +``` + +Tells if mouse is attached to free cam or not + +**Returns** + +1. `boolean` β€” if mouse is attached (true) or not (false) + +### Gui.Camera.toggleFreeCameraMouseAttachment[πŸ”—](#$api.gui~Gui.Camera.toggleFreeCameraMouseAttachment) + +``` +function Gui.Camera.toggleFreeCameraMouseAttachment() +``` + +Toggles mouse attachment + +### Gui.Camera.toggleFreeCamera[πŸ”—](#$api.gui~Gui.Camera.toggleFreeCamera) + +``` +function Gui.Camera.toggleFreeCamera() +``` + +Toggles free camera + +### Gui.Camera.world2Screen[πŸ”—](#$api.gui~Gui.Camera.world2Screen) + +``` +function Gui.Camera.world2Screen(Vec3f): Vec2i +``` + +Convert a 3D World position into a position on screen (in pixels) + +**Parameters** + +* `Vec3f` + +**Returns** + +1. `Vec2i` + +### Gui.Camera.screen2World[πŸ”—](#$api.gui~Gui.Camera.screen2World) + +``` +function Gui.Camera.screen2World(Vec3f): Vec3f +``` + +Convert a position on the screen (in pixels) (with depth [0, 1]) into a 3D World position + +**Parameters** + +* `Vec3f` + +**Returns** + +1. `Vec3f` + +### Gui.Camera.getEye[πŸ”—](#$api.gui~Gui.Camera.getEye) + +``` +function Gui.Camera.getEye(): Vec3f +``` + +Get camera origin in world coordinates + +**Returns** + +1. `Vec3f` + +### Gui.Camera.getCenter[πŸ”—](#$api.gui~Gui.Camera.getCenter) + +``` +function Gui.Camera.getCenter(): Vec3f +``` + +Get camera center ("look-at" pos) in world coordinates + +**Returns** + +1. `Vec3f` + +### Gui.Camera.getNearFar[πŸ”—](#$api.gui~Gui.Camera.getNearFar) + +``` +function Gui.Camera.getNearFar(): Vec2f +``` + +Get near and far distances of camera in x and y coordinates repsectively + +**Returns** + +1. `Vec2f` + +### Gui.Camera.getSize[πŸ”—](#$api.gui~Gui.Camera.getSize) + +``` +function Gui.Camera.getSize(): Vec2i +``` + +Width and height of the viewport, in pixels + +**Returns** + +1. `Vec2i` + +### Gui.Camera.traceToTerrain[πŸ”—](#$api.gui~Gui.Camera.traceToTerrain) + +``` +function Gui.Camera.traceToTerrain(worldPos : Vec3f, farPos : Vec3f, zOffset : number, numSteps : integer): Vec3f | nil +``` + +Trace a ray from worldPos to farPos, and find the intersection (if any) with the terrain, offsetted at zOffset + +**Parameters** + +* `worldPos` :`Vec3f` β€” world position of starting point of ray +* `farPos` :`Vec3f` β€” world position of end point of ray +* `zOffset` :`number` β€” offset to shift the terrain for intersection +* `numSteps` :`integer` β€” number of steps to perform for finding an intersection. more steps are more precise but cost more, 30 is a good compromise + +**Returns** + +1. `Vec3f | nil` + +### Gui.Sound[πŸ”—](#$api.gui~Gui.Sound) + +``` +record Gui.Sound letVehicleHorn: function(vehicleEntity : Engine.Entity) + playRandomSoundEffect: function(paths : {FilePath}) +end +``` + +### Gui.Sound.letVehicleHorn[πŸ”—](#$api.gui~Gui.Sound.letVehicleHorn) + +``` +function Gui.Sound.letVehicleHorn(vehicleEntity : Engine.Entity) +``` + +Sounds the vehicle horn. + +**Parameters** + +* `vehicleEntity` :`Engine.Entity` β€” the vehicle to sound the horn + +### Gui.Sound.playRandomSoundEffect[πŸ”—](#$api.gui~Gui.Sound.playRandomSoundEffect) + +``` +function Gui.Sound.playRandomSoundEffect(paths : {FilePath}) +``` + +Plays a single sound effect randomly selected of the provided selection. + +**Parameters** + +* `paths` :`{FilePath}` β€” vector of strings paths of sound effects + +### Gui.MusicPlayer[πŸ”—](#$api.gui~Gui.MusicPlayer) + +``` +record Gui.MusicPlayer goBack: function() + goForward: function() + togglePause: function() + getTitle: function(): string + getArtist: function(): string + hasPlaylist: function(): boolean + getPlaylistIndex: function(): integer + setTrackListFromPlayList: function(playlist : string, startPaused : boolean, offset : number) + setPlaylist: function(playlist : string) + getPlaylist: function(): string + isPlaying: function(): boolean + playTrack: function(trackName : string, offset : number) + playTrackFile: function(filePath : string, offset : number) + getTrackLength: function(): number + getTrackElapsedTime: function(): number + getGain: function(): number + setGain: function(gain : number) + setTrackList: function(trackList : {{string, string, boolean}}, enableRepeat : boolean) + addTrackList: function(trackList : {{string, string, boolean}}, enableRepeat : boolean) + setContextTag: function(contextTag : string) +end +``` + +### Gui.MusicPlayer.goBack[πŸ”—](#$api.gui~Gui.MusicPlayer.goBack) + +``` +function Gui.MusicPlayer.goBack() +``` + +Goes back to the previous track in the music player. + +### Gui.MusicPlayer.goForward[πŸ”—](#$api.gui~Gui.MusicPlayer.goForward) + +``` +function Gui.MusicPlayer.goForward() +``` + +Goes forward to the next track in the music player. + +### Gui.MusicPlayer.togglePause[πŸ”—](#$api.gui~Gui.MusicPlayer.togglePause) + +``` +function Gui.MusicPlayer.togglePause() +``` + +Toggles pause/play state of the music player. + +### Gui.MusicPlayer.getTitle[πŸ”—](#$api.gui~Gui.MusicPlayer.getTitle) + +``` +function Gui.MusicPlayer.getTitle(): string +``` + +Gets the title of the currently playing track. + +**Returns** + +1. `string` β€” the track title + +### Gui.MusicPlayer.getArtist[πŸ”—](#$api.gui~Gui.MusicPlayer.getArtist) + +``` +function Gui.MusicPlayer.getArtist(): string +``` + +Gets the artist of the currently playing track. + +**Returns** + +1. `string` β€” the track artist + +### Gui.MusicPlayer.hasPlaylist[πŸ”—](#$api.gui~Gui.MusicPlayer.hasPlaylist) + +``` +function Gui.MusicPlayer.hasPlaylist(): boolean +``` + +Checks if the music player has tracks loaded. + +**Returns** + +1. `boolean` β€” true if the music player has tracks + +### Gui.MusicPlayer.getPlaylistIndex[πŸ”—](#$api.gui~Gui.MusicPlayer.getPlaylistIndex) + +``` +function Gui.MusicPlayer.getPlaylistIndex(): integer +``` + +Gets the current track index (1-based). + +**Returns** + +1. `integer` β€” the current track index + +### Gui.MusicPlayer.setTrackListFromPlayList[πŸ”—](#$api.gui~Gui.MusicPlayer.setTrackListFromPlayList) + +``` +function Gui.MusicPlayer.setTrackListFromPlayList(playlist : string, startPaused : boolean, offset : number) +``` + +Sets the current playlist. +The current track will only start after the current track ends. To trigger the new playlist immediately, call `goForward()` right after this call. + +**Parameters** + +* `playlist` :`string` β€” the playlist resource name +* `startPaused` :`boolean` β€” if set, does not play the playlist, just prepares it +* `offset` :`number` β€” playback offset in seconds (optional) + +### Gui.MusicPlayer.setPlaylist[πŸ”—](#$api.gui~Gui.MusicPlayer.setPlaylist) + +``` +function Gui.MusicPlayer.setPlaylist(playlist : string) +``` + +Sets the current playlist. Only available while in-game. +The current track will only start after the current track ends. To trigger the new playlist immediately, call `goForward()` right after this call. + +**Parameters** + +* `playlist` :`string` β€” the playlist resource name + +### Gui.MusicPlayer.getPlaylist[πŸ”—](#$api.gui~Gui.MusicPlayer.getPlaylist) + +``` +function Gui.MusicPlayer.getPlaylist(): string +``` + +Gets the current playlist. Only available while in-game. + +**Returns** + +1. `string` β€” the resource name of the current playlist + +### Gui.MusicPlayer.isPlaying[πŸ”—](#$api.gui~Gui.MusicPlayer.isPlaying) + +``` +function Gui.MusicPlayer.isPlaying(): boolean +``` + +Checks if the music player is currently playing. + +**Returns** + +1. `boolean` β€” true if music is playing + +### Gui.MusicPlayer.playTrack[πŸ”—](#$api.gui~Gui.MusicPlayer.playTrack) + +``` +function Gui.MusicPlayer.playTrack(trackName : string, offset : number) +``` + +Plays a track by name. + +**Parameters** + +* `trackName` :`string` β€” the name of the track to play +* `offset` :`number` β€” playback offset in seconds (optional) + +### Gui.MusicPlayer.playTrackFile[πŸ”—](#$api.gui~Gui.MusicPlayer.playTrackFile) + +``` +function Gui.MusicPlayer.playTrackFile(filePath : string, offset : number) +``` + +Plays a specific file that might not be part of the current track list + +**Parameters** + +* `filePath` :`string` β€” the path to the track file +* `offset` :`number` β€” playback offset in seconds (optional) + +### Gui.MusicPlayer.getTrackLength[πŸ”—](#$api.gui~Gui.MusicPlayer.getTrackLength) + +``` +function Gui.MusicPlayer.getTrackLength(): number +``` + +Gets the length (duration) of the current track + +**Returns** + +1. `number` β€” the track duration in second + +### Gui.MusicPlayer.getTrackElapsedTime[πŸ”—](#$api.gui~Gui.MusicPlayer.getTrackElapsedTime) + +``` +function Gui.MusicPlayer.getTrackElapsedTime(): number +``` + +Gets the time of the current track + +**Returns** + +1. `number` β€” the current time of the current track + +### Gui.MusicPlayer.getGain[πŸ”—](#$api.gui~Gui.MusicPlayer.getGain) + +``` +function Gui.MusicPlayer.getGain(): number +``` + +Gets the current gain (volume) of the music player. + +**Returns** + +1. `number` β€” the gain value + +### Gui.MusicPlayer.setGain[πŸ”—](#$api.gui~Gui.MusicPlayer.setGain) + +``` +function Gui.MusicPlayer.setGain(gain : number) +``` + +Sets the gain (volume) of the music player. + +**Parameters** + +* `gain` :`number` β€” the gain value + +### Gui.MusicPlayer.setTrackList[πŸ”—](#$api.gui~Gui.MusicPlayer.setTrackList) + +``` +function Gui.MusicPlayer.setTrackList(trackList : {{string, string, boolean}}, enableRepeat : boolean) +``` + +Sets the track list for the music player, replaces the current track list. + +**Parameters** + +* `trackList` :`{{string, string, boolean}}` β€” array of tuples containing track name, file path, and repeat flag +* `enableRepeat` :`boolean` β€” true to enable repeat for the entire list + +### Gui.MusicPlayer.addTrackList[πŸ”—](#$api.gui~Gui.MusicPlayer.addTrackList) + +``` +function Gui.MusicPlayer.addTrackList(trackList : {{string, string, boolean}}, enableRepeat : boolean) +``` + +Adds a track list to the music player. This doesn't replace the existing tracks +and once the added tracks are finish, the track previously playing will resume + +**Parameters** + +* `trackList` :`{{string, string, boolean}}` β€” array of tuples containing track name, file path, and repeat flag +* `enableRepeat` :`boolean` β€” true to enable repeat for the entire list + +### Gui.MusicPlayer.setContextTag[πŸ”—](#$api.gui~Gui.MusicPlayer.setContextTag) + +``` +function Gui.MusicPlayer.setContextTag(contextTag : string) +``` + +Sets the context tag for the music player. +The context tag can be used to change the variant of a playing track. + +**Parameters** + +* `contextTag` :`string` β€” the context tag to set + +### Gui.VoiceOverManager[πŸ”—](#$api.gui~Gui.VoiceOverManager) + +``` +record Gui.VoiceOverManager stop: function() + play: function(voiceOverRes : string, delayInSeconds : number) + isPlaying: function(voiceOverRes : string): boolean + isPlayingAny: function(): boolean + getPlaying: function(): ResName +end +``` + +### Gui.VoiceOverManager.stop[πŸ”—](#$api.gui~Gui.VoiceOverManager.stop) + +``` +function Gui.VoiceOverManager.stop() +``` + +Stops the current voice over playing + +### Gui.VoiceOverManager.play[πŸ”—](#$api.gui~Gui.VoiceOverManager.play) + +``` +function Gui.VoiceOverManager.play(voiceOverRes : string, delayInSeconds : number) +``` + +Plays a new voice over + +**Parameters** + +* `voiceOverRes` :`string` β€” the file path to the voice over to play +* `delayInSeconds` :`number` β€” delay before the voice over starts + +### Gui.VoiceOverManager.isPlaying[πŸ”—](#$api.gui~Gui.VoiceOverManager.isPlaying) + +``` +function Gui.VoiceOverManager.isPlaying(voiceOverRes : string): boolean +``` + +Checks whether a specific voice over is playing + +**Parameters** + +* `voiceOverRes` :`string` β€” the voice over file to check + +**Returns** + +1. `boolean` β€” true if the voice over file is playing + +### Gui.VoiceOverManager.isPlayingAny[πŸ”—](#$api.gui~Gui.VoiceOverManager.isPlayingAny) + +``` +function Gui.VoiceOverManager.isPlayingAny(): boolean +``` + +Checks whether any voice over is current playing + +**Returns** + +1. `boolean` β€” true if any voice over is playing + +### Gui.VoiceOverManager.getPlaying[πŸ”—](#$api.gui~Gui.VoiceOverManager.getPlaying) + +``` +function Gui.VoiceOverManager.getPlaying(): ResName +``` + +Checks whether any voice over is current playing and returns the file path if one is playing + +**Returns** + +1. `ResName` β€” file path if any voice over is playing + +### Gui.ByEntity[πŸ”—](#$api.gui~Gui.ByEntity) + +``` +record Gui.ByEntity isLineEmptyOrVisible: function(Engine.Entity : Engine.Entity): boolean + isVisible: function(Engine.Entity : Engine.Entity): boolean + isVehicleVisible: function(Engine.Entity : Engine.Entity): boolean +end +``` + +### Gui.ByEntity.isLineEmptyOrVisible[πŸ”—](#$api.gui~Gui.ByEntity.isLineEmptyOrVisible) + +``` +function Gui.ByEntity.isLineEmptyOrVisible(Engine.Entity : Engine.Entity): boolean +``` + +Checks if line is empty or visible + +**Parameters** + +* `Engine.Entity` :`Engine.Entity` β€” the line entity to check + +**Returns** + +1. `boolean` β€” true if the line is empty or visible + +### Gui.ByEntity.isVisible[πŸ”—](#$api.gui~Gui.ByEntity.isVisible) + +``` +function Gui.ByEntity.isVisible(Engine.Entity : Engine.Entity): boolean +``` + +Checks if an entity is visible + +**Parameters** + +* `Engine.Entity` :`Engine.Entity` β€” the entity to check + +**Returns** + +1. `boolean` β€” true if the entity is visible + +### Gui.ByEntity.isVehicleVisible[πŸ”—](#$api.gui~Gui.ByEntity.isVehicleVisible) + +``` +function Gui.ByEntity.isVehicleVisible(Engine.Entity : Engine.Entity): boolean +``` + +Checks if vehicle is visible + +**Parameters** + +* `Engine.Entity` :`Engine.Entity` β€” the vehicle entity to check + +**Returns** + +1. `boolean` β€” true if the vehicle is visible + +### Gui.ContextHelper[πŸ”—](#$api.gui~Gui.ContextHelper) + +``` +[Expand All] [Collapse All] + +record Gui.ContextHelper record SubjectState Visible: SubjectState + Focused: SubjectState +end + collectSubjectStates: function(idsOfInterest : {string}): {string : SubjectState} + getIdsOfActiveTool: function(): {string} +end +``` + +### Gui.ContextHelper.SubjectState[πŸ”—](#$api.gui~Gui.ContextHelper.SubjectState) + +``` +record Gui.ContextHelper.SubjectState Visible: SubjectState + Focused: SubjectState +end +``` + +### Gui.ContextHelper.SubjectState.Visible[πŸ”—](#$api.gui~Gui.ContextHelper.SubjectState.Visible) + +``` +Gui.ContextHelper.SubjectState.Visible: SubjectState +``` + +### Gui.ContextHelper.SubjectState.Focused[πŸ”—](#$api.gui~Gui.ContextHelper.SubjectState.Focused) + +``` +Gui.ContextHelper.SubjectState.Focused: SubjectState +``` + +### Gui.ContextHelper.collectSubjectStates[πŸ”—](#$api.gui~Gui.ContextHelper.collectSubjectStates) + +``` +function Gui.ContextHelper.collectSubjectStates(idsOfInterest : {string}): {string : SubjectState} +``` + +Collects subject states for given ids + +**Parameters** + +* `idsOfInterest` :`{string}` β€” ids to collect states for + +**Returns** + +1. `{string : SubjectState}` + +### Gui.ContextHelper.getIdsOfActiveTool[πŸ”—](#$api.gui~Gui.ContextHelper.getIdsOfActiveTool) + +``` +function Gui.ContextHelper.getIdsOfActiveTool(): {string} +``` + +**Returns** + +1. `{string}` + +### Gui.Construction[πŸ”—](#$api.gui~Gui.Construction) + +``` +record Gui.Construction setAngle: function(angle : number) + modify: function(construction : Engine.Entity) + getBrushIcons: function(): {string} + provideDustWheneverPossible: function(proposal : Proposal, proposalData : ProposalData) + getRefundableEntities: function(): {{Engine.Entity, integer}, {Engine.Revision, integer}} + updateRefundableEntities: function(resultEntities : {Engine.Entity}, proposal : Proposal.StreetProposal) +end +``` + +### Gui.Construction.setAngle[πŸ”—](#$api.gui~Gui.Construction.setAngle) + +``` +function Gui.Construction.setAngle(angle : number) +``` + +Sets the default construction angle for constructions. + +**Parameters** + +* `angle` :`number` β€” the default construction angle + +### Gui.Construction.modify[πŸ”—](#$api.gui~Gui.Construction.modify) + +``` +function Gui.Construction.modify(construction : Engine.Entity) +``` + +Modifies a construction + +**Parameters** + +* `construction` :`Engine.Entity` β€” the construction entity + +### Gui.Construction.getBrushIcons[πŸ”—](#$api.gui~Gui.Construction.getBrushIcons) + +``` +function Gui.Construction.getBrushIcons(): {string} +``` + +Returns brush icons for construction menu + +**Returns** + +1. `{string}` β€” paths to brush icons for the construction menu + +### Gui.Construction.provideDustWheneverPossible[πŸ”—](#$api.gui~Gui.Construction.provideDustWheneverPossible) + +``` +function Gui.Construction.provideDustWheneverPossible(proposal : Proposal, proposalData : ProposalData) +``` + +Provides dust effects for proposal + +**Parameters** + +* `proposal` :`Proposal` β€” the proposal +* `proposalData` :`ProposalData` β€” the proposal data + +### Gui.Construction.getRefundableEntities[πŸ”—](#$api.gui~Gui.Construction.getRefundableEntities) + +``` +function Gui.Construction.getRefundableEntities(): {{Engine.Entity, integer}, {Engine.Revision, integer}} +``` + +**Returns** + +1. `{{Engine.Entity, integer}, {Engine.Revision, integer}}` + +### Gui.Construction.updateRefundableEntities[πŸ”—](#$api.gui~Gui.Construction.updateRefundableEntities) + +``` +function Gui.Construction.updateRefundableEntities(resultEntities : {Engine.Entity}, proposal : Proposal.StreetProposal) +``` + +Updates refundable entities + +**Parameters** + +* `resultEntities` :`{Engine.Entity}` β€” result entities +* `proposal` :`Proposal.StreetProposal` β€” the street proposal + +### Gui.Mission[πŸ”—](#$api.gui~Gui.Mission) + +``` +record Gui.Mission getMission: function(): string + getCampaign: function(): string + setZone: function(key : string, polygon : {Vec2f}, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number) + setZoneCircle: function(key : string, center : Vec2f, radius : number, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number) + removeZone: function(key : string) + setMarkerAtPosition: function(key : string, pos : Vec3f, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean) + setMarkerAtEntity: function(key : string, entity : Engine.Entity, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean) + removeMarker: function(key : string) + setMovePathVisualizationAtEntity: function(key : string, entity : Engine.Entity, color : Vec3f) + removeMovePathVisualization: function(key : string) + playCutscene: function(filePath : string, resolveLanguageFolder : boolean, entityToEntityMap : {Engine.Entity : Engine.Entity}) + isCutscenePlaying: function(): boolean + getCutsceneElapsedTime: function(): number +end +``` + +### Gui.Mission.getMission[πŸ”—](#$api.gui~Gui.Mission.getMission) + +``` +function Gui.Mission.getMission(): string +``` + +Get the current mission + +**Returns** + +1. `string` β€” the mission name + +### Gui.Mission.getCampaign[πŸ”—](#$api.gui~Gui.Mission.getCampaign) + +``` +function Gui.Mission.getCampaign(): string +``` + +Get the current campaign + +**Returns** + +1. `string` β€” the campaign name + +### Gui.Mission.setZone[πŸ”—](#$api.gui~Gui.Mission.setZone) + +``` +function Gui.Mission.setZone(key : string, polygon : {Vec2f}, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number) +``` + +Adds a zone + +**Parameters** + +* `key` :`string` β€” the key (name) of the zone +* `polygon` :`{Vec2f}` β€” the shape of the zone as a list of 2d position +* `draw` :`boolean` β€” if the zone should be drawn +* `drawColor` :`Vec4f` β€” the color of the zone +* `prohibitBuilding` :`boolean` β€” if prevented or not to build inside the zone +* `playAnimation` :`boolean` β€” if player zone animation (optional), default to true +* `zOffset` :`number` β€” (optional), default to terrain level + +### Gui.Mission.setZoneCircle[πŸ”—](#$api.gui~Gui.Mission.setZoneCircle) + +``` +function Gui.Mission.setZoneCircle(key : string, center : Vec2f, radius : number, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number) +``` + +Adds a zone as a cylinder + +**Parameters** + +* `key` :`string` β€” the key (name) of the zone +* `center` :`Vec2f` β€” the center of the zone +* `radius` :`number` β€” the radius of the zone +* `draw` :`boolean` β€” if the zone should be drawn +* `drawColor` :`Vec4f` β€” the color of the zone +* `prohibitBuilding` :`boolean` β€” if prevented or not to build inside the zone +* `playAnimation` :`boolean` β€” if player zone animation (optional), default to true +* `zOffset` :`number` β€” (optional), default to terrain level + +### Gui.Mission.removeZone[πŸ”—](#$api.gui~Gui.Mission.removeZone) + +``` +function Gui.Mission.removeZone(key : string) +``` + +Removes a zone + +**Parameters** + +* `key` :`string` β€” the key of the zone + +### Gui.Mission.setMarkerAtPosition[πŸ”—](#$api.gui~Gui.Mission.setMarkerAtPosition) + +``` +function Gui.Mission.setMarkerAtPosition(key : string, pos : Vec3f, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean) +``` + +Sets marker at the given position + +**Parameters** + +* `key` :`string` β€” the key of the marker +* `pos` :`Vec3f` β€” the position of the marker +* `type` :`string` β€” type of marker (optional) +* `scaling` :`number` β€” scaling of marker (optional) +* `isSelectable` :`boolean` β€” whether marker is selectable +* `fireSelectEntity` :`boolean` β€” whether selecting the marker also selects the underlying entity (default is true) + +### Gui.Mission.setMarkerAtEntity[πŸ”—](#$api.gui~Gui.Mission.setMarkerAtEntity) + +``` +function Gui.Mission.setMarkerAtEntity(key : string, entity : Engine.Entity, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean) +``` + +Sets marker at the given entity + +**Parameters** + +* `key` :`string` β€” the key of the marker +* `entity` :`Engine.Entity` β€” the entity +* `type` :`string` β€” optional type +* `scaling` :`number` β€” optional scaling +* `isSelectable` :`boolean` β€” whether marker is selectable +* `fireSelectEntity` :`boolean` β€” whether selecting the marker also selects the underlying entity (default is true) + +### Gui.Mission.removeMarker[πŸ”—](#$api.gui~Gui.Mission.removeMarker) + +``` +function Gui.Mission.removeMarker(key : string) +``` + +Removes a marker + +**Parameters** + +* `key` :`string` β€” the key of the marker + +### Gui.Mission.setMovePathVisualizationAtEntity[πŸ”—](#$api.gui~Gui.Mission.setMovePathVisualizationAtEntity) + +``` +function Gui.Mission.setMovePathVisualizationAtEntity(key : string, entity : Engine.Entity, color : Vec3f) +``` + +Renderes the move path of an entity dynamically +ATTENTION: at the moment, only ships are supported. + +**Parameters** + +* `key` :`string` β€” unique key +* `entity` :`Engine.Entity` β€” entity +* `color` :`Vec3f` β€” optional color + +### Gui.Mission.removeMovePathVisualization[πŸ”—](#$api.gui~Gui.Mission.removeMovePathVisualization) + +``` +function Gui.Mission.removeMovePathVisualization(key : string) +``` + +Removes the move path of an entity dynamically + +**Parameters** + +* `key` :`string` β€” unique key + +### Gui.Mission.playCutscene[πŸ”—](#$api.gui~Gui.Mission.playCutscene) + +``` +function Gui.Mission.playCutscene(filePath : string, resolveLanguageFolder : boolean, entityToEntityMap : {Engine.Entity : Engine.Entity}) +``` + +Plays a cutscene. + +**Parameters** + +* `filePath` :`string` β€” the filepath to the cutscene keyframe definition that should be played +* `resolveLanguageFolder` :`boolean` β€” automatically resolve the selected keyframe file by language +* `entityToEntityMap` :`{Engine.Entity : Engine.Entity}` β€” maps entities from the keyframe file to possible runtime entities + +### Gui.Mission.isCutscenePlaying[πŸ”—](#$api.gui~Gui.Mission.isCutscenePlaying) + +``` +function Gui.Mission.isCutscenePlaying(): boolean +``` + +Checks if a cutscene is currently playing. + +**Returns** + +1. `boolean` + +### Gui.Mission.getCutsceneElapsedTime[πŸ”—](#$api.gui~Gui.Mission.getCutsceneElapsedTime) + +``` +function Gui.Mission.getCutsceneElapsedTime(): number +``` + +Return the current cutscene time for syncing mission related systems to the cutscene + +**Returns** + +1. `number` β€” the actual simulated cutscene time + +### Gui.Game[πŸ”—](#$api.gui~Gui.Game) + +``` +record Gui.Game isSavegameUIBlocked: function(): boolean + setInGameMenuPause: function(pause : boolean) + getGuiSaveData: function(modId : string): { : } + setGuiSaveData: function(modId : string, data : { : }) + getEstimatedMaximumGameSpeed: function(): integer + isMapEditor: function(): boolean + getDefaultSavegameId: function(): string + setEnvironment: function(environment : ResName) + getEnvironment: function(): ResName +end +``` + +### Gui.Game.isSavegameUIBlocked[πŸ”—](#$api.gui~Gui.Game.isSavegameUIBlocked) + +``` +function Gui.Game.isSavegameUIBlocked(): boolean +``` + +Returns if the UI is blocked by a savegame in progress + +**Returns** + +1. `boolean` β€” true if the ui is blocked by a savegame + +### Gui.Game.setInGameMenuPause[πŸ”—](#$api.gui~Gui.Game.setInGameMenuPause) + +``` +function Gui.Game.setInGameMenuPause(pause : boolean) +``` + +Sets if the game pause menu is open + +**Parameters** + +* `pause` :`boolean` β€” true if the user is in the pause menu + +### Gui.Game.getGuiSaveData[πŸ”—](#$api.gui~Gui.Game.getGuiSaveData) + +``` +function Gui.Game.getGuiSaveData(modId : string): { : } +``` + +Returns the GUI SaveData + +**Parameters** + +* `modId` :`string` β€” the mod to get the user data for + +**Returns** + +1. `{ : }` β€” the userData as a lua table + +### Gui.Game.setGuiSaveData[πŸ”—](#$api.gui~Gui.Game.setGuiSaveData) + +``` +function Gui.Game.setGuiSaveData(modId : string, data : { : }) +``` + +Sets the GUI SaveData + +**Parameters** + +* `modId` :`string` β€” the mod to set the user data for +* `data` :`{ : }` β€” the user data + +### Gui.Game.getEstimatedMaximumGameSpeed[πŸ”—](#$api.gui~Gui.Game.getEstimatedMaximumGameSpeed) + +``` +function Gui.Game.getEstimatedMaximumGameSpeed(): integer +``` + +Returns the (estimated) maximum possible game speed based on actual simulation timings. +Only available in GUI thread. + +**Returns** + +1. `integer` β€” maximum game speed (or 0 if not enough data available) + +### Gui.Game.isMapEditor[πŸ”—](#$api.gui~Gui.Game.isMapEditor) + +``` +function Gui.Game.isMapEditor(): boolean +``` + +Returns if the game is currently in the map editor + +**Returns** + +1. `boolean` β€” true if in the map editor + +### Gui.Game.getDefaultSavegameId[πŸ”—](#$api.gui~Gui.Game.getDefaultSavegameId) + +``` +function Gui.Game.getDefaultSavegameId(): string +``` + +Returns the default savegame id + +**Returns** + +1. `string` β€” the default savegame id + +### Gui.Game.setEnvironment[πŸ”—](#$api.gui~Gui.Game.setEnvironment) + +``` +function Gui.Game.setEnvironment(environment : ResName) +``` + +Sets an environment. This value is saved in the GUI SaveData and will be restored on next load. +Changing it will not change the current environment, for that `api.gui.rendering.setEnvironment` needs to be as well called. + +**Parameters** + +* `environment` :`ResName` β€” the resource name for the environment + +### Gui.Game.getEnvironment[πŸ”—](#$api.gui~Gui.Game.getEnvironment) + +``` +function Gui.Game.getEnvironment(): ResName +``` + +Returns the resource name of the current environment + +**Returns** + +1. `ResName` β€” the environment resource name + +### Gui.Guide[πŸ”—](#$api.gui~Gui.Guide) + +``` +[Expand All] [Collapse All] + +record Gui.Guide record GuidePosition Left: GuidePosition + Right: GuidePosition + Above: GuidePosition + Below: GuidePosition +end + record FreeGuidePosition High: FreeGuidePosition + Low: FreeGuidePosition +end + record GuideTarget new: function(string, GuidePosition): GuideTarget + idOrTag: string + position: GuidePosition +end + trySpawnGuideById: function({GuideTarget}, string, string): boolean + trySpawnGuideFree: function(FreeGuidePosition, string, string): boolean + completeGuideById: function({GuideTarget}): boolean +end +``` + +### Gui.Guide.GuidePosition[πŸ”—](#$api.gui~Gui.Guide.GuidePosition) + +``` +record Gui.Guide.GuidePosition Left: GuidePosition + Right: GuidePosition + Above: GuidePosition + Below: GuidePosition +end +``` + +Gui positioning of the guide "bookmark" with respect to target component + +### Gui.Guide.GuidePosition.Left[πŸ”—](#$api.gui~Gui.Guide.GuidePosition.Left) + +``` +Gui.Guide.GuidePosition.Left: GuidePosition +``` + +### Gui.Guide.GuidePosition.Right[πŸ”—](#$api.gui~Gui.Guide.GuidePosition.Right) + +``` +Gui.Guide.GuidePosition.Right: GuidePosition +``` + +### Gui.Guide.GuidePosition.Above[πŸ”—](#$api.gui~Gui.Guide.GuidePosition.Above) + +``` +Gui.Guide.GuidePosition.Above: GuidePosition +``` + +### Gui.Guide.GuidePosition.Below[πŸ”—](#$api.gui~Gui.Guide.GuidePosition.Below) + +``` +Gui.Guide.GuidePosition.Below: GuidePosition +``` + +### Gui.Guide.FreeGuidePosition[πŸ”—](#$api.gui~Gui.Guide.FreeGuidePosition) + +``` +record Gui.Guide.FreeGuidePosition High: FreeGuidePosition + Low: FreeGuidePosition +end +``` + +Gui positioning of the guide "bookmark" with respect to the entire screen + +### Gui.Guide.FreeGuidePosition.High[πŸ”—](#$api.gui~Gui.Guide.FreeGuidePosition.High) + +``` +Gui.Guide.FreeGuidePosition.High: FreeGuidePosition +``` + +### Gui.Guide.FreeGuidePosition.Low[πŸ”—](#$api.gui~Gui.Guide.FreeGuidePosition.Low) + +``` +Gui.Guide.FreeGuidePosition.Low: FreeGuidePosition +``` + +### Gui.Guide.GuideTarget[πŸ”—](#$api.gui~Gui.Guide.GuideTarget) + +``` +record Gui.Guide.GuideTarget new: function(string, GuidePosition): GuideTarget + idOrTag: string + position: GuidePosition +end +``` + +A target component for the guide system + +### Gui.Guide.GuideTarget.new[πŸ”—](#$api.gui~Gui.Guide.GuideTarget.new) + +``` +function Gui.Guide.GuideTarget.new(string, GuidePosition): GuideTarget +``` + +**Parameters** + +* `string` +* `GuidePosition` + +**Returns** + +1. `GuideTarget` + +### Gui.Guide.GuideTarget.idOrTag[πŸ”—](#$api.gui~Gui.Guide.GuideTarget.idOrTag) + +``` +Gui.Guide.GuideTarget.idOrTag: string +``` + +### Gui.Guide.GuideTarget.position[πŸ”—](#$api.gui~Gui.Guide.GuideTarget.position) + +``` +Gui.Guide.GuideTarget.position: GuidePosition +``` + +### Gui.Guide.trySpawnGuideById[πŸ”—](#$api.gui~Gui.Guide.trySpawnGuideById) + +``` +function Gui.Guide.trySpawnGuideById({GuideTarget}, string, string): boolean +``` + +**Parameters** + +* `{GuideTarget}` +* `string` +* `string` + +**Returns** + +1. `boolean` + +### Gui.Guide.trySpawnGuideFree[πŸ”—](#$api.gui~Gui.Guide.trySpawnGuideFree) + +``` +function Gui.Guide.trySpawnGuideFree(FreeGuidePosition, string, string): boolean +``` + +**Parameters** + +* `FreeGuidePosition` +* `string` +* `string` + +**Returns** + +1. `boolean` + +### Gui.Guide.completeGuideById[πŸ”—](#$api.gui~Gui.Guide.completeGuideById) + +``` +function Gui.Guide.completeGuideById({GuideTarget}): boolean +``` + +**Parameters** + +* `{GuideTarget}` + +**Returns** + +1. `boolean` + +### Gui.Rendering[πŸ”—](#$api.gui~Gui.Rendering) + +``` +record Gui.Rendering setEnvironment: function(environment : Environment) + getEnvironment: function(): Environment + spawnDust: function(bbMin : Vec3f, bbMax : Vec3f, transf : Mat4f) + getFrameTime01: function(): number +end +``` + +### Gui.Rendering.setEnvironment[πŸ”—](#$api.gui~Gui.Rendering.setEnvironment) + +``` +function Gui.Rendering.setEnvironment(environment : Environment) +``` + +Sets an environment. This will change the current environment, but will not persist the environment resource name. +It might be necessary to as well call `api.gui.game.setEnvironment` if a different environment resource is set. + +**Parameters** + +* `environment` :`Environment` β€” the description for the environment + +### Gui.Rendering.getEnvironment[πŸ”—](#$api.gui~Gui.Rendering.getEnvironment) + +``` +function Gui.Rendering.getEnvironment(): Environment +``` + +Returns the current environment data + +**Returns** + +1. `Environment` β€” the current environment data + +### Gui.Rendering.spawnDust[πŸ”—](#$api.gui~Gui.Rendering.spawnDust) + +``` +function Gui.Rendering.spawnDust(bbMin : Vec3f, bbMax : Vec3f, transf : Mat4f) +``` + +Makes a dust cloud appear + +**Parameters** + +* `bbMin` :`Vec3f` β€” bounding box min +* `bbMax` :`Vec3f` β€” bounding box max +* `transf` :`Mat4f` β€” transformation matrix + +### Gui.Rendering.getFrameTime01[πŸ”—](#$api.gui~Gui.Rendering.getFrameTime01) + +``` +function Gui.Rendering.getFrameTime01(): number +``` + +**Returns** + +1. `number` + +### Gui.Map[πŸ”—](#$api.gui~Gui.Map) + +``` +record Gui.Map setMapSeedText: function(seed : string) + reloadMaterialIndexManagerPipeline: function() + openTerrainEditor: function() + closeTerrainEditor: function() +end +``` + +### Gui.Map.setMapSeedText[πŸ”—](#$api.gui~Gui.Map.setMapSeedText) + +``` +function Gui.Map.setMapSeedText(seed : string) +``` + +Sets seed for the map. Only available in GUI thread. + +**Parameters** + +* `seed` :`string` β€” the seed + +### Gui.Map.reloadMaterialIndexManagerPipeline[πŸ”—](#$api.gui~Gui.Map.reloadMaterialIndexManagerPipeline) + +``` +function Gui.Map.reloadMaterialIndexManagerPipeline() +``` + +Reloads the material index manager pipeline. + +### Gui.Map.openTerrainEditor[πŸ”—](#$api.gui~Gui.Map.openTerrainEditor) + +``` +function Gui.Map.openTerrainEditor() +``` + +### Gui.Map.closeTerrainEditor[πŸ”—](#$api.gui~Gui.Map.closeTerrainEditor) + +``` +function Gui.Map.closeTerrainEditor() +``` + +### Gui.BenchMark[πŸ”—](#$api.gui~Gui.BenchMark) + +``` +[Expand All] [Collapse All] + +record Gui.BenchMark record SimTime frameTime: integer + gameTime: integer +end + getBeginFrameTimes: function(): {integer} + getEventTimes: function(): {integer} + getCoreStepTimes: function(): {integer} + getRenderTimes: function(): {integer} + getSwapTimes: function(): {integer} + getReplicateTimes: function(): {SimTime} + getCommandTimes: function(): {SimTime} + getGameStepTimes: function(): {SimTime} +end +``` + +### Gui.BenchMark.SimTime[πŸ”—](#$api.gui~Gui.BenchMark.SimTime) + +``` +record Gui.BenchMark.SimTime frameTime: integer + gameTime: integer +end +``` + +Simulation time frame along with game time at moment of capture + +### Gui.BenchMark.SimTime.frameTime[πŸ”—](#$api.gui~Gui.BenchMark.SimTime.frameTime) + +``` +Gui.BenchMark.SimTime.frameTime: integer +``` + +### Gui.BenchMark.SimTime.gameTime[πŸ”—](#$api.gui~Gui.BenchMark.SimTime.gameTime) + +``` +Gui.BenchMark.SimTime.gameTime: integer +``` + +### Gui.BenchMark.getBeginFrameTimes[πŸ”—](#$api.gui~Gui.BenchMark.getBeginFrameTimes) + +``` +function Gui.BenchMark.getBeginFrameTimes(): {integer} +``` + +Returns the rendering preparation time + +**Returns** + +1. `{integer}` + +### Gui.BenchMark.getEventTimes[πŸ”—](#$api.gui~Gui.BenchMark.getEventTimes) + +``` +function Gui.BenchMark.getEventTimes(): {integer} +``` + +Returns the events processing time + +**Returns** + +1. `{integer}` + +### Gui.BenchMark.getCoreStepTimes[πŸ”—](#$api.gui~Gui.BenchMark.getCoreStepTimes) + +``` +function Gui.BenchMark.getCoreStepTimes(): {integer} +``` + +Returns the gui update time + +**Returns** + +1. `{integer}` + +### Gui.BenchMark.getRenderTimes[πŸ”—](#$api.gui~Gui.BenchMark.getRenderTimes) + +``` +function Gui.BenchMark.getRenderTimes(): {integer} +``` + +Returns the rendering time + +**Returns** + +1. `{integer}` + +### Gui.BenchMark.getSwapTimes[πŸ”—](#$api.gui~Gui.BenchMark.getSwapTimes) + +``` +function Gui.BenchMark.getSwapTimes(): {integer} +``` + +Returns the rendering finish time + +**Returns** + +1. `{integer}` + +### Gui.BenchMark.getReplicateTimes[πŸ”—](#$api.gui~Gui.BenchMark.getReplicateTimes) + +``` +function Gui.BenchMark.getReplicateTimes(): {SimTime} +``` + +Returns the sync time between gui and simulation. Only available in GUI thread. + +**Returns** + +1. `{SimTime}` + +### Gui.BenchMark.getCommandTimes[πŸ”—](#$api.gui~Gui.BenchMark.getCommandTimes) + +``` +function Gui.BenchMark.getCommandTimes(): {SimTime} +``` + +Returns commands processing time. Only available in GUI thread. + +**Returns** + +1. `{SimTime}` + +### Gui.BenchMark.getGameStepTimes[πŸ”—](#$api.gui~Gui.BenchMark.getGameStepTimes) + +``` +function Gui.BenchMark.getGameStepTimes(): {SimTime} +``` + +Returns the simulation update time. Only available in GUI thread. + +**Returns** + +1. `{SimTime}` + +### Gui.Debug[πŸ”—](#$api.gui~Gui.Debug) + +``` +record Gui.Debug selectEntity: function(entity : Engine.Entity) +end +``` + +### Gui.Debug.selectEntity[πŸ”—](#$api.gui~Gui.Debug.selectEntity) + +``` +function Gui.Debug.selectEntity(entity : Engine.Entity) +``` + +Set the current debug entity + +**Parameters** + +* `entity` :`Engine.Entity` β€” the entity + +### Gui.Achievements[πŸ”—](#$api.gui~Gui.Achievements) + +``` +record Gui.Achievements areStatsDisabled: function(): boolean + unlockAchievement: function(achievement : string) + isAchievementUnlockable: function(achievement : string): boolean + isAchievementUnlocked: function(achievement : string): boolean + updateStat: function(playerStat : string, value : number) + setStat: function(playerStat : string, value : number) + getStatValue: function(playerStat : string): number + setStatExtraData: function(playerStat : string, data : { : }) + getStatExtraData: function(playerStat : string): { : } + setEarnedSFX: function(sfx : {FilePath}) +end +``` + +### Gui.Achievements.areStatsDisabled[πŸ”—](#$api.gui~Gui.Achievements.areStatsDisabled) + +``` +function Gui.Achievements.areStatsDisabled(): boolean +``` + +Checkes whether player stats are disabled + +**Returns** + +1. `boolean` β€” true if player stats are disabled + +### Gui.Achievements.unlockAchievement[πŸ”—](#$api.gui~Gui.Achievements.unlockAchievement) + +``` +function Gui.Achievements.unlockAchievement(achievement : string) +``` + +Unlocks an achievement based on its string id + +**Parameters** + +* `achievement` :`string` β€” achievement to unlock + +### Gui.Achievements.isAchievementUnlockable[πŸ”—](#$api.gui~Gui.Achievements.isAchievementUnlockable) + +``` +function Gui.Achievements.isAchievementUnlockable(achievement : string): boolean +``` + +Checks whether an achievement can be unlocked + +**Parameters** + +* `achievement` :`string` β€” achievement to check + +**Returns** + +1. `boolean` β€” true if the achievement can be unlocked + +### Gui.Achievements.isAchievementUnlocked[πŸ”—](#$api.gui~Gui.Achievements.isAchievementUnlocked) + +``` +function Gui.Achievements.isAchievementUnlocked(achievement : string): boolean +``` + +Checks whether an achievement is unlocked (completed) + +**Parameters** + +* `achievement` :`string` β€” achievement to check + +**Returns** + +1. `boolean` β€” true if the achievement is unlocked + +### Gui.Achievements.updateStat[πŸ”—](#$api.gui~Gui.Achievements.updateStat) + +``` +function Gui.Achievements.updateStat(playerStat : string, value : number) +``` + +Increments a player stat value by the provided value + +**Parameters** + +* `playerStat` :`string` β€” the stat id to update +* `value` :`number` β€” the value to add to the stat + +### Gui.Achievements.setStat[πŸ”—](#$api.gui~Gui.Achievements.setStat) + +``` +function Gui.Achievements.setStat(playerStat : string, value : number) +``` + +Sets a player stat value, replacing the current value by the provided one + +**Parameters** + +* `playerStat` :`string` β€” the stat id to update +* `value` :`number` β€” the value to add to the stat + +### Gui.Achievements.getStatValue[πŸ”—](#$api.gui~Gui.Achievements.getStatValue) + +``` +function Gui.Achievements.getStatValue(playerStat : string): number +``` + +Gets a player stat value + +**Parameters** + +* `playerStat` :`string` β€” the stat id to get + +**Returns** + +1. `number` β€” the current value of the stat + +### Gui.Achievements.setStatExtraData[πŸ”—](#$api.gui~Gui.Achievements.setStatExtraData) + +``` +function Gui.Achievements.setStatExtraData(playerStat : string, data : { : }) +``` + +Sets extra data associated with a stat. +Extra data are stored locally in the player profile and allow tracking of more informations if necessary. + +**Parameters** + +* `playerStat` :`string` β€” the stat id to set the extra data for +* `data` :`{ : }` β€” the extra data to set + +### Gui.Achievements.getStatExtraData[πŸ”—](#$api.gui~Gui.Achievements.getStatExtraData) + +``` +function Gui.Achievements.getStatExtraData(playerStat : string): { : } +``` + +Gets extra data associated with a stat. +Extra data are stored locally in the player profile and allow tracking of more informations if necessary. + +**Parameters** + +* `playerStat` :`string` β€” the stat id to get the extra data for + +**Returns** + +1. `{ : }` β€” the extra data + +### Gui.Achievements.setEarnedSFX[πŸ”—](#$api.gui~Gui.Achievements.setEarnedSFX) + +``` +function Gui.Achievements.setEarnedSFX(sfx : {FilePath}) +``` + +Set sound effect(s) to be played when an achievement is earned. + +**Parameters** + +* `sfx` :`{FilePath}` β€” vector of filepaths pointing to .wav files with according sound effect(s) + +### Gui.GenericRep[πŸ”—](#$api.gui~Gui.GenericRep) + +``` +record Gui.GenericRep getAllOfType: function(typeName : string, includeInvisible : boolean): {integer} +end +``` + +### Gui.GenericRep.getAllOfType[πŸ”—](#$api.gui~Gui.GenericRep.getAllOfType) + +``` +function Gui.GenericRep.getAllOfType(typeName : string, includeInvisible : boolean): {integer} +``` + +Gets all the Genereic Resource Type of a given type name +Only allows typeName in { "gui*res*overwrite", "gui\_res" }, for other types, use `api.res.genericRep` + +**Parameters** + +* `typeName` :`string` β€” the type name +* `includeInvisible` :`boolean` β€” whether to include invisible resources + +**Returns** + +1. `{integer}` + +### Gui.Backend[πŸ”—](#$api.gui~Gui.Backend) + +``` +[Expand All] [Collapse All] + +record Gui.Backend record LegalDocument title: string + text: string +end + isInitialized: function(): boolean + hasLegalDocuments: function() + getLegalDocuments: function(): {PdxLegalDocumentType} + isAccountLoggedIn: function(): boolean + loginAccount: function(string, string): PdxFuture + logoutAccount: function(): PdxFuture + getAccountInfo: function(): PdxFuture + getProfile: function(boolean): PdxFuture + createProfile: function(string, boolean): PdxFuture + renameProfile: function(string, boolean): PdxFuture + getCountries: function(): {PdxCountry} + getLegalDocument: function(PdxLegalDocumentType): PdxFuture + createAccount: function(string, string, string, integer, boolean): PdxFuture + supportsAccountLinking: function(): boolean + getThirdPartyLinkState: function(): PdxFuture + getThirdPartyAutoLoginPromptState: function(): PdxThirdPartyAutoLoginPromptState + setThirdPartyAutoLoginPromptState: function(PdxThirdPartyAutoLoginPromptState) + linkThirdPartyAccount: function(): PdxFuture + unlinkThirdPartyAccount: function(): PdxFuture + loginThirdPartyAccount: function(): PdxFuture +end +``` + +### Gui.Backend.LegalDocument[πŸ”—](#$api.gui~Gui.Backend.LegalDocument) + +``` +record Gui.Backend.LegalDocument title: string + text: string +end +``` + +### Gui.Backend.LegalDocument.title[πŸ”—](#$api.gui~Gui.Backend.LegalDocument.title) + +``` +Gui.Backend.LegalDocument.title: string +``` + +### Gui.Backend.LegalDocument.text[πŸ”—](#$api.gui~Gui.Backend.LegalDocument.text) + +``` +Gui.Backend.LegalDocument.text: string +``` + +### Gui.Backend.isInitialized[πŸ”—](#$api.gui~Gui.Backend.isInitialized) + +``` +function Gui.Backend.isInitialized(): boolean +``` + +**Returns** + +1. `boolean` + +### Gui.Backend.hasLegalDocuments[πŸ”—](#$api.gui~Gui.Backend.hasLegalDocuments) + +``` +function Gui.Backend.hasLegalDocuments() +``` + +### Gui.Backend.getLegalDocuments[πŸ”—](#$api.gui~Gui.Backend.getLegalDocuments) + +``` +function Gui.Backend.getLegalDocuments(): {PdxLegalDocumentType} +``` + +**Returns** + +1. `{PdxLegalDocumentType}` + +### Gui.Backend.isAccountLoggedIn[πŸ”—](#$api.gui~Gui.Backend.isAccountLoggedIn) + +``` +function Gui.Backend.isAccountLoggedIn(): boolean +``` + +**Returns** + +1. `boolean` + +### Gui.Backend.loginAccount[πŸ”—](#$api.gui~Gui.Backend.loginAccount) + +``` +function Gui.Backend.loginAccount(string, string): PdxFuture +``` + +**Parameters** + +* `string` +* `string` + +**Returns** + +1. `PdxFuture` + +### Gui.Backend.logoutAccount[πŸ”—](#$api.gui~Gui.Backend.logoutAccount) + +``` +function Gui.Backend.logoutAccount(): PdxFuture +``` + +**Returns** + +1. `PdxFuture` + +### Gui.Backend.getAccountInfo[πŸ”—](#$api.gui~Gui.Backend.getAccountInfo) + +``` +function Gui.Backend.getAccountInfo(): PdxFuture +``` + +**Returns** + +1. `PdxFuture` + +### Gui.Backend.getProfile[πŸ”—](#$api.gui~Gui.Backend.getProfile) + +``` +function Gui.Backend.getProfile(boolean): PdxFuture +``` + +**Parameters** + +* `boolean` + +**Returns** + +1. `PdxFuture` + +### Gui.Backend.createProfile[πŸ”—](#$api.gui~Gui.Backend.createProfile) + +``` +function Gui.Backend.createProfile(string, boolean): PdxFuture +``` + +**Parameters** + +* `string` +* `boolean` + +**Returns** + +1. `PdxFuture` + +### Gui.Backend.renameProfile[πŸ”—](#$api.gui~Gui.Backend.renameProfile) + +``` +function Gui.Backend.renameProfile(string, boolean): PdxFuture +``` + +**Parameters** + +* `string` +* `boolean` + +**Returns** + +1. `PdxFuture` + +### Gui.Backend.getCountries[πŸ”—](#$api.gui~Gui.Backend.getCountries) + +``` +function Gui.Backend.getCountries(): {PdxCountry} +``` + +**Returns** + +1. `{PdxCountry}` + +### Gui.Backend.getLegalDocument[πŸ”—](#$api.gui~Gui.Backend.getLegalDocument) + +``` +function Gui.Backend.getLegalDocument(PdxLegalDocumentType): PdxFuture +``` + +**Parameters** + +* `PdxLegalDocumentType` + +**Returns** + +1. `PdxFuture` + +### Gui.Backend.createAccount[πŸ”—](#$api.gui~Gui.Backend.createAccount) + +``` +function Gui.Backend.createAccount(string, string, string, integer, boolean): PdxFuture +``` + +**Parameters** + +* `string` +* `string` +* `string` +* `integer` +* `boolean` + +**Returns** + +1. `PdxFuture` + +### Gui.Backend.supportsAccountLinking[πŸ”—](#$api.gui~Gui.Backend.supportsAccountLinking) + +``` +function Gui.Backend.supportsAccountLinking(): boolean +``` + +**Returns** + +1. `boolean` + +### Gui.Backend.getThirdPartyLinkState[πŸ”—](#$api.gui~Gui.Backend.getThirdPartyLinkState) + +``` +function Gui.Backend.getThirdPartyLinkState(): PdxFuture +``` + +**Returns** + +1. `PdxFuture` + +### Gui.Backend.getThirdPartyAutoLoginPromptState[πŸ”—](#$api.gui~Gui.Backend.getThirdPartyAutoLoginPromptState) + +``` +function Gui.Backend.getThirdPartyAutoLoginPromptState(): PdxThirdPartyAutoLoginPromptState +``` + +**Returns** + +1. `PdxThirdPartyAutoLoginPromptState` + +### Gui.Backend.setThirdPartyAutoLoginPromptState[πŸ”—](#$api.gui~Gui.Backend.setThirdPartyAutoLoginPromptState) + +``` +function Gui.Backend.setThirdPartyAutoLoginPromptState(PdxThirdPartyAutoLoginPromptState) +``` + +**Parameters** + +* `PdxThirdPartyAutoLoginPromptState` + +### Gui.Backend.linkThirdPartyAccount[πŸ”—](#$api.gui~Gui.Backend.linkThirdPartyAccount) + +``` +function Gui.Backend.linkThirdPartyAccount(): PdxFuture +``` + +**Returns** + +1. `PdxFuture` + +### Gui.Backend.unlinkThirdPartyAccount[πŸ”—](#$api.gui~Gui.Backend.unlinkThirdPartyAccount) + +``` +function Gui.Backend.unlinkThirdPartyAccount(): PdxFuture +``` + +**Returns** + +1. `PdxFuture` + +### Gui.Backend.loginThirdPartyAccount[πŸ”—](#$api.gui~Gui.Backend.loginThirdPartyAccount) + +``` +function Gui.Backend.loginThirdPartyAccount(): PdxFuture +``` + +**Returns** + +1. `PdxFuture` + +### Gui.mouse[πŸ”—](#$api.gui~Gui.mouse) + +``` +Gui.mouse: Mouse +``` + +### Gui.key[πŸ”—](#$api.gui~Gui.key) + +``` +Gui.key: Key +``` + +### Gui.dnd[πŸ”—](#$api.gui~Gui.dnd) + +``` +Gui.dnd: DnD +``` + +### Gui.inputAction[πŸ”—](#$api.gui~Gui.inputAction) + +``` +Gui.inputAction: InputAction +``` + +### Gui.byId[πŸ”—](#$api.gui~Gui.byId) + +``` +Gui.byId: ById +``` + +### Gui.camera[πŸ”—](#$api.gui~Gui.camera) + +``` +Gui.camera: Camera +``` + +### Gui.sound[πŸ”—](#$api.gui~Gui.sound) + +``` +Gui.sound: Sound +``` + +### Gui.musicPlayer[πŸ”—](#$api.gui~Gui.musicPlayer) + +``` +Gui.musicPlayer: MusicPlayer +``` + +### Gui.backend[πŸ”—](#$api.gui~Gui.backend) + +``` +Gui.backend: Backend +``` + +### Gui.voiceOverManager[πŸ”—](#$api.gui~Gui.voiceOverManager) + +``` +Gui.voiceOverManager: VoiceOverManager +``` + +### Gui.byEntity[πŸ”—](#$api.gui~Gui.byEntity) + +``` +Gui.byEntity: ByEntity +``` + +### Gui.contextHelper[πŸ”—](#$api.gui~Gui.contextHelper) + +``` +Gui.contextHelper: ContextHelper +``` + +### Gui.construction[πŸ”—](#$api.gui~Gui.construction) + +``` +Gui.construction: Construction +``` + +### Gui.mission[πŸ”—](#$api.gui~Gui.mission) + +``` +Gui.mission: Mission +``` + +### Gui.guide[πŸ”—](#$api.gui~Gui.guide) + +``` +Gui.guide: Guide +``` + +### Gui.game[πŸ”—](#$api.gui~Gui.game) + +``` +Gui.game: Game +``` + +### Gui.map[πŸ”—](#$api.gui~Gui.map) + +``` +Gui.map: Map +``` + +### Gui.benchMark[πŸ”—](#$api.gui~Gui.benchMark) + +``` +Gui.benchMark: BenchMark +``` + +### Gui.rendering[πŸ”—](#$api.gui~Gui.rendering) + +``` +Gui.rendering: Rendering +``` + +### Gui.debug[πŸ”—](#$api.gui~Gui.debug) + +``` +Gui.debug: Debug +``` + +### Gui.achievements[πŸ”—](#$api.gui~Gui.achievements) + +``` +Gui.achievements: Achievements +``` + +### Gui.genericRep[πŸ”—](#$api.gui~Gui.genericRep) + +``` +Gui.genericRep: GenericRep +``` + +### Gui.StyleSheet[πŸ”—](#$api.gui~Gui.StyleSheet) + +``` +Gui.StyleSheet: StyleSheet +``` + +### Gui.NinePatch[πŸ”—](#$api.gui~Gui.NinePatch) + +``` +Gui.NinePatch: NinePatch +``` + +## Category: globals[πŸ”—](#category-globals) + +### NinePatch[πŸ”—](#$api.gui~NinePatch) + +``` +global record NinePatch new: function(): NinePatch + fileName: string + horizontal: {integer} + vertical: {integer} + flipHorizontally: boolean + repeatHorizontally: boolean + repeatVertically: boolean + repeatFactor: number +end +``` + +Nine-patch image description. + +### NinePatch.new[πŸ”—](#$api.gui~NinePatch.new) + +``` +function NinePatch.new(): NinePatch +``` + +**Returns** + +1. `NinePatch` + +### NinePatch.fileName[πŸ”—](#$api.gui~NinePatch.fileName) + +``` +NinePatch.fileName: string +``` + +### NinePatch.horizontal[πŸ”—](#$api.gui~NinePatch.horizontal) + +``` +NinePatch.horizontal: {integer} +``` + +### NinePatch.vertical[πŸ”—](#$api.gui~NinePatch.vertical) + +``` +NinePatch.vertical: {integer} +``` + +### NinePatch.flipHorizontally[πŸ”—](#$api.gui~NinePatch.flipHorizontally) + +``` +NinePatch.flipHorizontally: boolean +``` + +### NinePatch.repeatHorizontally[πŸ”—](#$api.gui~NinePatch.repeatHorizontally) + +``` +NinePatch.repeatHorizontally: boolean +``` + +### NinePatch.repeatVertically[πŸ”—](#$api.gui~NinePatch.repeatVertically) + +``` +NinePatch.repeatVertically: boolean +``` + +### NinePatch.repeatFactor[πŸ”—](#$api.gui~NinePatch.repeatFactor) + +``` +NinePatch.repeatFactor: number +``` + +Repeat factor (must be positive). + +### StyleSheet[πŸ”—](#$api.gui~StyleSheet) + +``` +global record StyleSheet new: function(): StyleSheet + backgroundColor: Vec4f + backgroundColor1: Vec4f + backgroundColor2: Vec4f + backgroundImage1: NinePatch + backgroundImage2: NinePatch + borderWidth: Vec4f + borderColor: Vec4f + color: Vec4f + size: Vec2f + padding: Vec4f + fontSize: integer + borderImage: NinePatch + anchorPoint: Vec2f +end +``` + +Stylesheet used by GUI components. + +### StyleSheet.new[πŸ”—](#$api.gui~StyleSheet.new) + +``` +function StyleSheet.new(): StyleSheet +``` + +**Returns** + +1. `StyleSheet` + +### StyleSheet.backgroundColor[πŸ”—](#$api.gui~StyleSheet.backgroundColor) + +``` +StyleSheet.backgroundColor: Vec4f +``` + +### StyleSheet.backgroundColor1[πŸ”—](#$api.gui~StyleSheet.backgroundColor1) + +``` +StyleSheet.backgroundColor1: Vec4f +``` + +### StyleSheet.backgroundColor2[πŸ”—](#$api.gui~StyleSheet.backgroundColor2) + +``` +StyleSheet.backgroundColor2: Vec4f +``` + +### StyleSheet.backgroundImage1[πŸ”—](#$api.gui~StyleSheet.backgroundImage1) + +``` +StyleSheet.backgroundImage1: NinePatch +``` + +### StyleSheet.backgroundImage2[πŸ”—](#$api.gui~StyleSheet.backgroundImage2) + +``` +StyleSheet.backgroundImage2: NinePatch +``` + +### StyleSheet.borderWidth[πŸ”—](#$api.gui~StyleSheet.borderWidth) + +``` +StyleSheet.borderWidth: Vec4f +``` + +### StyleSheet.borderColor[πŸ”—](#$api.gui~StyleSheet.borderColor) + +``` +StyleSheet.borderColor: Vec4f +``` + +### StyleSheet.color[πŸ”—](#$api.gui~StyleSheet.color) + +``` +StyleSheet.color: Vec4f +``` + +### StyleSheet.size[πŸ”—](#$api.gui~StyleSheet.size) + +``` +StyleSheet.size: Vec2f +``` + +### StyleSheet.padding[πŸ”—](#$api.gui~StyleSheet.padding) + +``` +StyleSheet.padding: Vec4f +``` + +### StyleSheet.fontSize[πŸ”—](#$api.gui~StyleSheet.fontSize) + +``` +StyleSheet.fontSize: integer +``` + +### StyleSheet.borderImage[πŸ”—](#$api.gui~StyleSheet.borderImage) + +``` +StyleSheet.borderImage: NinePatch +``` + +### StyleSheet.anchorPoint[πŸ”—](#$api.gui~StyleSheet.anchorPoint) + +``` +StyleSheet.anchorPoint: Vec2f +``` diff --git a/docs/reference/script-doc/api_res.md b/docs/reference/script-doc/api_res.md new file mode 100644 index 0000000..e368621 --- /dev/null +++ b/docs/reference/script-doc/api_res.md @@ -0,0 +1,723 @@ + + +[index](../index.html) / [api](../api.html) / res + +--- + +# Module api.res[πŸ”—](#api.res) + +Repositories containing game resources (models, tracks, streets, ...) + +``` +global record Res buildingTypeRep: ResTypeRep + bridgeTypeRep: ResTypeRep + constructionRep: ResTypeRep + metaConstructionRep: ResTypeRep + genericRep: GenericRep + economyRep: ResTypeRep + climateRep: ResTypeRep + terrainGeneratorRep: ResTypeRep + environmentRep: ResTypeRep + playlistRep: ResTypeRep + gameScriptRep: ResTypeRep + cargoClassRep: CargoClassRep + cargoTypeRep: CargoTypeRep + nameRep: ResTypeRep + campaignRep: ResTypeRep + missionRep: ResTypeRep + modelRep: ModelRep + multipleUnitRep: ResTypeRep + streetTemplateRep: ResTypeRep + edgeDecorationRep: ResTypeRep + terrainMaterialTypeRep: ResTypeRep + trafficLightTypeRep: ResTypeRep + tunnelTypeRep: ResTypeRep + moduleRep: ResTypeRep + railroadCrossingTypeRep: ResTypeRep + streetStyleRep: ResTypeRep + builderAudioSetRep: ResTypeRep + soundSetRep: ResTypeRep + groundTextureRep: ResTypeRep + autoGroundTexRep: ResTypeRep + getBaseConfig: function(): BaseConfig +end +global record CargoClassRep getCargoClassId: function(cargoClass : string): CargoClassId + hasCargoClass: function(cargoClass : string): boolean +end +global record CargoTypeRep forEachCargoType: function(cargoTypeSet : CargoTypeSet, callback : function(CargoTypeId)) + hasCargoType: function(cargoTypeSet : CargoTypeSet, test : CargoTypeId, inverse : boolean): boolean + getPassengerCargoTypeId: function(): CargoTypeId +end +global record GameScriptType getState: function(GameScriptType): { : } +end +global record GenericRep getAllOfType: function(typeName : string, includeInvisible : boolean): {integer} +end +global record ModelRep forEachModelWithMetadata: function(metadata : string, callback : function(string)) +end +global interface ResTypeRep get: function(id : K): T + getName: function(id : K): string + find: function(resName : string): K + findAndGet: function(resName : string): T + getAll: function(includeInvisible : boolean): {K : string} + add: function(resName : ResName, resource : T, visible : boolean): K + setVisible: function(id : K, visible : boolean) + isVisible: function(id : K): boolean + getAsTable: function(id : K): T + setAsTable: function(id : K, t : T): boolean + addAsTable: function(the : ResName, t : T): K +end +``` + +## Category: main[πŸ”—](#category-main) + +### Res[πŸ”—](#$api.res~Res) + +``` +global record Res buildingTypeRep: ResTypeRep + bridgeTypeRep: ResTypeRep + constructionRep: ResTypeRep + metaConstructionRep: ResTypeRep + genericRep: GenericRep + economyRep: ResTypeRep + climateRep: ResTypeRep + terrainGeneratorRep: ResTypeRep + environmentRep: ResTypeRep + playlistRep: ResTypeRep + gameScriptRep: ResTypeRep + cargoClassRep: CargoClassRep + cargoTypeRep: CargoTypeRep + nameRep: ResTypeRep + campaignRep: ResTypeRep + missionRep: ResTypeRep + modelRep: ModelRep + multipleUnitRep: ResTypeRep + streetTemplateRep: ResTypeRep + edgeDecorationRep: ResTypeRep + terrainMaterialTypeRep: ResTypeRep + trafficLightTypeRep: ResTypeRep + tunnelTypeRep: ResTypeRep + moduleRep: ResTypeRep + railroadCrossingTypeRep: ResTypeRep + streetStyleRep: ResTypeRep + builderAudioSetRep: ResTypeRep + soundSetRep: ResTypeRep + groundTextureRep: ResTypeRep + autoGroundTexRep: ResTypeRep + getBaseConfig: function(): BaseConfig +end +``` + +List of all repositories + +### Res.buildingTypeRep[πŸ”—](#$api.res~Res.buildingTypeRep) + +``` +Res.buildingTypeRep: ResTypeRep +``` + +A resource repository containing data for town buildings. + +### Res.bridgeTypeRep[πŸ”—](#$api.res~Res.bridgeTypeRep) + +``` +Res.bridgeTypeRep: ResTypeRep +``` + +A resource repository containing data from the bridge configuration files and from dynamically generated bridges. + +### Res.constructionRep[πŸ”—](#$api.res~Res.constructionRep) + +``` +Res.constructionRep: ResTypeRep +``` + +A resource repository containing data from the ".con" files and from dynamically generated constructions. + +### Res.metaConstructionRep[πŸ”—](#$api.res~Res.metaConstructionRep) + +``` +Res.metaConstructionRep: ResTypeRep +``` + +A resource repository containing data for all custom resources. + +### Res.genericRep[πŸ”—](#$api.res~Res.genericRep) + +``` +Res.genericRep: GenericRep +``` + +### Res.economyRep[πŸ”—](#$api.res~Res.economyRep) + +``` +Res.economyRep: ResTypeRep +``` + +A resource repository containing data from the ".eco" economy resources. + +### Res.climateRep[πŸ”—](#$api.res~Res.climateRep) + +``` +Res.climateRep: ResTypeRep +``` + +A resource repository containing data for the climates. + +### Res.terrainGeneratorRep[πŸ”—](#$api.res~Res.terrainGeneratorRep) + +``` +Res.terrainGeneratorRep: ResTypeRep +``` + +A resource repository containing data for the terrain generation. + +### Res.environmentRep[πŸ”—](#$api.res~Res.environmentRep) + +``` +Res.environmentRep: ResTypeRep +``` + +A resource repository containing data for the environment. + +### Res.playlistRep[πŸ”—](#$api.res~Res.playlistRep) + +``` +Res.playlistRep: ResTypeRep +``` + +A repository for playlists. + +### Res.gameScriptRep[πŸ”—](#$api.res~Res.gameScriptRep) + +``` +Res.gameScriptRep: ResTypeRep +``` + +A resource repository containing game scripts. + +### Res.cargoClassRep[πŸ”—](#$api.res~Res.cargoClassRep) + +``` +Res.cargoClassRep: CargoClassRep +``` + +A resource repository containing data with all the cargo classes. + +### Res.cargoTypeRep[πŸ”—](#$api.res~Res.cargoTypeRep) + +``` +Res.cargoTypeRep: CargoTypeRep +``` + +A resource repository containing data with all the cargo types. + +### Res.nameRep[πŸ”—](#$api.res~Res.nameRep) + +``` +Res.nameRep: ResTypeRep +``` + +A resource repository for names. + +### Res.campaignRep[πŸ”—](#$api.res~Res.campaignRep) + +``` +Res.campaignRep: ResTypeRep +``` + +A resource repository for campaign chapters. + +### Res.missionRep[πŸ”—](#$api.res~Res.missionRep) + +``` +Res.missionRep: ResTypeRep +``` + +A resource repository for campaign missions. + +### Res.modelRep[πŸ”—](#$api.res~Res.modelRep) + +``` +Res.modelRep: ModelRep +``` + +A resource repository containing all the game models and metadata. + +### Res.multipleUnitRep[πŸ”—](#$api.res~Res.multipleUnitRep) + +``` +Res.multipleUnitRep: ResTypeRep +``` + +A resource repository containing data from the multiple unit files and from dynamically generated multiple units. + +### Res.streetTemplateRep[πŸ”—](#$api.res~Res.streetTemplateRep) + +``` +Res.streetTemplateRep: ResTypeRep +``` + +A resource repository containing data from the street template files and from dynamically generated street templates. + +### Res.edgeDecorationRep[πŸ”—](#$api.res~Res.edgeDecorationRep) + +``` +Res.edgeDecorationRep: ResTypeRep +``` + +### Res.terrainMaterialTypeRep[πŸ”—](#$api.res~Res.terrainMaterialTypeRep) + +``` +Res.terrainMaterialTypeRep: ResTypeRep +``` + +A resource repository containing materials. + +### Res.trafficLightTypeRep[πŸ”—](#$api.res~Res.trafficLightTypeRep) + +``` +Res.trafficLightTypeRep: ResTypeRep +``` + +A resource repository containing data from the traffic lights. + +### Res.tunnelTypeRep[πŸ”—](#$api.res~Res.tunnelTypeRep) + +``` +Res.tunnelTypeRep: ResTypeRep +``` + +A resource repository containing data from the tunnel configuration files and from dynamically generated tunnels. + +### Res.moduleRep[πŸ”—](#$api.res~Res.moduleRep) + +``` +Res.moduleRep: ResTypeRep +``` + +A resource repository containing data from the ".modules" files and from dynamically generated modules. + +### Res.railroadCrossingTypeRep[πŸ”—](#$api.res~Res.railroadCrossingTypeRep) + +``` +Res.railroadCrossingTypeRep: ResTypeRep +``` + +A resource repository containing data from the railroad crossing files and from dynamically generated railroad crossing types. + +### Res.streetStyleRep[πŸ”—](#$api.res~Res.streetStyleRep) + +``` +Res.streetStyleRep: ResTypeRep +``` + +A resource repository containing data from the street type files and from dynamically generated street types. + +### Res.builderAudioSetRep[πŸ”—](#$api.res~Res.builderAudioSetRep) + +``` +Res.builderAudioSetRep: ResTypeRep +``` + +A resource repository containing data for audio sets for building + +### Res.soundSetRep[πŸ”—](#$api.res~Res.soundSetRep) + +``` +Res.soundSetRep: ResTypeRep +``` + +A resource repository containing data for sound sets + +### Res.groundTextureRep[πŸ”—](#$api.res~Res.groundTextureRep) + +``` +Res.groundTextureRep: ResTypeRep +``` + +A resource repository containing data for ground textures. + +### Res.autoGroundTexRep[πŸ”—](#$api.res~Res.autoGroundTexRep) + +``` +Res.autoGroundTexRep: ResTypeRep +``` + +A resource repository containing data for automatic ground texture definitions. + +### Res.getBaseConfig[πŸ”—](#$api.res~Res.getBaseConfig) + +``` +function Res.getBaseConfig(): BaseConfig +``` + +Gets the base config, it contains most of the data which was read from "base/base\_config.lua". + +**Returns** + +1. `BaseConfig` β€” Table the configuration table. See https://wiki.transportfever3.com/doku.php?id=modding:baseconfig for a detailed explanation. + +## Category: globals[πŸ”—](#category-globals) + +### CargoClassRep[πŸ”—](#$api.res~CargoClassRep) + +``` +global record CargoClassRep getCargoClassId: function(cargoClass : string): CargoClassId + hasCargoClass: function(cargoClass : string): boolean +end +``` + +### CargoClassRep.getCargoClassId[πŸ”—](#$api.res~CargoClassRep.getCargoClassId) + +``` +function CargoClassRep.getCargoClassId(cargoClass : string): CargoClassId +``` + +Gets the CargoClassId for a given CargoClass name + +**Parameters** + +* `cargoClass` :`string` β€” cargo class name + +**Returns** + +1. `CargoClassId` β€” cargo class id + +### CargoClassRep.hasCargoClass[πŸ”—](#$api.res~CargoClassRep.hasCargoClass) + +``` +function CargoClassRep.hasCargoClass(cargoClass : string): boolean +``` + +Checks if the given cargo class is present, this can be used if some cargo classes exist but are invisible + +**Parameters** + +* `cargoClass` :`string` β€” cargo class name + +**Returns** + +1. `boolean` β€” true if present + +### CargoTypeRep[πŸ”—](#$api.res~CargoTypeRep) + +``` +global record CargoTypeRep forEachCargoType: function(cargoTypeSet : CargoTypeSet, callback : function(CargoTypeId)) + hasCargoType: function(cargoTypeSet : CargoTypeSet, test : CargoTypeId, inverse : boolean): boolean + getPassengerCargoTypeId: function(): CargoTypeId +end +``` + +### CargoTypeRep.forEachCargoType[πŸ”—](#$api.res~CargoTypeRep.forEachCargoType) + +``` +function CargoTypeRep.forEachCargoType(cargoTypeSet : CargoTypeSet, callback : function(CargoTypeId)) +``` + +Iterates over all cargo types in a given cargo type set + +**Parameters** + +* `cargoTypeSet` :`CargoTypeSet` β€” the cargo type set to iterate over +* `callback` :`function(CargoTypeId)` β€” a callback for each cargo type + +### CargoTypeRep.hasCargoType[πŸ”—](#$api.res~CargoTypeRep.hasCargoType) + +``` +function CargoTypeRep.hasCargoType(cargoTypeSet : CargoTypeSet, test : CargoTypeId, inverse : boolean): boolean +``` + +Checks if a cargo type set contains a specific cargo type + +**Parameters** + +* `cargoTypeSet` :`CargoTypeSet` β€” the cargo type set to check +* `test` :`CargoTypeId` β€” the cargo type to test for +* `inverse` :`boolean` β€” if true, the function returns true when any other cargo exists + +**Returns** + +1. `boolean` + +### CargoTypeRep.getPassengerCargoTypeId[πŸ”—](#$api.res~CargoTypeRep.getPassengerCargoTypeId) + +``` +function CargoTypeRep.getPassengerCargoTypeId(): CargoTypeId +``` + +Returns the cargo type id for passenger + +**Returns** + +1. `CargoTypeId` + +### GameScriptType[πŸ”—](#$api.res~GameScriptType) + +``` +global record GameScriptType getState: function(GameScriptType): { : } +end +``` + +### GameScriptType.getState[πŸ”—](#$api.res~GameScriptType.getState) + +``` +function GameScriptType.getState(GameScriptType): { : } +``` + +**Parameters** + +* `GameScriptType` + +**Returns** + +1. `{ : }` + +### GenericRep[πŸ”—](#$api.res~GenericRep) + +``` +global record GenericRep getAllOfType: function(typeName : string, includeInvisible : boolean): {integer} +end +``` + +### GenericRep.getAllOfType[πŸ”—](#$api.res~GenericRep.getAllOfType) + +``` +function GenericRep.getAllOfType(typeName : string, includeInvisible : boolean): {integer} +``` + +Gets all Generic resource types of a given type name +does not allow typeName in { "gui*res*overwrite", "gui\_res" }, for those, use `api.gui.genericRep` + +**Parameters** + +* `typeName` :`string` β€” type name +* `includeInvisible` :`boolean` β€” whether to include invisible + +**Returns** + +1. `{integer}` β€” resource ids + +### ModelRep[πŸ”—](#$api.res~ModelRep) + +``` +global record ModelRep forEachModelWithMetadata: function(metadata : string, callback : function(string)) +end +``` + +### ModelRep.forEachModelWithMetadata[πŸ”—](#$api.res~ModelRep.forEachModelWithMetadata) + +``` +function ModelRep.forEachModelWithMetadata(metadata : string, callback : function(string)) +``` + +Iterates over all the models with a specific metadata + +**Parameters** + +* `metadata` :`string` β€” the name of the metadata +* `callback` :`function(string)` β€” a callback for every model that contains the specified metadata + +### ResTypeRep[πŸ”—](#$api.res~ResTypeRep) + +``` +global interface ResTypeRep get: function(id : K): T + getName: function(id : K): string + find: function(resName : string): K + findAndGet: function(resName : string): T + getAll: function(includeInvisible : boolean): {K : string} + add: function(resName : ResName, resource : T, visible : boolean): K + setVisible: function(id : K, visible : boolean) + isVisible: function(id : K): boolean + getAsTable: function(id : K): T + setAsTable: function(id : K, t : T): boolean + addAsTable: function(the : ResName, t : T): K +end +``` + +Generic interface for repositories +Resources are generally static (initialized when the game starts and don't change) +Make sure that resource exists before trying to access them +Resource ids are only valid within the same repository + +##### Type Parameters + +* **`K`** +* **`T`** + +### ResTypeRep.get[πŸ”—](#$api.res~ResTypeRep.get) + +``` +function ResTypeRep.get(id : K): T +``` + +Gets the resource for a given id - (can be used to directly modify the resource, +but this is discouraged, except for performance reasons. Use getAsTable and setAsTable instead. + +**Parameters** + +* `id` :`K` β€” a resource id + +**Returns** + +1. `T` β€” the resource + +### ResTypeRep.getName[πŸ”—](#$api.res~ResTypeRep.getName) + +``` +function ResTypeRep.getName(id : K): string +``` + +Gets the resource name for a given id + +**Parameters** + +* `id` :`K` β€” a resource id + +**Returns** + +1. `string` β€” the resource name + +### ResTypeRep.find[πŸ”—](#$api.res~ResTypeRep.find) + +``` +function ResTypeRep.find(resName : string): K +``` + +Finds the id of the given resource name and returns its id + +**Parameters** + +* `resName` :`string` β€” a resource name + +**Returns** + +1. `K` β€” the id of the resource, -1 if the resource doesn't exist + +### ResTypeRep.findAndGet[πŸ”—](#$api.res~ResTypeRep.findAndGet) + +``` +function ResTypeRep.findAndGet(resName : string): T +``` + +Finds the resource with the given name and returns it + +**Parameters** + +* `resName` :`string` β€” a resource name + +**Returns** + +1. `T` β€” the resource, and an error if the resource is not found + +### ResTypeRep.getAll[πŸ”—](#$api.res~ResTypeRep.getAll) + +``` +function ResTypeRep.getAll(includeInvisible : boolean): {K : string} +``` + +Gets all resources + +**Parameters** + +* `includeInvisible` :`boolean` β€” if invisible resources should be included, false by default + +**Returns** + +1. `{K : string}` β€” a dictionary containing all id and resource names + +### ResTypeRep.add[πŸ”—](#$api.res~ResTypeRep.add) + +``` +function ResTypeRep.add(resName : ResName, resource : T, visible : boolean): K +``` + +Adds a new resource to the repository + +**Parameters** + +* `resName` :`ResName` β€” the resource name of the new resource +* `resource` :`T` β€” the resource itself +* `visible` :`boolean` β€” if the resource is visible + +**Returns** + +1. `K` β€” the id of the newly added resource + +### ResTypeRep.setVisible[πŸ”—](#$api.res~ResTypeRep.setVisible) + +``` +function ResTypeRep.setVisible(id : K, visible : boolean) +``` + +Sets a resource visible + +**Parameters** + +* `id` :`K` β€” the id of the resource +* `visible` :`boolean` β€” if the resource should be visible + +### ResTypeRep.isVisible[πŸ”—](#$api.res~ResTypeRep.isVisible) + +``` +function ResTypeRep.isVisible(id : K): boolean +``` + +Checks if a resource is visible + +**Parameters** + +* `id` :`K` β€” the id of the resource + +**Returns** + +1. `boolean` β€” if the resource is visible + +### ResTypeRep.getAsTable[πŸ”—](#$api.res~ResTypeRep.getAsTable) + +``` +function ResTypeRep.getAsTable(id : K): T +``` + +Gets the resource for a given id as a pure lua table + +**Parameters** + +* `id` :`K` β€” a resource id + +**Returns** + +1. `T` β€” the resource + +### ResTypeRep.setAsTable[πŸ”—](#$api.res~ResTypeRep.setAsTable) + +``` +function ResTypeRep.setAsTable(id : K, t : T): boolean +``` + +Updates the resource for a given id from a pure lua table (as if it was the resource file) + +**Parameters** + +* `id` :`K` β€” a resource id +* `t` :`T` β€” the resource + +**Returns** + +1. `boolean` β€” success + +### ResTypeRep.addAsTable[πŸ”—](#$api.res~ResTypeRep.addAsTable) + +``` +function ResTypeRep.addAsTable(the : ResName, t : T): K +``` + +Add a new resource from a pure lua table (as if it was the resource file) + +**Parameters** + +* `the` :`ResName` β€” name of the resource to add (should be unique) +* `t` :`T` β€” the resource to add + +**Returns** + +1. `K` β€” the newly added id diff --git a/docs/reference/script-doc/api_type.md b/docs/reference/script-doc/api_type.md new file mode 100644 index 0000000..fb9c1ef --- /dev/null +++ b/docs/reference/script-doc/api_type.md @@ -0,0 +1,29355 @@ + + +[index](../index.html) / [api](../api.html) / type + +--- + +# Module api.type[πŸ”—](#api.type) + +Contains game command objects and related utilities. + +``` +global record Type ScriptParam: ScriptParam + LangKey: LangKey + ModDesc: Mod.ModDesc + ModId: Mod.ModId + KeyCombo: KeyCombo + KeyComboDef: KeyComboDef + AppConfig: AppConfig + enum: Enum + Vec5f: Vec5f + Vec4f: Vec4f + Vec3f: Vec3f + Vec2f: Vec2f + Mat4f: Mat4f + Vec2i: Vec2i + Box3: Box3f + Box2: Box2f + Clock: Clock + CommandProgress: CommandProgress + LoaderHelper: LoaderHelper + Connection: Connection + ComponentType: Engine.ComponentType + Date: Date + JournalEntry: JournalEntry + EdgeId: EdgeId + EdgePos: EdgePos + NodeId: NodeId + Waypoint: Waypoint + SignalId: SignalId + StationTerminal: StationTerminal + ScriptRef: ScriptRef + ModuleDesc: ModuleDesc + ConstructionDesc: ConstructionDesc + GameScriptDesc: GameScriptDesc + DynamicConstructionTemplate: DynamicConstructionTemplate + Line: Engine.Component.Line + EmissionGrid: Engine.Component.EmissionGrid + MovePathAircraft: Engine.Component.MovePathAircraft + TransportVehicle: Engine.Component.TransportVehicle + LoadConfig: LoadConfig + BaseConfig: BaseConfig + CargoTypeSet: CargoTypeSet + TransportVehiclePart: TransportVehiclePart + TransportVehicleConfig: TransportVehicleConfig + Context: Context + Proposal: Proposal + SimpleProposal: SimpleProposal + ProposalData: ProposalData + StreetProposal: Proposal.StreetProposal + SimpleStreetProposal: SimpleStreetProposal + CatchmentArea: CatchmentArea + LayerConfig: LayerConfig + NodeViewerData: NodeViewerData + ParticleParamFloat: ParticleParamFloat + ParticleParamVec2f: ParticleParamVec2f + ParticleParamCurveFloat: ParticleParamCurveFloat + ParticleParamCurveVec2f: ParticleParamCurveVec2f + ParticleParamCurveVec3f: ParticleParamCurveVec3f + Path: Path + PathPos: PathPos + AnimationState: Transformator.AnimationState + HeighmapGenerationMode: HeighmapGenerationMode + TownIndustryGenerationMode: TownIndustryGenerationMode + ImportExportHeightmapMode: ImportExportHeightmapMode + StreetGenerationMode: StreetGenerationMode + Map: GameMap + StartGameParams: StartGameParams + SaveGameInfo: SaveGameInfo + SavegameId: SaveGameId + SaveGameDetails: SaveGameData.SaveGameDetails + SaveGameData: SaveGameData + ChartConfig: ChartConfig + FinanceData: FinanceData + Failure: Failure + NodeAndEntity: Proposal.NodeAndEntity + SegmentAndEntity: Proposal.SegmentAndEntity + BaseNodeLaneConnectionAndEntity: Proposal.BaseNodeLaneConnectionAndEntity + EdgeGeometry: EdgeGeometry + MetadataMap: ModelMetadata + Collider: Collider + mod: Mod + modhub: Modhub + TrackType: TrackType + GenericGameRes: GenericGameRes + BridgeType: BridgeType + Industry: Engine.Component.Industry + StockList: Engine.Component.StockList + LineIssue: LineIssue + TrafficLightConfig: Engine.Component.TrafficLightConfig + TrafficLightState: Engine.Component.TrafficLightState +end +global record AchievementDesc id: string + name: string + description: string + icon: string + lockedIcon: string + grade: string + hidden: boolean + campaign: string + alwaysEarnable: boolean + score: integer + playerStatTarget: PlayerStatProgress +end +global record AchievementRep getNumAchievements: function(achievementRep : AchievementRep): integer + get: function(achievementRep : AchievementRep, index : integer): AchievementDesc +end +global record AircraftInfo weight: number + topSpeed: number + landingDistance: number + maxThrust: number + idleThrust: number + mainGear: Vec2f + bodyAngle: number + forwardOffset: number + backwardOffset: number + taxiHoldOffset: number + hasFlaps: boolean + isHelicopter: boolean +end +global record AnyAxisend +global record AnyKeyend +global record AppConfig new: function(AppConfig): AppConfig + equals: function(AppConfig, AppConfig): boolean + distanceSpeedUnit: DistanceSpeedUnit + mainMenuState: { : } + enableKeyboardMouse: boolean + keyCmdDefinitions: {string : {KeyComboDef}} + moneyPrefix: string + cameraTool: boolean + showReleaseNotes: boolean + hasShownInitialDeluxeThankYou: boolean + updateMessageID: integer + debugMode: boolean + guideSystemActive: boolean + experimentalTerrainGeneratorEditor: boolean + experimentalMapFeatures: boolean + screenMode: integer + enableSeamlessStreetBuilder: boolean + showIntelHDwarning: boolean + showLicenseAgreement: boolean + musicEnabled: boolean + menuMusicEnabled: boolean + voiceOverEnabled: boolean + masterVolume: number + soundVolume: number + musicVolume: number + voiceOverVolume: number + audioEffectSettings: AudioEffectSettings + experimentalTunnelAndBridgeMinHeight: boolean + resolutionScale: number + cssEffectsVelocity: number +end +global record Async isCompleted: function(Async): boolean + get: function(Async): T + abort: function(Async) + getProgressMonitor: function(Async): App.ProgressMonitor +end +global record AudioEffectSettings bulldozer: boolean + construction: boolean +end +global record AutoGroundTex new: function(): AutoGroundTex + category: string + gridSize: integer + countFrom: integer + countTo: integer + groundTex: string + individual: boolean + individualCategory: string +end + +[Expand All] [Collapse All] + +global record BaseConfig record AdvancedOptions trafficSpeedSensitivityScale: number + vehicleMaintenanceEmissionsEffect: number + vehicleMaintenancePerformanceEffect: number + vehicleMaintenanceRunningCostsEffect: number + missionVehicleMaintenanceDisableRepair: boolean + missionDisableTunnelBuilding: boolean + missionEmissionsScriptFactor: number + simPersonHappinessDecayAtVehicle: number + simPersonHappinessDecayAtTerminal: number + subventionMode: integer + subventionRisk: integer + subventionFinancialRewardMultiplier: number + landmarkResources: number + isReforestationActive: boolean +end + record Animal new: function(): Animal + populationDensityMultiplier: number + useLocalSpawning: boolean + localTileSize: number + notifyAnimalDespawn: boolean +end + record Locations new: function(): Locations + record IndustryParamList new: function(): IndustryParamList + absoluteMinimum: integer + maxNumberPerArea: number + industryDensity: number + randomSize: boolean + industryProductivity: number +end + record TownParamList new: function(): TownParamList + maxNumberPerArea: number + allowInRoughTerrain: boolean + townFrequency: number + populationDensity: number +end + town: TownParamList + industry: IndustryParamList + makeInitialStreets: boolean +end + record Terrain lodErrorMultiplier: number +end + record Economy new: function(): Economy + record TownDevelopment cargoNeedsPerTown: integer + townGrowthMinDistrictFraction: number +end + record IndustryDevelopment spawnTargetTimeSpan: number + spawnProbabilityExponent: number + spawnIndustries: boolean + unusedTimeSpan: number + closureCountdownTimeSpan: number + closureProbability: number + extendTimeSpan: number +end + cargoIncomeScript: ScriptRef + passengerIncomeScript: ScriptRef + townDevelopment: TownDevelopment + industryDevelopment: IndustryDevelopment +end + record Settings new: function(): Settings + record GeometryQualityOption new: function(): GeometryQualityOption + viewNearFar: Vec2f + fogStartEndFarPerc: Vec2f + lodDistanceScaling: number +end + geometryQualityOptions: {GeometryQualityOption} +end + record Water record Textures foamNormal: string + foamDetail: string + foam: string +end + textures: Textures +end + record Particles record Textures noise0: string + noise1: string + smoke: string + smokeNormal: string +end + textures: Textures +end + record Emissions noiseLowerBoundDB: number + noiseUpperBoundDB: number + pollutionLowerBoundDB: number + pollutionUpperBoundDB: number + townNoiseResidentialAffected: boolean + townNoiseCommercialAffected: boolean + townNoiseIndustrialAffected: boolean +end + animal: Animal + locations: Locations + settings: Settings + particles: Particles + water: Water + emission: Emissions + scaffold: {string : {string : {string}}} + costs: {string : number} + advancedOptions: AdvancedOptions + economy: Economy + terrain: Terrain + environment: ResName + economyId: ResName + nameId: ResName + climate: ResName + trackCatenaryYearFrom: integer + busLaneYearFrom: integer + terrainToolMinStrength: number + terrainToolMaxStrength: number + enforceMainConnections: boolean + townDevelopInterval: number + chargeMaintenanceInterval: number + simulateCargoWeight: boolean + simPersonDestinationRecomputationProbability: number + townMajorStreetAngleRange: number + townConnectionMaxBridgeLength: number + maxVehicleCloneAmount: number + trainAccelerationFactor: number + trainBrakeDeceleration: number + terrainToolMinSize: number + terrainToolMaxSize: number + terrainToolScale: number + terrainToolMaxSizeEditor: number + terrainPainterMinSize: number + terrainPainterMaxSize: number + terrainPainterMaxSizeEditor: number + terrainPainterScale: number + assetBrushMinSize: number + assetBrushMaxSize: number + assetBrushScale: number + treeCostYearMultipliers: {integer : number} + townInitialMajorStreetAngleRange: number + townCapacityScalingFactor: number + sandboxMode: boolean + noCosts: boolean + constructionScript: ScriptRef +end +global record BaseEdgeType NORMAL: BaseEdgeType + BRIDGE: BaseEdgeType + TUNNEL: BaseEdgeType +end +global record BoundingInfo new: function(): BoundingInfo + + bbMax: Vec3f + bbMin: Vec3f +end +global record Box2f new: function(): Box2f + + min: Vec3f + max: Vec3f +end +global record Box3f new: function(): Box3f + + min: Vec3f + max: Vec3f +end +global record BridgeType description: ModelMetadata.Description + availability: ModelMetadata.Availability + menuCategory: ModelMetadata.MenuCategory + cost: number + speedLimit: number + new: function(): BridgeType + costFactors: Vec3f + maintenanceCost: integer + carriers: {Carrier} + padding: number + height: number + sidewalkHeight: number + pillarWidth: number + pillarLen: number + pillarMinDist: number + pillarMaxDist: number + pillarTargetDist: number + abutmentLen: number + abutmentWidth: number + materialsToReplace: { : } + assetsToReplace: { : } + pillarGroundTexture: string + pillarGroundTextureOffset: number + updateScript: ScriptRef + isAutoSelectable: boolean + portals: { : } +end +global record BuilderAudioSet attrs: SoundAttributes + dragStart: SoundClip + drag: {SoundClip} + dragBridge: {SoundClip} + dragTunnel: {SoundClip} + dragEnd: SoundClip + dragOffset: number + build: {SoundClip} + noMoney: {SoundClip} + bulldoze: {SoundClip} + terraform: {SoundClip} +end +global record BuildingType constructionFile: string + params: TownBuildingParams +end +global record CampaignDesc new: function(): CampaignDesc + name: string + description: string + icon: string + map: string + order: number + voiceOver: string + requiresCompleted: string + unlockingProgression: boolean +end +global record CargoCategory tier: integer + landUses: {LandUseType} + requiredIndustryTags: {string} + townConsumptionFactor: number +end +global record CargoClass new: function(): CargoClass + + tag: string + name: string + description: string + icon: string + color: Vec3f + order: integer +end +global type CargoClassId = integer +global record CargoType new: function(): CargoType + + name: string + icon: string + color: Vec3f + scriptRef: ScriptRef + weight: number + cargoClasses: {string} + order: integer + category: string + categoryList: ModelMetadata.CategoryList + timeToDeliverInSeconds: integer + loadSpeedFactor: number +end +global type CargoTypeId = integer +global record CargoTypeSet new: function(): CargoTypeSet + cargoClassesIncluded: {string} + cargoClassesExcluded: {string} + cargoTypesIncluded: {ResName} + cargoTypesExcluded: {ResName} +end +global record CarriageInfo owningVehicle: Engine.Entity + index: integer + offset: number + reversed: boolean + crew: Engine.Entity + end: number +end +global record Carrier ROAD: Carrier + RAIL: Carrier + TRAM: Carrier + OTHER: Carrier + AIR: Carrier + WATER: Carrier + metamethod __index: function(Carrier, string): Carrier +end +global record CatchmentArea position: Vec3f + radius: number +end +global record ChartConfig new: function(): ChartConfig + interval: integer + count: integer + minCount: integer + yStepScale: number +end +global record ChartResult equals: function(ChartResult, ChartResult): boolean + xRange: {number} + yRange: {number} + series: {{{number}}} + xMarkers: {number} + yMarkers: {number} + numPotentialGroups: integer +end +global record ClimateDesc new: function(): ClimateDesc + id: string + desc: ModelMetadata.Description + category: string + order: integer + visible: boolean + mapColoring: PreviewColoring + economy: string + environment: string + defaultNames: string +end +global record Clock new: function(): Clock + getTime: function(Clock): integer +end + +[Expand All] [Collapse All] + +global record Collider record Type NONE: Type + BOX: Type + CYLINDER: Type + POINT_CLOUD: Type +end + record Box halfExtents: Vec3f +end + record Cylinder halfExtents: Vec3f +end + record PointCloud points: {Vec3f} +end + transf: Mat4f + type: Type + box: Box + cylinder: Cylinder + pointCloud: PointCloud +end +global record CommandProgress new: function(): CommandProgress + get: function(CommandProgress): number +end +global record CompanyValue totalScore: integer + railVehicles: integer + trams: integer + roadVehicles: integer + aircrafts: integer + ships: integer + trackTotalLength: integer + trackElectricLength: integer + bridgeTotalLength: integer + tunnelTotalLength: integer + roadTotalLength: integer + suppliedTowns: integer + connectedIndustries: integer + numberOfLines: integer + totalStations: integer + railStations: integer + tramStations: integer + roadStations: integer + aircraftStations: integer + shipStations: integer + topSpeed: number + topLength: number + oldestTransportVehicle: integer + balance: integer + totalAssets: integer + debt: integer +end +global record ComponentCustomState new: function(): ComponentCustomState + + state: { : } +end +global record Connection disconnect: function(Connection) +end +global record ConsoleGen Gen9pro: ConsoleGen + Gen9standard: ConsoleGen + Gen9base: ConsoleGen + PC: ConsoleGen +end + +[Expand All] [Collapse All] + +global record ConstructionDesc record SnapConfig rail: boolean + road: boolean + water: boolean +end + record EdgeObject minDistToCrossing: number + snapToStreet: boolean + snapToTrack: boolean + catchmentCargo: boolean + catchmentPassengers: boolean + catchmentAreaRadius: number +end + new: function(ConstructionDesc): ConstructionDesc + updateScript: ScriptRef + configureLayerScript: ScriptRef + configureHudIconsScript: ScriptRef + hudIconScript: ScriptRef + entityWindowScript: ScriptRef + fileName: string + availability: ModelMetadata.Availability + soundConfig: ModelMetadata.SoundConfig + description: ModelMetadata.Description + categoryList: ModelMetadata.CategoryList + params: {ScriptParam} + categories: {string} + order: number + menuCategory: ModelMetadata.MenuCategory + constructionTemplates: {ConstructionTemplate} + constructionTemplates_native: Vector + placementTag: string + metadata: ConstructionDescMetadata + snapping: SnapConfig + undergroundView: boolean + heightAdjustable: boolean + isIndustry: boolean + edgeObject: EdgeObject + townBuildingParams: TownBuildingParams +end + +[Expand All] [Collapse All] + +global record ConstructionDescMetadata record EmissionConfig noise: number + pollution: number +end + emissionConfig: EmissionConfig +end +global type ConstructionId = integer +global record ConstructionInstanceMetadata costScaleFactor: number +end +global record ConstructionResult subconstructions: {Proposal.Subconstruction} + metadata: ConstructionInstanceMetadata + cost: number + maintenanceCost: number + maintenanceCarrier: string + streetTerminal: Proposal.StreetTerminal + params: { : } +end + +[Expand All] [Collapse All] + +global record ConstructionScriptParam enum Type "Button" + "CheckBox" + "ComboBox" + "IconButton" + "Slider" +end + enum Location "Default" + "Toolbar" +end + enum DisplayMode "Compact" + "Default" + "Horizontal" + "Sparse" + "Vertical" +end + key: string + name: string + group: string + tooltip: string + values: {string} + numbers: {number} + tooltips: {string} + postConstructionModifiable: boolean + hideLabel: boolean + images: {string} + defaultIndex: Index + uiType: Type + location: Location + displayMode: DisplayMode + tags: {string} + yearFrom: integer + yearTo: integer + checkEnabledScript: ScriptRef + stepValueScript: ScriptRef + formatValueScript: ScriptRef +end +global record ConstructionTemplate availability: ModelMetadata.Availability + desc: ModelMetadata.Description + data: ConstructionTemplateData + menuCategory: ModelMetadata.MenuCategory + builderAudioRes: ResName + configureHudIconsScript: ScriptRef +end +global record ConstructionTemplateData initialModules: {ResName : integer} + params: {ScriptParam} +end +global record ConstructionType STREET_STATION: ConstructionType + RAIL_STATION: ConstructionType + AIRPORT: ConstructionType + HARBOR: ConstructionType + STREET_STATION_CARGO: ConstructionType + RAIL_STATION_CARGO: ConstructionType + HARBOR_CARGO: ConstructionType + STREET_DEPOT: ConstructionType + RAIL_DEPOT: ConstructionType + WATER_DEPOT: ConstructionType + INDUSTRY: ConstructionType + WAREHOUSE: ConstructionType + ASSET_DEFAULT: ConstructionType + ASSET_TRACK: ConstructionType + TOWN_BUILDING: ConstructionType + STREET_CONSTRUCTION: ConstructionType + NONE: ConstructionType + AIRPORT_CARGO: ConstructionType + TRACK_CONSTRUCTION: ConstructionType + WATER_WAYPOINT: ConstructionType +end +global record Context new: function(): Context + checkTerrainAlignment: boolean + cleanupStreetGraph: boolean + gatherBuildings: boolean + gatherFields: boolean + player: Engine.Entity + refundableEntities: {{Engine.Entity, integer}, {Engine.Revision, integer}} + extendProposalRedoPillars: boolean +end +global record Date new: function(year : integer, month : integer, day : integer): Date + + now: function(): Date + fromYear: function(integer : integer): Date + fromString: function(str : string): Date + getEndOfMonth: function(current : Date): Date + getDayOfWeek: function(current : Date): integer + addOffsetDays: function(date : Date, numDays : integer): Date + year: integer + month: integer + day: integer +end +global record DateFormat LONG: DateFormat + SHORT: DateFormat + MEDIUM: DateFormat + FULL: DateFormat + FILENAME: DateFormat + YEAR: DateFormat +end +global record DistanceSpeedUnit Metric: DistanceSpeedUnit + Imperial: DistanceSpeedUnit +end +global record DynamicConstructionTemplate params: {ScriptParam} +end +global record Easing Linear: integer + EaseOutSqrt: integer + EaseInSine: integer + EaseOutSine: integer + EaseInOutSine: integer + EaseInQuad: integer + EaseOutQuad: integer + EaseInOutQuad: integer + EaseInCubic: integer + EaseOutCubic: integer + EaseInOutCubic: integer + EaseInQuart: integer + EaseOutQuart: integer + EaseInOutQuart: integer + EaseInQuint: integer + EaseOutQuint: integer + EaseInOutQuint: integer + EaseInExpo: integer + EaseOutExpo: integer + EaseInOutExpo: integer + EaseInCirc: integer + EaseOutCirc: integer + EaseInOutCirc: integer + EaseInBack: integer + EaseOutBack: integer + EaseInOutBack: integer + EaseInElastic: integer + EaseOutElastic: integer + EaseInOutElastic: integer + EaseInBounce: integer + EaseOutBounce: integer + EaseInOutBounce: integer +end + +[Expand All] [Collapse All] + +global record EconomyDesc record TownCargoLevelInfo new: function(): TownCargoLevelInfo + + minTier: integer + maxTier: integer + landUseType: LandUseType +end + new: function(): EconomyDesc + desc: ModelMetadata.Description + order: integer + visible: boolean + category: string + industryWeightsSum2Population: number + placementParams: {string : PlacementParams} + cargoCategories: {string : CargoCategory} + townLevels2CargoInfos: {integer : {TownCargoLevelInfo}} + cargoRequiredIndustries: { : } + companyRankRequiredIndustries: { : } + defaultIndustryDensity: number + defaultPopulationDensity: number + defaultIndustryProductivity: number +end +global record Edge conns: {NodeId} + geometry: EdgeGeometry + transportModes: {TransportMode : boolean} + speedLimit: number + curveSpeedLimit: number + curSpeed: number + linkable: integer + pedestrianWalkPenalty: number + precedence: boolean + noiseModifier: number + pollutionModifier: number + needsReservation: boolean + forwardOnly: boolean +end +global record EdgeDecoration new: function(): EdgeDecoration + + availability: ModelMetadata.Availability + desc: ModelMetadata.Description + cost: ModelMetadata.Cost + maintenance: number + categoryList: ModelMetadata.CategoryList + requiredTags: {string} + incompatibleTags: {string} + repModel: string + length: number + stretch: boolean + verticalAlignment: integer + snapMode: integer + offset: number + skipSameInParallelStrip: boolean + order: integer + modifiers: Modifiers + menuCategory: ModelMetadata.MenuCategory + builderAudioRes: ResName +end + +[Expand All] [Collapse All] + +global record EdgeGeometry record Type ARC: Type + STRAIGHT: Type + CUBIC_SPLINE: Type + CUBIC_OFFSET_SPLINE: Type +end + record Arc new: function(): Arc + center: Vec2f + radius: number + startAngle: number + angle: number +end + record Straight new: function(): Straight + pos: {Vec2f} +end + record CubicSpline new: function(): CubicSpline + pos: {Vec2f} + tangent: {Vec2f} +end + record CubicOffsetSpline new: function(): CubicOffsetSpline + pos: {Vec2f} + tangent: {Vec2f} + offset: number +end + new: function(): EdgeGeometry + type: Type + arc: Arc + straight: Straight + cubicSpline: CubicSpline + cubicOffsetSpline: CubicOffsetSpline + tangent: Vec2f + height: Vec2f + length: number + width: number + locate: function(geom : EdgeGeometry, pos : Vec3f, maxSteps : integer, tol : number): {number, boolean} + calcPos: function(geom : EdgeGeometry, param : number): {Vec3f, Vec3f, Vec3f} +end +global record EdgeId new: function(): EdgeId + + entity: Engine.Entity + index: integer +end + +[Expand All] [Collapse All] + +global record EdgeIsect record Info index: integer + param: number + pos: Vec3f +end + infos: {Info, Info} +end +global record EdgeObjectType STOP_LEFT: EdgeObjectType + STOP_RIGHT: EdgeObjectType + SIGNAL: EdgeObjectType +end +global record EdgePos new: function(): EdgePos + + equals: function(EdgePos, EdgePos): boolean + edgeId: EdgeId + param: number +end +global record Enum LogLevel: LogLevel + SaveGameType: SaveGameType + DateFormat: DateFormat + EdgeObjectType: EdgeObjectType + TransportVehicleState: TransportVehicleState + Carrier: Carrier + SignalType: SignalType + VehicleEngineType: VehicleEngineType + LineProblem: LineProblem + LineStationProblem: LineStationProblem + VehicleProblem: VehicleProblem + VehicleIconType: VehicleIconType + TownProblem: TownProblem + StockListType: StockListType + ConstructionType: ConstructionType + TransportMode: TransportMode + TramTrackType: TramTrackType + LandUseType: LandUseType + InputMode: InputMode + GamepadType: GamepadType + Platform: Platform + Vendor: Vendor + ConsoleGen: ConsoleGen + TrafficLightPreference: TrafficLightPreference + BaseEdgeType: BaseEdgeType + MoveMode: MoveMode + RoadType: RoadType + ScriptParamType: ScriptParamType + ScriptParamLocation: ScriptParamLocation + ScriptParamDisplayMode: ScriptParamDisplayMode + DistanceSpeedUnit: DistanceSpeedUnit + HudEffectMode: HudEffectMode + FontScaleClass: FontScaleClass + MoneyMode: MoneyMode + PowerUnit: PowerUnit + WeightUnit: WeightUnit + ForceUnit: ForceUnit + Gender: Gender + UgcAccessLimitedReason: UgcAccessLimitedReason + FlightState: FlightState + Easing: Easing + PdxErrorCodes: PdxErrorCodes + PdxLegalDocumentType: PdxLegalDocumentType + PdxThirdPartyLinkState: PdxThirdPartyLinkState + PdxThirdPartyAutoLoginPromptState: PdxThirdPartyAutoLoginPromptState +end + +[Expand All] [Collapse All] + +global record Environment record AthmostphereParams new: function(): AthmostphereParams + cloudCoverage: number + cloudBase: number + cloudTop: number + cloudScattering: number + dayOfYear: number + sunRotation: number +end + new: function(): Environment + atmosphere: AthmostphereParams + name: string + isToolEnvironment: boolean +end + +[Expand All] [Collapse All] + +global record ExtPath record ExtPathEdge range: EdgeRange + link: LinkEdge + record EdgeRange edgeId: EdgeId + params: {number, number} + dir: boolean +end + record LinkEdge points: {EdgePos, EdgePos} +end +end + edges: {ExtPathEdge} +end +global record Extent new: function(): Extent + + bbMax: Vec3f + bbMin: Vec3f +end + +[Expand All] [Collapse All] + +global record Failure record Reason Unkown: Reason + NoPath: Reason + NoElectric: Reason + NoTram: Reason + NoTramButTramTrack: Reason + NoTramTrackButRail: Reason + NoRail: Reason + NoRoad: Reason + NoSmallAircraft: Reason + NoSmallShip: Reason +end + reason: Reason + pos: Vec3f +end +global type FilePath = string +global record FinanceData equals: function(FinanceData, FinanceData): boolean + transport: {JournalEntry.Carrier : {integer : {integer}}} + investment: {integer : {integer}} + other: {JournalEntry.Other, {integer}} + loan: {integer} + interest: {integer} + loanBorrowing: {integer} + loanRepayment: {integer} + total: {integer} + balance: {integer} + header: {string} + unfoldKey: function(FinanceData, integer): {JournalEntry.Type, JournalEntry.Maintenance, JournalEntry.Construction} + foreach_carrier: function(FinanceData, function(JournalEntry.Carrier, {integer : {integer}})) + foreach_transport: function(FinanceData, function(integer, {integer}), JournalEntry.Carrier) + foreach_investment: function(FinanceData, function(integer, {integer})) + foreach_other: function(FinanceData, function(JournalEntry.Other, {integer})) +end +global record FlightState Taxi0: FlightState + TakeOff: FlightState + Flight: FlightState + Approach: FlightState + Landing: FlightState + Taxi1: FlightState +end +global record FontScaleClass Small: FontScaleClass + Medium: FontScaleClass + Large: FontScaleClass +end +global record ForceUnit KN: ForceUnit + KGF: ForceUnit + LBF: ForceUnit +end +global record GPUCapabilities hasDiscreteGPU: boolean + hasUnsupportedGPU: boolean +end + +[Expand All] [Collapse All] + +global record GameMap record Town new: function(): Town + pos: Vec2f + name: string + sizeFactors: {number} + landUse2CargoNeeds: {LandUseType : {{string, number}}} + existing: Engine.Entity +end + record Industry new: function(): Industry + pos: Vec2f + angle: number + onWater: boolean + fileName: string + tag: string + existing: Engine.Entity +end + record MapTree add: function(category : GameMap.MapTree, position : string, Vec3f) +end + record MapAsset add: function(category : GameMap.MapAsset, position : string, Mat4f) +end + record Tree id: integer + pos: Vec3f +end + record Asset id: integer + transf: Mat4f +end + new: function(): GameMap + + setHeightMap: function(GameMap, integer, number) + heightmap: {number} + numTilesX: integer + numTilesY: integer + levels: integer + offsetZ: number + waterLevel: number + climateId: string + resolution: Vec3f + towns: {GameMap.Town} + industries: {GameMap.Industry} + townConnections: {{integer, integer}} + trees: GameMap.MapTree + assets: GameMap.MapAsset +end +global record GameMetadata date: integer + balance: integer + population: integer + startYear: integer + numVehicleModels: integer + terrainDimensions: Vec2i + companyValue: CompanyValue + transportationStats: TransportationStats + scriptMetadata: SavegameScriptMetadata + gameModDescs: {Mod.GameModDesc} + achievementsEarnable: boolean + screenshot: GameScreenshot +end +global record GameScreenshot width: integer + height: integer + image: {integer} + image_native: Vector +end +global record GameScriptDesc new: function(): GameScriptDesc + + postUpdateScript: ScriptRef + handleEventScript: ScriptRef + guiUpdateScript: ScriptRef + guiHandleEventScript: ScriptRef + updateScript: ScriptRef +end +global record GamepadType None: GamepadType + XBox: GamepadType + PlayStation5: GamepadType + PlayStation4: GamepadType +end +global record Gender FEMALE: Gender + MALE: Gender +end +global record GenericGameRes new: function(): GenericGameRes + type: string + data: { : } + setData: function(GenericGameRes, { : }) +end +global record GenericGameResT new: function(): GenericGameResT + type: string + data: T + setData: function(GenericGameResT, T) +end +global GlobalType: Type +global record GridCollisionSystem getCollisionDataAt: function(GridCollisionSystem, Vec2f): integer +end +global record GridVec2f new: function(): GridVec2f + + width: integer + height: integer + x0: integer + y0: integer + at: function(grid : GridVec2f, pos : Vec2i): Vec2f +end +global record Gridf new: function(): Gridf + + width: integer + height: integer + at: function(pos : Vec2i): number +end + +[Expand All] [Collapse All] + +global record GroundTexture new: function(): GroundTexture + + matIndexMap: { : } + indices: { : } + priority: integer + texSize: number + record Data data: { : } + size: integer +end +end +global record HeighmapGenerationMode new: function(): HeighmapGenerationMode + terrainGenerator: string + generateTowns: boolean + generateIndustries: boolean + generateAssets: boolean + keepHeightmap: boolean +end +global record HeightmapNew getSize: function(): Vec2i + at: function(x : integer, y : integer): number +end +global record HudEffectMode Always: HudEffectMode + CockpitOnly: HudEffectMode + Never: HudEffectMode +end +global record ImportExportHeightmapMode new: function(): ImportExportHeightmapMode + fileName: string + import: boolean + generateAssets: boolean + minH: number + maxH: number +end +global type Index = integer +global record IndustryInfo fileName: string + bbox: Box2f + streetPoint: Vec2i + transf: Mat4f + onWater: boolean +end +global record IndustryResult toRemove: {Engine.Entity} + toAdd: {IndustryInfo} +end +global record InputActionDesc uiName: string + type: integer + defaultBindings: {KeyComboDef} + modifierOnly: boolean + uiCategory: string + uiOrder: integer + duplicateOf: string + duplicatedKeybindings: boolean +end +global record InputActionRep getAll: function(InputActionRep): {string} + get: function(InputActionRep, string): InputActionDesc +end +global record InputMode Undefined: InputMode + KeyboardMouse: InputMode + Gamepad: InputMode +end +global record KeyCombo new: function(KeyComboDef): KeyCombo + toString: function(KeyCombo): string + isModifierOnly: function(KeyCombo): boolean + relevantFor: function(KeyCombo, InputMode): boolean +end +global record KeyComboDef new: function(): KeyComboDef + + setKeyScancode: function(KeyComboDef, integer) + addModifierKey: function(KeyComboDef, integer) + condition: integer +end +global record LandUseType RESIDENTIAL: LandUseType + COMMERCIAL: LandUseType + INDUSTRIAL: LandUseType +end +global record LandVehicleMoveInfo availPower: number + traction: number + tractiveEffort: number + vehicleAvailPower: {number} +end +global record LaneConfig speed: number + width: number + height: number + forward: boolean + transportModes: {TransportMode : boolean} + offset: number +end +global record LaneConnection segment0: Engine.Entity + lane0: integer + segment1: Engine.Entity + lane1: integer + withRoad: boolean + withTram: boolean +end +global record LangKey new: function(): LangKey + equals: function(LangKey, LangKey): boolean + code: string + mod: Mod.ModId +end +global record LanguageRep getAllLanguages: function(LanguageRep): {{string, LangKey}} +end + +[Expand All] [Collapse All] + +global record LayerConfig new: function(): LayerConfig + + record EmissionColorMap new: function(): EmissionColorMap + + record Colors new: function(): Colors + + numberOfLevels: integer + colors: {Vec4f} + thresholds: {number} +end + record VisualizationType DecibelCurrent: VisualizationType + DecibelAverage: VisualizationType + Combined: VisualizationType +end + colors: Colors + currentEmissionId: Engine.Component.EmissionGrid.Type + visualizationType: VisualizationType +end + record TerrainColorMap new: function(): TerrainColorMap + + record Colors new: function(): Colors + + numberOfLevels: integer + colors: {Vec4f} + thresholds: {number} + water: Vec4f + navigableWater: Vec4f + interpolateNavigableWater: boolean +end + colors: Colors +end + record TerrainContours new: function(): TerrainContours + + record Contour new: function(): Contour + + color: Vec4f + level: number + thickness: number + fadeDistance: number +end + contours: {Contour} +end + record ColorPassFn new: function(): ColorPassFn + + record BaseColor new: function(BaseColor): BaseColor + fromColor: function(Vec4f, boolean): BaseColor + value: Vec4f + overrideColorMap: boolean +end + record BaseMappedColor new: function(): BaseMappedColor + + thresholds: {number} + colors: {Vec4f} + nearest: boolean + overrideColorMap: boolean +end + record BaseRangeColor new: function(): BaseRangeColor + + minMax: {Vec4f} + overrideColorMap: boolean +end + record CargoColor new: function(): CargoColor + clone: function(CargoColor): CargoColor + residential: BaseRangeColor + industrial: BaseRangeColor + commercial: BaseRangeColor + numBuildingLevels: integer + includePassengers: boolean +end + record DestinationColor new: function(): DestinationColor + + town: Engine.Entity + showPlayerTransport: boolean + showPrivateTransport: boolean + residential: BaseRangeColor + industrial: BaseRangeColor + commercial: BaseRangeColor + numBuildingLevels: integer +end + record EmissionEmitterColor new: function(): EmissionEmitterColor + + color: BaseRangeColor + currentEmissionId: Engine.Component.EmissionGrid.Type + lowerBound: number + upperBound: number + goodColor: BaseRangeColor + goodColorLowerBound: number + goodColorUpperBound: number +end + record EmissionImpactColor new: function(): EmissionImpactColor + + color: BaseRangeColor + currentEmissionId: Engine.Component.EmissionGrid.Type + useAverage: boolean + lowerBoundDB: number + upperBoundDB: number +end + record FallbackColor new: function(): FallbackColor + + terrain: BaseColor + water: BaseColor + edge: BaseColor + node: BaseColor + parallelStrip: BaseColor + whatever: BaseColor +end + record IndustryColor new: function(): IndustryColor + + industry: BaseColor + onlyWithPersonCapacity: boolean +end + record LandUseColor new: function(): LandUseColor + + residential: BaseRangeColor + industrial: BaseRangeColor + commercial: BaseRangeColor +end + record LineVehicleColor new: function(): LineVehicleColor + + highlightedEntities: {Engine.Entity} + carriers: {Carrier} +end + record MaintainedTransportVehicleColor new: function(): MaintainedTransportVehicleColor + + color: BaseColor + maintenanceStationEntity: Engine.Entity +end + record StationOvercrowdedColor new: function(): StationOvercrowdedColor + + color: BaseMappedColor +end + record SpeedLimitsColor new: function(): SpeedLimitsColor + + slowToFast: {BaseColor} + numberOfLevels: integer + hideNonPlayerOwned: boolean + hideNonLocked: boolean +end + record TrafficColor new: function(): TrafficColor + + poorToGood: {BaseColor} + numberOfLevels: integer + discrete: boolean +end + record HappinessColor new: function(): HappinessColor + + normalToPoor: {BaseColor} +end + terrainPainter: any + waterPainter: any + townBuildingPainter: any + industryPainter: any + emissionEmitterPainter: any + stationPainter: any + warehousePainter: any + transportNetworkPainter: any + transportVehiclePainter: any + landVehiclePainter: any + simAtTerminalPainter: any + fallbackColor: FallbackColor +end + record BuildingRenderableConfig new: function(): BuildingRenderableConfig + + isVisible: boolean + includeTownBuildings: boolean + includeTownBuildingModels: boolean + includeTownBuildingMainModel: boolean + includeIndustries: boolean + includeWarehouses: boolean + includeStations: boolean + includeEdges: boolean +end + record CatchmentAreaDisplaySettings new: function(): CatchmentAreaDisplaySettings + + personBaseColor: Vec3f + cargoBaseColor: Vec3f + inactiveColor: Vec3f + unreachableColor: Vec3f + deleteColor: Vec3f + maintenanceColor: Vec3f + noiseColor: Vec3f + pollutionColor: Vec3f + borderAlpha: number + borderAlphaPassive: number + godrayAlpha: number + godrayAlphaPassive: number + innerAlpha: number + buildingAlpha: number + borderWidth: number +end + record CatchmentAreaRenderableConfig new: function(): CatchmentAreaRenderableConfig + + isVisible: boolean + displaySettings: CatchmentAreaDisplaySettings + cargo: boolean + person: boolean + maintenance: boolean + noise: boolean + pollution: boolean + addGodrays: boolean + entity: Engine.Entity + carriers: {Carrier} +end + record PlotsRenderableConfig new: function(): PlotsRenderableConfig + + triangles: {Vec2f} +end + record SignConfig new: function(): SignConfig + + signRenderDistance: number +end + record CargoEdgesRenderables new: function(): CargoEdgesRenderables + + town: Engine.Entity + cargoTypes: {CargoTypeId} + showPlayerTransport: boolean + showPrivateTransport: boolean + playerTransportColor: {Vec4f, Vec4f} + privateTransportColor: {Vec4f, Vec4f} + numTransportLevels: integer + signConfig: SignConfig +end + record SatisfactionEdgesRenderables new: function(): SatisfactionEdgesRenderables + + town: Engine.Entity + cargoTypes: {CargoTypeId} + colors: {Vec4f} + thresholds: {number} + signConfig: SignConfig +end + record SpeedLimitsEdgesRenderables new: function(): SpeedLimitsEdgesRenderables + + speedColor: {Vec4f, Vec4f, Vec4f} + undergroundSpeedColor: {Vec4f, Vec4f, Vec4f} + numberOfLevels: integer + tunnelOutlineColor: Vec4f + tunnelOutlineSize: number + signConfig: SignConfig + hideNonPlayerOwned: boolean + hideNonLocked: boolean +end + record TrafficEdgesRenderables new: function(): TrafficEdgesRenderables + + trafficColor: {Vec4f, Vec4f, Vec4f} + undergroundTrafficColor: {Vec4f, Vec4f, Vec4f} + numberOfLevels: integer + discrete: boolean + tunnelOutlineColor: Vec4f + tunnelOutlineSize: number +end + record VoronoiRenderableConfig new: function(): VoronoiRenderableConfig + + showTowns: boolean + townsOfInterest: {Engine.Entity} + showMapBorder: boolean + lineWidth: number + colors: {Vec4f} + sectionsPerColor: integer + fadingMinHeight: number + fadingDeltaHeight: number +end + record WindRenderableConfig new: function(): WindRenderableConfig + + isVisible: boolean + emissionType: Engine.Component.EmissionGrid.Type +end + record CargoFlowRenderableConfig new: function(): CargoFlowRenderableConfig + + record FlowData new: function(): FlowData + + from: Vec3f + to: Vec3f + speed: number + arrowColors: {Vec4f} + cargoIconAlpha: number + cargoTypes: {CargoTypeId} +end + flowData: {FlowData} +end + colorMap: any + contours: TerrainContours + colorPassFn: ColorPassFn + colorPassFnForBuildingRenderableOnly: boolean + buildingRenderableConfig: BuildingRenderableConfig + catchmentAreaRenderableConfig: CatchmentAreaRenderableConfig + edgeRenderableConfig: any + voronoiRenderableConfig: VoronoiRenderableConfig + windRenderableConfig: WindRenderableConfig + plotsRenderableConfig: PlotsRenderableConfig + cargoFlowRenderableConfig: CargoFlowRenderableConfig + undergroundMode: boolean + showOneWay: boolean +end +global record LineCargoInfo realSectionTimes: {{number, integer}} + sectionTimes: {number} + frequency: number + driveRealSectionTimes: {{number, integer}} + driveSectionTimes: {number} + numVehicles: integer + totalCapacity: integer + availableCapacities: {integer} + comfortFactor: number + priceFactor: number +end + +[Expand All] [Collapse All] + +global record LineIssue record Type NowhereToLoad: Type + NowhereToUnload: Type + NoVehicleToLoadCargo: Type + VehicleUseless: Type + LineCargoConfig: Type + None: Type +end + type: Type + stopIndex: integer + cargoType: CargoTypeId +end +global record LineOrEdges line: Engine.Entity + lineStop0: integer + lineStop1: integer + lineTerminal1: {Engine.Entity, integer} + edges: {EdgePos} +end +global record LineProblem NOTHING: integer + ZERO_OR_ONE_STATION: integer + DOUBLE_STATIONS: integer + INCOMPATIBLE_STATIONS: integer + NO_PATH: integer + BAD_ALTERNATIVE_TERMINAL: integer +end +global record LineStationProblem StopUseless: integer + PassengerStopUseless: integer + CargoStopUseless: integer + AllPassengerStopUseless: integer + CargoTypeUnloadUseless: integer + CargoTypeLoadUseless: integer +end +global record LineVehicleInfo transportModes: {TransportMode : boolean} +end +global record LoadConfig new: function(): LoadConfig + loadConfigIndex: integer + cargoTypeId: CargoTypeId +end +global record LoaderHelper useFn: function(LoaderHelper, string) +end +global record LogLevel Raw: LogLevel + Error: LogLevel + Warning: LogLevel + Message: LogLevel + Verbose: LogLevel +end +global record Map find: function(Map, K): V + insert: function(Map, K, V) + size: function(Map): integer + asTable: function(Map): {K : V} + next: function(K): K +end +global record Mat4f new: function(): Mat4f + + clone: function(Mat4f): Mat4f + cols: function(matrix : Mat4f, colIndex : integer): Vec4f + getTransl: function(Mat4f): Vec3f + setTransl: function(v : Mat4f, Vec3f): Mat4f + transformPosition: function(v : Mat4f, Vec3f): Vec3f + transformDirection: function(v : Mat4f, Vec3f): Vec3f + rotZ: function(angle : number): Mat4f + rotY: function(angle : number): Mat4f + rotX: function(angle : number): Mat4f + rotZTransl: function(angle : number, transl : Vec3f): Mat4f + rotZYTransl: function(angles : Vec2f, transl : Vec3f): Mat4f + scale: function(scale : Vec3f): Mat4f + scaleRotZTransl: function(scale : Vec3f, angle : number, transl : Vec3f): Mat4f + scaleTransl: function(scale : Vec3f, transl : Vec3f): Mat4f + transl: function(transl : Vec3f): Mat4f + metamethod __index: function(Mat4f, integer): number + +end +global record MemoryStatistics vidMemUsage: integer + trackedVidMemUsage: integer + vidMemMax: integer + peakVidMem: integer + ramUsage: integer + trackedRamUsage: integer + ramMax: integer + peakRam: integer + peakTotalMem: integer + largestFreeBlock: integer +end +global record MetaConstructionDesc new: function(MetaConstructionDesc): MetaConstructionDesc + availability: ModelMetadata.Availability + description: ModelMetadata.Description + soundConfig: ModelMetadata.SoundConfig + categoryList: ModelMetadata.CategoryList + params: {ConstructionScriptParam} + menuCategory: ModelMetadata.MenuCategory + undergroundView: boolean + heightAdjustable: boolean + isIndustry: boolean + heightModView: boolean + configureLayerScript: ScriptRef + configureHudIconsScript: ScriptRef + metadata: ConstructionDescMetadata + relativePath: string + createTemplateScript: ScriptRef + order: integer +end +global record MissionCampaign campaign: ResName + mission: ResName +end + +[Expand All] [Collapse All] + +global record MissionDesc record Medal id: string + name: string + nameLocked: string + iconLocked: string + iconCompleted: string +end + record Star id: string + name: string + description: string + iconLocked: string + iconCompleted: string +end + record Character name: string + info: string + portrait: string +end + name: string + description: string + campaign: string + characters: {Character} + order: integer + image: string + imagePreview: string + imageSuccess: string + imageFailure: string + loadscreen: string + loadscreenDescription: string + loadscreenVoiceOver: string + savegame: string + languageScript: string + playlistOverride: string + medals: {Medal} + starsDescription: string + stars: {Star} + voiceOver: string + location: string + year: string + musicTracks: {{ResName, boolean}} +end +global record ModRep getInstalledMods: function(ModRep): {Mod.ModId} + exists: function(ModRep, Mod.ModId): boolean + + getModDesc: function(ModRep, Mod.ModId): Mod.ModDesc + getModSize: function(ModRep, Mod.ModId): Mod.ModSize + getGameModDesc: function(ModRep, Mod.ModId): Mod.GameModDesc + getModSource: function(ModRep, Mod.ModId): string + wouldForceActivateAchievements: function(ModRep, {Mod.ModId}): boolean + couldAchievementsBeEarned: function(ModRep, {Mod.ModId}): boolean +end +global record Model metadata: { : } + boundingInfo: BoundingInfo + collider: { : } + modelPath: ResName +end +global record ModelInstance modelId: integer + transf0: Mat4f + transf: Mat4f + transformator: integer +end + +[Expand All] [Collapse All] + +global record ModelMetadata record Animal record MovementType description: string +end + record Config density: number + fish: boolean +end + config: Config + movementTypes: {MovementType} + idForAchievement: string +end + record Description name: string + description: string + iconSmall: string + iconSmallCblend: string + icon: string + icon20: string + icon3d: string + icon20cblend: string + lockedIcon: string + previewIcon: string + attributes: {string : {number, number}} + attributes_native: Map + cargoTypeSet: CargoTypeSet +end + record Category categories: {string} +end + record CategoryList categories: {string} +end + record MenuCategory record CategoryWithOrder new: function(): CategoryWithOrder + category: string + order: integer + filterCategories: {string} +end + categories: {CategoryWithOrder} +end + record Availability yearFrom: integer + yearTo: integer + notifyWhenAvailable: boolean + notificationGroup: string + notificationSortKey: integer +end + record SoundConfig record SoundSet name: string +end + soundSet: SoundSet + effects: {string : {string}} + builderAudioRes: ResName +end + record Maintenance lifespan: integer + runningCosts: number + runningCostScale: number + maintenanceScale: number + topSpeedMaintenanceFactorPenaltyPerLevel: number +end + record Emission idle: number + speed: number + power: number + score: number +end + record Emissions noise: Emission + pollution: Emission +end + record VehicleEngine power: number + tractiveEffort: number + type: VehicleEngineType +end + record TransportVehicle record CargoEntry cargoTypeSet: CargoTypeSet + capacity: integer + seats: {integer} + loadIndicator: string +end + record LoadConfig new: function(): LoadConfig + cargoEntry: CargoEntry + toHide: {string} +end + record Compartment loadConfigs: {LoadConfig} +end + line: Engine.Entity + carrier: Carrier + compartments: {Compartment} + loadSpeed: number + reversible: boolean + arrivalDelay: integer + departureDelay: integer + groupFileName: ResName + transportModes: {TransportMode} + engineTransportModes: {TransportMode} + filterTags: {string} + comfortFactor: number + priceFactor: number + maintenanceFactor: number + noCblendMask: boolean +end + record Cost priceScale: number + price: integer +end + record LandVehicle topSpeed: number + weightEmpty: number + weightMaxPayload: number + engines: {VehicleEngine} + friction: number +end + record WaterVehicle topSpeed: number + weightEmpty: number + weightMaxPayload: number + availPower: number + maxRpm: number + area: number +end + record AirVehicle topSpeed: number + weightEmpty: number + weightMaxPayload: number + maxThrust: number + isHelicopter: boolean +end + record Person gender: Gender +end + record Tree reputationFactor: number +end +end +global record Modifiers new: function(): Modifiers + + equals: function(Modifiers, Modifiers): boolean + noiseModifier: number + pollutionModifier: number + maxSpeedModifier: number +end +global record ModuleDesc new: function(): ModuleDesc + fileName: ResName + type: string + autoRemovable: boolean + availability: ModelMetadata.Availability + description: ModelMetadata.Description + category: ModelMetadata.Category + cost: ModelMetadata.Cost + menuCategory: ModelMetadata.MenuCategory + builderAudioRes: ResName + metadata: { : } + metadata_native: Map + relativePath: string + updateScript: ScriptRef + getModelsScript: ScriptRef +end +global record MoneyMode RAW: MoneyMode + KMB: MoneyMode +end +global record MoveMode WALK: MoveMode + DRIVE: MoveMode + LINES: MoveMode +end + +[Expand All] [Collapse All] + +global record MultipleUnit new: function(): MultipleUnit + + vehicles: {MultipleUnit.Vehicle} + name: string + desc: string + filterTags: {string} + availabilityNotificationGroup: string + availabilityNotificationSortKey: integer + groupFileName: string + record Vehicle name: string + forward: boolean +end +end +global record NameDesc name: string + personNamesScript: string + townNamesScript: string + streetNamesScript: string +end +global record NativeLuaTable find: function(NativeLuaTable, NativeLuaValue): NativeLuaValue + findPath: function(NativeLuaTable, {NativeLuaValue}): NativeLuaValue + insert: function(NativeLuaTable, NativeLuaValue, any) + insert_native: function(NativeLuaTable, NativeLuaValue, NativeLuaValue) + remove: function(NativeLuaTable, NativeLuaValue) + size: function(NativeLuaTable): integer + asTable: function(NativeLuaTable): { : } + clone: function(NativeLuaTable): NativeLuaTable + next: function(NativeLuaTable, NativeLuaValue): NativeLuaValue +end +global type NativeLuaValue = string | number | boolean | nil | NativeLuaTable +global record Nodeend +global record NodeId new: function(): NodeId + + entity: Engine.Entity + index: integer +end +global record NodeViewerData new: function(): NodeViewerData + clone: function(NodeViewerData): NodeViewerData + edgeIdx: integer + colors: {Vec4f} + order: integer + width: number +end +global record ParcelData leftEntities: {Engine.Entity} + rightParcels: {Engine.Entity} +end +global record ParsedSavegameName type: SaveGameType + groupName: string + ingameTimestamp: string + fileTimestamp: string +end + +[Expand All] [Collapse All] + +global record ParticleParamCurveFloat new: function(): ParticleParamCurveFloat + + record CurvePoint new: function(): CurvePoint + + time: number + value: number + easing: integer +end + curve: {CurvePoint} +end + +[Expand All] [Collapse All] + +global record ParticleParamCurveVec2f new: function(): ParticleParamCurveVec2f + + record CurvePoint new: function(): CurvePoint + + time: number + value: Vec2f + easing: integer +end + curve: {CurvePoint} +end + +[Expand All] [Collapse All] + +global record ParticleParamCurveVec3f new: function(): ParticleParamCurveVec3f + + record CurvePoint new: function(): CurvePoint + + time: number + value: Vec3f + easing: integer +end + curve: {CurvePoint} +end + +[Expand All] [Collapse All] + +global record ParticleParamFloat new: function(): ParticleParamFloat + + record RandomMinMax new: function(): RandomMinMax + + min: number + max: number +end + record ComponentWiseMinMax new: function(): ComponentWiseMinMax + + min: number + max: number +end + value: any +end + +[Expand All] [Collapse All] + +global record ParticleParamVec2f new: function(): ParticleParamVec2f + + record RandomMinMax new: function(): RandomMinMax + + min: Vec2f + max: Vec2f +end + record ComponentWiseMinMax new: function(): ComponentWiseMinMax + + min: Vec2f + max: Vec2f +end + value: any +end +global record Path new: function(): Path + edges: {{EdgeId, boolean}} + endOffset: integer + terminalDecisionOffset: integer + earlyArrivalIndices: integer +end +global record PathFactoryInput fromEdgesWalk: {EdgePos} + fromEdgesDrive: {EdgePos} + fromLineOrEdges: LineOrEdges + moveMode2costFactor: {number, number, number} + toEntityWalk: Engine.Entity + toEdgesDrive: {EdgePos} + fromEdgesWalkForDrive: {EdgePos} + toEdgesWalkForDrive: {EdgePos} + cargoType: CargoTypeId +end + +[Expand All] [Collapse All] + +global record PathFactoryOutput record LineSection line: Engine.Entity + lineStop0: integer + lineStop1: integer +end + line0: LineSection + line1: LineSection + path: ExtPath + cost: number + moveMode: MoveMode +end +global record PathPos new: function(): PathPos + edgeIndex: integer + pos: number + pos01: number +end +global record PathPosData position: Vec3f + pPrime: Vec3f + pPrimePrime: Vec3f +end +global record PdxAccountInfo email: string +end +global record PdxCountry name: string + code: integer +end +global record PdxErrorCodes AccountAlreadyExists: PdxErrorCodes + BadEmailAddressFormat: PdxErrorCodes + BadPasswordLength: PdxErrorCodes + BadDateFormat: PdxErrorCodes + UnderAgeAccount: PdxErrorCodes + MissingAccountInfo: PdxErrorCodes + ProfileDoesNotExist: PdxErrorCodes + ProfileAlreadyTaken: PdxErrorCodes + ProfileAlreadyExists: PdxErrorCodes + ProfileNameTooLong: PdxErrorCodes + ProfileNameTooShort: PdxErrorCodes + ProfileNameInvalid: PdxErrorCodes +end +global record PdxFuture getResult: function(PdxFuture): T +end +global record PdxLegalDocument title: string + text: string +end +global record PdxLegalDocumentType UserAgreement: PdxLegalDocumentType + PrivacyPolicy: PdxLegalDocumentType +end +global record PdxLoginResultend +global record PdxProfileResult id: string + name: string +end +global interface PdxResult success: boolean + errorCode: PdxErrorCodes +end +global record PdxThirdPartyAutoLoginPromptState NotShown: PdxThirdPartyAutoLoginPromptState + Accepted: PdxThirdPartyAutoLoginPromptState + Rejected: PdxThirdPartyAutoLoginPromptState +end +global record PdxThirdPartyLinkState NeitherAccountHasLink: PdxThirdPartyLinkState + ParadoxAccountHasLink: PdxThirdPartyLinkState + ThirdPartyAccountHasLink: PdxThirdPartyLinkState + BothAccountsHaveLinks: PdxThirdPartyLinkState + BothAccountsAreLinked: PdxThirdPartyLinkState +end +global record PlacementParams requiredIndustryTags: {string} + tags: {string} + distanceWeights: {string : number} + allowedOnLand: boolean + allowedOnWater: boolean + buildOrder: integer + initWeight: integer + tier: integer + weights: {string : number} +end +global record Platform Windows: Platform + Linux: Platform + Mac: Platform + XBoxSeries: Platform + PS5: Platform + PS: Platform + XBox: Platform + Desktop: Platform + Console: Platform +end +global record PlatformDeviceSpec gen: ConsoleGen + resolution: Vec2i +end +global record PlayerStatDesc id: string +end +global record PlayerStatProgress id: string + getValue: function(PlayerStatProgress): number +end +global record PlayerStatRep get: function(playerStatRep : PlayerStatRep, statId : string): PlayerStatDesc +end +global record PlaylistDesc name: string + tracks: {PlaylistTrack} + order: integer + hidden: boolean + allFilter: boolean +end +global record PlaylistTrack name: string + fileName: string + yearFrom: integer + yearTo: integer +end +global record PortId nodeId: NodeId + port: integer +end +global record PowerUnit KW: PowerUnit + HP: PowerUnit +end +global record PrecedencePreference YES: PrecedencePreference + NO: PrecedencePreference + AUTO: PrecedencePreference +end +global record PreviewColoringend + +[Expand All] [Collapse All] + +global record Proposal record EdgeObject resultEntity: Engine.Entity + category: integer + modelInstance: ModelInstance + playerEntity: Engine.Entity + left: boolean +end + record NodeAndEntity new: function(): NodeAndEntity + entity: Engine.Entity + comp: Engine.Component.BaseNode +end + record SegmentAndEntity new: function(): SegmentAndEntity + entity: Engine.Entity + comp: Engine.Component.BaseEdge + type: integer + streetEdge: Engine.Component.BaseEdgeStreet + emissionEmitter: Engine.Component.EmissionEmitter + playerOwned: Engine.Component.PlayerOwned +end + record BaseNodeLaneConnectionAndEntity new: function(): BaseNodeLaneConnectionAndEntity + comp: Engine.Component.BaseNodeConfig + entity: Engine.Entity +end + record StreetProposal addedNodes: {NodeAndEntity} + addedNodes_native: Vector + addedSegments: {SegmentAndEntity} + addedSegments_native: Vector + removedSegments: {SegmentAndEntity} + removedNodes: {NodeAndEntity} + edgeObjectsToAdd: {EdgeObject} + new2oldEdgeObjects: {Engine.Entity : {Engine.Entity}} + old2newEdgeObjects: {Engine.Entity : {Engine.Entity}} + nodeConfigsToAdd: {BaseNodeLaneConnectionAndEntity} + nodeConfigsToRemove: {Engine.Entity} +end + record TransformedModel id: string + tag: integer + transf: Mat4f + thin: boolean +end + record Subconstruction models: {TransformedModel} + models_native: Vector + metadata: SubconstructionInstanceMetadata + station: Station + colliders: {Collider} +end + record Construction subconstructions: {Subconstruction} + subconstructions_native: Vector + fileName: string + frozenNodes: {Engine.Entity} + frozenEdges: {Engine.Entity} + depots: {Engine.Entity} + stations: {Engine.Entity} + industries: {Engine.Entity} + townBuildings: {Engine.Entity} + persistentMetadata: ConstructionInstanceMetadata + params: { : } +end + record StreetTerminal cargo: boolean + passengers: boolean + capacity: integer + wantSymmetric: boolean + cargoUnload: boolean + cargoLoad: boolean +end + record Signal type: SignalType +end + record ConstructionEntity fileName: ResName + hasCargoPlatform: boolean + desc: ConstructionDesc + construction: Construction + transf: Mat4f + playerEntity: Engine.Entity +end + record Terrain baseHeightMod: GridVec2f +end + new: function(): Proposal + clone: function(Proposal): Proposal + proposal: StreetProposal + toRemove: {Engine.Entity} + toRemove_native: Vector + old2new: {Engine.Entity : integer} + toAdd: {ConstructionEntity} + toAdd_native: Vector + terrain: Terrain +end + +[Expand All] [Collapse All] + +global record ProposalData record SubconstructionData station: Engine.Component.Station +end + record ConstructionData boundingVolume: Engine.Component.BoundingVolume + subconstructionDatas: {SubconstructionData} + subconstructionDatas_native: Vector +end + record CollisionInfo record EntityData entity: Engine.Entity +end + collisionEntities: {EntityData} + autoRemovalEntity2models: {Engine.Entity : {{integer, integer}}} + buildingEntities: {Engine.Entity} + removableModules: {Engine.Entity} +end + record ErrorState critical: boolean + messages: {string} + warnings: {string} + infos: {string} +end + record ParallelStripProposal toAdd: {Engine.Component.BaseParallelStrip} + toAdd_native: Vector + toRemove: {Engine.Entity} + toRemove_native: Vector +end + collisionInfo: CollisionInfo + old2new: {Engine.Entity : integer} + toAddData: {ConstructionData} + toAddData_native: Vector + parallelProposal: ParallelStripProposal + terrainPreviewHeightModLocations: {Vec3f} + terrainPreviewHeightModCutFill: {Vec2f} + errorState: ErrorState + entity2tn: {Engine.Entity : Engine.Component.TransportNetwork} + tpNetLinkProposal: TpNetLinkProposal + costs: integer +end +global record ProposalEventData proposal: Proposal + data: ProposalData + result: {Engine.Entity} +end + +[Expand All] [Collapse All] + +global record RailroadCrossingType description: ModelMetadata.Description + availability: ModelMetadata.Availability + menuCategory: ModelMetadata.MenuCategory + cost: number + speedLimit: number + new: function(): RailroadCrossingType + soundFileName: string + config: {RailroadCrossingType.ConfigEntry} + trafficDelay: number + crossingMaterial: string + categoryList: ModelMetadata.CategoryList + isAutoSelectable: boolean + record ConfigEntry modelLeft: string + modelRight: string + streetWidth: number +end +end +global type ResName = string +global record RoadType STREET: RoadType + TRACK: RoadType +end +global record Runway type: RunwayType + nodeId: NodeId + edgeIds: {EdgeId} +end +global record RunwayType LANDING: RunwayType + TAKEOFF: RunwayType +end + +[Expand All] [Collapse All] + +global record SaveGameData record SaveGameDetails new: function(SaveGameDetails): SaveGameDetails + metadata: GameMetadata + mods: {Mod.ModId} + configDict: {{string, string}} + modParams: {string : {string : integer}} + campaign: string + mission: string +end + new: function(SaveGameData): SaveGameData + errorMsg: string + info: SaveGameDetails +end +global record SaveGameId new: function(): SaveGameId + path: string + saveGameName: string + saveGameNamespace: string +end +global record SaveGameInfo new: function(): SaveGameInfo + equals: function(SaveGameInfo, SaveGameInfo): boolean + size: integer + timestamp: integer + path: string + modId: ModId + saveName: string +end +global record SaveGameStorageInfo totalSpace: number + usedSpace: number +end +global record SaveGameType Manual: SaveGameType + Autosave: SaveGameType + Crash: SaveGameType + Exit: SaveGameType +end +global record SavegameScriptMetadataend +global record ScriptParam new: function(): ScriptParam + key: string + name: string + group: string + tooltip: string + values: {string} + numbers: {number} + tooltips: {string} + postConstructionModifiable: boolean + hideLabel: boolean + images: {string} + defaultIndex: Index + uiType: ScriptParamType + location: ScriptParamLocation + displayMode: ScriptParamDisplayMode + tags: {string} + yearFrom: integer + yearTo: integer + checkEnabledScript: ScriptRef + stepValueScript: ScriptRef + formatValueScript: ScriptRef +end +global record ScriptParamDisplayMode Default: ScriptParamDisplayMode + Compact: ScriptParamDisplayMode + Horizontal: ScriptParamDisplayMode + Vertical: ScriptParamDisplayMode + Sparse: ScriptParamDisplayMode +end +global record ScriptParamLocation Default: ScriptParamLocation + Toolbar: ScriptParamLocation +end +global record ScriptParamType Button: ScriptParamType + Slider: ScriptParamType + ComboBox: ScriptParamType + IconButton: ScriptParamType + CheckBox: ScriptParamType +end +global record ScriptRef new: function(): ScriptRef + fileName: string + params: { : } +end +global record Set contains: function(Set, T): boolean + insert: function(Set, T): boolean + size: function(Set): integer + asTable: function(Set): {T : boolean} +end +global record Shape subShapes: {SubShape} + generator: integer +end +global record ShipInfo topSpeed: number + maxTractiveEffort: number + availablePower: number +end + +[Expand All] [Collapse All] + +global record Signal record Type SIGNAL: Type + ONE_WAY_SIGNAL: Type + WAYPOINT: Type +end + edgePr: {EdgeId, boolean} + type: Type + state: integer + stateTime: integer +end +global record SignalId new: function(): SignalId + + entity: Engine.Entity + index: integer +end +global record SignalType PATH_SIGNAL: SignalType + WAYPOINT: SignalType + ONE_WAY_PATH_SIGNAL: SignalType +end + +[Expand All] [Collapse All] + +global record SimpleProposal new: function(): SimpleProposal + record ConstructionEntity new: function(): ConstructionEntity + fileName: string + params: { : } + transf: Mat4f + name: string + playerEntity: Engine.Entity + autoFillSlots: boolean +end + constructionsToAdd: {ConstructionEntity} + constructionsToRemove: {Engine.Entity} + old2new: {Engine.Entity : integer} + streetProposal: SimpleStreetProposal +end + +[Expand All] [Collapse All] + +global record SimpleStreetProposal record EdgeObject new: function(): EdgeObject + edgeEntity: Engine.Entity + param: number + oneWay: boolean + left: boolean + model: ResName + playerEntity: Engine.Entity + name: string +end + new: function(): SimpleStreetProposal + nodesToAdd: {Proposal.NodeAndEntity} + edgesToAdd: {Proposal.SegmentAndEntity} + nodesToRemove: {Engine.Entity} + edgesToRemove: {Engine.Entity} + edgeObjectsToAdd: {EdgeObject} + edgeObjectsToRemove: {Engine.Entity} + nodeConfigsToAdd: {Proposal.BaseNodeLaneConnectionAndEntity} + nodeConfigsToRemove: {Engine.Entity} + node2rcType: {Engine.Entity : integer} +end +global record Slot autoFill: boolean + id: integer + type: string + transf: Mat4f + spacing: Vec4f + height: number + shape: integer + alignToTerrain: boolean + replaceable: boolean +end +global record SlotConfig maxModules: integer + message: string + skipCollisionCheck: boolean +end +global record SoundAttributes gain: number + refDist: number + rolloffFact: number + hasVelocity: boolean +end +global record SoundClip name: string + attrs: SoundAttributes +end +global record SoundClipList names: {string} + attrs: SoundAttributes +end +global record SoundSet tracks: {SoundClip} + events: {string : SoundClipList} + updateScript: ScriptRef + attrs: SoundAttributes +end +global record StartGameParams new: function(): StartGameParams + numTiles: Vec2i + climateGenerator: string + terrainGenerator: string + economy: string + mods: {string} + modParams: {string : {string : integer}} + seed: string + startDate: Date + startTimeOfDaySeconds: integer + startCloudCoverage: number + isMapEditor: boolean + generateTowns: boolean + generateIndustries: boolean + generateAssets: boolean + locationsConfig: BaseConfig.Locations +end +global record StaticConstructionTemplate initialModules: {ResName : integer} +end + +[Expand All] [Collapse All] + +global record Station record Pool new: function(): Pool + edges: {EdgeId} + capacity: integer +end + new: function(): Station + tag: integer + terminals: {Terminal} + catchmentAreas: {CatchmentArea} + pool: Pool +end +global record StationTerminal new: function(): StationTerminal + + station: integer + terminal: integer +end +global type StockId = integer +global record StockListType InputStock: StockListType + OutputStock: StockListType + StorageStock: StockListType +end +global record StopState empty: boolean + noPath: boolean + noPathFromAlternative: boolean + noPathToAlternative: boolean + duplicateStop: boolean + incompatibleStop: boolean + noPathLocation: boolean +end +global record StreetGenerationMode new: function(): StreetGenerationMode +end +global record StreetStyle categoryList: ModelMetadata.CategoryList + trackStraightModel: {string, string, string, string} +end + +[Expand All] [Collapse All] + +global record StreetTemplate new: function(string): StreetTemplate + roadType: RoadType + description: ModelMetadata.Description + availability: ModelMetadata.Availability + simBuildable: boolean + initiallyLocked: boolean + country: boolean + laneConfigs: {LaneConfig} + transportModesStreet: {TransportMode} + modifiers: Modifiers + cost: integer + maintenanceCost: integer + fillGroundTex: ResName + sidewalkFillGroundTex: ResName + borderGroundTex: ResName + streetStyle: ResName + defaultEdgeDecorations: {{ResName, boolean}} + defaultWithCrosswalk: boolean + embankmentSlopeLow: number + embankmentSlopeHigh: number + maxSlope: number + maxSlopeShape: number + priority: integer + busAndTramRight: boolean + pedestrianWalkPenalty: number + speedCoeffs: {number} + minCurveRadius: number + minCurveRadiusBuild: number + trackDistance: number + maxSlopeBuild: number + slopeBuildSteps: number + menuCategory: ModelMetadata.MenuCategory + record Emissions noise: number + pollution: number + radius: number +end + emissions: Emissions + catenaryAdd: ResName + catenaryRemove: ResName + builderAudioRes: ResName +end +global record SubShape faces: {{Vec3f}} + startRule: integer + height0: number + height1: number +end +global record SubconstructionInstanceMetadataend +global record TargetData entries: {TargetDataEntry} + edges: {EdgePos} +end +global record TargetDataEntry entity: Engine.Entity + freeCapacity: integer + capacity: integer + edgeWalk: {integer, integer} + edgeDrive: {integer, integer} + isIndustry: boolean +end +global record TargetsByLandUse targets: {TargetData, TargetData} +end + +[Expand All] [Collapse All] + +global record Terminal vehicleNodeId: NodeId + personNodes: {NodeId} + personEdges: {EdgeId} + vehicleEdges: {EdgePos} + tag: integer + cargoLoad: boolean + passengersLoad: boolean + cargoUnload: boolean + passengersUnload: boolean + transportModes: {TransportMode : boolean} + record TerminalCargoTransferSpeed cargoTypeSet: CargoTypeSet + loadSpeedModifier: number + length: number +end + cargoTransferSpeeds: {TerminalCargoTransferSpeed} + comfortFactor: number + capacity: integer + terminalAssignmentWeight: number +end +global record TerrainAlignment triangles: {{Vec3f, Vec3f, Vec3f}} + weights: {{number, number, number}} + type: TerrainAlignmentType + bbox: Box2f +end +global record TerrainAlignmentType EQUAL: TerrainAlignmentType + LESS: TerrainAlignmentType + GREATER: TerrainAlignmentType +end +global record TerrainGeneratorDesc new: function(): TerrainGeneratorDesc + desc: ModelMetadata.Description + order: integer + editorOnly: boolean + visible: boolean + climate: string + nodeTree: string + params: {ScriptParam} +end +global record TerrainMaterialType new: function(): TerrainMaterialType + + name: string + desc: string + icon: ResName + previewIcon: ResName + categories: {string} + detailColorTexture: string + detailMetalGlossAoHTexture: string + detailNormalTexture: string + overlayTexture: string + detailSize: number + overlaySize: number + overlayStrength: number + hScale: number + order: integer + menuCategory: ModelMetadata.MenuCategory + priority: integer + grass: ResName + categoryList: ModelMetadata.CategoryList +end +global record ThinModelInstance modelId: integer + pos: Vec3f + rot: number + scale: number +end +global record TownBuildingParams landUseType: LandUseType + level: integer + parcelSize: Vec2i +end +global record TownIndustryGenerationMode new: function(): TownIndustryGenerationMode + numTownsToAdd: integer + addIndustries: boolean + showExistingTowns: boolean + showExistingIndustries: boolean + keepExistingTowns: boolean + keepExistingIndustries: boolean +end +global record TownInfo name: string + position: Vec2f + initialLandUseCapacities: {integer} + landUse2CargoNeedsCategories: {LandUseType : {string}} + majorStreetAngle: number + initialMajorStreetAngle: number + capacityScalingFactor: number +end +global record TownProblem Disconnected: TownProblem + Overlength: TownProblem +end +global record TownResult toRemove: {Engine.Entity} + toAdd: {TownInfo} +end + +[Expand All] [Collapse All] + +global record TpNetData record NodeData record Port edgeId: EdgeId + transitions: {integer} +end + ports: {Port} +end + record EdgeData ports: {PortId, PortId} + equidistParams: {number} +end + getNodeData: function(TpNetData, NodeId): NodeData + getEdgeData: function(TpNetData, EdgeId): EdgeData +end + +[Expand All] [Collapse All] + +global record TpNetLinkProposal record Data link: {EdgePos, EdgePos} +end + toRemove: {Data} + toAdd: {Data} +end +global record TrafficLightData state2lockedLanes: {{integer}} + state2redLightModelIndices: {{integer}} + state2duration: {number} + animatedModels: {integer} +end +global record TrafficLightPreference YES: TrafficLightPreference + NO: TrafficLightPreference + AUTO: TrafficLightPreference +end +global record TrafficLightType availability: ModelMetadata.Availability + description: ModelMetadata.Description + cost: number + categoryList: ModelMetadata.CategoryList + menuCategory: ModelMetadata.MenuCategory + tryOpposite: boolean + modelScript: ScriptRef + relativePath: string +end +global record TramTrackType NO: TramTrackType + YES: TramTrackType + ELECTRIC: TramTrackType +end +global record TransportMode PERSON: TransportMode + CARGO: TransportMode + CAR: TransportMode + BUS: TransportMode + TRUCK: TransportMode + TRAM: TransportMode + ELECTRIC_TRAM: TransportMode + TRAIN: TransportMode + ELECTRIC_TRAIN: TransportMode + AIRCRAFT: TransportMode + SHIP: TransportMode + SMALL_AIRCRAFT: TransportMode + SMALL_SHIP: TransportMode + HELICOPTER: TransportMode + TRAM_TRACK: TransportMode + ELECTRIC_TRAM_TRACK: TransportMode +end +global record TransportVehicleConfig new: function(): TransportVehicleConfig + + vehicles: {TransportVehiclePart} + vehicleGroups: {integer} + muFileNames: {string} +end +global record TransportVehicleInfo cargoInfos: {{{VehicleCargoInfo}}} +end +global record TransportVehiclePart new: function(): TransportVehiclePart + part: VehiclePart + purchaseTime: integer + maintenanceChange: number + maintenanceState: number + autoLoadConfig: {boolean} +end +global record TransportVehicleState IN_DEPOT: TransportVehicleState + EN_ROUTE: TransportVehicleState + AT_TERMINAL: TransportVehicleState + GOING_TO_DEPOT: TransportVehicleState +end +global record TransportationStats passengersTransported: integer + cargoTransported: integer +end +global record UgcAccessLimitedReason None: UgcAccessLimitedReason + NotSignedIn: UgcAccessLimitedReason + Restricted: UgcAccessLimitedReason + Error: UgcAccessLimitedReason +end +global record UserProfile getModRep: function(UserProfile): ModRep + getLanguageRep: function(UserProfile): LanguageRep + getUserName: function(UserProfile): string + changeLanguage: function(UserProfile, LangKey) + getLanguage: function(UserProfile): LangKey + subscribeMod: function(UserProfile, string) + unsubscribeMod: function(UserProfile, string) + getUnlockedAchievementIds: function(UserProfile): {string : boolean} + getAchievementRep: function(UserProfile): AchievementRep + getPlayerStatProgress: function(UserProfile, string): number + getPlayerStatsProgress: function(UserProfile): {string : number} + getLastMission: function(UserProfile, string): {string, SaveGameId} + getLastSavegameForMission: function(UserProfile, string, string): SaveGameId + getLastGame: function(UserProfile): SaveGameId | MissionCampaign + isMissionCompleted: function(UserProfile, string, string): boolean + isCurrentMissionCompleted: function(UserProfile): boolean + noteEditorsNoteShown: function(UserProfile) + isEditorsNoteShown: function(UserProfile) + noteMedalState: function(UserProfile, string, boolean) + getMedalsState: function(UserProfile, string, string): {string : boolean} + noteStarState: function(UserProfile, string, boolean) + getStarsState: function(UserProfile, string, string): {string : boolean} + hasUgcAccess: function(UserProfile): boolean + checkUgcRestrictions: function(UserProfile): boolean + hasAgeGroupForUgc: function(UserProfile): boolean + getUgcAccessLimitedReason: function(UserProfile): UgcAccessLimitedReason + openUrl: function(UserProfile, string) +end +global record Vec2f new: function(): Vec2f + + equals: function(Vec2f, Vec2f): boolean + clone: function(Vec2f): Vec2f + x: number + y: number + scale: function(s : Vec2f, number): Vec2f + normalize: function(Vec2f): Vec2f + length: function(Vec2f): number + distance: function(a : Vec2f, b : Vec2f): number + distance2: function(a : Vec2f, b : Vec2f): number + lerp: function(a : Vec2f, b : Vec2f, t : number): Vec2f + angle: function(a : Vec2f, b : Vec2f): number + rotate: function(angle : Vec2f, number): Vec2f + metamethod __add: function(Vec2f, Vec2f): Vec2f + +end +global record Vec2i new: function(): Vec2i + + equals: function(Vec2i, Vec2i): boolean + x: integer + y: integer + metamethod __add: function(Vec2i, Vec2i): Vec2i + +end +global record Vec3f new: function(): Vec3f + + equals: function(Vec3f, Vec3f): boolean + clone: function(Vec3f): Vec3f + x: number + y: number + z: number + scale: function(s : Vec3f, number): Vec3f + normalize: function(Vec3f): Vec3f + length: function(Vec3f): number + distance: function(a : Vec3f, b : Vec3f): number + distance2: function(a : Vec3f, b : Vec3f): number + distance2_2: function(a : Vec3f, b : Vec3f): number + distance_2: function(a : Vec3f, b : Vec3f): number + lerp: function(a : Vec3f, b : Vec3f, t : number): Vec3f + angle: function(a : Vec3f, b : Vec3f): number + dot: function(a : Vec3f, b : Vec3f): number + metamethod __add: function(Vec3f, Vec3f): Vec3f + +end +global record Vec4f new: function(): Vec4f + + equals: function(Vec4f, Vec4f): boolean + x: number + y: number + z: number + w: number + lerp: function(a : Vec4f, b : Vec4f, t : number): Vec4f + metamethod __add: function(Vec4f, Vec4f): Vec4f + +end +global record Vec5f new: function(): Vec5f + + equals: function(Vec5f, Vec5f): boolean + x: number + y: number + z: number + w: number + q: number + lerp: function(a : Vec5f, b : Vec5f, t : number): Vec5f + metamethod __add: function(Vec5f, Vec5f): Vec5f + +end +global record Vector new: function(): Vector + at: function(Vector, integer): T + pushBack: function(Vector, T) + size: function(Vector): integer + asTable: function(Vector): {T} + clone: function(Vector): Vector +end +global record VehicleCargoInfo capacity: number + offset: number +end + +[Expand All] [Collapse All] + +global record VehicleData record CarriageData offset: number + reversed: boolean + emissions: ModelMetadata.Emissions +end + bounds: VehicleExtent + length: number + topSpeed: number + brakeDeceleration: number + carriages: {CarriageData} +end +global record VehicleEngineType HORSE: VehicleEngineType + STEAM: VehicleEngineType + ELECTRIC: VehicleEngineType + DIESEL: VehicleEngineType +end +global record VehicleExtent back: number + front: number +end +global record VehicleIconType Bus: VehicleIconType + Truck: VehicleIconType + TrainSteam: VehicleIconType + TrainElectric: VehicleIconType + TrainDiesel: VehicleIconType + Tram: VehicleIconType + Aircraft: VehicleIconType + Helicopter: VehicleIconType + Ship: VehicleIconType +end +global record VehiclePart new: function(): VehiclePart + modelId: integer + reversed: boolean + compartment2loadConfig: {LoadConfig} + color: Vec3f +end + +[Expand All] [Collapse All] + +global record VehiclePartInfo record Seat occupied: Engine.Entity + animation: string + crew: boolean +end + seats: {Seat} + count: number +end +global record VehicleProblem NoPathElectric: integer + NoPathShip: integer + NoPathAircraft: integer + NoPathGeneric: integer + Blocked: integer +end +global record VehicleState RUNNING: VehicleState + STOPPING: VehicleState + STOPPED: VehicleState + ARRIVED: VehicleState +end +global record Vendor Steam: Vendor + Gog: Vendor + Eos: Vendor + MacAppstore: Vendor + Microsoft: Vendor + Sony: Vendor + Dev: Vendor +end +global record View getEye: function(View): Vec3f + getCenter: function(View): Vec3f + getUp: function(View): Vec3f + isVisible: function(view : View, position : Vec3f, radius : number): boolean +end +global record Waypoint new: function(): Waypoint + + clone: function(Waypoint): Waypoint + equals: function(Waypoint, Waypoint) + edgePos: EdgePos + pos: Vec3f + tag: integer +end +global record WeightUnit T: WeightUnit + KG: WeightUnit + TN_SH: WeightUnit + LB: WeightUnit +end +global record ipairs_native metamethod __call: function(ipairs_native): function() : (integer, T) +end +global record orderedPairs metamethod __call: function(orderedPairs, any): function() : (T, V) +end +global record pairs_native metamethod __call: function(pairs_native): function() : (T, V) +end +global recordDef: boolean +``` + +## Category: main[πŸ”—](#category-main) + +### Type[πŸ”—](#$api.type~Type) + +``` +global record Type ScriptParam: ScriptParam + LangKey: LangKey + ModDesc: Mod.ModDesc + ModId: Mod.ModId + KeyCombo: KeyCombo + KeyComboDef: KeyComboDef + AppConfig: AppConfig + enum: Enum + Vec5f: Vec5f + Vec4f: Vec4f + Vec3f: Vec3f + Vec2f: Vec2f + Mat4f: Mat4f + Vec2i: Vec2i + Box3: Box3f + Box2: Box2f + Clock: Clock + CommandProgress: CommandProgress + LoaderHelper: LoaderHelper + Connection: Connection + ComponentType: Engine.ComponentType + Date: Date + JournalEntry: JournalEntry + EdgeId: EdgeId + EdgePos: EdgePos + NodeId: NodeId + Waypoint: Waypoint + SignalId: SignalId + StationTerminal: StationTerminal + ScriptRef: ScriptRef + ModuleDesc: ModuleDesc + ConstructionDesc: ConstructionDesc + GameScriptDesc: GameScriptDesc + DynamicConstructionTemplate: DynamicConstructionTemplate + Line: Engine.Component.Line + EmissionGrid: Engine.Component.EmissionGrid + MovePathAircraft: Engine.Component.MovePathAircraft + TransportVehicle: Engine.Component.TransportVehicle + LoadConfig: LoadConfig + BaseConfig: BaseConfig + CargoTypeSet: CargoTypeSet + TransportVehiclePart: TransportVehiclePart + TransportVehicleConfig: TransportVehicleConfig + Context: Context + Proposal: Proposal + SimpleProposal: SimpleProposal + ProposalData: ProposalData + StreetProposal: Proposal.StreetProposal + SimpleStreetProposal: SimpleStreetProposal + CatchmentArea: CatchmentArea + LayerConfig: LayerConfig + NodeViewerData: NodeViewerData + ParticleParamFloat: ParticleParamFloat + ParticleParamVec2f: ParticleParamVec2f + ParticleParamCurveFloat: ParticleParamCurveFloat + ParticleParamCurveVec2f: ParticleParamCurveVec2f + ParticleParamCurveVec3f: ParticleParamCurveVec3f + Path: Path + PathPos: PathPos + AnimationState: Transformator.AnimationState + HeighmapGenerationMode: HeighmapGenerationMode + TownIndustryGenerationMode: TownIndustryGenerationMode + ImportExportHeightmapMode: ImportExportHeightmapMode + StreetGenerationMode: StreetGenerationMode + Map: GameMap + StartGameParams: StartGameParams + SaveGameInfo: SaveGameInfo + SavegameId: SaveGameId + SaveGameDetails: SaveGameData.SaveGameDetails + SaveGameData: SaveGameData + ChartConfig: ChartConfig + FinanceData: FinanceData + Failure: Failure + NodeAndEntity: Proposal.NodeAndEntity + SegmentAndEntity: Proposal.SegmentAndEntity + BaseNodeLaneConnectionAndEntity: Proposal.BaseNodeLaneConnectionAndEntity + EdgeGeometry: EdgeGeometry + MetadataMap: ModelMetadata + Collider: Collider + mod: Mod + modhub: Modhub + TrackType: TrackType + GenericGameRes: GenericGameRes + BridgeType: BridgeType + Industry: Engine.Component.Industry + StockList: Engine.Component.StockList + LineIssue: LineIssue + TrafficLightConfig: Engine.Component.TrafficLightConfig + TrafficLightState: Engine.Component.TrafficLightState +end +``` + +Types namespace (used in `api.type.`...) + +### Type.ScriptParam[πŸ”—](#$api.type~Type.ScriptParam) + +``` +Type.ScriptParam: ScriptParam +``` + +### Type.LangKey[πŸ”—](#$api.type~Type.LangKey) + +``` +Type.LangKey: LangKey +``` + +### Type.ModDesc[πŸ”—](#$api.type~Type.ModDesc) + +``` +Type.ModDesc: Mod.ModDesc +``` + +### Type.ModId[πŸ”—](#$api.type~Type.ModId) + +``` +Type.ModId: Mod.ModId +``` + +### Type.KeyCombo[πŸ”—](#$api.type~Type.KeyCombo) + +``` +Type.KeyCombo: KeyCombo +``` + +### Type.KeyComboDef[πŸ”—](#$api.type~Type.KeyComboDef) + +``` +Type.KeyComboDef: KeyComboDef +``` + +### Type.AppConfig[πŸ”—](#$api.type~Type.AppConfig) + +``` +Type.AppConfig: AppConfig +``` + +### Type.enum[πŸ”—](#$api.type~Type.enum) + +``` +Type.enum: Enum +``` + +### Type.Vec5f[πŸ”—](#$api.type~Type.Vec5f) + +``` +Type.Vec5f: Vec5f +``` + +### Type.Vec4f[πŸ”—](#$api.type~Type.Vec4f) + +``` +Type.Vec4f: Vec4f +``` + +### Type.Vec3f[πŸ”—](#$api.type~Type.Vec3f) + +``` +Type.Vec3f: Vec3f +``` + +### Type.Vec2f[πŸ”—](#$api.type~Type.Vec2f) + +``` +Type.Vec2f: Vec2f +``` + +### Type.Mat4f[πŸ”—](#$api.type~Type.Mat4f) + +``` +Type.Mat4f: Mat4f +``` + +### Type.Vec2i[πŸ”—](#$api.type~Type.Vec2i) + +``` +Type.Vec2i: Vec2i +``` + +### Type.Box3[πŸ”—](#$api.type~Type.Box3) + +``` +Type.Box3: Box3f +``` + +### Type.Box2[πŸ”—](#$api.type~Type.Box2) + +``` +Type.Box2: Box2f +``` + +### Type.Clock[πŸ”—](#$api.type~Type.Clock) + +``` +Type.Clock: Clock +``` + +### Type.CommandProgress[πŸ”—](#$api.type~Type.CommandProgress) + +``` +Type.CommandProgress: CommandProgress +``` + +### Type.LoaderHelper[πŸ”—](#$api.type~Type.LoaderHelper) + +``` +Type.LoaderHelper: LoaderHelper +``` + +### Type.Connection[πŸ”—](#$api.type~Type.Connection) + +``` +Type.Connection: Connection +``` + +### Type.ComponentType[πŸ”—](#$api.type~Type.ComponentType) + +``` +Type.ComponentType: Engine.ComponentType +``` + +### Type.Date[πŸ”—](#$api.type~Type.Date) + +``` +Type.Date: Date +``` + +### Type.JournalEntry[πŸ”—](#$api.type~Type.JournalEntry) + +``` +Type.JournalEntry: JournalEntry +``` + +### Type.EdgeId[πŸ”—](#$api.type~Type.EdgeId) + +``` +Type.EdgeId: EdgeId +``` + +### Type.EdgePos[πŸ”—](#$api.type~Type.EdgePos) + +``` +Type.EdgePos: EdgePos +``` + +### Type.NodeId[πŸ”—](#$api.type~Type.NodeId) + +``` +Type.NodeId: NodeId +``` + +### Type.Waypoint[πŸ”—](#$api.type~Type.Waypoint) + +``` +Type.Waypoint: Waypoint +``` + +### Type.SignalId[πŸ”—](#$api.type~Type.SignalId) + +``` +Type.SignalId: SignalId +``` + +### Type.StationTerminal[πŸ”—](#$api.type~Type.StationTerminal) + +``` +Type.StationTerminal: StationTerminal +``` + +### Type.ScriptRef[πŸ”—](#$api.type~Type.ScriptRef) + +``` +Type.ScriptRef: ScriptRef +``` + +### Type.ModuleDesc[πŸ”—](#$api.type~Type.ModuleDesc) + +``` +Type.ModuleDesc: ModuleDesc +``` + +### Type.ConstructionDesc[πŸ”—](#$api.type~Type.ConstructionDesc) + +``` +Type.ConstructionDesc: ConstructionDesc +``` + +### Type.GameScriptDesc[πŸ”—](#$api.type~Type.GameScriptDesc) + +``` +Type.GameScriptDesc: GameScriptDesc +``` + +### Type.DynamicConstructionTemplate[πŸ”—](#$api.type~Type.DynamicConstructionTemplate) + +``` +Type.DynamicConstructionTemplate: DynamicConstructionTemplate +``` + +### Type.Line[πŸ”—](#$api.type~Type.Line) + +``` +Type.Line: Engine.Component.Line +``` + +### Type.EmissionGrid[πŸ”—](#$api.type~Type.EmissionGrid) + +``` +Type.EmissionGrid: Engine.Component.EmissionGrid +``` + +### Type.MovePathAircraft[πŸ”—](#$api.type~Type.MovePathAircraft) + +``` +Type.MovePathAircraft: Engine.Component.MovePathAircraft +``` + +### Type.TransportVehicle[πŸ”—](#$api.type~Type.TransportVehicle) + +``` +Type.TransportVehicle: Engine.Component.TransportVehicle +``` + +### Type.LoadConfig[πŸ”—](#$api.type~Type.LoadConfig) + +``` +Type.LoadConfig: LoadConfig +``` + +### Type.BaseConfig[πŸ”—](#$api.type~Type.BaseConfig) + +``` +Type.BaseConfig: BaseConfig +``` + +### Type.CargoTypeSet[πŸ”—](#$api.type~Type.CargoTypeSet) + +``` +Type.CargoTypeSet: CargoTypeSet +``` + +### Type.TransportVehiclePart[πŸ”—](#$api.type~Type.TransportVehiclePart) + +``` +Type.TransportVehiclePart: TransportVehiclePart +``` + +### Type.TransportVehicleConfig[πŸ”—](#$api.type~Type.TransportVehicleConfig) + +``` +Type.TransportVehicleConfig: TransportVehicleConfig +``` + +### Type.Context[πŸ”—](#$api.type~Type.Context) + +``` +Type.Context: Context +``` + +### Type.Proposal[πŸ”—](#$api.type~Type.Proposal) + +``` +Type.Proposal: Proposal +``` + +### Type.SimpleProposal[πŸ”—](#$api.type~Type.SimpleProposal) + +``` +Type.SimpleProposal: SimpleProposal +``` + +### Type.ProposalData[πŸ”—](#$api.type~Type.ProposalData) + +``` +Type.ProposalData: ProposalData +``` + +### Type.StreetProposal[πŸ”—](#$api.type~Type.StreetProposal) + +``` +Type.StreetProposal: Proposal.StreetProposal +``` + +### Type.SimpleStreetProposal[πŸ”—](#$api.type~Type.SimpleStreetProposal) + +``` +Type.SimpleStreetProposal: SimpleStreetProposal +``` + +### Type.CatchmentArea[πŸ”—](#$api.type~Type.CatchmentArea) + +``` +Type.CatchmentArea: CatchmentArea +``` + +### Type.LayerConfig[πŸ”—](#$api.type~Type.LayerConfig) + +``` +Type.LayerConfig: LayerConfig +``` + +### Type.NodeViewerData[πŸ”—](#$api.type~Type.NodeViewerData) + +``` +Type.NodeViewerData: NodeViewerData +``` + +### Type.ParticleParamFloat[πŸ”—](#$api.type~Type.ParticleParamFloat) + +``` +Type.ParticleParamFloat: ParticleParamFloat +``` + +### Type.ParticleParamVec2f[πŸ”—](#$api.type~Type.ParticleParamVec2f) + +``` +Type.ParticleParamVec2f: ParticleParamVec2f +``` + +### Type.ParticleParamCurveFloat[πŸ”—](#$api.type~Type.ParticleParamCurveFloat) + +``` +Type.ParticleParamCurveFloat: ParticleParamCurveFloat +``` + +### Type.ParticleParamCurveVec2f[πŸ”—](#$api.type~Type.ParticleParamCurveVec2f) + +``` +Type.ParticleParamCurveVec2f: ParticleParamCurveVec2f +``` + +### Type.ParticleParamCurveVec3f[πŸ”—](#$api.type~Type.ParticleParamCurveVec3f) + +``` +Type.ParticleParamCurveVec3f: ParticleParamCurveVec3f +``` + +### Type.Path[πŸ”—](#$api.type~Type.Path) + +``` +Type.Path: Path +``` + +### Type.PathPos[πŸ”—](#$api.type~Type.PathPos) + +``` +Type.PathPos: PathPos +``` + +### Type.AnimationState[πŸ”—](#$api.type~Type.AnimationState) + +``` +Type.AnimationState: Transformator.AnimationState +``` + +### Type.HeighmapGenerationMode[πŸ”—](#$api.type~Type.HeighmapGenerationMode) + +``` +Type.HeighmapGenerationMode: HeighmapGenerationMode +``` + +### Type.TownIndustryGenerationMode[πŸ”—](#$api.type~Type.TownIndustryGenerationMode) + +``` +Type.TownIndustryGenerationMode: TownIndustryGenerationMode +``` + +### Type.ImportExportHeightmapMode[πŸ”—](#$api.type~Type.ImportExportHeightmapMode) + +``` +Type.ImportExportHeightmapMode: ImportExportHeightmapMode +``` + +### Type.StreetGenerationMode[πŸ”—](#$api.type~Type.StreetGenerationMode) + +``` +Type.StreetGenerationMode: StreetGenerationMode +``` + +### Type.Map[πŸ”—](#$api.type~Type.Map) + +``` +Type.Map: GameMap +``` + +### Type.StartGameParams[πŸ”—](#$api.type~Type.StartGameParams) + +``` +Type.StartGameParams: StartGameParams +``` + +### Type.SaveGameInfo[πŸ”—](#$api.type~Type.SaveGameInfo) + +``` +Type.SaveGameInfo: SaveGameInfo +``` + +### Type.SavegameId[πŸ”—](#$api.type~Type.SavegameId) + +``` +Type.SavegameId: SaveGameId +``` + +### Type.SaveGameDetails[πŸ”—](#$api.type~Type.SaveGameDetails) + +``` +Type.SaveGameDetails: SaveGameData.SaveGameDetails +``` + +### Type.SaveGameData[πŸ”—](#$api.type~Type.SaveGameData) + +``` +Type.SaveGameData: SaveGameData +``` + +### Type.ChartConfig[πŸ”—](#$api.type~Type.ChartConfig) + +``` +Type.ChartConfig: ChartConfig +``` + +### Type.FinanceData[πŸ”—](#$api.type~Type.FinanceData) + +``` +Type.FinanceData: FinanceData +``` + +### Type.Failure[πŸ”—](#$api.type~Type.Failure) + +``` +Type.Failure: Failure +``` + +### Type.NodeAndEntity[πŸ”—](#$api.type~Type.NodeAndEntity) + +``` +Type.NodeAndEntity: Proposal.NodeAndEntity +``` + +### Type.SegmentAndEntity[πŸ”—](#$api.type~Type.SegmentAndEntity) + +``` +Type.SegmentAndEntity: Proposal.SegmentAndEntity +``` + +### Type.BaseNodeLaneConnectionAndEntity[πŸ”—](#$api.type~Type.BaseNodeLaneConnectionAndEntity) + +``` +Type.BaseNodeLaneConnectionAndEntity: Proposal.BaseNodeLaneConnectionAndEntity +``` + +### Type.EdgeGeometry[πŸ”—](#$api.type~Type.EdgeGeometry) + +``` +Type.EdgeGeometry: EdgeGeometry +``` + +### Type.MetadataMap[πŸ”—](#$api.type~Type.MetadataMap) + +``` +Type.MetadataMap: ModelMetadata +``` + +### Type.Collider[πŸ”—](#$api.type~Type.Collider) + +``` +Type.Collider: Collider +``` + +### Type.mod[πŸ”—](#$api.type~Type.mod) + +``` +Type.mod: Mod +``` + +### Type.modhub[πŸ”—](#$api.type~Type.modhub) + +``` +Type.modhub: Modhub +``` + +### Type.TrackType[πŸ”—](#$api.type~Type.TrackType) + +``` +Type.TrackType: TrackType +``` + +### Type.GenericGameRes[πŸ”—](#$api.type~Type.GenericGameRes) + +``` +Type.GenericGameRes: GenericGameRes +``` + +### Type.BridgeType[πŸ”—](#$api.type~Type.BridgeType) + +``` +Type.BridgeType: BridgeType +``` + +### Type.Industry[πŸ”—](#$api.type~Type.Industry) + +``` +Type.Industry: Engine.Component.Industry +``` + +### Type.StockList[πŸ”—](#$api.type~Type.StockList) + +``` +Type.StockList: Engine.Component.StockList +``` + +### Type.LineIssue[πŸ”—](#$api.type~Type.LineIssue) + +``` +Type.LineIssue: LineIssue +``` + +### Type.TrafficLightConfig[πŸ”—](#$api.type~Type.TrafficLightConfig) + +``` +Type.TrafficLightConfig: Engine.Component.TrafficLightConfig +``` + +### Type.TrafficLightState[πŸ”—](#$api.type~Type.TrafficLightState) + +``` +Type.TrafficLightState: Engine.Component.TrafficLightState +``` + +## Category: globals[πŸ”—](#category-globals) + +### AchievementDesc[πŸ”—](#$api.type~AchievementDesc) + +``` +global record AchievementDesc id: string + name: string + description: string + icon: string + lockedIcon: string + grade: string + hidden: boolean + campaign: string + alwaysEarnable: boolean + score: integer + playerStatTarget: PlayerStatProgress +end +``` + +The description of an achievement + +### AchievementDesc.id[πŸ”—](#$api.type~AchievementDesc.id) + +``` +AchievementDesc.id: string +``` + +The unique id as a string + +### AchievementDesc.name[πŸ”—](#$api.type~AchievementDesc.name) + +``` +AchievementDesc.name: string +``` + +The display name of the achievement + +### AchievementDesc.description[πŸ”—](#$api.type~AchievementDesc.description) + +``` +AchievementDesc.description: string +``` + +The description of the acheivement + +### AchievementDesc.icon[πŸ”—](#$api.type~AchievementDesc.icon) + +``` +AchievementDesc.icon: string +``` + +The icon once completed of the achievement + +### AchievementDesc.lockedIcon[πŸ”—](#$api.type~AchievementDesc.lockedIcon) + +``` +AchievementDesc.lockedIcon: string +``` + +The icon while not yet completed + +### AchievementDesc.grade[πŸ”—](#$api.type~AchievementDesc.grade) + +``` +AchievementDesc.grade: string +``` + +The grade of the achievement for platform that supports it + +### AchievementDesc.hidden[πŸ”—](#$api.type~AchievementDesc.hidden) + +``` +AchievementDesc.hidden: boolean +``` + +If the achievement is hidden until it's completed + +### AchievementDesc.campaign[πŸ”—](#$api.type~AchievementDesc.campaign) + +``` +AchievementDesc.campaign: string +``` + +If it's a campaign achievement + +### AchievementDesc.alwaysEarnable[πŸ”—](#$api.type~AchievementDesc.alwaysEarnable) + +``` +AchievementDesc.alwaysEarnable: boolean +``` + +If the achievement can always be earned regardless + +### AchievementDesc.score[πŸ”—](#$api.type~AchievementDesc.score) + +``` +AchievementDesc.score: integer +``` + +The score (points) earned when completing the achievements for platforms that supports it + +### AchievementDesc.playerStatTarget[πŸ”—](#$api.type~AchievementDesc.playerStatTarget) + +``` +AchievementDesc.playerStatTarget: PlayerStatProgress +``` + +The player start value to reach to unlock the achievement (optional) + +### AchievementRep[πŸ”—](#$api.type~AchievementRep) + +``` +global record AchievementRep getNumAchievements: function(achievementRep : AchievementRep): integer + get: function(achievementRep : AchievementRep, index : integer): AchievementDesc +end +``` + +Repository for all achievement types (static data) +To access the current state of a player achievements, use UserProfile:getUnlockedAchievementIds + +### AchievementRep.getNumAchievements[πŸ”—](#$api.type~AchievementRep.getNumAchievements) + +``` +function AchievementRep.getNumAchievements(achievementRep : AchievementRep): integer +``` + +Get the number of achievement types + +**Parameters** + +* `achievementRep` :`AchievementRep` β€” the achievement rep + +**Returns** + +1. `integer` β€” the number of achievements + +### AchievementRep.get[πŸ”—](#$api.type~AchievementRep.get) + +``` +function AchievementRep.get(achievementRep : AchievementRep, index : integer): AchievementDesc +``` + +Get an achievement data by its index + +**Parameters** + +* `achievementRep` :`AchievementRep` β€” the achievement rep +* `index` :`integer` β€” the achievement index (use `getNumAchievements` to iterate over all achievement types) + +**Returns** + +1. `AchievementDesc` β€” the achievement desc + +### AircraftInfo[πŸ”—](#$api.type~AircraftInfo) + +``` +global record AircraftInfo weight: number + topSpeed: number + landingDistance: number + maxThrust: number + idleThrust: number + mainGear: Vec2f + bodyAngle: number + forwardOffset: number + backwardOffset: number + taxiHoldOffset: number + hasFlaps: boolean + isHelicopter: boolean +end +``` + +Movement information for aircraft + +### AircraftInfo.weight[πŸ”—](#$api.type~AircraftInfo.weight) + +``` +AircraftInfo.weight: number +``` + +Aircraft weight (in kg) + +### AircraftInfo.topSpeed[πŸ”—](#$api.type~AircraftInfo.topSpeed) + +``` +AircraftInfo.topSpeed: number +``` + +Maximum speed (in m/s) + +### AircraftInfo.landingDistance[πŸ”—](#$api.type~AircraftInfo.landingDistance) + +``` +AircraftInfo.landingDistance: number +``` + +Distance required for landing (in meters) + +### AircraftInfo.maxThrust[πŸ”—](#$api.type~AircraftInfo.maxThrust) + +``` +AircraftInfo.maxThrust: number +``` + +Maximum engine thrust (in kN) + +### AircraftInfo.idleThrust[πŸ”—](#$api.type~AircraftInfo.idleThrust) + +``` +AircraftInfo.idleThrust: number +``` + +Idle engine thrust (in kN) + +### AircraftInfo.mainGear[πŸ”—](#$api.type~AircraftInfo.mainGear) + +``` +AircraftInfo.mainGear: Vec2f +``` + +Position of main landing gear + +### AircraftInfo.bodyAngle[πŸ”—](#$api.type~AircraftInfo.bodyAngle) + +``` +AircraftInfo.bodyAngle: number +``` + +### AircraftInfo.forwardOffset[πŸ”—](#$api.type~AircraftInfo.forwardOffset) + +``` +AircraftInfo.forwardOffset: number +``` + +How far forward the front of the airfract is (in meters) + +### AircraftInfo.backwardOffset[πŸ”—](#$api.type~AircraftInfo.backwardOffset) + +``` +AircraftInfo.backwardOffset: number +``` + +How far backwards the front of the airfract is (in meters) + +### AircraftInfo.taxiHoldOffset[πŸ”—](#$api.type~AircraftInfo.taxiHoldOffset) + +``` +AircraftInfo.taxiHoldOffset: number +``` + +How far from the hold line the aircraft is supposed to wait (meters) + +### AircraftInfo.hasFlaps[πŸ”—](#$api.type~AircraftInfo.hasFlaps) + +``` +AircraftInfo.hasFlaps: boolean +``` + +Whether the aircraft has flaps + +### AircraftInfo.isHelicopter[πŸ”—](#$api.type~AircraftInfo.isHelicopter) + +``` +AircraftInfo.isHelicopter: boolean +``` + +Whether this is a helicopter + +### AnyAxis[πŸ”—](#$api.type~AnyAxis) + +``` +global record AnyAxisend +``` + +### AnyKey[πŸ”—](#$api.type~AnyKey) + +``` +global record AnyKeyend +``` + +### AppConfig[πŸ”—](#$api.type~AppConfig) + +``` +global record AppConfig new: function(AppConfig): AppConfig + equals: function(AppConfig, AppConfig): boolean + distanceSpeedUnit: DistanceSpeedUnit + mainMenuState: { : } + enableKeyboardMouse: boolean + keyCmdDefinitions: {string : {KeyComboDef}} + moneyPrefix: string + cameraTool: boolean + showReleaseNotes: boolean + hasShownInitialDeluxeThankYou: boolean + updateMessageID: integer + debugMode: boolean + guideSystemActive: boolean + experimentalTerrainGeneratorEditor: boolean + experimentalMapFeatures: boolean + screenMode: integer + enableSeamlessStreetBuilder: boolean + showIntelHDwarning: boolean + showLicenseAgreement: boolean + musicEnabled: boolean + menuMusicEnabled: boolean + voiceOverEnabled: boolean + masterVolume: number + soundVolume: number + musicVolume: number + voiceOverVolume: number + audioEffectSettings: AudioEffectSettings + experimentalTunnelAndBridgeMinHeight: boolean + resolutionScale: number + cssEffectsVelocity: number +end +``` + +Game settings + +### AppConfig.new[πŸ”—](#$api.type~AppConfig.new) + +``` +function AppConfig.new(AppConfig): AppConfig +``` + +**Parameters** + +* `AppConfig` + +**Returns** + +1. `AppConfig` + +### AppConfig.equals[πŸ”—](#$api.type~AppConfig.equals) + +``` +function AppConfig.equals(AppConfig, AppConfig): boolean +``` + +**Parameters** + +* `AppConfig` +* `AppConfig` + +**Returns** + +1. `boolean` + +### AppConfig.distanceSpeedUnit[πŸ”—](#$api.type~AppConfig.distanceSpeedUnit) + +``` +AppConfig.distanceSpeedUnit: DistanceSpeedUnit +``` + +Unit of measurement for distance + +### AppConfig.mainMenuState[πŸ”—](#$api.type~AppConfig.mainMenuState) + +``` +AppConfig.mainMenuState: { : } +``` + +Main menu state data (filled by the UI scripts to persist things like the list of active mods) + +### AppConfig.enableKeyboardMouse[πŸ”—](#$api.type~AppConfig.enableKeyboardMouse) + +``` +AppConfig.enableKeyboardMouse: boolean +``` + +Whether keyboard and mouse input is enabled + +### AppConfig.keyCmdDefinitions[πŸ”—](#$api.type~AppConfig.keyCmdDefinitions) + +``` +AppConfig.keyCmdDefinitions: {string : {KeyComboDef}} +``` + +Keybindings (stored `settings_keys_v*.lua`) + +### AppConfig.moneyPrefix[πŸ”—](#$api.type~AppConfig.moneyPrefix) + +``` +AppConfig.moneyPrefix: string +``` + +Prefix for money display + +### AppConfig.cameraTool[πŸ”—](#$api.type~AppConfig.cameraTool) + +``` +AppConfig.cameraTool: boolean +``` + +Whether camera tool is enabled + +### AppConfig.showReleaseNotes[πŸ”—](#$api.type~AppConfig.showReleaseNotes) + +``` +AppConfig.showReleaseNotes: boolean +``` + +Whether to show release notes + +### AppConfig.hasShownInitialDeluxeThankYou[πŸ”—](#$api.type~AppConfig.hasShownInitialDeluxeThankYou) + +``` +AppConfig.hasShownInitialDeluxeThankYou: boolean +``` + +Whether an initial thank you message for owning deluxe edition has been shown before + +### AppConfig.updateMessageID[πŸ”—](#$api.type~AppConfig.updateMessageID) + +``` +AppConfig.updateMessageID: integer +``` + +Last update message ID shown + +### AppConfig.debugMode[πŸ”—](#$api.type~AppConfig.debugMode) + +``` +AppConfig.debugMode: boolean +``` + +Whether debug mode is enabled + +### AppConfig.guideSystemActive[πŸ”—](#$api.type~AppConfig.guideSystemActive) + +``` +AppConfig.guideSystemActive: boolean +``` + +Whether guide system is active + +### AppConfig.experimentalTerrainGeneratorEditor[πŸ”—](#$api.type~AppConfig.experimentalTerrainGeneratorEditor) + +``` +AppConfig.experimentalTerrainGeneratorEditor: boolean +``` + +Whether the terrain node graph editor is enabled + +### AppConfig.experimentalMapFeatures[πŸ”—](#$api.type~AppConfig.experimentalMapFeatures) + +``` +AppConfig.experimentalMapFeatures: boolean +``` + +Whether experimental map features are enabled + +### AppConfig.screenMode[πŸ”—](#$api.type~AppConfig.screenMode) + +``` +AppConfig.screenMode: integer +``` + +Screen mode setting (WINDOWED = 0, BORDERLESS = 1, FULLSCREEN = 2) + +### AppConfig.enableSeamlessStreetBuilder[πŸ”—](#$api.type~AppConfig.enableSeamlessStreetBuilder) + +``` +AppConfig.enableSeamlessStreetBuilder: boolean +``` + +Whether to enable the seamless construction mode for the street builder + +### AppConfig.showIntelHDwarning[πŸ”—](#$api.type~AppConfig.showIntelHDwarning) + +``` +AppConfig.showIntelHDwarning: boolean +``` + +Display unsupported hardware info + +### AppConfig.showLicenseAgreement[πŸ”—](#$api.type~AppConfig.showLicenseAgreement) + +``` +AppConfig.showLicenseAgreement: boolean +``` + +### AppConfig.musicEnabled[πŸ”—](#$api.type~AppConfig.musicEnabled) + +``` +AppConfig.musicEnabled: boolean +``` + +Whether music is enabled + +### AppConfig.menuMusicEnabled[πŸ”—](#$api.type~AppConfig.menuMusicEnabled) + +``` +AppConfig.menuMusicEnabled: boolean +``` + +Whether menu music is enabled + +### AppConfig.voiceOverEnabled[πŸ”—](#$api.type~AppConfig.voiceOverEnabled) + +``` +AppConfig.voiceOverEnabled: boolean +``` + +Whether voice-over is enabled + +### AppConfig.masterVolume[πŸ”—](#$api.type~AppConfig.masterVolume) + +``` +AppConfig.masterVolume: number +``` + +Master volume level + +### AppConfig.soundVolume[πŸ”—](#$api.type~AppConfig.soundVolume) + +``` +AppConfig.soundVolume: number +``` + +Sound effects volume level + +### AppConfig.musicVolume[πŸ”—](#$api.type~AppConfig.musicVolume) + +``` +AppConfig.musicVolume: number +``` + +Music volume level + +### AppConfig.voiceOverVolume[πŸ”—](#$api.type~AppConfig.voiceOverVolume) + +``` +AppConfig.voiceOverVolume: number +``` + +Voice-over volume level + +### AppConfig.audioEffectSettings[πŸ”—](#$api.type~AppConfig.audioEffectSettings) + +``` +AppConfig.audioEffectSettings: AudioEffectSettings +``` + +Audio effect settings + +### AppConfig.experimentalTunnelAndBridgeMinHeight[πŸ”—](#$api.type~AppConfig.experimentalTunnelAndBridgeMinHeight) + +``` +AppConfig.experimentalTunnelAndBridgeMinHeight: boolean +``` + +Enable experimental tunnel/bridge height settings + +### AppConfig.resolutionScale[πŸ”—](#$api.type~AppConfig.resolutionScale) + +``` +AppConfig.resolutionScale: number +``` + +Render extent scale for in-game viewport + +### AppConfig.cssEffectsVelocity[πŸ”—](#$api.type~AppConfig.cssEffectsVelocity) + +``` +AppConfig.cssEffectsVelocity: number +``` + +### Async[πŸ”—](#$api.type~Async) + +``` +global record Async isCompleted: function(Async): boolean + get: function(Async): T + abort: function(Async) + getProgressMonitor: function(Async): App.ProgressMonitor +end +``` + +Asynchronous operation wrapper for background tasks + +##### Type Parameters + +* **`T`** + +### Async.isCompleted[πŸ”—](#$api.type~Async.isCompleted) + +``` +function Async.isCompleted(Async): boolean +``` + +**Parameters** + +* `Async` + +**Returns** + +1. `boolean` + +### Async.get[πŸ”—](#$api.type~Async.get) + +``` +function Async.get(Async): T +``` + +Block until the task is complete and then return its result + +**Parameters** + +* `Async` + +**Returns** + +1. `T` + +### Async.abort[πŸ”—](#$api.type~Async.abort) + +``` +function Async.abort(Async) +``` + +**Parameters** + +* `Async` + +### Async.getProgressMonitor[πŸ”—](#$api.type~Async.getProgressMonitor) + +``` +function Async.getProgressMonitor(Async): App.ProgressMonitor +``` + +**Parameters** + +* `Async` + +**Returns** + +1. `App.ProgressMonitor` + +### AudioEffectSettings[πŸ”—](#$api.type~AudioEffectSettings) + +``` +global record AudioEffectSettings bulldozer: boolean + construction: boolean +end +``` + +Specification for audio settings + +### AudioEffectSettings.bulldozer[πŸ”—](#$api.type~AudioEffectSettings.bulldozer) + +``` +AudioEffectSettings.bulldozer: boolean +``` + +Bulldozer sound effects enabled + +### AudioEffectSettings.construction[πŸ”—](#$api.type~AudioEffectSettings.construction) + +``` +AudioEffectSettings.construction: boolean +``` + +Construction sound effects enabled + +### AutoGroundTex[πŸ”—](#$api.type~AutoGroundTex) + +``` +global record AutoGroundTex new: function(): AutoGroundTex + category: string + gridSize: integer + countFrom: integer + countTo: integer + groundTex: string + individual: boolean + individualCategory: string +end +``` + +Specification for auto-generated ground textures + +### AutoGroundTex.new[πŸ”—](#$api.type~AutoGroundTex.new) + +``` +function AutoGroundTex.new(): AutoGroundTex +``` + +**Returns** + +1. `AutoGroundTex` + +### AutoGroundTex.category[πŸ”—](#$api.type~AutoGroundTex.category) + +``` +AutoGroundTex.category: string +``` + +### AutoGroundTex.gridSize[πŸ”—](#$api.type~AutoGroundTex.gridSize) + +``` +AutoGroundTex.gridSize: integer +``` + +### AutoGroundTex.countFrom[πŸ”—](#$api.type~AutoGroundTex.countFrom) + +``` +AutoGroundTex.countFrom: integer +``` + +### AutoGroundTex.countTo[πŸ”—](#$api.type~AutoGroundTex.countTo) + +``` +AutoGroundTex.countTo: integer +``` + +### AutoGroundTex.groundTex[πŸ”—](#$api.type~AutoGroundTex.groundTex) + +``` +AutoGroundTex.groundTex: string +``` + +### AutoGroundTex.individual[πŸ”—](#$api.type~AutoGroundTex.individual) + +``` +AutoGroundTex.individual: boolean +``` + +### AutoGroundTex.individualCategory[πŸ”—](#$api.type~AutoGroundTex.individualCategory) + +``` +AutoGroundTex.individualCategory: string +``` + +### BaseConfig[πŸ”—](#$api.type~BaseConfig) + +``` +[Expand All] [Collapse All] + +global record BaseConfig record AdvancedOptions trafficSpeedSensitivityScale: number + vehicleMaintenanceEmissionsEffect: number + vehicleMaintenancePerformanceEffect: number + vehicleMaintenanceRunningCostsEffect: number + missionVehicleMaintenanceDisableRepair: boolean + missionDisableTunnelBuilding: boolean + missionEmissionsScriptFactor: number + simPersonHappinessDecayAtVehicle: number + simPersonHappinessDecayAtTerminal: number + subventionMode: integer + subventionRisk: integer + subventionFinancialRewardMultiplier: number + landmarkResources: number + isReforestationActive: boolean +end + record Animal new: function(): Animal + populationDensityMultiplier: number + useLocalSpawning: boolean + localTileSize: number + notifyAnimalDespawn: boolean +end + record Locations new: function(): Locations + record IndustryParamList new: function(): IndustryParamList + absoluteMinimum: integer + maxNumberPerArea: number + industryDensity: number + randomSize: boolean + industryProductivity: number +end + record TownParamList new: function(): TownParamList + maxNumberPerArea: number + allowInRoughTerrain: boolean + townFrequency: number + populationDensity: number +end + town: TownParamList + industry: IndustryParamList + makeInitialStreets: boolean +end + record Terrain lodErrorMultiplier: number +end + record Economy new: function(): Economy + record TownDevelopment cargoNeedsPerTown: integer + townGrowthMinDistrictFraction: number +end + record IndustryDevelopment spawnTargetTimeSpan: number + spawnProbabilityExponent: number + spawnIndustries: boolean + unusedTimeSpan: number + closureCountdownTimeSpan: number + closureProbability: number + extendTimeSpan: number +end + cargoIncomeScript: ScriptRef + passengerIncomeScript: ScriptRef + townDevelopment: TownDevelopment + industryDevelopment: IndustryDevelopment +end + record Settings new: function(): Settings + record GeometryQualityOption new: function(): GeometryQualityOption + viewNearFar: Vec2f + fogStartEndFarPerc: Vec2f + lodDistanceScaling: number +end + geometryQualityOptions: {GeometryQualityOption} +end + record Water record Textures foamNormal: string + foamDetail: string + foam: string +end + textures: Textures +end + record Particles record Textures noise0: string + noise1: string + smoke: string + smokeNormal: string +end + textures: Textures +end + record Emissions noiseLowerBoundDB: number + noiseUpperBoundDB: number + pollutionLowerBoundDB: number + pollutionUpperBoundDB: number + townNoiseResidentialAffected: boolean + townNoiseCommercialAffected: boolean + townNoiseIndustrialAffected: boolean +end + animal: Animal + locations: Locations + settings: Settings + particles: Particles + water: Water + emission: Emissions + scaffold: {string : {string : {string}}} + costs: {string : number} + advancedOptions: AdvancedOptions + economy: Economy + terrain: Terrain + environment: ResName + economyId: ResName + nameId: ResName + climate: ResName + trackCatenaryYearFrom: integer + busLaneYearFrom: integer + terrainToolMinStrength: number + terrainToolMaxStrength: number + enforceMainConnections: boolean + townDevelopInterval: number + chargeMaintenanceInterval: number + simulateCargoWeight: boolean + simPersonDestinationRecomputationProbability: number + townMajorStreetAngleRange: number + townConnectionMaxBridgeLength: number + maxVehicleCloneAmount: number + trainAccelerationFactor: number + trainBrakeDeceleration: number + terrainToolMinSize: number + terrainToolMaxSize: number + terrainToolScale: number + terrainToolMaxSizeEditor: number + terrainPainterMinSize: number + terrainPainterMaxSize: number + terrainPainterMaxSizeEditor: number + terrainPainterScale: number + assetBrushMinSize: number + assetBrushMaxSize: number + assetBrushScale: number + treeCostYearMultipliers: {integer : number} + townInitialMajorStreetAngleRange: number + townCapacityScalingFactor: number + sandboxMode: boolean + noCosts: boolean + constructionScript: ScriptRef +end +``` + +Base configuration of a single game + +### BaseConfig.AdvancedOptions[πŸ”—](#$api.type~BaseConfig.AdvancedOptions) + +``` +record BaseConfig.AdvancedOptions trafficSpeedSensitivityScale: number + vehicleMaintenanceEmissionsEffect: number + vehicleMaintenancePerformanceEffect: number + vehicleMaintenanceRunningCostsEffect: number + missionVehicleMaintenanceDisableRepair: boolean + missionDisableTunnelBuilding: boolean + missionEmissionsScriptFactor: number + simPersonHappinessDecayAtVehicle: number + simPersonHappinessDecayAtTerminal: number + subventionMode: integer + subventionRisk: integer + subventionFinancialRewardMultiplier: number + landmarkResources: number + isReforestationActive: boolean +end +``` + +Advanced gameplay option + +### BaseConfig.AdvancedOptions.trafficSpeedSensitivityScale[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.trafficSpeedSensitivityScale) + +``` +BaseConfig.AdvancedOptions.trafficSpeedSensitivityScale: number +``` + +### BaseConfig.AdvancedOptions.vehicleMaintenanceEmissionsEffect[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.vehicleMaintenanceEmissionsEffect) + +``` +BaseConfig.AdvancedOptions.vehicleMaintenanceEmissionsEffect: number +``` + +### BaseConfig.AdvancedOptions.vehicleMaintenancePerformanceEffect[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.vehicleMaintenancePerformanceEffect) + +``` +BaseConfig.AdvancedOptions.vehicleMaintenancePerformanceEffect: number +``` + +### BaseConfig.AdvancedOptions.vehicleMaintenanceRunningCostsEffect[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.vehicleMaintenanceRunningCostsEffect) + +``` +BaseConfig.AdvancedOptions.vehicleMaintenanceRunningCostsEffect: number +``` + +### BaseConfig.AdvancedOptions.missionVehicleMaintenanceDisableRepair[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.missionVehicleMaintenanceDisableRepair) + +``` +BaseConfig.AdvancedOptions.missionVehicleMaintenanceDisableRepair: boolean +``` + +### BaseConfig.AdvancedOptions.missionDisableTunnelBuilding[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.missionDisableTunnelBuilding) + +``` +BaseConfig.AdvancedOptions.missionDisableTunnelBuilding: boolean +``` + +### BaseConfig.AdvancedOptions.missionEmissionsScriptFactor[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.missionEmissionsScriptFactor) + +``` +BaseConfig.AdvancedOptions.missionEmissionsScriptFactor: number +``` + +### BaseConfig.AdvancedOptions.simPersonHappinessDecayAtVehicle[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.simPersonHappinessDecayAtVehicle) + +``` +BaseConfig.AdvancedOptions.simPersonHappinessDecayAtVehicle: number +``` + +### BaseConfig.AdvancedOptions.simPersonHappinessDecayAtTerminal[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.simPersonHappinessDecayAtTerminal) + +``` +BaseConfig.AdvancedOptions.simPersonHappinessDecayAtTerminal: number +``` + +### BaseConfig.AdvancedOptions.subventionMode[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.subventionMode) + +``` +BaseConfig.AdvancedOptions.subventionMode: integer +``` + +### BaseConfig.AdvancedOptions.subventionRisk[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.subventionRisk) + +``` +BaseConfig.AdvancedOptions.subventionRisk: integer +``` + +### BaseConfig.AdvancedOptions.subventionFinancialRewardMultiplier[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.subventionFinancialRewardMultiplier) + +``` +BaseConfig.AdvancedOptions.subventionFinancialRewardMultiplier: number +``` + +### BaseConfig.AdvancedOptions.landmarkResources[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.landmarkResources) + +``` +BaseConfig.AdvancedOptions.landmarkResources: number +``` + +### BaseConfig.AdvancedOptions.isReforestationActive[πŸ”—](#$api.type~BaseConfig.AdvancedOptions.isReforestationActive) + +``` +BaseConfig.AdvancedOptions.isReforestationActive: boolean +``` + +### BaseConfig.Animal[πŸ”—](#$api.type~BaseConfig.Animal) + +``` +record BaseConfig.Animal new: function(): Animal + populationDensityMultiplier: number + useLocalSpawning: boolean + localTileSize: number + notifyAnimalDespawn: boolean +end +``` + +Configuration for animal spawning + +### BaseConfig.Animal.new[πŸ”—](#$api.type~BaseConfig.Animal.new) + +``` +function BaseConfig.Animal.new(): Animal +``` + +Creates a new object of type Animal + +**Returns** + +1. `Animal` + +### BaseConfig.Animal.populationDensityMultiplier[πŸ”—](#$api.type~BaseConfig.Animal.populationDensityMultiplier) + +``` +BaseConfig.Animal.populationDensityMultiplier: number +``` + +Multiply the density (in square exemplars per square km) by this factor for all animals + +### BaseConfig.Animal.useLocalSpawning[πŸ”—](#$api.type~BaseConfig.Animal.useLocalSpawning) + +``` +BaseConfig.Animal.useLocalSpawning: boolean +``` + +Spawning only looks at the existing population within localTileSize squared boxes instead of the entire map (results in density +more similarly distributed to the actual scoring functions) + +### BaseConfig.Animal.localTileSize[πŸ”—](#$api.type~BaseConfig.Animal.localTileSize) + +``` +BaseConfig.Animal.localTileSize: number +``` + +Size used for controlling local spawning + +### BaseConfig.Animal.notifyAnimalDespawn[πŸ”—](#$api.type~BaseConfig.Animal.notifyAnimalDespawn) + +``` +BaseConfig.Animal.notifyAnimalDespawn: boolean +``` + +Add notification when a named animal despawns + +### BaseConfig.Locations[πŸ”—](#$api.type~BaseConfig.Locations) + +``` +[Expand All] [Collapse All] + +record BaseConfig.Locations new: function(): Locations + record IndustryParamList new: function(): IndustryParamList + absoluteMinimum: integer + maxNumberPerArea: number + industryDensity: number + randomSize: boolean + industryProductivity: number +end + record TownParamList new: function(): TownParamList + maxNumberPerArea: number + allowInRoughTerrain: boolean + townFrequency: number + populationDensity: number +end + town: TownParamList + industry: IndustryParamList + makeInitialStreets: boolean +end +``` + +Configuration for the placement of industry and towns on max generation + +### BaseConfig.Locations.new[πŸ”—](#$api.type~BaseConfig.Locations.new) + +``` +function BaseConfig.Locations.new(): Locations +``` + +Creates a new object of type Locations + +**Returns** + +1. `Locations` + +### BaseConfig.Locations.IndustryParamList[πŸ”—](#$api.type~BaseConfig.Locations.IndustryParamList) + +``` +record BaseConfig.Locations.IndustryParamList new: function(): IndustryParamList + absoluteMinimum: integer + maxNumberPerArea: number + industryDensity: number + randomSize: boolean + industryProductivity: number +end +``` + +Configuration parameters for industries + +### BaseConfig.Locations.IndustryParamList.new[πŸ”—](#$api.type~BaseConfig.Locations.IndustryParamList.new) + +``` +function BaseConfig.Locations.IndustryParamList.new(): IndustryParamList +``` + +Creates a new object of type IndustryParamList + +**Returns** + +1. `IndustryParamList` + +### BaseConfig.Locations.IndustryParamList.absoluteMinimum[πŸ”—](#$api.type~BaseConfig.Locations.IndustryParamList.absoluteMinimum) + +``` +BaseConfig.Locations.IndustryParamList.absoluteMinimum: integer +``` + +Spawning will ensure at least this number of industries is present on the map + +### BaseConfig.Locations.IndustryParamList.maxNumberPerArea[πŸ”—](#$api.type~BaseConfig.Locations.IndustryParamList.maxNumberPerArea) + +``` +BaseConfig.Locations.IndustryParamList.maxNumberPerArea: number +``` + +Spawning will ensure that the density per square km will not exceed this number + +### BaseConfig.Locations.IndustryParamList.industryDensity[πŸ”—](#$api.type~BaseConfig.Locations.IndustryParamList.industryDensity) + +``` +BaseConfig.Locations.IndustryParamList.industryDensity: number +``` + +Spawning will try to spawn this number of industries + +### BaseConfig.Locations.IndustryParamList.randomSize[πŸ”—](#$api.type~BaseConfig.Locations.IndustryParamList.randomSize) + +``` +BaseConfig.Locations.IndustryParamList.randomSize: boolean +``` + +Productivity will be randomized slightly to induce more variation + +### BaseConfig.Locations.IndustryParamList.industryProductivity[πŸ”—](#$api.type~BaseConfig.Locations.IndustryParamList.industryProductivity) + +``` +BaseConfig.Locations.IndustryParamList.industryProductivity: number +``` + +Scale the industry productivity by this factor + +### BaseConfig.Locations.TownParamList[πŸ”—](#$api.type~BaseConfig.Locations.TownParamList) + +``` +record BaseConfig.Locations.TownParamList new: function(): TownParamList + maxNumberPerArea: number + allowInRoughTerrain: boolean + townFrequency: number + populationDensity: number +end +``` + +Configuration parameters for towns + +### BaseConfig.Locations.TownParamList.new[πŸ”—](#$api.type~BaseConfig.Locations.TownParamList.new) + +``` +function BaseConfig.Locations.TownParamList.new(): TownParamList +``` + +Creates a new object of type TownParamList + +**Returns** + +1. `TownParamList` + +### BaseConfig.Locations.TownParamList.maxNumberPerArea[πŸ”—](#$api.type~BaseConfig.Locations.TownParamList.maxNumberPerArea) + +``` +BaseConfig.Locations.TownParamList.maxNumberPerArea: number +``` + +Spawning will ensure at most this density per square km + +### BaseConfig.Locations.TownParamList.allowInRoughTerrain[πŸ”—](#$api.type~BaseConfig.Locations.TownParamList.allowInRoughTerrain) + +``` +BaseConfig.Locations.TownParamList.allowInRoughTerrain: boolean +``` + +Town will be able to spawn in uneven and slightly unsuitable terrain, the resulting town might +be smaller than it's target size + +### BaseConfig.Locations.TownParamList.townFrequency[πŸ”—](#$api.type~BaseConfig.Locations.TownParamList.townFrequency) + +``` +BaseConfig.Locations.TownParamList.townFrequency: number +``` + +Number of towns per sqm + +### BaseConfig.Locations.TownParamList.populationDensity[πŸ”—](#$api.type~BaseConfig.Locations.TownParamList.populationDensity) + +``` +BaseConfig.Locations.TownParamList.populationDensity: number +``` + +Population will be scaled by this factor + +### BaseConfig.Locations.town[πŸ”—](#$api.type~BaseConfig.Locations.town) + +``` +BaseConfig.Locations.town: TownParamList +``` + +Configuration for town spawning at map generation + +### BaseConfig.Locations.industry[πŸ”—](#$api.type~BaseConfig.Locations.industry) + +``` +BaseConfig.Locations.industry: IndustryParamList +``` + +Configuration for industry spawning at map generation + +### BaseConfig.Locations.makeInitialStreets[πŸ”—](#$api.type~BaseConfig.Locations.makeInitialStreets) + +``` +BaseConfig.Locations.makeInitialStreets: boolean +``` + +Add small streets at the edge of industries + +### BaseConfig.Terrain[πŸ”—](#$api.type~BaseConfig.Terrain) + +``` +record BaseConfig.Terrain lodErrorMultiplier: number +end +``` + +Configuration for the terrain mesh (Deprecated) + +### BaseConfig.Terrain.lodErrorMultiplier[πŸ”—](#$api.type~BaseConfig.Terrain.lodErrorMultiplier) + +``` +BaseConfig.Terrain.lodErrorMultiplier: number +``` + +(Deprecated) Only used with legacy terrain, determines the quality of the terrain mesh + +### BaseConfig.Economy[πŸ”—](#$api.type~BaseConfig.Economy) + +``` +[Expand All] [Collapse All] + +record BaseConfig.Economy new: function(): Economy + record TownDevelopment cargoNeedsPerTown: integer + townGrowthMinDistrictFraction: number +end + record IndustryDevelopment spawnTargetTimeSpan: number + spawnProbabilityExponent: number + spawnIndustries: boolean + unusedTimeSpan: number + closureCountdownTimeSpan: number + closureProbability: number + extendTimeSpan: number +end + cargoIncomeScript: ScriptRef + passengerIncomeScript: ScriptRef + townDevelopment: TownDevelopment + industryDevelopment: IndustryDevelopment +end +``` + +Configures cargo relations and industry developement for a single game + +### BaseConfig.Economy.new[πŸ”—](#$api.type~BaseConfig.Economy.new) + +``` +function BaseConfig.Economy.new(): Economy +``` + +Creates a new empty economy + +**Returns** + +1. `Economy` + +### BaseConfig.Economy.TownDevelopment[πŸ”—](#$api.type~BaseConfig.Economy.TownDevelopment) + +``` +record BaseConfig.Economy.TownDevelopment cargoNeedsPerTown: integer + townGrowthMinDistrictFraction: number +end +``` + +Parameters for the town developement + +### BaseConfig.Economy.TownDevelopment.cargoNeedsPerTown[πŸ”—](#$api.type~BaseConfig.Economy.TownDevelopment.cargoNeedsPerTown) + +``` +BaseConfig.Economy.TownDevelopment.cargoNeedsPerTown: integer +``` + +Number of initial cargo needs when the town ist first built + +### BaseConfig.Economy.TownDevelopment.townGrowthMinDistrictFraction[πŸ”—](#$api.type~BaseConfig.Economy.TownDevelopment.townGrowthMinDistrictFraction) + +``` +BaseConfig.Economy.TownDevelopment.townGrowthMinDistrictFraction: number +``` + +The minimum a distric fraction (compared to other disctricts) can shrink + +### BaseConfig.Economy.IndustryDevelopment[πŸ”—](#$api.type~BaseConfig.Economy.IndustryDevelopment) + +``` +record BaseConfig.Economy.IndustryDevelopment spawnTargetTimeSpan: number + spawnProbabilityExponent: number + spawnIndustries: boolean + unusedTimeSpan: number + closureCountdownTimeSpan: number + closureProbability: number + extendTimeSpan: number +end +``` + +Parameters for the industry developement + +### BaseConfig.Economy.IndustryDevelopment.spawnTargetTimeSpan[πŸ”—](#$api.type~BaseConfig.Economy.IndustryDevelopment.spawnTargetTimeSpan) + +``` +BaseConfig.Economy.IndustryDevelopment.spawnTargetTimeSpan: number +``` + +Unused + +### BaseConfig.Economy.IndustryDevelopment.spawnProbabilityExponent[πŸ”—](#$api.type~BaseConfig.Economy.IndustryDevelopment.spawnProbabilityExponent) + +``` +BaseConfig.Economy.IndustryDevelopment.spawnProbabilityExponent: number +``` + +Control the frequency at which enw industries appear + +### BaseConfig.Economy.IndustryDevelopment.spawnIndustries[πŸ”—](#$api.type~BaseConfig.Economy.IndustryDevelopment.spawnIndustries) + +``` +BaseConfig.Economy.IndustryDevelopment.spawnIndustries: boolean +``` + +Control whether new industry might spawn on the map + +### BaseConfig.Economy.IndustryDevelopment.unusedTimeSpan[πŸ”—](#$api.type~BaseConfig.Economy.IndustryDevelopment.unusedTimeSpan) + +``` +BaseConfig.Economy.IndustryDevelopment.unusedTimeSpan: number +``` + +Control the mean time after which an industry will begin closing after not being used + +### BaseConfig.Economy.IndustryDevelopment.closureCountdownTimeSpan[πŸ”—](#$api.type~BaseConfig.Economy.IndustryDevelopment.closureCountdownTimeSpan) + +``` +BaseConfig.Economy.IndustryDevelopment.closureCountdownTimeSpan: number +``` + +Controls the grace period the player has to prevent closure + +### BaseConfig.Economy.IndustryDevelopment.closureProbability[πŸ”—](#$api.type~BaseConfig.Economy.IndustryDevelopment.closureProbability) + +``` +BaseConfig.Economy.IndustryDevelopment.closureProbability: number +``` + +Controls how likely an unused industry has of being closed + +### BaseConfig.Economy.IndustryDevelopment.extendTimeSpan[πŸ”—](#$api.type~BaseConfig.Economy.IndustryDevelopment.extendTimeSpan) + +``` +BaseConfig.Economy.IndustryDevelopment.extendTimeSpan: number +``` + +Control how often the industry will build new satellites + +### BaseConfig.Economy.cargoIncomeScript[πŸ”—](#$api.type~BaseConfig.Economy.cargoIncomeScript) + +``` +BaseConfig.Economy.cargoIncomeScript: ScriptRef +``` + +A script reference controlling the income of a given cargo given specific parameters + +### BaseConfig.Economy.passengerIncomeScript[πŸ”—](#$api.type~BaseConfig.Economy.passengerIncomeScript) + +``` +BaseConfig.Economy.passengerIncomeScript: ScriptRef +``` + +A script reference controlling the income of a given passengers given specific parameters + +### BaseConfig.Economy.townDevelopment[πŸ”—](#$api.type~BaseConfig.Economy.townDevelopment) + +``` +BaseConfig.Economy.townDevelopment: TownDevelopment +``` + +Controls the automatic development of towns + +### BaseConfig.Economy.industryDevelopment[πŸ”—](#$api.type~BaseConfig.Economy.industryDevelopment) + +``` +BaseConfig.Economy.industryDevelopment: IndustryDevelopment +``` + +Controls the automatic developement of industries + +### BaseConfig.Settings[πŸ”—](#$api.type~BaseConfig.Settings) + +``` +[Expand All] [Collapse All] + +record BaseConfig.Settings new: function(): Settings + record GeometryQualityOption new: function(): GeometryQualityOption + viewNearFar: Vec2f + fogStartEndFarPerc: Vec2f + lodDistanceScaling: number +end + geometryQualityOptions: {GeometryQualityOption} +end +``` + +Graphic settings for main quality modes, camera tool and cockpit + +### BaseConfig.Settings.new[πŸ”—](#$api.type~BaseConfig.Settings.new) + +``` +function BaseConfig.Settings.new(): Settings +``` + +Creates a new graphic settings parameters + +**Returns** + +1. `Settings` + +### BaseConfig.Settings.GeometryQualityOption[πŸ”—](#$api.type~BaseConfig.Settings.GeometryQualityOption) + +``` +record BaseConfig.Settings.GeometryQualityOption new: function(): GeometryQualityOption + viewNearFar: Vec2f + fogStartEndFarPerc: Vec2f + lodDistanceScaling: number +end +``` + +Contains information about graphi quality of a single game + +### BaseConfig.Settings.GeometryQualityOption.new[πŸ”—](#$api.type~BaseConfig.Settings.GeometryQualityOption.new) + +``` +function BaseConfig.Settings.GeometryQualityOption.new(): GeometryQualityOption +``` + +Creates a new GeometryQualityOption + +**Returns** + +1. `GeometryQualityOption` + +### BaseConfig.Settings.GeometryQualityOption.viewNearFar[πŸ”—](#$api.type~BaseConfig.Settings.GeometryQualityOption.viewNearFar) + +``` +BaseConfig.Settings.GeometryQualityOption.viewNearFar: Vec2f +``` + +Distance im meters of near and far plane + +### BaseConfig.Settings.GeometryQualityOption.fogStartEndFarPerc[πŸ”—](#$api.type~BaseConfig.Settings.GeometryQualityOption.fogStartEndFarPerc) + +``` +BaseConfig.Settings.GeometryQualityOption.fogStartEndFarPerc: Vec2f +``` + +Unused + +### BaseConfig.Settings.GeometryQualityOption.lodDistanceScaling[πŸ”—](#$api.type~BaseConfig.Settings.GeometryQualityOption.lodDistanceScaling) + +``` +BaseConfig.Settings.GeometryQualityOption.lodDistanceScaling: number +``` + +A factor multiplying all lod distances + +### BaseConfig.Settings.geometryQualityOptions[πŸ”—](#$api.type~BaseConfig.Settings.geometryQualityOptions) + +``` +BaseConfig.Settings.geometryQualityOptions: {GeometryQualityOption} +``` + +Quality settings for: {low, medium, high, cockpit, camera tool} + +### BaseConfig.Water[πŸ”—](#$api.type~BaseConfig.Water) + +``` +[Expand All] [Collapse All] + +record BaseConfig.Water record Textures foamNormal: string + foamDetail: string + foam: string +end + textures: Textures +end +``` + +Configures water look and feel + +### BaseConfig.Water.Textures[πŸ”—](#$api.type~BaseConfig.Water.Textures) + +``` +record BaseConfig.Water.Textures foamNormal: string + foamDetail: string + foam: string +end +``` + +Configures water textures + +### BaseConfig.Water.Textures.foamNormal[πŸ”—](#$api.type~BaseConfig.Water.Textures.foamNormal) + +``` +BaseConfig.Water.Textures.foamNormal: string +``` + +Normal texture for water foam + +### BaseConfig.Water.Textures.foamDetail[πŸ”—](#$api.type~BaseConfig.Water.Textures.foamDetail) + +``` +BaseConfig.Water.Textures.foamDetail: string +``` + +Extra detail texture for water foam + +### BaseConfig.Water.Textures.foam[πŸ”—](#$api.type~BaseConfig.Water.Textures.foam) + +``` +BaseConfig.Water.Textures.foam: string +``` + +Albedo texture for water foam + +### BaseConfig.Water.textures[πŸ”—](#$api.type~BaseConfig.Water.textures) + +``` +BaseConfig.Water.textures: Textures +``` + +Configures water textures + +### BaseConfig.Particles[πŸ”—](#$api.type~BaseConfig.Particles) + +``` +[Expand All] [Collapse All] + +record BaseConfig.Particles record Textures noise0: string + noise1: string + smoke: string + smokeNormal: string +end + textures: Textures +end +``` + +### BaseConfig.Particles.Textures[πŸ”—](#$api.type~BaseConfig.Particles.Textures) + +``` +record BaseConfig.Particles.Textures noise0: string + noise1: string + smoke: string + smokeNormal: string +end +``` + +### BaseConfig.Particles.Textures.noise0[πŸ”—](#$api.type~BaseConfig.Particles.Textures.noise0) + +``` +BaseConfig.Particles.Textures.noise0: string +``` + +### BaseConfig.Particles.Textures.noise1[πŸ”—](#$api.type~BaseConfig.Particles.Textures.noise1) + +``` +BaseConfig.Particles.Textures.noise1: string +``` + +### BaseConfig.Particles.Textures.smoke[πŸ”—](#$api.type~BaseConfig.Particles.Textures.smoke) + +``` +BaseConfig.Particles.Textures.smoke: string +``` + +### BaseConfig.Particles.Textures.smokeNormal[πŸ”—](#$api.type~BaseConfig.Particles.Textures.smokeNormal) + +``` +BaseConfig.Particles.Textures.smokeNormal: string +``` + +### BaseConfig.Particles.textures[πŸ”—](#$api.type~BaseConfig.Particles.textures) + +``` +BaseConfig.Particles.textures: Textures +``` + +### BaseConfig.Emissions[πŸ”—](#$api.type~BaseConfig.Emissions) + +``` +record BaseConfig.Emissions noiseLowerBoundDB: number + noiseUpperBoundDB: number + pollutionLowerBoundDB: number + pollutionUpperBoundDB: number + townNoiseResidentialAffected: boolean + townNoiseCommercialAffected: boolean + townNoiseIndustrialAffected: boolean +end +``` + +### BaseConfig.Emissions.noiseLowerBoundDB[πŸ”—](#$api.type~BaseConfig.Emissions.noiseLowerBoundDB) + +``` +BaseConfig.Emissions.noiseLowerBoundDB: number +``` + +### BaseConfig.Emissions.noiseUpperBoundDB[πŸ”—](#$api.type~BaseConfig.Emissions.noiseUpperBoundDB) + +``` +BaseConfig.Emissions.noiseUpperBoundDB: number +``` + +### BaseConfig.Emissions.pollutionLowerBoundDB[πŸ”—](#$api.type~BaseConfig.Emissions.pollutionLowerBoundDB) + +``` +BaseConfig.Emissions.pollutionLowerBoundDB: number +``` + +### BaseConfig.Emissions.pollutionUpperBoundDB[πŸ”—](#$api.type~BaseConfig.Emissions.pollutionUpperBoundDB) + +``` +BaseConfig.Emissions.pollutionUpperBoundDB: number +``` + +### BaseConfig.Emissions.townNoiseResidentialAffected[πŸ”—](#$api.type~BaseConfig.Emissions.townNoiseResidentialAffected) + +``` +BaseConfig.Emissions.townNoiseResidentialAffected: boolean +``` + +### BaseConfig.Emissions.townNoiseCommercialAffected[πŸ”—](#$api.type~BaseConfig.Emissions.townNoiseCommercialAffected) + +``` +BaseConfig.Emissions.townNoiseCommercialAffected: boolean +``` + +### BaseConfig.Emissions.townNoiseIndustrialAffected[πŸ”—](#$api.type~BaseConfig.Emissions.townNoiseIndustrialAffected) + +``` +BaseConfig.Emissions.townNoiseIndustrialAffected: boolean +``` + +### BaseConfig.animal[πŸ”—](#$api.type~BaseConfig.animal) + +``` +BaseConfig.animal: Animal +``` + +Defines the properties of an animal + +### BaseConfig.locations[πŸ”—](#$api.type~BaseConfig.locations) + +``` +BaseConfig.locations: Locations +``` + +### BaseConfig.settings[πŸ”—](#$api.type~BaseConfig.settings) + +``` +BaseConfig.settings: Settings +``` + +### BaseConfig.particles[πŸ”—](#$api.type~BaseConfig.particles) + +``` +BaseConfig.particles: Particles +``` + +### BaseConfig.water[πŸ”—](#$api.type~BaseConfig.water) + +``` +BaseConfig.water: Water +``` + +### BaseConfig.emission[πŸ”—](#$api.type~BaseConfig.emission) + +``` +BaseConfig.emission: Emissions +``` + +### BaseConfig.scaffold[πŸ”—](#$api.type~BaseConfig.scaffold) + +``` +BaseConfig.scaffold: {string : {string : {string}}} +``` + +### BaseConfig.costs[πŸ”—](#$api.type~BaseConfig.costs) + +``` +BaseConfig.costs: {string : number} +``` + +### BaseConfig.advancedOptions[πŸ”—](#$api.type~BaseConfig.advancedOptions) + +``` +BaseConfig.advancedOptions: AdvancedOptions +``` + +### BaseConfig.economy[πŸ”—](#$api.type~BaseConfig.economy) + +``` +BaseConfig.economy: Economy +``` + +### BaseConfig.terrain[πŸ”—](#$api.type~BaseConfig.terrain) + +``` +BaseConfig.terrain: Terrain +``` + +### BaseConfig.environment[πŸ”—](#$api.type~BaseConfig.environment) + +``` +BaseConfig.environment: ResName +``` + +### BaseConfig.economyId[πŸ”—](#$api.type~BaseConfig.economyId) + +``` +BaseConfig.economyId: ResName +``` + +### BaseConfig.nameId[πŸ”—](#$api.type~BaseConfig.nameId) + +``` +BaseConfig.nameId: ResName +``` + +### BaseConfig.climate[πŸ”—](#$api.type~BaseConfig.climate) + +``` +BaseConfig.climate: ResName +``` + +### BaseConfig.trackCatenaryYearFrom[πŸ”—](#$api.type~BaseConfig.trackCatenaryYearFrom) + +``` +BaseConfig.trackCatenaryYearFrom: integer +``` + +### BaseConfig.busLaneYearFrom[πŸ”—](#$api.type~BaseConfig.busLaneYearFrom) + +``` +BaseConfig.busLaneYearFrom: integer +``` + +### BaseConfig.terrainToolMinStrength[πŸ”—](#$api.type~BaseConfig.terrainToolMinStrength) + +``` +BaseConfig.terrainToolMinStrength: number +``` + +### BaseConfig.terrainToolMaxStrength[πŸ”—](#$api.type~BaseConfig.terrainToolMaxStrength) + +``` +BaseConfig.terrainToolMaxStrength: number +``` + +### BaseConfig.enforceMainConnections[πŸ”—](#$api.type~BaseConfig.enforceMainConnections) + +``` +BaseConfig.enforceMainConnections: boolean +``` + +### BaseConfig.townDevelopInterval[πŸ”—](#$api.type~BaseConfig.townDevelopInterval) + +``` +BaseConfig.townDevelopInterval: number +``` + +### BaseConfig.chargeMaintenanceInterval[πŸ”—](#$api.type~BaseConfig.chargeMaintenanceInterval) + +``` +BaseConfig.chargeMaintenanceInterval: number +``` + +### BaseConfig.simulateCargoWeight[πŸ”—](#$api.type~BaseConfig.simulateCargoWeight) + +``` +BaseConfig.simulateCargoWeight: boolean +``` + +### BaseConfig.simPersonDestinationRecomputationProbability[πŸ”—](#$api.type~BaseConfig.simPersonDestinationRecomputationProbability) + +``` +BaseConfig.simPersonDestinationRecomputationProbability: number +``` + +### BaseConfig.townMajorStreetAngleRange[πŸ”—](#$api.type~BaseConfig.townMajorStreetAngleRange) + +``` +BaseConfig.townMajorStreetAngleRange: number +``` + +### BaseConfig.townConnectionMaxBridgeLength[πŸ”—](#$api.type~BaseConfig.townConnectionMaxBridgeLength) + +``` +BaseConfig.townConnectionMaxBridgeLength: number +``` + +### BaseConfig.maxVehicleCloneAmount[πŸ”—](#$api.type~BaseConfig.maxVehicleCloneAmount) + +``` +BaseConfig.maxVehicleCloneAmount: number +``` + +### BaseConfig.trainAccelerationFactor[πŸ”—](#$api.type~BaseConfig.trainAccelerationFactor) + +``` +BaseConfig.trainAccelerationFactor: number +``` + +### BaseConfig.trainBrakeDeceleration[πŸ”—](#$api.type~BaseConfig.trainBrakeDeceleration) + +``` +BaseConfig.trainBrakeDeceleration: number +``` + +### BaseConfig.terrainToolMinSize[πŸ”—](#$api.type~BaseConfig.terrainToolMinSize) + +``` +BaseConfig.terrainToolMinSize: number +``` + +### BaseConfig.terrainToolMaxSize[πŸ”—](#$api.type~BaseConfig.terrainToolMaxSize) + +``` +BaseConfig.terrainToolMaxSize: number +``` + +### BaseConfig.terrainToolScale[πŸ”—](#$api.type~BaseConfig.terrainToolScale) + +``` +BaseConfig.terrainToolScale: number +``` + +### BaseConfig.terrainToolMaxSizeEditor[πŸ”—](#$api.type~BaseConfig.terrainToolMaxSizeEditor) + +``` +BaseConfig.terrainToolMaxSizeEditor: number +``` + +### BaseConfig.terrainPainterMinSize[πŸ”—](#$api.type~BaseConfig.terrainPainterMinSize) + +``` +BaseConfig.terrainPainterMinSize: number +``` + +### BaseConfig.terrainPainterMaxSize[πŸ”—](#$api.type~BaseConfig.terrainPainterMaxSize) + +``` +BaseConfig.terrainPainterMaxSize: number +``` + +### BaseConfig.terrainPainterMaxSizeEditor[πŸ”—](#$api.type~BaseConfig.terrainPainterMaxSizeEditor) + +``` +BaseConfig.terrainPainterMaxSizeEditor: number +``` + +### BaseConfig.terrainPainterScale[πŸ”—](#$api.type~BaseConfig.terrainPainterScale) + +``` +BaseConfig.terrainPainterScale: number +``` + +### BaseConfig.assetBrushMinSize[πŸ”—](#$api.type~BaseConfig.assetBrushMinSize) + +``` +BaseConfig.assetBrushMinSize: number +``` + +### BaseConfig.assetBrushMaxSize[πŸ”—](#$api.type~BaseConfig.assetBrushMaxSize) + +``` +BaseConfig.assetBrushMaxSize: number +``` + +### BaseConfig.assetBrushScale[πŸ”—](#$api.type~BaseConfig.assetBrushScale) + +``` +BaseConfig.assetBrushScale: number +``` + +### BaseConfig.treeCostYearMultipliers[πŸ”—](#$api.type~BaseConfig.treeCostYearMultipliers) + +``` +BaseConfig.treeCostYearMultipliers: {integer : number} +``` + +### BaseConfig.townInitialMajorStreetAngleRange[πŸ”—](#$api.type~BaseConfig.townInitialMajorStreetAngleRange) + +``` +BaseConfig.townInitialMajorStreetAngleRange: number +``` + +### BaseConfig.townCapacityScalingFactor[πŸ”—](#$api.type~BaseConfig.townCapacityScalingFactor) + +``` +BaseConfig.townCapacityScalingFactor: number +``` + +### BaseConfig.sandboxMode[πŸ”—](#$api.type~BaseConfig.sandboxMode) + +``` +BaseConfig.sandboxMode: boolean +``` + +### BaseConfig.noCosts[πŸ”—](#$api.type~BaseConfig.noCosts) + +``` +BaseConfig.noCosts: boolean +``` + +### BaseConfig.constructionScript[πŸ”—](#$api.type~BaseConfig.constructionScript) + +``` +BaseConfig.constructionScript: ScriptRef +``` + +### BaseEdgeType[πŸ”—](#$api.type~BaseEdgeType) + +``` +global record BaseEdgeType NORMAL: BaseEdgeType + BRIDGE: BaseEdgeType + TUNNEL: BaseEdgeType +end +``` + +Base edge type + +### BaseEdgeType.NORMAL[πŸ”—](#$api.type~BaseEdgeType.NORMAL) + +``` +BaseEdgeType.NORMAL: BaseEdgeType +``` + +### BaseEdgeType.BRIDGE[πŸ”—](#$api.type~BaseEdgeType.BRIDGE) + +``` +BaseEdgeType.BRIDGE: BaseEdgeType +``` + +### BaseEdgeType.TUNNEL[πŸ”—](#$api.type~BaseEdgeType.TUNNEL) + +``` +BaseEdgeType.TUNNEL: BaseEdgeType +``` + +### BoundingInfo[πŸ”—](#$api.type~BoundingInfo) + +``` +global record BoundingInfo new: function(): BoundingInfo + + bbMax: Vec3f + bbMin: Vec3f +end +``` + +Information about the axis aligned bounding box of the model + +### BoundingInfo.new()[πŸ”—](#$api.type~BoundingInfo.new()) + +``` +function BoundingInfo.new()(): BoundingInfo +``` + +Creates a new empty bounding info + +**Returns** + +1. `BoundingInfo` + +### BoundingInfo.new(Vec3f, Vec3f)[πŸ”—](#$api.type~BoundingInfo.new(Vec3f, Vec3f)) + +``` +function BoundingInfo.new(Vec3f, Vec3f)(bbMin : Vec3f, bbMax : Vec3f): BoundingInfo +``` + +Creates a new bounding info with specified bounds + +**Parameters** + +* `bbMin` :`Vec3f` β€” Corner with lowest coordinates +* `bbMax` :`Vec3f` β€” Corner with highest coordinates + +**Returns** + +1. `BoundingInfo` + +### BoundingInfo.bbMax[πŸ”—](#$api.type~BoundingInfo.bbMax) + +``` +BoundingInfo.bbMax: Vec3f +``` + +Corner with lowest coordinates + +### BoundingInfo.bbMin[πŸ”—](#$api.type~BoundingInfo.bbMin) + +``` +BoundingInfo.bbMin: Vec3f +``` + +Corner with highest coordinates + +### Box2f[πŸ”—](#$api.type~Box2f) + +``` +global record Box2f new: function(): Box2f + + min: Vec3f + max: Vec3f +end +``` + +A 2d bounding box + +### Box2f.new()[πŸ”—](#$api.type~Box2f.new()) + +``` +function Box2f.new()(): Box2f +``` + +Creates a new Box2f + +**Returns** + +1. `Box2f` + +### Box2f.new(Vec2f, Vec2f)[πŸ”—](#$api.type~Box2f.new(Vec2f, Vec2f)) + +``` +function Box2f.new(Vec2f, Vec2f)(Vec2f, Vec2f): Box2f +``` + +Creates a new Box2f + +**Parameters** + +* `Vec2f` +* `Vec2f` + +**Returns** + +1. `Box2f` + +### Box2f.min[πŸ”—](#$api.type~Box2f.min) + +``` +Box2f.min: Vec3f +``` + +Minimum corner of the box + +### Box2f.max[πŸ”—](#$api.type~Box2f.max) + +``` +Box2f.max: Vec3f +``` + +Maximum corner of the box + +### Box3f[πŸ”—](#$api.type~Box3f) + +``` +global record Box3f new: function(): Box3f + + min: Vec3f + max: Vec3f +end +``` + +A 3d bounding box + +### Box3f.new()[πŸ”—](#$api.type~Box3f.new()) + +``` +function Box3f.new()(): Box3f +``` + +Creates a new Box3f + +**Returns** + +1. `Box3f` + +### Box3f.new(Vec3f, Vec3f)[πŸ”—](#$api.type~Box3f.new(Vec3f, Vec3f)) + +``` +function Box3f.new(Vec3f, Vec3f)(Vec3f, Vec3f): Box3f +``` + +Creates a new Box3f + +**Parameters** + +* `Vec3f` +* `Vec3f` + +**Returns** + +1. `Box3f` + +### Box3f.min[πŸ”—](#$api.type~Box3f.min) + +``` +Box3f.min: Vec3f +``` + +Minimum corner of the box + +### Box3f.max[πŸ”—](#$api.type~Box3f.max) + +``` +Box3f.max: Vec3f +``` + +Maximum corner of the box + +### BridgeType[πŸ”—](#$api.type~BridgeType) + +``` +global record BridgeType description: ModelMetadata.Description + availability: ModelMetadata.Availability + menuCategory: ModelMetadata.MenuCategory + cost: number + speedLimit: number + new: function(): BridgeType + costFactors: Vec3f + maintenanceCost: integer + carriers: {Carrier} + padding: number + height: number + sidewalkHeight: number + pillarWidth: number + pillarLen: number + pillarMinDist: number + pillarMaxDist: number + pillarTargetDist: number + abutmentLen: number + abutmentWidth: number + materialsToReplace: { : } + assetsToReplace: { : } + pillarGroundTexture: string + pillarGroundTextureOffset: number + updateScript: ScriptRef + isAutoSelectable: boolean + portals: { : } +end +``` + +Specification for bridge types and also tunnels + +### BridgeType.description[πŸ”—](#$api.type~BridgeType.description) + +``` +BridgeType.description: ModelMetadata.Description +``` + +Localized strings and icons paths for user interface + +### BridgeType.availability[πŸ”—](#$api.type~BridgeType.availability) + +``` +BridgeType.availability: ModelMetadata.Availability +``` + +Era information for user interface + +### BridgeType.menuCategory[πŸ”—](#$api.type~BridgeType.menuCategory) + +``` +BridgeType.menuCategory: ModelMetadata.MenuCategory +``` + +Configure category, order and filter behaviour in the construction menu + +### BridgeType.cost[πŸ”—](#$api.type~BridgeType.cost) + +``` +BridgeType.cost: number +``` + +Cost per unit length + +### BridgeType.speedLimit[πŸ”—](#$api.type~BridgeType.speedLimit) + +``` +BridgeType.speedLimit: number +``` + +Top speed over the section type, limits top speed of road and tracks + +### BridgeType.new[πŸ”—](#$api.type~BridgeType.new) + +``` +function BridgeType.new(): BridgeType +``` + +Creates a new empty bridge type + +**Returns** + +1. `BridgeType` + +### BridgeType.costFactors[πŸ”—](#$api.type~BridgeType.costFactors) + +``` +BridgeType.costFactors: Vec3f +``` + +Cost for extensions to bridges: thresold, exponent, offset within a curve + +### BridgeType.maintenanceCost[πŸ”—](#$api.type~BridgeType.maintenanceCost) + +``` +BridgeType.maintenanceCost: integer +``` + +Maintenance cost per unit length + +### BridgeType.carriers[πŸ”—](#$api.type~BridgeType.carriers) + +``` +BridgeType.carriers: {Carrier} +``` + +Carriers allowed on the bridge/tunnel + +### BridgeType.padding[πŸ”—](#$api.type~BridgeType.padding) + +``` +BridgeType.padding: number +``` + +Extra width added to the side of the bridge (in meters) + +### BridgeType.height[πŸ”—](#$api.type~BridgeType.height) + +``` +BridgeType.height: number +``` + +Height (tunnel only): results in offset applied to the terrain alignment above the bridge + +### BridgeType.sidewalkHeight[πŸ”—](#$api.type~BridgeType.sidewalkHeight) + +``` +BridgeType.sidewalkHeight: number +``` + +Overrides the sidewalk height for the bridge + +### BridgeType.pillarWidth[πŸ”—](#$api.type~BridgeType.pillarWidth) + +``` +BridgeType.pillarWidth: number +``` + +Width (in meters) of bridge pillars + +### BridgeType.pillarLen[πŸ”—](#$api.type~BridgeType.pillarLen) + +``` +BridgeType.pillarLen: number +``` + +Length (in meters) of bridge pillars + +### BridgeType.pillarMinDist[πŸ”—](#$api.type~BridgeType.pillarMinDist) + +``` +BridgeType.pillarMinDist: number +``` + +Minimal distance (in meters) between bridge pillars along the length of the bridge + +### BridgeType.pillarMaxDist[πŸ”—](#$api.type~BridgeType.pillarMaxDist) + +``` +BridgeType.pillarMaxDist: number +``` + +Maximal allowed (in meters) distance between pillars along the length of the bridge + +### BridgeType.pillarTargetDist[πŸ”—](#$api.type~BridgeType.pillarTargetDist) + +``` +BridgeType.pillarTargetDist: number +``` + +Targeted distance (in meters) between pillars, as allowed by the street segment + +### BridgeType.abutmentLen[πŸ”—](#$api.type~BridgeType.abutmentLen) + +``` +BridgeType.abutmentLen: number +``` + +Length of abutments along bridges (in meters) + +### BridgeType.abutmentWidth[πŸ”—](#$api.type~BridgeType.abutmentWidth) + +``` +BridgeType.abutmentWidth: number +``` + +Wdith of abutments along bridges (in meters) + +### BridgeType.materialsToReplace[πŸ”—](#$api.type~BridgeType.materialsToReplace) + +``` +BridgeType.materialsToReplace: { : } +``` + +Override street materials by using the given configurations + +### BridgeType.assetsToReplace[πŸ”—](#$api.type~BridgeType.assetsToReplace) + +``` +BridgeType.assetsToReplace: { : } +``` + +Overrides street assets by using the given list + +### BridgeType.pillarGroundTexture[πŸ”—](#$api.type~BridgeType.pillarGroundTexture) + +``` +BridgeType.pillarGroundTexture: string +``` + +Ground textures applied to the base of bridge pillars + +### BridgeType.pillarGroundTextureOffset[πŸ”—](#$api.type~BridgeType.pillarGroundTextureOffset) + +``` +BridgeType.pillarGroundTextureOffset: number +``` + +Extra padding applied to the ground texture shape below bridges + +### BridgeType.updateScript[πŸ”—](#$api.type~BridgeType.updateScript) + +``` +BridgeType.updateScript: ScriptRef +``` + +A script precisely controlling placement of railing models, pillars and entrances + +### BridgeType.isAutoSelectable[πŸ”—](#$api.type~BridgeType.isAutoSelectable) + +``` +BridgeType.isAutoSelectable: boolean +``` + +Allow to be used for auto bridge selection while building roads and tracks, nil defaults to true + +### BridgeType.portals[πŸ”—](#$api.type~BridgeType.portals) + +``` +BridgeType.portals: { : } +``` + +Deprecated + +### BuilderAudioSet[πŸ”—](#$api.type~BuilderAudioSet) + +``` +global record BuilderAudioSet attrs: SoundAttributes + dragStart: SoundClip + drag: {SoundClip} + dragBridge: {SoundClip} + dragTunnel: {SoundClip} + dragEnd: SoundClip + dragOffset: number + build: {SoundClip} + noMoney: {SoundClip} + bulldoze: {SoundClip} + terraform: {SoundClip} +end +``` + +### BuilderAudioSet.attrs[πŸ”—](#$api.type~BuilderAudioSet.attrs) + +``` +BuilderAudioSet.attrs: SoundAttributes +``` + +### BuilderAudioSet.dragStart[πŸ”—](#$api.type~BuilderAudioSet.dragStart) + +``` +BuilderAudioSet.dragStart: SoundClip +``` + +### BuilderAudioSet.drag[πŸ”—](#$api.type~BuilderAudioSet.drag) + +``` +BuilderAudioSet.drag: {SoundClip} +``` + +### BuilderAudioSet.dragBridge[πŸ”—](#$api.type~BuilderAudioSet.dragBridge) + +``` +BuilderAudioSet.dragBridge: {SoundClip} +``` + +### BuilderAudioSet.dragTunnel[πŸ”—](#$api.type~BuilderAudioSet.dragTunnel) + +``` +BuilderAudioSet.dragTunnel: {SoundClip} +``` + +### BuilderAudioSet.dragEnd[πŸ”—](#$api.type~BuilderAudioSet.dragEnd) + +``` +BuilderAudioSet.dragEnd: SoundClip +``` + +### BuilderAudioSet.dragOffset[πŸ”—](#$api.type~BuilderAudioSet.dragOffset) + +``` +BuilderAudioSet.dragOffset: number +``` + +### BuilderAudioSet.build[πŸ”—](#$api.type~BuilderAudioSet.build) + +``` +BuilderAudioSet.build: {SoundClip} +``` + +### BuilderAudioSet.noMoney[πŸ”—](#$api.type~BuilderAudioSet.noMoney) + +``` +BuilderAudioSet.noMoney: {SoundClip} +``` + +### BuilderAudioSet.bulldoze[πŸ”—](#$api.type~BuilderAudioSet.bulldoze) + +``` +BuilderAudioSet.bulldoze: {SoundClip} +``` + +### BuilderAudioSet.terraform[πŸ”—](#$api.type~BuilderAudioSet.terraform) + +``` +BuilderAudioSet.terraform: {SoundClip} +``` + +### BuildingType[πŸ”—](#$api.type~BuildingType) + +``` +global record BuildingType constructionFile: string + params: TownBuildingParams +end +``` + +Specification for town building types + +### BuildingType.constructionFile[πŸ”—](#$api.type~BuildingType.constructionFile) + +``` +BuildingType.constructionFile: string +``` + +Resource name of the construction + +### BuildingType.params[πŸ”—](#$api.type~BuildingType.params) + +``` +BuildingType.params: TownBuildingParams +``` + +### CampaignDesc[πŸ”—](#$api.type~CampaignDesc) + +``` +global record CampaignDesc new: function(): CampaignDesc + name: string + description: string + icon: string + map: string + order: number + voiceOver: string + requiresCompleted: string + unlockingProgression: boolean +end +``` + +Campaign description + +### CampaignDesc.new[πŸ”—](#$api.type~CampaignDesc.new) + +``` +function CampaignDesc.new(): CampaignDesc +``` + +**Returns** + +1. `CampaignDesc` + +### CampaignDesc.name[πŸ”—](#$api.type~CampaignDesc.name) + +``` +CampaignDesc.name: string +``` + +### CampaignDesc.description[πŸ”—](#$api.type~CampaignDesc.description) + +``` +CampaignDesc.description: string +``` + +### CampaignDesc.icon[πŸ”—](#$api.type~CampaignDesc.icon) + +``` +CampaignDesc.icon: string +``` + +### CampaignDesc.map[πŸ”—](#$api.type~CampaignDesc.map) + +``` +CampaignDesc.map: string +``` + +### CampaignDesc.order[πŸ”—](#$api.type~CampaignDesc.order) + +``` +CampaignDesc.order: number +``` + +### CampaignDesc.voiceOver[πŸ”—](#$api.type~CampaignDesc.voiceOver) + +``` +CampaignDesc.voiceOver: string +``` + +### CampaignDesc.requiresCompleted[πŸ”—](#$api.type~CampaignDesc.requiresCompleted) + +``` +CampaignDesc.requiresCompleted: string +``` + +### CampaignDesc.unlockingProgression[πŸ”—](#$api.type~CampaignDesc.unlockingProgression) + +``` +CampaignDesc.unlockingProgression: boolean +``` + +### CargoCategory[πŸ”—](#$api.type~CargoCategory) + +``` +global record CargoCategory tier: integer + landUses: {LandUseType} + requiredIndustryTags: {string} + townConsumptionFactor: number +end +``` + +Represent a group of cargo types that are transported with similar packaging/containers: e.g. liquid, bulk, ... + +### CargoCategory.tier[πŸ”—](#$api.type~CargoCategory.tier) + +``` +CargoCategory.tier: integer +``` + +Tier level of the cargo category + +### CargoCategory.landUses[πŸ”—](#$api.type~CargoCategory.landUses) + +``` +CargoCategory.landUses: {LandUseType} +``` + +Land use types associated with this category + +### CargoCategory.requiredIndustryTags[πŸ”—](#$api.type~CargoCategory.requiredIndustryTags) + +``` +CargoCategory.requiredIndustryTags: {string} +``` + +Industry tags required for this cargo category + +### CargoCategory.townConsumptionFactor[πŸ”—](#$api.type~CargoCategory.townConsumptionFactor) + +``` +CargoCategory.townConsumptionFactor: number +``` + +### CargoClass[πŸ”—](#$api.type~CargoClass) + +``` +global record CargoClass new: function(): CargoClass + + tag: string + name: string + description: string + icon: string + color: Vec3f + order: integer +end +``` + +Specification for cargo types + +### CargoClass.new()[πŸ”—](#$api.type~CargoClass.new()) + +``` +function CargoClass.new()(): CargoClass +``` + +**Returns** + +1. `CargoClass` + +### CargoClass.new(CargoClass)[πŸ”—](#$api.type~CargoClass.new(CargoClass)) + +``` +function CargoClass.new(CargoClass)(CargoClass): CargoClass +``` + +**Parameters** + +* `CargoClass` + +**Returns** + +1. `CargoClass` + +### CargoClass.tag[πŸ”—](#$api.type~CargoClass.tag) + +``` +CargoClass.tag: string +``` + +unique tag + +### CargoClass.name[πŸ”—](#$api.type~CargoClass.name) + +``` +CargoClass.name: string +``` + +display name + +### CargoClass.description[πŸ”—](#$api.type~CargoClass.description) + +``` +CargoClass.description: string +``` + +detailed info + +### CargoClass.icon[πŸ”—](#$api.type~CargoClass.icon) + +``` +CargoClass.icon: string +``` + +display icon path + +### CargoClass.color[πŸ”—](#$api.type~CargoClass.color) + +``` +CargoClass.color: Vec3f +``` + +color of the cargo class + +### CargoClass.order[πŸ”—](#$api.type~CargoClass.order) + +``` +CargoClass.order: integer +``` + +display ordering + +### CargoClassId[πŸ”—](#$api.type~CargoClassId) + +``` +global type CargoClassId = integer +``` + +### CargoType[πŸ”—](#$api.type~CargoType) + +``` +global record CargoType new: function(): CargoType + + name: string + icon: string + color: Vec3f + scriptRef: ScriptRef + weight: number + cargoClasses: {string} + order: integer + category: string + categoryList: ModelMetadata.CategoryList + timeToDeliverInSeconds: integer + loadSpeedFactor: number +end +``` + +Specification for cargo types + +### CargoType.new()[πŸ”—](#$api.type~CargoType.new()) + +``` +function CargoType.new()(): CargoType +``` + +**Returns** + +1. `CargoType` + +### CargoType.new(CargoType)[πŸ”—](#$api.type~CargoType.new(CargoType)) + +``` +function CargoType.new(CargoType)(CargoType): CargoType +``` + +**Parameters** + +* `CargoType` + +**Returns** + +1. `CargoType` + +### CargoType.name[πŸ”—](#$api.type~CargoType.name) + +``` +CargoType.name: string +``` + +Display name + +### CargoType.icon[πŸ”—](#$api.type~CargoType.icon) + +``` +CargoType.icon: string +``` + +Display icon path + +### CargoType.color[πŸ”—](#$api.type~CargoType.color) + +``` +CargoType.color: Vec3f +``` + +Color of the cargo + +### CargoType.scriptRef[πŸ”—](#$api.type~CargoType.scriptRef) + +``` +CargoType.scriptRef: ScriptRef +``` + +Reference to cargo income factor script + +### CargoType.weight[πŸ”—](#$api.type~CargoType.weight) + +``` +CargoType.weight: number +``` + +Weight of a unit of cargo + +### CargoType.cargoClasses[πŸ”—](#$api.type~CargoType.cargoClasses) + +``` +CargoType.cargoClasses: {string} +``` + +### CargoType.order[πŸ”—](#$api.type~CargoType.order) + +``` +CargoType.order: integer +``` + +Order for sorting in cargo type lists + +### CargoType.category[πŸ”—](#$api.type~CargoType.category) + +``` +CargoType.category: string +``` + +Category of the cargo + +### CargoType.categoryList[πŸ”—](#$api.type~CargoType.categoryList) + +``` +CargoType.categoryList: ModelMetadata.CategoryList +``` + +### CargoType.timeToDeliverInSeconds[πŸ”—](#$api.type~CargoType.timeToDeliverInSeconds) + +``` +CargoType.timeToDeliverInSeconds: integer +``` + +Lifetime of cargo in seconds + +### CargoType.loadSpeedFactor[πŸ”—](#$api.type~CargoType.loadSpeedFactor) + +``` +CargoType.loadSpeedFactor: number +``` + +### CargoTypeId[πŸ”—](#$api.type~CargoTypeId) + +``` +global type CargoTypeId = integer +``` + +### CargoTypeSet[πŸ”—](#$api.type~CargoTypeSet) + +``` +global record CargoTypeSet new: function(): CargoTypeSet + cargoClassesIncluded: {string} + cargoClassesExcluded: {string} + cargoTypesIncluded: {ResName} + cargoTypesExcluded: {ResName} +end +``` + +Specification for cargo type set + +### CargoTypeSet.new[πŸ”—](#$api.type~CargoTypeSet.new) + +``` +function CargoTypeSet.new(): CargoTypeSet +``` + +**Returns** + +1. `CargoTypeSet` + +### CargoTypeSet.cargoClassesIncluded[πŸ”—](#$api.type~CargoTypeSet.cargoClassesIncluded) + +``` +CargoTypeSet.cargoClassesIncluded: {string} +``` + +cargo classes included + +### CargoTypeSet.cargoClassesExcluded[πŸ”—](#$api.type~CargoTypeSet.cargoClassesExcluded) + +``` +CargoTypeSet.cargoClassesExcluded: {string} +``` + +cargo classes excluded + +### CargoTypeSet.cargoTypesIncluded[πŸ”—](#$api.type~CargoTypeSet.cargoTypesIncluded) + +``` +CargoTypeSet.cargoTypesIncluded: {ResName} +``` + +cargo types included + +### CargoTypeSet.cargoTypesExcluded[πŸ”—](#$api.type~CargoTypeSet.cargoTypesExcluded) + +``` +CargoTypeSet.cargoTypesExcluded: {ResName} +``` + +cargo types excluded + +### CarriageInfo[πŸ”—](#$api.type~CarriageInfo) + +``` +global record CarriageInfo owningVehicle: Engine.Entity + index: integer + offset: number + reversed: boolean + crew: Engine.Entity + end: number +end +``` + +Information about carriages + +### CarriageInfo.owningVehicle[πŸ”—](#$api.type~CarriageInfo.owningVehicle) + +``` +CarriageInfo.owningVehicle: Engine.Entity +``` + +### CarriageInfo.index[πŸ”—](#$api.type~CarriageInfo.index) + +``` +CarriageInfo.index: integer +``` + +### CarriageInfo.offset[πŸ”—](#$api.type~CarriageInfo.offset) + +``` +CarriageInfo.offset: number +``` + +### CarriageInfo.reversed[πŸ”—](#$api.type~CarriageInfo.reversed) + +``` +CarriageInfo.reversed: boolean +``` + +Whether the carriage is reversed + +### CarriageInfo.crew[πŸ”—](#$api.type~CarriageInfo.crew) + +``` +CarriageInfo.crew: Engine.Entity +``` + +### CarriageInfo.end[πŸ”—](#$api.type~CarriageInfo.end) + +``` +CarriageInfo.end: number +``` + +### Carrier[πŸ”—](#$api.type~Carrier) + +``` +global record Carrier ROAD: Carrier + RAIL: Carrier + TRAM: Carrier + OTHER: Carrier + AIR: Carrier + WATER: Carrier + metamethod __index: function(Carrier, string): Carrier +end +``` + +Carrier types for journal entries + +### Carrier.ROAD[πŸ”—](#$api.type~Carrier.ROAD) + +``` +Carrier.ROAD: Carrier +``` + +Road vehicles (trucks, buses, cars) + +### Carrier.RAIL[πŸ”—](#$api.type~Carrier.RAIL) + +``` +Carrier.RAIL: Carrier +``` + +Rail vehicles (trains) + +### Carrier.TRAM[πŸ”—](#$api.type~Carrier.TRAM) + +``` +Carrier.TRAM: Carrier +``` + +Tram vehicles + +### Carrier.OTHER[πŸ”—](#$api.type~Carrier.OTHER) + +``` +Carrier.OTHER: Carrier +``` + +Other types of carriers + +### Carrier.AIR[πŸ”—](#$api.type~Carrier.AIR) + +``` +Carrier.AIR: Carrier +``` + +Aircraft (planes, helicopters) + +### Carrier.WATER[πŸ”—](#$api.type~Carrier.WATER) + +``` +Carrier.WATER: Carrier +``` + +Water vehicles (ships, boats) + +### Carrier.$meta.\_\_index[πŸ”—](#$api.type~Carrier.$meta.__index) + +``` +metamethod Carrier.$meta.__index(Carrier, string): Carrier +``` + +**Parameters** + +* `Carrier` +* `string` + +**Returns** + +1. `Carrier` + +### CatchmentArea[πŸ”—](#$api.type~CatchmentArea) + +``` +global record CatchmentArea position: Vec3f + radius: number +end +``` + +A catchment area is a cylinder around a position with a specific radius + +### CatchmentArea.position[πŸ”—](#$api.type~CatchmentArea.position) + +``` +CatchmentArea.position: Vec3f +``` + +### CatchmentArea.radius[πŸ”—](#$api.type~CatchmentArea.radius) + +``` +CatchmentArea.radius: number +``` + +### ChartConfig[πŸ”—](#$api.type~ChartConfig) + +``` +global record ChartConfig new: function(): ChartConfig + interval: integer + count: integer + minCount: integer + yStepScale: number +end +``` + +A structure that holds config for a chart + +### ChartConfig.new[πŸ”—](#$api.type~ChartConfig.new) + +``` +function ChartConfig.new(): ChartConfig +``` + +**Returns** + +1. `ChartConfig` + +### ChartConfig.interval[πŸ”—](#$api.type~ChartConfig.interval) + +``` +ChartConfig.interval: integer +``` + +The time in which the data gets collected. + +### ChartConfig.count[πŸ”—](#$api.type~ChartConfig.count) + +``` +ChartConfig.count: integer +``` + +The desired number of intervals. + +### ChartConfig.minCount[πŸ”—](#$api.type~ChartConfig.minCount) + +``` +ChartConfig.minCount: integer +``` + +The minimum number of intervals to display. + +### ChartConfig.yStepScale[πŸ”—](#$api.type~ChartConfig.yStepScale) + +``` +ChartConfig.yStepScale: number +``` + +Modify y stepSize for fine-tuning. + +### ChartResult[πŸ”—](#$api.type~ChartResult) + +``` +global record ChartResult equals: function(ChartResult, ChartResult): boolean + xRange: {number} + yRange: {number} + series: {{{number}}} + xMarkers: {number} + yMarkers: {number} + numPotentialGroups: integer +end +``` + +A structure that holds data for a chart + +### ChartResult.equals[πŸ”—](#$api.type~ChartResult.equals) + +``` +function ChartResult.equals(ChartResult, ChartResult): boolean +``` + +**Parameters** + +* `ChartResult` +* `ChartResult` + +**Returns** + +1. `boolean` + +### ChartResult.xRange[πŸ”—](#$api.type~ChartResult.xRange) + +``` +ChartResult.xRange: {number} +``` + +X-axis range + +### ChartResult.yRange[πŸ”—](#$api.type~ChartResult.yRange) + +``` +ChartResult.yRange: {number} +``` + +Y-axis range + +### ChartResult.series[πŸ”—](#$api.type~ChartResult.series) + +``` +ChartResult.series: {{{number}}} +``` + +Data series + +### ChartResult.xMarkers[πŸ”—](#$api.type~ChartResult.xMarkers) + +``` +ChartResult.xMarkers: {number} +``` + +X-axis markers + +### ChartResult.yMarkers[πŸ”—](#$api.type~ChartResult.yMarkers) + +``` +ChartResult.yMarkers: {number} +``` + +Y-axis markers + +### ChartResult.numPotentialGroups[πŸ”—](#$api.type~ChartResult.numPotentialGroups) + +``` +ChartResult.numPotentialGroups: integer +``` + +Number of potential groups + +### ClimateDesc[πŸ”—](#$api.type~ClimateDesc) + +``` +global record ClimateDesc new: function(): ClimateDesc + id: string + desc: ModelMetadata.Description + category: string + order: integer + visible: boolean + mapColoring: PreviewColoring + economy: string + environment: string + defaultNames: string +end +``` + +Contains all data relevant for the climate + +### ClimateDesc.new[πŸ”—](#$api.type~ClimateDesc.new) + +``` +function ClimateDesc.new(): ClimateDesc +``` + +Creates a new, empty climate description + +**Returns** + +1. `ClimateDesc` + +### ClimateDesc.id[πŸ”—](#$api.type~ClimateDesc.id) + +``` +ClimateDesc.id: string +``` + +Unique identifier for te climate + +### ClimateDesc.desc[πŸ”—](#$api.type~ClimateDesc.desc) + +``` +ClimateDesc.desc: ModelMetadata.Description +``` + +Localized strings and icons paths for user interface + +### ClimateDesc.category[πŸ”—](#$api.type~ClimateDesc.category) + +``` +ClimateDesc.category: string +``` + +Category for content selection: only objects with matching categories in categoryList will be availalbe in a +game + +### ClimateDesc.order[πŸ”—](#$api.type~ClimateDesc.order) + +``` +ClimateDesc.order: integer +``` + +Order for UI sorting + +### ClimateDesc.visible[πŸ”—](#$api.type~ClimateDesc.visible) + +``` +ClimateDesc.visible: boolean +``` + +Configure visibility of clima zones in the selection screen + +### ClimateDesc.mapColoring[πŸ”—](#$api.type~ClimateDesc.mapColoring) + +``` +ClimateDesc.mapColoring: PreviewColoring +``` + +Configures minimap preview in colors and look and feel + +### ClimateDesc.economy[πŸ”—](#$api.type~ClimateDesc.economy) + +``` +ClimateDesc.economy: string +``` + +Default economy for the climate zone + +### ClimateDesc.environment[πŸ”—](#$api.type~ClimateDesc.environment) + +``` +ClimateDesc.environment: string +``` + +Default environment for the cliamte zone + +### ClimateDesc.defaultNames[πŸ”—](#$api.type~ClimateDesc.defaultNames) + +``` +ClimateDesc.defaultNames: string +``` + +Default name lists for the cliate zone + +### Clock[πŸ”—](#$api.type~Clock) + +``` +global record Clock new: function(): Clock + getTime: function(Clock): integer +end +``` + +A very precise clock. + +### Clock.new[πŸ”—](#$api.type~Clock.new) + +``` +function Clock.new(): Clock +``` + +Constructs a new intance of a clock and starts its timer + +**Returns** + +1. `Clock` + +### Clock.getTime[πŸ”—](#$api.type~Clock.getTime) + +``` +function Clock.getTime(Clock): integer +``` + +Get elapsed time since clock construction in microseconds + +**Parameters** + +* `Clock` + +**Returns** + +1. `integer` + +### Collider[πŸ”—](#$api.type~Collider) + +``` +[Expand All] [Collapse All] + +global record Collider record Type NONE: Type + BOX: Type + CYLINDER: Type + POINT_CLOUD: Type +end + record Box halfExtents: Vec3f +end + record Cylinder halfExtents: Vec3f +end + record PointCloud points: {Vec3f} +end + transf: Mat4f + type: Type + box: Box + cylinder: Cylinder + pointCloud: PointCloud +end +``` + +Information about the collider of the model + +### Collider.Type[πŸ”—](#$api.type~Collider.Type) + +``` +record Collider.Type NONE: Type + BOX: Type + CYLINDER: Type + POINT_CLOUD: Type +end +``` + +### Collider.Type.NONE[πŸ”—](#$api.type~Collider.Type.NONE) + +``` +Collider.Type.NONE: Type +``` + +### Collider.Type.BOX[πŸ”—](#$api.type~Collider.Type.BOX) + +``` +Collider.Type.BOX: Type +``` + +### Collider.Type.CYLINDER[πŸ”—](#$api.type~Collider.Type.CYLINDER) + +``` +Collider.Type.CYLINDER: Type +``` + +### Collider.Type.POINT\_CLOUD[πŸ”—](#$api.type~Collider.Type.POINT_CLOUD) + +``` +Collider.Type.POINT_CLOUD: Type +``` + +### Collider.Box[πŸ”—](#$api.type~Collider.Box) + +``` +record Collider.Box halfExtents: Vec3f +end +``` + +A rectangular parallelepiped used for colliders + +### Collider.Box.halfExtents[πŸ”—](#$api.type~Collider.Box.halfExtents) + +``` +Collider.Box.halfExtents: Vec3f +``` + +Distance from transform position to define the cuboid (in the direction relative to the transform) + +### Collider.Cylinder[πŸ”—](#$api.type~Collider.Cylinder) + +``` +record Collider.Cylinder halfExtents: Vec3f +end +``` + +A cylinder used for colliders + +### Collider.Cylinder.halfExtents[πŸ”—](#$api.type~Collider.Cylinder.halfExtents) + +``` +Collider.Cylinder.halfExtents: Vec3f +``` + +The dimensions from the center the cylinder extends to. Before being transformed. + +### Collider.PointCloud[πŸ”—](#$api.type~Collider.PointCloud) + +``` +record Collider.PointCloud points: {Vec3f} +end +``` + +A set of points used for collision + +### Collider.PointCloud.points[πŸ”—](#$api.type~Collider.PointCloud.points) + +``` +Collider.PointCloud.points: {Vec3f} +``` + +A list of points specifying all collision points + +### Collider.transf[πŸ”—](#$api.type~Collider.transf) + +``` +Collider.transf: Mat4f +``` + +The transform of the collider, relative to which the other data is transformed + +### Collider.type[πŸ”—](#$api.type~Collider.type) + +``` +Collider.type: Type +``` + +The type of collider + +### Collider.box[πŸ”—](#$api.type~Collider.box) + +``` +Collider.box: Box +``` + +Only if type == 1, a collider with a cuboidal shape + +### Collider.cylinder[πŸ”—](#$api.type~Collider.cylinder) + +``` +Collider.cylinder: Cylinder +``` + +Only if type == 2, a collider with a cylindrical shape + +### Collider.pointCloud[πŸ”—](#$api.type~Collider.pointCloud) + +``` +Collider.pointCloud: PointCloud +``` + +Only if type == 3, a collider made up of a set of points + +### CommandProgress[πŸ”—](#$api.type~CommandProgress) + +``` +global record CommandProgress new: function(): CommandProgress + get: function(CommandProgress): number +end +``` + +Command progress tracker + +### CommandProgress.new[πŸ”—](#$api.type~CommandProgress.new) + +``` +function CommandProgress.new(): CommandProgress +``` + +**Returns** + +1. `CommandProgress` + +### CommandProgress.get[πŸ”—](#$api.type~CommandProgress.get) + +``` +function CommandProgress.get(CommandProgress): number +``` + +**Parameters** + +* `CommandProgress` + +**Returns** + +1. `number` + +### CompanyValue[πŸ”—](#$api.type~CompanyValue) + +``` +global record CompanyValue totalScore: integer + railVehicles: integer + trams: integer + roadVehicles: integer + aircrafts: integer + ships: integer + trackTotalLength: integer + trackElectricLength: integer + bridgeTotalLength: integer + tunnelTotalLength: integer + roadTotalLength: integer + suppliedTowns: integer + connectedIndustries: integer + numberOfLines: integer + totalStations: integer + railStations: integer + tramStations: integer + roadStations: integer + aircraftStations: integer + shipStations: integer + topSpeed: number + topLength: number + oldestTransportVehicle: integer + balance: integer + totalAssets: integer + debt: integer +end +``` + +A structure that holds information about the company's value + +### CompanyValue.totalScore[πŸ”—](#$api.type~CompanyValue.totalScore) + +``` +CompanyValue.totalScore: integer +``` + +### CompanyValue.railVehicles[πŸ”—](#$api.type~CompanyValue.railVehicles) + +``` +CompanyValue.railVehicles: integer +``` + +### CompanyValue.trams[πŸ”—](#$api.type~CompanyValue.trams) + +``` +CompanyValue.trams: integer +``` + +### CompanyValue.roadVehicles[πŸ”—](#$api.type~CompanyValue.roadVehicles) + +``` +CompanyValue.roadVehicles: integer +``` + +### CompanyValue.aircrafts[πŸ”—](#$api.type~CompanyValue.aircrafts) + +``` +CompanyValue.aircrafts: integer +``` + +### CompanyValue.ships[πŸ”—](#$api.type~CompanyValue.ships) + +``` +CompanyValue.ships: integer +``` + +### CompanyValue.trackTotalLength[πŸ”—](#$api.type~CompanyValue.trackTotalLength) + +``` +CompanyValue.trackTotalLength: integer +``` + +### CompanyValue.trackElectricLength[πŸ”—](#$api.type~CompanyValue.trackElectricLength) + +``` +CompanyValue.trackElectricLength: integer +``` + +### CompanyValue.bridgeTotalLength[πŸ”—](#$api.type~CompanyValue.bridgeTotalLength) + +``` +CompanyValue.bridgeTotalLength: integer +``` + +### CompanyValue.tunnelTotalLength[πŸ”—](#$api.type~CompanyValue.tunnelTotalLength) + +``` +CompanyValue.tunnelTotalLength: integer +``` + +### CompanyValue.roadTotalLength[πŸ”—](#$api.type~CompanyValue.roadTotalLength) + +``` +CompanyValue.roadTotalLength: integer +``` + +### CompanyValue.suppliedTowns[πŸ”—](#$api.type~CompanyValue.suppliedTowns) + +``` +CompanyValue.suppliedTowns: integer +``` + +### CompanyValue.connectedIndustries[πŸ”—](#$api.type~CompanyValue.connectedIndustries) + +``` +CompanyValue.connectedIndustries: integer +``` + +### CompanyValue.numberOfLines[πŸ”—](#$api.type~CompanyValue.numberOfLines) + +``` +CompanyValue.numberOfLines: integer +``` + +### CompanyValue.totalStations[πŸ”—](#$api.type~CompanyValue.totalStations) + +``` +CompanyValue.totalStations: integer +``` + +### CompanyValue.railStations[πŸ”—](#$api.type~CompanyValue.railStations) + +``` +CompanyValue.railStations: integer +``` + +### CompanyValue.tramStations[πŸ”—](#$api.type~CompanyValue.tramStations) + +``` +CompanyValue.tramStations: integer +``` + +### CompanyValue.roadStations[πŸ”—](#$api.type~CompanyValue.roadStations) + +``` +CompanyValue.roadStations: integer +``` + +### CompanyValue.aircraftStations[πŸ”—](#$api.type~CompanyValue.aircraftStations) + +``` +CompanyValue.aircraftStations: integer +``` + +### CompanyValue.shipStations[πŸ”—](#$api.type~CompanyValue.shipStations) + +``` +CompanyValue.shipStations: integer +``` + +### CompanyValue.topSpeed[πŸ”—](#$api.type~CompanyValue.topSpeed) + +``` +CompanyValue.topSpeed: number +``` + +### CompanyValue.topLength[πŸ”—](#$api.type~CompanyValue.topLength) + +``` +CompanyValue.topLength: number +``` + +### CompanyValue.oldestTransportVehicle[πŸ”—](#$api.type~CompanyValue.oldestTransportVehicle) + +``` +CompanyValue.oldestTransportVehicle: integer +``` + +### CompanyValue.balance[πŸ”—](#$api.type~CompanyValue.balance) + +``` +CompanyValue.balance: integer +``` + +### CompanyValue.totalAssets[πŸ”—](#$api.type~CompanyValue.totalAssets) + +``` +CompanyValue.totalAssets: integer +``` + +### CompanyValue.debt[πŸ”—](#$api.type~CompanyValue.debt) + +``` +CompanyValue.debt: integer +``` + +### ComponentCustomState[πŸ”—](#$api.type~ComponentCustomState) + +``` +global record ComponentCustomState new: function(): ComponentCustomState + + state: { : } +end +``` + +A custom component might contain any data in form of a lua table (without functions) and can used with custom +scripts to create new custom objects in game + +### ComponentCustomState.new()[πŸ”—](#$api.type~ComponentCustomState.new()) + +``` +function ComponentCustomState.new()(): ComponentCustomState +``` + +**Returns** + +1. `ComponentCustomState` + +### ComponentCustomState.new(ComponentCustomState)[πŸ”—](#$api.type~ComponentCustomState.new(ComponentCustomState)) + +``` +function ComponentCustomState.new(ComponentCustomState)(ComponentCustomState): Engine.Component.Line +``` + +**Parameters** + +* `ComponentCustomState` + +**Returns** + +1. `Engine.Component.Line` + +### ComponentCustomState.state[πŸ”—](#$api.type~ComponentCustomState.state) + +``` +ComponentCustomState.state: { : } +``` + +Any lua table, as long as it is serializable + +### Connection[πŸ”—](#$api.type~Connection) + +``` +global record Connection disconnect: function(Connection) +end +``` + +An object used to disconnect callbacks. + +### Connection.disconnect[πŸ”—](#$api.type~Connection.disconnect) + +``` +function Connection.disconnect(Connection) +``` + +The callback will be no longer called + +**Parameters** + +* `Connection` + +### ConsoleGen[πŸ”—](#$api.type~ConsoleGen) + +``` +global record ConsoleGen Gen9pro: ConsoleGen + Gen9standard: ConsoleGen + Gen9base: ConsoleGen + PC: ConsoleGen +end +``` + +### ConsoleGen.Gen9pro[πŸ”—](#$api.type~ConsoleGen.Gen9pro) + +``` +ConsoleGen.Gen9pro: ConsoleGen +``` + +### ConsoleGen.Gen9standard[πŸ”—](#$api.type~ConsoleGen.Gen9standard) + +``` +ConsoleGen.Gen9standard: ConsoleGen +``` + +### ConsoleGen.Gen9base[πŸ”—](#$api.type~ConsoleGen.Gen9base) + +``` +ConsoleGen.Gen9base: ConsoleGen +``` + +### ConsoleGen.PC[πŸ”—](#$api.type~ConsoleGen.PC) + +``` +ConsoleGen.PC: ConsoleGen +``` + +### ConstructionDesc[πŸ”—](#$api.type~ConstructionDesc) + +``` +[Expand All] [Collapse All] + +global record ConstructionDesc record SnapConfig rail: boolean + road: boolean + water: boolean +end + record EdgeObject minDistToCrossing: number + snapToStreet: boolean + snapToTrack: boolean + catchmentCargo: boolean + catchmentPassengers: boolean + catchmentAreaRadius: number +end + new: function(ConstructionDesc): ConstructionDesc + updateScript: ScriptRef + configureLayerScript: ScriptRef + configureHudIconsScript: ScriptRef + hudIconScript: ScriptRef + entityWindowScript: ScriptRef + fileName: string + availability: ModelMetadata.Availability + soundConfig: ModelMetadata.SoundConfig + description: ModelMetadata.Description + categoryList: ModelMetadata.CategoryList + params: {ScriptParam} + categories: {string} + order: number + menuCategory: ModelMetadata.MenuCategory + constructionTemplates: {ConstructionTemplate} + constructionTemplates_native: Vector + placementTag: string + metadata: ConstructionDescMetadata + snapping: SnapConfig + undergroundView: boolean + heightAdjustable: boolean + isIndustry: boolean + edgeObject: EdgeObject + townBuildingParams: TownBuildingParams +end +``` + +Describes a construction + +### ConstructionDesc.SnapConfig[πŸ”—](#$api.type~ConstructionDesc.SnapConfig) + +``` +record ConstructionDesc.SnapConfig rail: boolean + road: boolean + water: boolean +end +``` + +### ConstructionDesc.SnapConfig.rail[πŸ”—](#$api.type~ConstructionDesc.SnapConfig.rail) + +``` +ConstructionDesc.SnapConfig.rail: boolean +``` + +### ConstructionDesc.SnapConfig.road[πŸ”—](#$api.type~ConstructionDesc.SnapConfig.road) + +``` +ConstructionDesc.SnapConfig.road: boolean +``` + +### ConstructionDesc.SnapConfig.water[πŸ”—](#$api.type~ConstructionDesc.SnapConfig.water) + +``` +ConstructionDesc.SnapConfig.water: boolean +``` + +### ConstructionDesc.EdgeObject[πŸ”—](#$api.type~ConstructionDesc.EdgeObject) + +``` +record ConstructionDesc.EdgeObject minDistToCrossing: number + snapToStreet: boolean + snapToTrack: boolean + catchmentCargo: boolean + catchmentPassengers: boolean + catchmentAreaRadius: number +end +``` + +### ConstructionDesc.EdgeObject.minDistToCrossing[πŸ”—](#$api.type~ConstructionDesc.EdgeObject.minDistToCrossing) + +``` +ConstructionDesc.EdgeObject.minDistToCrossing: number +``` + +Minimum distance to crossings (in meters) + +### ConstructionDesc.EdgeObject.snapToStreet[πŸ”—](#$api.type~ConstructionDesc.EdgeObject.snapToStreet) + +``` +ConstructionDesc.EdgeObject.snapToStreet: boolean +``` + +Whether edge object snaps to streets + +### ConstructionDesc.EdgeObject.snapToTrack[πŸ”—](#$api.type~ConstructionDesc.EdgeObject.snapToTrack) + +``` +ConstructionDesc.EdgeObject.snapToTrack: boolean +``` + +Whether edge object snaps to tracks + +### ConstructionDesc.EdgeObject.catchmentCargo[πŸ”—](#$api.type~ConstructionDesc.EdgeObject.catchmentCargo) + +``` +ConstructionDesc.EdgeObject.catchmentCargo: boolean +``` + +Whether edge object has cargo catchment area + +### ConstructionDesc.EdgeObject.catchmentPassengers[πŸ”—](#$api.type~ConstructionDesc.EdgeObject.catchmentPassengers) + +``` +ConstructionDesc.EdgeObject.catchmentPassengers: boolean +``` + +Whether edge object has passenger catchment area + +### ConstructionDesc.EdgeObject.catchmentAreaRadius[πŸ”—](#$api.type~ConstructionDesc.EdgeObject.catchmentAreaRadius) + +``` +ConstructionDesc.EdgeObject.catchmentAreaRadius: number +``` + +Catchment area radius (in meters) + +### ConstructionDesc.new[πŸ”—](#$api.type~ConstructionDesc.new) + +``` +function ConstructionDesc.new(ConstructionDesc): ConstructionDesc +``` + +**Parameters** + +* `ConstructionDesc` + +**Returns** + +1. `ConstructionDesc` + +### ConstructionDesc.updateScript[πŸ”—](#$api.type~ConstructionDesc.updateScript) + +``` +ConstructionDesc.updateScript: ScriptRef +``` + +### ConstructionDesc.configureLayerScript[πŸ”—](#$api.type~ConstructionDesc.configureLayerScript) + +``` +ConstructionDesc.configureLayerScript: ScriptRef +``` + +### ConstructionDesc.configureHudIconsScript[πŸ”—](#$api.type~ConstructionDesc.configureHudIconsScript) + +``` +ConstructionDesc.configureHudIconsScript: ScriptRef +``` + +### ConstructionDesc.hudIconScript[πŸ”—](#$api.type~ConstructionDesc.hudIconScript) + +``` +ConstructionDesc.hudIconScript: ScriptRef +``` + +### ConstructionDesc.entityWindowScript[πŸ”—](#$api.type~ConstructionDesc.entityWindowScript) + +``` +ConstructionDesc.entityWindowScript: ScriptRef +``` + +### ConstructionDesc.fileName[πŸ”—](#$api.type~ConstructionDesc.fileName) + +``` +ConstructionDesc.fileName: string +``` + +A file name or unique identifier for the construction. + +### ConstructionDesc.availability[πŸ”—](#$api.type~ConstructionDesc.availability) + +``` +ConstructionDesc.availability: ModelMetadata.Availability +``` + +### ConstructionDesc.soundConfig[πŸ”—](#$api.type~ConstructionDesc.soundConfig) + +``` +ConstructionDesc.soundConfig: ModelMetadata.SoundConfig +``` + +Defines the sound emitted by the model when in-game + +### ConstructionDesc.description[πŸ”—](#$api.type~ConstructionDesc.description) + +``` +ConstructionDesc.description: ModelMetadata.Description +``` + +### ConstructionDesc.categoryList[πŸ”—](#$api.type~ConstructionDesc.categoryList) + +``` +ConstructionDesc.categoryList: ModelMetadata.CategoryList +``` + +### ConstructionDesc.params[πŸ”—](#$api.type~ConstructionDesc.params) + +``` +ConstructionDesc.params: {ScriptParam} +``` + +A list of parameters that can be used to configure the construction. + +### ConstructionDesc.categories[πŸ”—](#$api.type~ConstructionDesc.categories) + +``` +ConstructionDesc.categories: {string} +``` + +### ConstructionDesc.order[πŸ”—](#$api.type~ConstructionDesc.order) + +``` +ConstructionDesc.order: number +``` + +### ConstructionDesc.menuCategory[πŸ”—](#$api.type~ConstructionDesc.menuCategory) + +``` +ConstructionDesc.menuCategory: ModelMetadata.MenuCategory +``` + +### ConstructionDesc.constructionTemplates[πŸ”—](#$api.type~ConstructionDesc.constructionTemplates) + +``` +ConstructionDesc.constructionTemplates: {ConstructionTemplate} +``` + +[DEPRECATED] Use metaconstructions instead + +### ConstructionDesc.constructionTemplates\_native[πŸ”—](#$api.type~ConstructionDesc.constructionTemplates_native) + +``` +ConstructionDesc.constructionTemplates_native: Vector +``` + +[DEPRECATED] Use metaconstructions instead + +### ConstructionDesc.placementTag[πŸ”—](#$api.type~ConstructionDesc.placementTag) + +``` +ConstructionDesc.placementTag: string +``` + +### ConstructionDesc.metadata[πŸ”—](#$api.type~ConstructionDesc.metadata) + +``` +ConstructionDesc.metadata: ConstructionDescMetadata +``` + +### ConstructionDesc.snapping[πŸ”—](#$api.type~ConstructionDesc.snapping) + +``` +ConstructionDesc.snapping: SnapConfig +``` + +### ConstructionDesc.undergroundView[πŸ”—](#$api.type~ConstructionDesc.undergroundView) + +``` +ConstructionDesc.undergroundView: boolean +``` + +### ConstructionDesc.heightAdjustable[πŸ”—](#$api.type~ConstructionDesc.heightAdjustable) + +``` +ConstructionDesc.heightAdjustable: boolean +``` + +### ConstructionDesc.isIndustry[πŸ”—](#$api.type~ConstructionDesc.isIndustry) + +``` +ConstructionDesc.isIndustry: boolean +``` + +### ConstructionDesc.edgeObject[πŸ”—](#$api.type~ConstructionDesc.edgeObject) + +``` +ConstructionDesc.edgeObject: EdgeObject +``` + +Optional edge object configuration + +### ConstructionDesc.townBuildingParams[πŸ”—](#$api.type~ConstructionDesc.townBuildingParams) + +``` +ConstructionDesc.townBuildingParams: TownBuildingParams +``` + +### ConstructionDescMetadata[πŸ”—](#$api.type~ConstructionDescMetadata) + +``` +[Expand All] [Collapse All] + +global record ConstructionDescMetadata record EmissionConfig noise: number + pollution: number +end + emissionConfig: EmissionConfig +end +``` + +### ConstructionDescMetadata.EmissionConfig[πŸ”—](#$api.type~ConstructionDescMetadata.EmissionConfig) + +``` +record ConstructionDescMetadata.EmissionConfig noise: number + pollution: number +end +``` + +### ConstructionDescMetadata.EmissionConfig.noise[πŸ”—](#$api.type~ConstructionDescMetadata.EmissionConfig.noise) + +``` +ConstructionDescMetadata.EmissionConfig.noise: number +``` + +### ConstructionDescMetadata.EmissionConfig.pollution[πŸ”—](#$api.type~ConstructionDescMetadata.EmissionConfig.pollution) + +``` +ConstructionDescMetadata.EmissionConfig.pollution: number +``` + +### ConstructionDescMetadata.emissionConfig[πŸ”—](#$api.type~ConstructionDescMetadata.emissionConfig) + +``` +ConstructionDescMetadata.emissionConfig: EmissionConfig +``` + +### ConstructionId[πŸ”—](#$api.type~ConstructionId) + +``` +global type ConstructionId = integer +``` + +### ConstructionInstanceMetadata[πŸ”—](#$api.type~ConstructionInstanceMetadata) + +``` +global record ConstructionInstanceMetadata costScaleFactor: number +end +``` + +### ConstructionInstanceMetadata.costScaleFactor[πŸ”—](#$api.type~ConstructionInstanceMetadata.costScaleFactor) + +``` +ConstructionInstanceMetadata.costScaleFactor: number +``` + +### ConstructionResult[πŸ”—](#$api.type~ConstructionResult) + +``` +global record ConstructionResult subconstructions: {Proposal.Subconstruction} + metadata: ConstructionInstanceMetadata + cost: number + maintenanceCost: number + maintenanceCarrier: string + streetTerminal: Proposal.StreetTerminal + params: { : } +end +``` + +Contains the processed result of a construction + +### ConstructionResult.subconstructions[πŸ”—](#$api.type~ConstructionResult.subconstructions) + +``` +ConstructionResult.subconstructions: {Proposal.Subconstruction} +``` + +### ConstructionResult.metadata[πŸ”—](#$api.type~ConstructionResult.metadata) + +``` +ConstructionResult.metadata: ConstructionInstanceMetadata +``` + +### ConstructionResult.cost[πŸ”—](#$api.type~ConstructionResult.cost) + +``` +ConstructionResult.cost: number +``` + +### ConstructionResult.maintenanceCost[πŸ”—](#$api.type~ConstructionResult.maintenanceCost) + +``` +ConstructionResult.maintenanceCost: number +``` + +### ConstructionResult.maintenanceCarrier[πŸ”—](#$api.type~ConstructionResult.maintenanceCarrier) + +``` +ConstructionResult.maintenanceCarrier: string +``` + +### ConstructionResult.streetTerminal[πŸ”—](#$api.type~ConstructionResult.streetTerminal) + +``` +ConstructionResult.streetTerminal: Proposal.StreetTerminal +``` + +### ConstructionResult.params[πŸ”—](#$api.type~ConstructionResult.params) + +``` +ConstructionResult.params: { : } +``` + +### ConstructionScriptParam[πŸ”—](#$api.type~ConstructionScriptParam) + +``` +[Expand All] [Collapse All] + +global record ConstructionScriptParam enum Type "Button" + "CheckBox" + "ComboBox" + "IconButton" + "Slider" +end + enum Location "Default" + "Toolbar" +end + enum DisplayMode "Compact" + "Default" + "Horizontal" + "Sparse" + "Vertical" +end + key: string + name: string + group: string + tooltip: string + values: {string} + numbers: {number} + tooltips: {string} + postConstructionModifiable: boolean + hideLabel: boolean + images: {string} + defaultIndex: Index + uiType: Type + location: Location + displayMode: DisplayMode + tags: {string} + yearFrom: integer + yearTo: integer + checkEnabledScript: ScriptRef + stepValueScript: ScriptRef + formatValueScript: ScriptRef +end +``` + +### ConstructionScriptParam.Type[πŸ”—](#$api.type~ConstructionScriptParam.Type) + +``` +enum ConstructionScriptParam.Type "Button" + "CheckBox" + "ComboBox" + "IconButton" + "Slider" +end +``` + +### ConstructionScriptParam.Type."Button"[πŸ”—](#$api.type~ConstructionScriptParam.Type.) + +Push button + +### ConstructionScriptParam.Type."CheckBox"[πŸ”—](#$api.type~ConstructionScriptParam.Type.) + +Check box + +### ConstructionScriptParam.Type."ComboBox"[πŸ”—](#$api.type~ConstructionScriptParam.Type.) + +Drop-down combo box + +### ConstructionScriptParam.Type."IconButton"[πŸ”—](#$api.type~ConstructionScriptParam.Type.) + +Button with an icon + +### ConstructionScriptParam.Type."Slider"[πŸ”—](#$api.type~ConstructionScriptParam.Type.) + +Slider + +### ConstructionScriptParam.Location[πŸ”—](#$api.type~ConstructionScriptParam.Location) + +``` +enum ConstructionScriptParam.Location "Default" + "Toolbar" +end +``` + +### ConstructionScriptParam.Location."Default"[πŸ”—](#$api.type~ConstructionScriptParam.Location.) + +Default construction parameter panel + +### ConstructionScriptParam.Location."Toolbar"[πŸ”—](#$api.type~ConstructionScriptParam.Location.) + +Toolbar area of construction panel + +### ConstructionScriptParam.DisplayMode[πŸ”—](#$api.type~ConstructionScriptParam.DisplayMode) + +``` +enum ConstructionScriptParam.DisplayMode "Compact" + "Default" + "Horizontal" + "Sparse" + "Vertical" +end +``` + +### ConstructionScriptParam.DisplayMode."Compact"[πŸ”—](#$api.type~ConstructionScriptParam.DisplayMode.) + +Value is collapsed, full parameter is shown in a callout + +### ConstructionScriptParam.DisplayMode."Default"[πŸ”—](#$api.type~ConstructionScriptParam.DisplayMode.) + +For BottomBar==on is Horizontal, for BottomBar==off is Sparse + +### ConstructionScriptParam.DisplayMode."Horizontal"[πŸ”—](#$api.type~ConstructionScriptParam.DisplayMode.) + +Label is shown left of value + +### ConstructionScriptParam.DisplayMode."Sparse"[πŸ”—](#$api.type~ConstructionScriptParam.DisplayMode.) + +Label is shown above the value, and the value might grow to multiple lines + +### ConstructionScriptParam.DisplayMode."Vertical"[πŸ”—](#$api.type~ConstructionScriptParam.DisplayMode.) + +Label is shown above value + +### ConstructionScriptParam.key[πŸ”—](#$api.type~ConstructionScriptParam.key) + +``` +ConstructionScriptParam.key: string +``` + +Unique key that is passed to the construction functions + +### ConstructionScriptParam.name[πŸ”—](#$api.type~ConstructionScriptParam.name) + +``` +ConstructionScriptParam.name: string +``` + +Display name + +### ConstructionScriptParam.group[πŸ”—](#$api.type~ConstructionScriptParam.group) + +``` +ConstructionScriptParam.group: string +``` + +Display Group: +- If hideLabel is true, items will be grouped horizontally +- Else items will be separated by a divider + +### ConstructionScriptParam.tooltip[πŸ”—](#$api.type~ConstructionScriptParam.tooltip) + +``` +ConstructionScriptParam.tooltip: string +``` + +Tooltip to display over certain parameters + +### ConstructionScriptParam.values[πŸ”—](#$api.type~ConstructionScriptParam.values) + +``` +ConstructionScriptParam.values: {string} +``` + +All display values of the params + +### ConstructionScriptParam.numbers[πŸ”—](#$api.type~ConstructionScriptParam.numbers) + +``` +ConstructionScriptParam.numbers: {number} +``` + +Specified return values instead of default 1, 2, 3... + +### ConstructionScriptParam.tooltips[πŸ”—](#$api.type~ConstructionScriptParam.tooltips) + +``` +ConstructionScriptParam.tooltips: {string} +``` + +Tooltips for the individual values + +### ConstructionScriptParam.postConstructionModifiable[πŸ”—](#$api.type~ConstructionScriptParam.postConstructionModifiable) + +``` +ConstructionScriptParam.postConstructionModifiable: boolean +``` + +This param can be changed when the construction is already built + +### ConstructionScriptParam.hideLabel[πŸ”—](#$api.type~ConstructionScriptParam.hideLabel) + +``` +ConstructionScriptParam.hideLabel: boolean +``` + +Allow to hide the label + +### ConstructionScriptParam.images[πŸ”—](#$api.type~ConstructionScriptParam.images) + +``` +ConstructionScriptParam.images: {string} +``` + +Image representations of the values (for Compact Mode) + +### ConstructionScriptParam.defaultIndex[πŸ”—](#$api.type~ConstructionScriptParam.defaultIndex) + +``` +ConstructionScriptParam.defaultIndex: Index +``` + +Default index/state + +### ConstructionScriptParam.uiType[πŸ”—](#$api.type~ConstructionScriptParam.uiType) + +``` +ConstructionScriptParam.uiType: Type +``` + +Type of ui shown in user interface selection + +### ConstructionScriptParam.location[πŸ”—](#$api.type~ConstructionScriptParam.location) + +``` +ConstructionScriptParam.location: Location +``` + +construction menu has two possible locations for parameters: default or toolbar + +### ConstructionScriptParam.displayMode[πŸ”—](#$api.type~ConstructionScriptParam.displayMode) + +``` +ConstructionScriptParam.displayMode: DisplayMode +``` + +displayMode controls whether the parameter is displayed in default or compact mode + +### ConstructionScriptParam.tags[πŸ”—](#$api.type~ConstructionScriptParam.tags) + +``` +ConstructionScriptParam.tags: {string} +``` + +Tags associated with the script param for filtering + +### ConstructionScriptParam.yearFrom[πŸ”—](#$api.type~ConstructionScriptParam.yearFrom) + +``` +ConstructionScriptParam.yearFrom: integer +``` + +Availability from + +### ConstructionScriptParam.yearTo[πŸ”—](#$api.type~ConstructionScriptParam.yearTo) + +``` +ConstructionScriptParam.yearTo: integer +``` + +Availability to + +### ConstructionScriptParam.checkEnabledScript[πŸ”—](#$api.type~ConstructionScriptParam.checkEnabledScript) + +``` +ConstructionScriptParam.checkEnabledScript: ScriptRef +``` + +callback function to allow dynamic disabling or hiding of the paramter +function(params : {string : number}, scriptRefParams : table) : ConstructionMenuParam.CheckEnabledResult + +### ConstructionScriptParam.stepValueScript[πŸ”—](#$api.type~ConstructionScriptParam.stepValueScript) + +``` +ConstructionScriptParam.stepValueScript: ScriptRef +``` + +callback function to allow returning any value on input actions +function(value : number, direction : integer, precise : boolean) : number + +### ConstructionScriptParam.formatValueScript[πŸ”—](#$api.type~ConstructionScriptParam.formatValueScript) + +``` +ConstructionScriptParam.formatValueScript: ScriptRef +``` + +callback function to allow formatting the value display in the UI +function(value : number) : string + +### ConstructionTemplate[πŸ”—](#$api.type~ConstructionTemplate) + +``` +global record ConstructionTemplate availability: ModelMetadata.Availability + desc: ModelMetadata.Description + data: ConstructionTemplateData + menuCategory: ModelMetadata.MenuCategory + builderAudioRes: ResName + configureHudIconsScript: ScriptRef +end +``` + +Construction template with availability and type information + +### ConstructionTemplate.availability[πŸ”—](#$api.type~ConstructionTemplate.availability) + +``` +ConstructionTemplate.availability: ModelMetadata.Availability +``` + +Specific availability (date) for the template (optional) + +### ConstructionTemplate.desc[πŸ”—](#$api.type~ConstructionTemplate.desc) + +``` +ConstructionTemplate.desc: ModelMetadata.Description +``` + +Localized strings and icons paths for user interface + +### ConstructionTemplate.data[πŸ”—](#$api.type~ConstructionTemplate.data) + +``` +ConstructionTemplate.data: ConstructionTemplateData +``` + +Additional slot configuration and params + +### ConstructionTemplate.menuCategory[πŸ”—](#$api.type~ConstructionTemplate.menuCategory) + +``` +ConstructionTemplate.menuCategory: ModelMetadata.MenuCategory +``` + +Configure category, order and filter behaviour in the construction menu + +### ConstructionTemplate.builderAudioRes[πŸ”—](#$api.type~ConstructionTemplate.builderAudioRes) + +``` +ConstructionTemplate.builderAudioRes: ResName +``` + +### ConstructionTemplate.configureHudIconsScript[πŸ”—](#$api.type~ConstructionTemplate.configureHudIconsScript) + +``` +ConstructionTemplate.configureHudIconsScript: ScriptRef +``` + +### ConstructionTemplateData[πŸ”—](#$api.type~ConstructionTemplateData) + +``` +global record ConstructionTemplateData initialModules: {ResName : integer} + params: {ScriptParam} +end +``` + +Specify additional variants of the construction by providing a list of modules and the slot in which they belong + +### ConstructionTemplateData.initialModules[πŸ”—](#$api.type~ConstructionTemplateData.initialModules) + +``` +ConstructionTemplateData.initialModules: {ResName : integer} +``` + +List of modules that come with the construction + +### ConstructionTemplateData.params[πŸ”—](#$api.type~ConstructionTemplateData.params) + +``` +ConstructionTemplateData.params: {ScriptParam} +``` + +Additional scriptparams that are used for this specific template + +### ConstructionType[πŸ”—](#$api.type~ConstructionType) + +``` +global record ConstructionType STREET_STATION: ConstructionType + RAIL_STATION: ConstructionType + AIRPORT: ConstructionType + HARBOR: ConstructionType + STREET_STATION_CARGO: ConstructionType + RAIL_STATION_CARGO: ConstructionType + HARBOR_CARGO: ConstructionType + STREET_DEPOT: ConstructionType + RAIL_DEPOT: ConstructionType + WATER_DEPOT: ConstructionType + INDUSTRY: ConstructionType + WAREHOUSE: ConstructionType + ASSET_DEFAULT: ConstructionType + ASSET_TRACK: ConstructionType + TOWN_BUILDING: ConstructionType + STREET_CONSTRUCTION: ConstructionType + NONE: ConstructionType + AIRPORT_CARGO: ConstructionType + TRACK_CONSTRUCTION: ConstructionType + WATER_WAYPOINT: ConstructionType +end +``` + +Type of the construction for displaying in the correct UI category and controlling specific behaviour for the type. + +### ConstructionType.STREET\_STATION[πŸ”—](#$api.type~ConstructionType.STREET_STATION) + +``` +ConstructionType.STREET_STATION: ConstructionType +``` + +### ConstructionType.RAIL\_STATION[πŸ”—](#$api.type~ConstructionType.RAIL_STATION) + +``` +ConstructionType.RAIL_STATION: ConstructionType +``` + +### ConstructionType.AIRPORT[πŸ”—](#$api.type~ConstructionType.AIRPORT) + +``` +ConstructionType.AIRPORT: ConstructionType +``` + +### ConstructionType.HARBOR[πŸ”—](#$api.type~ConstructionType.HARBOR) + +``` +ConstructionType.HARBOR: ConstructionType +``` + +### ConstructionType.STREET\_STATION\_CARGO[πŸ”—](#$api.type~ConstructionType.STREET_STATION_CARGO) + +``` +ConstructionType.STREET_STATION_CARGO: ConstructionType +``` + +### ConstructionType.RAIL\_STATION\_CARGO[πŸ”—](#$api.type~ConstructionType.RAIL_STATION_CARGO) + +``` +ConstructionType.RAIL_STATION_CARGO: ConstructionType +``` + +### ConstructionType.HARBOR\_CARGO[πŸ”—](#$api.type~ConstructionType.HARBOR_CARGO) + +``` +ConstructionType.HARBOR_CARGO: ConstructionType +``` + +### ConstructionType.STREET\_DEPOT[πŸ”—](#$api.type~ConstructionType.STREET_DEPOT) + +``` +ConstructionType.STREET_DEPOT: ConstructionType +``` + +### ConstructionType.RAIL\_DEPOT[πŸ”—](#$api.type~ConstructionType.RAIL_DEPOT) + +``` +ConstructionType.RAIL_DEPOT: ConstructionType +``` + +### ConstructionType.WATER\_DEPOT[πŸ”—](#$api.type~ConstructionType.WATER_DEPOT) + +``` +ConstructionType.WATER_DEPOT: ConstructionType +``` + +### ConstructionType.INDUSTRY[πŸ”—](#$api.type~ConstructionType.INDUSTRY) + +``` +ConstructionType.INDUSTRY: ConstructionType +``` + +### ConstructionType.WAREHOUSE[πŸ”—](#$api.type~ConstructionType.WAREHOUSE) + +``` +ConstructionType.WAREHOUSE: ConstructionType +``` + +### ConstructionType.ASSET\_DEFAULT[πŸ”—](#$api.type~ConstructionType.ASSET_DEFAULT) + +``` +ConstructionType.ASSET_DEFAULT: ConstructionType +``` + +### ConstructionType.ASSET\_TRACK[πŸ”—](#$api.type~ConstructionType.ASSET_TRACK) + +``` +ConstructionType.ASSET_TRACK: ConstructionType +``` + +### ConstructionType.TOWN\_BUILDING[πŸ”—](#$api.type~ConstructionType.TOWN_BUILDING) + +``` +ConstructionType.TOWN_BUILDING: ConstructionType +``` + +### ConstructionType.STREET\_CONSTRUCTION[πŸ”—](#$api.type~ConstructionType.STREET_CONSTRUCTION) + +``` +ConstructionType.STREET_CONSTRUCTION: ConstructionType +``` + +### ConstructionType.NONE[πŸ”—](#$api.type~ConstructionType.NONE) + +``` +ConstructionType.NONE: ConstructionType +``` + +### ConstructionType.AIRPORT\_CARGO[πŸ”—](#$api.type~ConstructionType.AIRPORT_CARGO) + +``` +ConstructionType.AIRPORT_CARGO: ConstructionType +``` + +### ConstructionType.TRACK\_CONSTRUCTION[πŸ”—](#$api.type~ConstructionType.TRACK_CONSTRUCTION) + +``` +ConstructionType.TRACK_CONSTRUCTION: ConstructionType +``` + +### ConstructionType.WATER\_WAYPOINT[πŸ”—](#$api.type~ConstructionType.WATER_WAYPOINT) + +``` +ConstructionType.WATER_WAYPOINT: ConstructionType +``` + +### Context[πŸ”—](#$api.type~Context) + +``` +global record Context new: function(): Context + checkTerrainAlignment: boolean + cleanupStreetGraph: boolean + gatherBuildings: boolean + gatherFields: boolean + player: Engine.Entity + refundableEntities: {{Engine.Entity, integer}, {Engine.Revision, integer}} + extendProposalRedoPillars: boolean +end +``` + +Proposal context to configure how the proposal is to be applied + +### Context.new[πŸ”—](#$api.type~Context.new) + +``` +function Context.new(): Context +``` + +**Returns** + +1. `Context` + +### Context.checkTerrainAlignment[πŸ”—](#$api.type~Context.checkTerrainAlignment) + +``` +Context.checkTerrainAlignment: boolean +``` + +### Context.cleanupStreetGraph[πŸ”—](#$api.type~Context.cleanupStreetGraph) + +``` +Context.cleanupStreetGraph: boolean +``` + +If true, attempts to simplifyy the base edge and base node graph + +### Context.gatherBuildings[πŸ”—](#$api.type~Context.gatherBuildings) + +``` +Context.gatherBuildings: boolean +``` + +### Context.gatherFields[πŸ”—](#$api.type~Context.gatherFields) + +``` +Context.gatherFields: boolean +``` + +### Context.player[πŸ”—](#$api.type~Context.player) + +``` +Context.player: Engine.Entity +``` + +### Context.refundableEntities[πŸ”—](#$api.type~Context.refundableEntities) + +``` +Context.refundableEntities: {{Engine.Entity, integer}, {Engine.Revision, integer}} +``` + +### Context.extendProposalRedoPillars[πŸ”—](#$api.type~Context.extendProposalRedoPillars) + +``` +Context.extendProposalRedoPillars: boolean +``` + +Find colliding bridge pillars and try to move them off the side + +### Date[πŸ”—](#$api.type~Date) + +``` +global record Date new: function(year : integer, month : integer, day : integer): Date + + now: function(): Date + fromYear: function(integer : integer): Date + fromString: function(str : string): Date + getEndOfMonth: function(current : Date): Date + getDayOfWeek: function(current : Date): integer + addOffsetDays: function(date : Date, numDays : integer): Date + year: integer + month: integer + day: integer +end +``` + +Date representation with year, month, and day + +### Date.new(integer, integer, integer)[πŸ”—](#$api.type~Date.new(integer, integer, integer)) + +``` +function Date.new(integer, integer, integer)(year : integer, month : integer, day : integer): Date +``` + +Creates a new date from year, month and day. + +**Parameters** + +* `year` :`integer` β€” Year +* `month` :`integer` β€” Month (1-12) +* `day` :`integer` β€” Day (1-31) + +**Returns** + +1. `Date` β€” New Date + +### Date.new(integer)[πŸ”—](#$api.type~Date.new(integer)) + +``` +function Date.new(integer)(year : integer): Date +``` + +Creates a new date from year + +**Parameters** + +* `year` :`integer` β€” Year + +**Returns** + +1. `Date` β€” New Date + +### Date.now[πŸ”—](#$api.type~Date.now) + +``` +function Date.now(): Date +``` + +Get date of current day + +**Returns** + +1. `Date` β€” Current date + +### Date.fromYear[πŸ”—](#$api.type~Date.fromYear) + +``` +function Date.fromYear(integer : integer): Date +``` + +Create date at the first day of the given year + +**Parameters** + +* `integer` :`integer` β€” year integer + +**Returns** + +1. `Date` β€” A new Date + +### Date.fromString[πŸ”—](#$api.type~Date.fromString) + +``` +function Date.fromString(str : string): Date +``` + +Parse date from string + +**Parameters** + +* `str` :`string` β€” Date string + +**Returns** + +1. `Date` β€” Parsed date + +### Date.getEndOfMonth[πŸ”—](#$api.type~Date.getEndOfMonth) + +``` +function Date.getEndOfMonth(current : Date): Date +``` + +Get the last day of the current month + +**Parameters** + +* `current` :`Date` β€” Current date + +**Returns** + +1. `Date` β€” Date representing end of month + +### Date.getDayOfWeek[πŸ”—](#$api.type~Date.getDayOfWeek) + +``` +function Date.getDayOfWeek(current : Date): integer +``` + +Get the day of the week of the current date + +**Parameters** + +* `current` :`Date` β€” Current date + +**Returns** + +1. `integer` β€” The day of the week + +### Date.addOffsetDays[πŸ”—](#$api.type~Date.addOffsetDays) + +``` +function Date.addOffsetDays(date : Date, numDays : integer): Date +``` + +add offset in days + +**Parameters** + +* `date` :`Date` β€” the date to offset +* `numDays` :`integer` β€” number of days to add + +**Returns** + +1. `Date` β€” New Date offset by the given number of days + +### Date.year[πŸ”—](#$api.type~Date.year) + +``` +Date.year: integer +``` + +Year component + +### Date.month[πŸ”—](#$api.type~Date.month) + +``` +Date.month: integer +``` + +Month component (1-12) + +### Date.day[πŸ”—](#$api.type~Date.day) + +``` +Date.day: integer +``` + +Day component (1-31) + +### DateFormat[πŸ”—](#$api.type~DateFormat) + +``` +global record DateFormat LONG: DateFormat + SHORT: DateFormat + MEDIUM: DateFormat + FULL: DateFormat + FILENAME: DateFormat + YEAR: DateFormat +end +``` + +DateFormat used for formatting calendar entries + +### DateFormat.LONG[πŸ”—](#$api.type~DateFormat.LONG) + +``` +DateFormat.LONG: DateFormat +``` + +### DateFormat.SHORT[πŸ”—](#$api.type~DateFormat.SHORT) + +``` +DateFormat.SHORT: DateFormat +``` + +### DateFormat.MEDIUM[πŸ”—](#$api.type~DateFormat.MEDIUM) + +``` +DateFormat.MEDIUM: DateFormat +``` + +### DateFormat.FULL[πŸ”—](#$api.type~DateFormat.FULL) + +``` +DateFormat.FULL: DateFormat +``` + +### DateFormat.FILENAME[πŸ”—](#$api.type~DateFormat.FILENAME) + +``` +DateFormat.FILENAME: DateFormat +``` + +### DateFormat.YEAR[πŸ”—](#$api.type~DateFormat.YEAR) + +``` +DateFormat.YEAR: DateFormat +``` + +Only output year + +### DistanceSpeedUnit[πŸ”—](#$api.type~DistanceSpeedUnit) + +``` +global record DistanceSpeedUnit Metric: DistanceSpeedUnit + Imperial: DistanceSpeedUnit +end +``` + +DistanceSpeedUnit represents the unit of measurement used for distance and speed. + +### DistanceSpeedUnit.Metric[πŸ”—](#$api.type~DistanceSpeedUnit.Metric) + +``` +DistanceSpeedUnit.Metric: DistanceSpeedUnit +``` + +### DistanceSpeedUnit.Imperial[πŸ”—](#$api.type~DistanceSpeedUnit.Imperial) + +``` +DistanceSpeedUnit.Imperial: DistanceSpeedUnit +``` + +### DynamicConstructionTemplate[πŸ”—](#$api.type~DynamicConstructionTemplate) + +``` +global record DynamicConstructionTemplate params: {ScriptParam} +end +``` + +Dynamic construction template configuration + +### DynamicConstructionTemplate.params[πŸ”—](#$api.type~DynamicConstructionTemplate.params) + +``` +DynamicConstructionTemplate.params: {ScriptParam} +``` + +### Easing[πŸ”—](#$api.type~Easing) + +``` +global record Easing Linear: integer + EaseOutSqrt: integer + EaseInSine: integer + EaseOutSine: integer + EaseInOutSine: integer + EaseInQuad: integer + EaseOutQuad: integer + EaseInOutQuad: integer + EaseInCubic: integer + EaseOutCubic: integer + EaseInOutCubic: integer + EaseInQuart: integer + EaseOutQuart: integer + EaseInOutQuart: integer + EaseInQuint: integer + EaseOutQuint: integer + EaseInOutQuint: integer + EaseInExpo: integer + EaseOutExpo: integer + EaseInOutExpo: integer + EaseInCirc: integer + EaseOutCirc: integer + EaseInOutCirc: integer + EaseInBack: integer + EaseOutBack: integer + EaseInOutBack: integer + EaseInElastic: integer + EaseOutElastic: integer + EaseInOutElastic: integer + EaseInBounce: integer + EaseOutBounce: integer + EaseInOutBounce: integer +end +``` + +Easing functions for particle curve interpolation + +### Easing.Linear[πŸ”—](#$api.type~Easing.Linear) + +``` +Easing.Linear: integer +``` + +### Easing.EaseOutSqrt[πŸ”—](#$api.type~Easing.EaseOutSqrt) + +``` +Easing.EaseOutSqrt: integer +``` + +### Easing.EaseInSine[πŸ”—](#$api.type~Easing.EaseInSine) + +``` +Easing.EaseInSine: integer +``` + +### Easing.EaseOutSine[πŸ”—](#$api.type~Easing.EaseOutSine) + +``` +Easing.EaseOutSine: integer +``` + +### Easing.EaseInOutSine[πŸ”—](#$api.type~Easing.EaseInOutSine) + +``` +Easing.EaseInOutSine: integer +``` + +### Easing.EaseInQuad[πŸ”—](#$api.type~Easing.EaseInQuad) + +``` +Easing.EaseInQuad: integer +``` + +### Easing.EaseOutQuad[πŸ”—](#$api.type~Easing.EaseOutQuad) + +``` +Easing.EaseOutQuad: integer +``` + +### Easing.EaseInOutQuad[πŸ”—](#$api.type~Easing.EaseInOutQuad) + +``` +Easing.EaseInOutQuad: integer +``` + +### Easing.EaseInCubic[πŸ”—](#$api.type~Easing.EaseInCubic) + +``` +Easing.EaseInCubic: integer +``` + +### Easing.EaseOutCubic[πŸ”—](#$api.type~Easing.EaseOutCubic) + +``` +Easing.EaseOutCubic: integer +``` + +### Easing.EaseInOutCubic[πŸ”—](#$api.type~Easing.EaseInOutCubic) + +``` +Easing.EaseInOutCubic: integer +``` + +### Easing.EaseInQuart[πŸ”—](#$api.type~Easing.EaseInQuart) + +``` +Easing.EaseInQuart: integer +``` + +### Easing.EaseOutQuart[πŸ”—](#$api.type~Easing.EaseOutQuart) + +``` +Easing.EaseOutQuart: integer +``` + +### Easing.EaseInOutQuart[πŸ”—](#$api.type~Easing.EaseInOutQuart) + +``` +Easing.EaseInOutQuart: integer +``` + +### Easing.EaseInQuint[πŸ”—](#$api.type~Easing.EaseInQuint) + +``` +Easing.EaseInQuint: integer +``` + +### Easing.EaseOutQuint[πŸ”—](#$api.type~Easing.EaseOutQuint) + +``` +Easing.EaseOutQuint: integer +``` + +### Easing.EaseInOutQuint[πŸ”—](#$api.type~Easing.EaseInOutQuint) + +``` +Easing.EaseInOutQuint: integer +``` + +### Easing.EaseInExpo[πŸ”—](#$api.type~Easing.EaseInExpo) + +``` +Easing.EaseInExpo: integer +``` + +### Easing.EaseOutExpo[πŸ”—](#$api.type~Easing.EaseOutExpo) + +``` +Easing.EaseOutExpo: integer +``` + +### Easing.EaseInOutExpo[πŸ”—](#$api.type~Easing.EaseInOutExpo) + +``` +Easing.EaseInOutExpo: integer +``` + +### Easing.EaseInCirc[πŸ”—](#$api.type~Easing.EaseInCirc) + +``` +Easing.EaseInCirc: integer +``` + +### Easing.EaseOutCirc[πŸ”—](#$api.type~Easing.EaseOutCirc) + +``` +Easing.EaseOutCirc: integer +``` + +### Easing.EaseInOutCirc[πŸ”—](#$api.type~Easing.EaseInOutCirc) + +``` +Easing.EaseInOutCirc: integer +``` + +### Easing.EaseInBack[πŸ”—](#$api.type~Easing.EaseInBack) + +``` +Easing.EaseInBack: integer +``` + +### Easing.EaseOutBack[πŸ”—](#$api.type~Easing.EaseOutBack) + +``` +Easing.EaseOutBack: integer +``` + +### Easing.EaseInOutBack[πŸ”—](#$api.type~Easing.EaseInOutBack) + +``` +Easing.EaseInOutBack: integer +``` + +### Easing.EaseInElastic[πŸ”—](#$api.type~Easing.EaseInElastic) + +``` +Easing.EaseInElastic: integer +``` + +### Easing.EaseOutElastic[πŸ”—](#$api.type~Easing.EaseOutElastic) + +``` +Easing.EaseOutElastic: integer +``` + +### Easing.EaseInOutElastic[πŸ”—](#$api.type~Easing.EaseInOutElastic) + +``` +Easing.EaseInOutElastic: integer +``` + +### Easing.EaseInBounce[πŸ”—](#$api.type~Easing.EaseInBounce) + +``` +Easing.EaseInBounce: integer +``` + +### Easing.EaseOutBounce[πŸ”—](#$api.type~Easing.EaseOutBounce) + +``` +Easing.EaseOutBounce: integer +``` + +### Easing.EaseInOutBounce[πŸ”—](#$api.type~Easing.EaseInOutBounce) + +``` +Easing.EaseInOutBounce: integer +``` + +### EconomyDesc[πŸ”—](#$api.type~EconomyDesc) + +``` +[Expand All] [Collapse All] + +global record EconomyDesc record TownCargoLevelInfo new: function(): TownCargoLevelInfo + + minTier: integer + maxTier: integer + landUseType: LandUseType +end + new: function(): EconomyDesc + desc: ModelMetadata.Description + order: integer + visible: boolean + category: string + industryWeightsSum2Population: number + placementParams: {string : PlacementParams} + cargoCategories: {string : CargoCategory} + townLevels2CargoInfos: {integer : {TownCargoLevelInfo}} + cargoRequiredIndustries: { : } + companyRankRequiredIndustries: { : } + defaultIndustryDensity: number + defaultPopulationDensity: number + defaultIndustryProductivity: number +end +``` + +Contains all data relevant for the economy. + +### EconomyDesc.TownCargoLevelInfo[πŸ”—](#$api.type~EconomyDesc.TownCargoLevelInfo) + +``` +record EconomyDesc.TownCargoLevelInfo new: function(): TownCargoLevelInfo + + minTier: integer + maxTier: integer + landUseType: LandUseType +end +``` + +Contains all data relevant for adding new cargo requirements to a town at a specific level + +### EconomyDesc.TownCargoLevelInfo.new()[πŸ”—](#$api.type~EconomyDesc.TownCargoLevelInfo.new()) + +``` +function EconomyDesc.TownCargoLevelInfo.new()(): TownCargoLevelInfo +``` + +**Returns** + +1. `TownCargoLevelInfo` + +### EconomyDesc.TownCargoLevelInfo.new(TownCargoLevelInfo)[πŸ”—](#$api.type~EconomyDesc.TownCargoLevelInfo.new(TownCargoLevelInfo)) + +``` +function EconomyDesc.TownCargoLevelInfo.new(TownCargoLevelInfo)(TownCargoLevelInfo): TownCargoLevelInfo +``` + +**Parameters** + +* `TownCargoLevelInfo` + +**Returns** + +1. `TownCargoLevelInfo` + +### EconomyDesc.TownCargoLevelInfo.minTier[πŸ”—](#$api.type~EconomyDesc.TownCargoLevelInfo.minTier) + +``` +EconomyDesc.TownCargoLevelInfo.minTier: integer +``` + +### EconomyDesc.TownCargoLevelInfo.maxTier[πŸ”—](#$api.type~EconomyDesc.TownCargoLevelInfo.maxTier) + +``` +EconomyDesc.TownCargoLevelInfo.maxTier: integer +``` + +### EconomyDesc.TownCargoLevelInfo.landUseType[πŸ”—](#$api.type~EconomyDesc.TownCargoLevelInfo.landUseType) + +``` +EconomyDesc.TownCargoLevelInfo.landUseType: LandUseType +``` + +### EconomyDesc.new[πŸ”—](#$api.type~EconomyDesc.new) + +``` +function EconomyDesc.new(): EconomyDesc +``` + +Creates a new, empty economy description + +**Returns** + +1. `EconomyDesc` + +### EconomyDesc.desc[πŸ”—](#$api.type~EconomyDesc.desc) + +``` +EconomyDesc.desc: ModelMetadata.Description +``` + +Localized strings and icons paths for user interface + +### EconomyDesc.order[πŸ”—](#$api.type~EconomyDesc.order) + +``` +EconomyDesc.order: integer +``` + +User interface order for sorting + +### EconomyDesc.visible[πŸ”—](#$api.type~EconomyDesc.visible) + +``` +EconomyDesc.visible: boolean +``` + +Selects the availability of the economy on the selection screen + +### EconomyDesc.category[πŸ”—](#$api.type~EconomyDesc.category) + +``` +EconomyDesc.category: string +``` + +Used for selecting content based on the economy, depending on whether the object has matching tags in categoryList categories + +### EconomyDesc.industryWeightsSum2Population[πŸ”—](#$api.type~EconomyDesc.industryWeightsSum2Population) + +``` +EconomyDesc.industryWeightsSum2Population: number +``` + +### EconomyDesc.placementParams[πŸ”—](#$api.type~EconomyDesc.placementParams) + +``` +EconomyDesc.placementParams: {string : PlacementParams} +``` + +### EconomyDesc.cargoCategories[πŸ”—](#$api.type~EconomyDesc.cargoCategories) + +``` +EconomyDesc.cargoCategories: {string : CargoCategory} +``` + +### EconomyDesc.townLevels2CargoInfos[πŸ”—](#$api.type~EconomyDesc.townLevels2CargoInfos) + +``` +EconomyDesc.townLevels2CargoInfos: {integer : {TownCargoLevelInfo}} +``` + +### EconomyDesc.cargoRequiredIndustries[πŸ”—](#$api.type~EconomyDesc.cargoRequiredIndustries) + +``` +EconomyDesc.cargoRequiredIndustries: { : } +``` + +### EconomyDesc.companyRankRequiredIndustries[πŸ”—](#$api.type~EconomyDesc.companyRankRequiredIndustries) + +``` +EconomyDesc.companyRankRequiredIndustries: { : } +``` + +### EconomyDesc.defaultIndustryDensity[πŸ”—](#$api.type~EconomyDesc.defaultIndustryDensity) + +``` +EconomyDesc.defaultIndustryDensity: number +``` + +### EconomyDesc.defaultPopulationDensity[πŸ”—](#$api.type~EconomyDesc.defaultPopulationDensity) + +``` +EconomyDesc.defaultPopulationDensity: number +``` + +### EconomyDesc.defaultIndustryProductivity[πŸ”—](#$api.type~EconomyDesc.defaultIndustryProductivity) + +``` +EconomyDesc.defaultIndustryProductivity: number +``` + +### Edge[πŸ”—](#$api.type~Edge) + +``` +global record Edge conns: {NodeId} + geometry: EdgeGeometry + transportModes: {TransportMode : boolean} + speedLimit: number + curveSpeedLimit: number + curSpeed: number + linkable: integer + pedestrianWalkPenalty: number + precedence: boolean + noiseModifier: number + pollutionModifier: number + needsReservation: boolean + forwardOnly: boolean +end +``` + +A single edge within a Transport Network. + +### Edge.conns[πŸ”—](#$api.type~Edge.conns) + +``` +Edge.conns: {NodeId} +``` + +Start and end node + +### Edge.geometry[πŸ”—](#$api.type~Edge.geometry) + +``` +Edge.geometry: EdgeGeometry +``` + +Edge geometry definition + +### Edge.transportModes[πŸ”—](#$api.type~Edge.transportModes) + +``` +Edge.transportModes: {TransportMode : boolean} +``` + +Transport modes allowed on this edge + +### Edge.speedLimit[πŸ”—](#$api.type~Edge.speedLimit) + +``` +Edge.speedLimit: number +``` + +Speed limit for the edge + +### Edge.curveSpeedLimit[πŸ”—](#$api.type~Edge.curveSpeedLimit) + +``` +Edge.curveSpeedLimit: number +``` + +Speed limit due to curvature + +### Edge.curSpeed[πŸ”—](#$api.type~Edge.curSpeed) + +``` +Edge.curSpeed: number +``` + +Current speed on the edge (for statistics) + +### Edge.linkable[πŸ”—](#$api.type~Edge.linkable) + +``` +Edge.linkable: integer +``` + +### Edge.pedestrianWalkPenalty[πŸ”—](#$api.type~Edge.pedestrianWalkPenalty) + +``` +Edge.pedestrianWalkPenalty: number +``` + +Penalty for pedestrian walking + +### Edge.precedence[πŸ”—](#$api.type~Edge.precedence) + +``` +Edge.precedence: boolean +``` + +### Edge.noiseModifier[πŸ”—](#$api.type~Edge.noiseModifier) + +``` +Edge.noiseModifier: number +``` + +Noise modifier + +### Edge.pollutionModifier[πŸ”—](#$api.type~Edge.pollutionModifier) + +``` +Edge.pollutionModifier: number +``` + +Pollution modifier + +### Edge.needsReservation[πŸ”—](#$api.type~Edge.needsReservation) + +``` +Edge.needsReservation: boolean +``` + +Whether the edge needs reservation + +### Edge.forwardOnly[πŸ”—](#$api.type~Edge.forwardOnly) + +``` +Edge.forwardOnly: boolean +``` + +Whether the edge only allowed to be traversed in forward direction + +### EdgeDecoration[πŸ”—](#$api.type~EdgeDecoration) + +``` +global record EdgeDecoration new: function(): EdgeDecoration + + availability: ModelMetadata.Availability + desc: ModelMetadata.Description + cost: ModelMetadata.Cost + maintenance: number + categoryList: ModelMetadata.CategoryList + requiredTags: {string} + incompatibleTags: {string} + repModel: string + length: number + stretch: boolean + verticalAlignment: integer + snapMode: integer + offset: number + skipSameInParallelStrip: boolean + order: integer + modifiers: Modifiers + menuCategory: ModelMetadata.MenuCategory + builderAudioRes: ResName +end +``` + +An addon to the sides (or the center) of BaseEdge like noise barrier and alleys + +### EdgeDecoration.new()[πŸ”—](#$api.type~EdgeDecoration.new()) + +``` +function EdgeDecoration.new()(): EdgeDecoration +``` + +**Returns** + +1. `EdgeDecoration` + +### EdgeDecoration.new(EdgeDecoration)[πŸ”—](#$api.type~EdgeDecoration.new(EdgeDecoration)) + +``` +function EdgeDecoration.new(EdgeDecoration)(EdgeDecoration): EdgeDecoration +``` + +**Parameters** + +* `EdgeDecoration` + +**Returns** + +1. `EdgeDecoration` + +### EdgeDecoration.availability[πŸ”—](#$api.type~EdgeDecoration.availability) + +``` +EdgeDecoration.availability: ModelMetadata.Availability +``` + +Era information for user interface + +### EdgeDecoration.desc[πŸ”—](#$api.type~EdgeDecoration.desc) + +``` +EdgeDecoration.desc: ModelMetadata.Description +``` + +Localized strings and icons paths for user interface + +### EdgeDecoration.cost[πŸ”—](#$api.type~EdgeDecoration.cost) + +``` +EdgeDecoration.cost: ModelMetadata.Cost +``` + +Cost per unit of length + +### EdgeDecoration.maintenance[πŸ”—](#$api.type~EdgeDecoration.maintenance) + +``` +EdgeDecoration.maintenance: number +``` + +Maintenance cost per unit of length + +### EdgeDecoration.categoryList[πŸ”—](#$api.type~EdgeDecoration.categoryList) + +``` +EdgeDecoration.categoryList: ModelMetadata.CategoryList +``` + +Filtering tags for incompatibility between edge decorations and clima zone selection + +### EdgeDecoration.requiredTags[πŸ”—](#$api.type~EdgeDecoration.requiredTags) + +``` +EdgeDecoration.requiredTags: {string} +``` + +An edge decoration will only be able to be built if the union of the base edge tags and all edge decoration category list are +containing all required tags. Base edges have special tags denoting whether they are "track" or "street" edges and if they are "bridge" and "tunnel edges" + +### EdgeDecoration.incompatibleTags[πŸ”—](#$api.type~EdgeDecoration.incompatibleTags) + +``` +EdgeDecoration.incompatibleTags: {string} +``` + +An edge decoration will only be able to be built if the union of the base edge tags and all edge decoration category list are +not containing any incompatible tags. Any edge with one or more decoration has the additional built-in tag "decorated" + +### EdgeDecoration.repModel[πŸ”—](#$api.type~EdgeDecoration.repModel) + +``` +EdgeDecoration.repModel: string +``` + +Model name that will be repeated along the decoration + +### EdgeDecoration.length[πŸ”—](#$api.type~EdgeDecoration.length) + +``` +EdgeDecoration.length: number +``` + +Length of the model + +### EdgeDecoration.stretch[πŸ”—](#$api.type~EdgeDecoration.stretch) + +``` +EdgeDecoration.stretch: boolean +``` + +Do stretch the model to perfectly fill in thegaps + +### EdgeDecoration.verticalAlignment[πŸ”—](#$api.type~EdgeDecoration.verticalAlignment) + +``` +EdgeDecoration.verticalAlignment: integer +``` + +Align models vertically or based on the slope of the edge: 0 = keep models vertical, 1 = keep model vertical but apply vertical shear to fill the +gaps and align with stree slop, 2 = rotate the model to be normal to the street + +### EdgeDecoration.snapMode[πŸ”—](#$api.type~EdgeDecoration.snapMode) + +``` +EdgeDecoration.snapMode: integer +``` + +Snapping mode for the decoration: 0 = at the centerline of the transport network, 1 = at the side of the transport network + +### EdgeDecoration.offset[πŸ”—](#$api.type~EdgeDecoration.offset) + +``` +EdgeDecoration.offset: number +``` + +Offset (orthogonal to the direction of the edge (in meters)) from the center line + +### EdgeDecoration.skipSameInParallelStrip[πŸ”—](#$api.type~EdgeDecoration.skipSameInParallelStrip) + +``` +EdgeDecoration.skipSameInParallelStrip: boolean +``` + +If a decoration is applied on the matching side of the same parallel strip, it will not be shown + +### EdgeDecoration.order[πŸ”—](#$api.type~EdgeDecoration.order) + +``` +EdgeDecoration.order: integer +``` + +Order for user interface menus + +### EdgeDecoration.modifiers[πŸ”—](#$api.type~EdgeDecoration.modifiers) + +``` +EdgeDecoration.modifiers: Modifiers +``` + +Modifers that are applied to vehicles travelling onto edges with such edge decoration + +### EdgeDecoration.menuCategory[πŸ”—](#$api.type~EdgeDecoration.menuCategory) + +``` +EdgeDecoration.menuCategory: ModelMetadata.MenuCategory +``` + +Configure category, order and filter behaviour in the construction menu + +### EdgeDecoration.builderAudioRes[πŸ”—](#$api.type~EdgeDecoration.builderAudioRes) + +``` +EdgeDecoration.builderAudioRes: ResName +``` + +### EdgeGeometry[πŸ”—](#$api.type~EdgeGeometry) + +``` +[Expand All] [Collapse All] + +global record EdgeGeometry record Type ARC: Type + STRAIGHT: Type + CUBIC_SPLINE: Type + CUBIC_OFFSET_SPLINE: Type +end + record Arc new: function(): Arc + center: Vec2f + radius: number + startAngle: number + angle: number +end + record Straight new: function(): Straight + pos: {Vec2f} +end + record CubicSpline new: function(): CubicSpline + pos: {Vec2f} + tangent: {Vec2f} +end + record CubicOffsetSpline new: function(): CubicOffsetSpline + pos: {Vec2f} + tangent: {Vec2f} + offset: number +end + new: function(): EdgeGeometry + type: Type + arc: Arc + straight: Straight + cubicSpline: CubicSpline + cubicOffsetSpline: CubicOffsetSpline + tangent: Vec2f + height: Vec2f + length: number + width: number + locate: function(geom : EdgeGeometry, pos : Vec3f, maxSteps : integer, tol : number): {number, boolean} + calcPos: function(geom : EdgeGeometry, param : number): {Vec3f, Vec3f, Vec3f} +end +``` + +Defines the geometry (shape) of an edge + +### EdgeGeometry.Type[πŸ”—](#$api.type~EdgeGeometry.Type) + +``` +record EdgeGeometry.Type ARC: Type + STRAIGHT: Type + CUBIC_SPLINE: Type + CUBIC_OFFSET_SPLINE: Type +end +``` + +Type of the edge geometry + +### EdgeGeometry.Type.ARC[πŸ”—](#$api.type~EdgeGeometry.Type.ARC) + +``` +EdgeGeometry.Type.ARC: Type +``` + +### EdgeGeometry.Type.STRAIGHT[πŸ”—](#$api.type~EdgeGeometry.Type.STRAIGHT) + +``` +EdgeGeometry.Type.STRAIGHT: Type +``` + +### EdgeGeometry.Type.CUBIC\_SPLINE[πŸ”—](#$api.type~EdgeGeometry.Type.CUBIC_SPLINE) + +``` +EdgeGeometry.Type.CUBIC_SPLINE: Type +``` + +### EdgeGeometry.Type.CUBIC\_OFFSET\_SPLINE[πŸ”—](#$api.type~EdgeGeometry.Type.CUBIC_OFFSET_SPLINE) + +``` +EdgeGeometry.Type.CUBIC_OFFSET_SPLINE: Type +``` + +### EdgeGeometry.Arc[πŸ”—](#$api.type~EdgeGeometry.Arc) + +``` +record EdgeGeometry.Arc new: function(): Arc + center: Vec2f + radius: number + startAngle: number + angle: number +end +``` + +Arc geometry parameters + +### EdgeGeometry.Arc.new[πŸ”—](#$api.type~EdgeGeometry.Arc.new) + +``` +function EdgeGeometry.Arc.new(): Arc +``` + +**Returns** + +1. `Arc` + +### EdgeGeometry.Arc.center[πŸ”—](#$api.type~EdgeGeometry.Arc.center) + +``` +EdgeGeometry.Arc.center: Vec2f +``` + +Center point of the arc + +### EdgeGeometry.Arc.radius[πŸ”—](#$api.type~EdgeGeometry.Arc.radius) + +``` +EdgeGeometry.Arc.radius: number +``` + +Radius of the arc + +### EdgeGeometry.Arc.startAngle[πŸ”—](#$api.type~EdgeGeometry.Arc.startAngle) + +``` +EdgeGeometry.Arc.startAngle: number +``` + +Starting angle in radians + +### EdgeGeometry.Arc.angle[πŸ”—](#$api.type~EdgeGeometry.Arc.angle) + +``` +EdgeGeometry.Arc.angle: number +``` + +Arc angle in radians + +### EdgeGeometry.Straight[πŸ”—](#$api.type~EdgeGeometry.Straight) + +``` +record EdgeGeometry.Straight new: function(): Straight + pos: {Vec2f} +end +``` + +Straight line geometry parameters + +### EdgeGeometry.Straight.new[πŸ”—](#$api.type~EdgeGeometry.Straight.new) + +``` +function EdgeGeometry.Straight.new(): Straight +``` + +**Returns** + +1. `Straight` + +### EdgeGeometry.Straight.pos[πŸ”—](#$api.type~EdgeGeometry.Straight.pos) + +``` +EdgeGeometry.Straight.pos: {Vec2f} +``` + +Start and end positions + +### EdgeGeometry.CubicSpline[πŸ”—](#$api.type~EdgeGeometry.CubicSpline) + +``` +record EdgeGeometry.CubicSpline new: function(): CubicSpline + pos: {Vec2f} + tangent: {Vec2f} +end +``` + +Cubic spline geometry parameters + +### EdgeGeometry.CubicSpline.new[πŸ”—](#$api.type~EdgeGeometry.CubicSpline.new) + +``` +function EdgeGeometry.CubicSpline.new(): CubicSpline +``` + +**Returns** + +1. `CubicSpline` + +### EdgeGeometry.CubicSpline.pos[πŸ”—](#$api.type~EdgeGeometry.CubicSpline.pos) + +``` +EdgeGeometry.CubicSpline.pos: {Vec2f} +``` + +Start and end positions + +### EdgeGeometry.CubicSpline.tangent[πŸ”—](#$api.type~EdgeGeometry.CubicSpline.tangent) + +``` +EdgeGeometry.CubicSpline.tangent: {Vec2f} +``` + +Tangent vectors at start and end + +### EdgeGeometry.CubicOffsetSpline[πŸ”—](#$api.type~EdgeGeometry.CubicOffsetSpline) + +``` +record EdgeGeometry.CubicOffsetSpline new: function(): CubicOffsetSpline + pos: {Vec2f} + tangent: {Vec2f} + offset: number +end +``` + +Cubic offset spline geometry parameters + +### EdgeGeometry.CubicOffsetSpline.new[πŸ”—](#$api.type~EdgeGeometry.CubicOffsetSpline.new) + +``` +function EdgeGeometry.CubicOffsetSpline.new(): CubicOffsetSpline +``` + +**Returns** + +1. `CubicOffsetSpline` + +### EdgeGeometry.CubicOffsetSpline.pos[πŸ”—](#$api.type~EdgeGeometry.CubicOffsetSpline.pos) + +``` +EdgeGeometry.CubicOffsetSpline.pos: {Vec2f} +``` + +Start and end positions + +### EdgeGeometry.CubicOffsetSpline.tangent[πŸ”—](#$api.type~EdgeGeometry.CubicOffsetSpline.tangent) + +``` +EdgeGeometry.CubicOffsetSpline.tangent: {Vec2f} +``` + +Tangent vectors at start and end + +### EdgeGeometry.CubicOffsetSpline.offset[πŸ”—](#$api.type~EdgeGeometry.CubicOffsetSpline.offset) + +``` +EdgeGeometry.CubicOffsetSpline.offset: number +``` + +Offset value + +### EdgeGeometry.new[πŸ”—](#$api.type~EdgeGeometry.new) + +``` +function EdgeGeometry.new(): EdgeGeometry +``` + +**Returns** + +1. `EdgeGeometry` + +### EdgeGeometry.type[πŸ”—](#$api.type~EdgeGeometry.type) + +``` +EdgeGeometry.type: Type +``` + +Type for the 2D (xy) shape + +### EdgeGeometry.arc[πŸ”—](#$api.type~EdgeGeometry.arc) + +``` +EdgeGeometry.arc: Arc +``` + +Arc parameters (if type is ARC) + +### EdgeGeometry.straight[πŸ”—](#$api.type~EdgeGeometry.straight) + +``` +EdgeGeometry.straight: Straight +``` + +Straight parameters (if type is STRAIGHT) + +### EdgeGeometry.cubicSpline[πŸ”—](#$api.type~EdgeGeometry.cubicSpline) + +``` +EdgeGeometry.cubicSpline: CubicSpline +``` + +Cubic spline parameters (if type is CUBIC\_SPLINE) + +### EdgeGeometry.cubicOffsetSpline[πŸ”—](#$api.type~EdgeGeometry.cubicOffsetSpline) + +``` +EdgeGeometry.cubicOffsetSpline: CubicOffsetSpline +``` + +Cubic offset spline parameters (if type is CUBIC*OFFSET*SPLINE) + +### EdgeGeometry.tangent[πŸ”—](#$api.type~EdgeGeometry.tangent) + +``` +EdgeGeometry.tangent: Vec2f +``` + +Vertical tangents at start and end + +### EdgeGeometry.height[πŸ”—](#$api.type~EdgeGeometry.height) + +``` +EdgeGeometry.height: Vec2f +``` + +Heights at start and end + +### EdgeGeometry.length[πŸ”—](#$api.type~EdgeGeometry.length) + +``` +EdgeGeometry.length: number +``` + +Length of the edge + +### EdgeGeometry.width[πŸ”—](#$api.type~EdgeGeometry.width) + +``` +EdgeGeometry.width: number +``` + +Width of the edge + +### EdgeGeometry.locate[πŸ”—](#$api.type~EdgeGeometry.locate) + +``` +function EdgeGeometry.locate(geom : EdgeGeometry, pos : Vec3f, maxSteps : integer, tol : number): {number, boolean} +``` + +Finds the parameter on a spline for a given world position + +**Parameters** + +* `geom` :`EdgeGeometry` β€” the edge geometry to sample +* `pos` :`Vec3f` β€” a 3d world position to search for +* `maxSteps` :`integer` β€” the maximum number of steps to perform +* `tol` :`number` β€” a maximal distance for the point to be found + +**Returns** + +1. `{number, boolean}` β€” paramAndFound the parameter value and whether there was a point on the spline + +### EdgeGeometry.calcPos[πŸ”—](#$api.type~EdgeGeometry.calcPos) + +``` +function EdgeGeometry.calcPos(geom : EdgeGeometry, param : number): {Vec3f, Vec3f, Vec3f} +``` + +Calculate a position on an edgegeometry, given a parameter in [0, 1] + +**Parameters** + +* `geom` :`EdgeGeometry` β€” the edge geometry to sample +* `param` :`number` β€” a number in [0, 1] + +**Returns** + +1. `{Vec3f, Vec3f, Vec3f}` β€” the position, tangent and second derivative at the specified param + +### EdgeId[πŸ”—](#$api.type~EdgeId) + +``` +global record EdgeId new: function(): EdgeId + + entity: Engine.Entity + index: integer +end +``` + +References a single transport network edge within a transport network entity + +### EdgeId.new()[πŸ”—](#$api.type~EdgeId.new()) + +``` +function EdgeId.new()(): EdgeId +``` + +**Returns** + +1. `EdgeId` + +### EdgeId.new(integer, integer)[πŸ”—](#$api.type~EdgeId.new(integer, integer)) + +``` +function EdgeId.new(integer, integer)(entity : integer, index : integer): EdgeId +``` + +Constructor with entity and index + +**Parameters** + +* `entity` :`integer` β€” The TransportNetwork entity +* `index` :`integer` β€” The zero-based index within the edges field of the TransportNetwork component + +**Returns** + +1. `EdgeId` + +### EdgeId.entity[πŸ”—](#$api.type~EdgeId.entity) + +``` +EdgeId.entity: Engine.Entity +``` + +The TransportNetwork entity + +### EdgeId.index[πŸ”—](#$api.type~EdgeId.index) + +``` +EdgeId.index: integer +``` + +The zero-basd index within the edges field of the TransportNetwork component + +### EdgeIsect[πŸ”—](#$api.type~EdgeIsect) + +``` +[Expand All] [Collapse All] + +global record EdgeIsect record Info index: integer + param: number + pos: Vec3f +end + infos: {Info, Info} +end +``` + +Specifies the intersection of two edges, with waiting area for vehicles. + +### EdgeIsect.Info[πŸ”—](#$api.type~EdgeIsect.Info) + +``` +record EdgeIsect.Info index: integer + param: number + pos: Vec3f +end +``` + +Data for an edge intersection entry + +### EdgeIsect.Info.index[πŸ”—](#$api.type~EdgeIsect.Info.index) + +``` +EdgeIsect.Info.index: integer +``` + +The index of the other edge in the intersection + +### EdgeIsect.Info.param[πŸ”—](#$api.type~EdgeIsect.Info.param) + +``` +EdgeIsect.Info.param: number +``` + +The parameter position on the edge + +### EdgeIsect.Info.pos[πŸ”—](#$api.type~EdgeIsect.Info.pos) + +``` +EdgeIsect.Info.pos: Vec3f +``` + +The world position of the intersection + +### EdgeIsect.infos[πŸ”—](#$api.type~EdgeIsect.infos) + +``` +EdgeIsect.infos: {Info, Info} +``` + +The two intersection info entries for each of the two edges + +### EdgeObjectType[πŸ”—](#$api.type~EdgeObjectType) + +``` +global record EdgeObjectType STOP_LEFT: EdgeObjectType + STOP_RIGHT: EdgeObjectType + SIGNAL: EdgeObjectType +end +``` + +Types of objects that can be placed on a BaseEdge + +### EdgeObjectType.STOP\_LEFT[πŸ”—](#$api.type~EdgeObjectType.STOP_LEFT) + +``` +EdgeObjectType.STOP_LEFT: EdgeObjectType +``` + +Stop on the left side of the edge + +### EdgeObjectType.STOP\_RIGHT[πŸ”—](#$api.type~EdgeObjectType.STOP_RIGHT) + +``` +EdgeObjectType.STOP_RIGHT: EdgeObjectType +``` + +Stop on the right side of the edge + +### EdgeObjectType.SIGNAL[πŸ”—](#$api.type~EdgeObjectType.SIGNAL) + +``` +EdgeObjectType.SIGNAL: EdgeObjectType +``` + +Signal controlling rail reservation + +### EdgePos[πŸ”—](#$api.type~EdgePos) + +``` +global record EdgePos new: function(): EdgePos + + equals: function(EdgePos, EdgePos): boolean + edgeId: EdgeId + param: number +end +``` + +References a position inside an EdgeId + +### EdgePos.new()[πŸ”—](#$api.type~EdgePos.new()) + +``` +function EdgePos.new()(): EdgePos +``` + +**Returns** + +1. `EdgePos` + +### EdgePos.new(EdgePos)[πŸ”—](#$api.type~EdgePos.new(EdgePos)) + +``` +function EdgePos.new(EdgePos)(EdgePos): EdgePos +``` + +Copy constructor + +**Parameters** + +* `EdgePos` + +**Returns** + +1. `EdgePos` + +### EdgePos.equals[πŸ”—](#$api.type~EdgePos.equals) + +``` +function EdgePos.equals(EdgePos, EdgePos): boolean +``` + +**Parameters** + +* `EdgePos` +* `EdgePos` + +**Returns** + +1. `boolean` + +### EdgePos.edgeId[πŸ”—](#$api.type~EdgePos.edgeId) + +``` +EdgePos.edgeId: EdgeId +``` + +The edge (entity and index within TransportNetwork) + +### EdgePos.param[πŸ”—](#$api.type~EdgePos.param) + +``` +EdgePos.param: number +``` + +The position on the edge + +### Enum[πŸ”—](#$api.type~Enum) + +``` +global record Enum LogLevel: LogLevel + SaveGameType: SaveGameType + DateFormat: DateFormat + EdgeObjectType: EdgeObjectType + TransportVehicleState: TransportVehicleState + Carrier: Carrier + SignalType: SignalType + VehicleEngineType: VehicleEngineType + LineProblem: LineProblem + LineStationProblem: LineStationProblem + VehicleProblem: VehicleProblem + VehicleIconType: VehicleIconType + TownProblem: TownProblem + StockListType: StockListType + ConstructionType: ConstructionType + TransportMode: TransportMode + TramTrackType: TramTrackType + LandUseType: LandUseType + InputMode: InputMode + GamepadType: GamepadType + Platform: Platform + Vendor: Vendor + ConsoleGen: ConsoleGen + TrafficLightPreference: TrafficLightPreference + BaseEdgeType: BaseEdgeType + MoveMode: MoveMode + RoadType: RoadType + ScriptParamType: ScriptParamType + ScriptParamLocation: ScriptParamLocation + ScriptParamDisplayMode: ScriptParamDisplayMode + DistanceSpeedUnit: DistanceSpeedUnit + HudEffectMode: HudEffectMode + FontScaleClass: FontScaleClass + MoneyMode: MoneyMode + PowerUnit: PowerUnit + WeightUnit: WeightUnit + ForceUnit: ForceUnit + Gender: Gender + UgcAccessLimitedReason: UgcAccessLimitedReason + FlightState: FlightState + Easing: Easing + PdxErrorCodes: PdxErrorCodes + PdxLegalDocumentType: PdxLegalDocumentType + PdxThirdPartyLinkState: PdxThirdPartyLinkState + PdxThirdPartyAutoLoginPromptState: PdxThirdPartyAutoLoginPromptState +end +``` + +### Enum.LogLevel[πŸ”—](#$api.type~Enum.LogLevel) + +``` +Enum.LogLevel: LogLevel +``` + +### Enum.SaveGameType[πŸ”—](#$api.type~Enum.SaveGameType) + +``` +Enum.SaveGameType: SaveGameType +``` + +### Enum.DateFormat[πŸ”—](#$api.type~Enum.DateFormat) + +``` +Enum.DateFormat: DateFormat +``` + +### Enum.EdgeObjectType[πŸ”—](#$api.type~Enum.EdgeObjectType) + +``` +Enum.EdgeObjectType: EdgeObjectType +``` + +### Enum.TransportVehicleState[πŸ”—](#$api.type~Enum.TransportVehicleState) + +``` +Enum.TransportVehicleState: TransportVehicleState +``` + +### Enum.Carrier[πŸ”—](#$api.type~Enum.Carrier) + +``` +Enum.Carrier: Carrier +``` + +### Enum.SignalType[πŸ”—](#$api.type~Enum.SignalType) + +``` +Enum.SignalType: SignalType +``` + +### Enum.VehicleEngineType[πŸ”—](#$api.type~Enum.VehicleEngineType) + +``` +Enum.VehicleEngineType: VehicleEngineType +``` + +### Enum.LineProblem[πŸ”—](#$api.type~Enum.LineProblem) + +``` +Enum.LineProblem: LineProblem +``` + +### Enum.LineStationProblem[πŸ”—](#$api.type~Enum.LineStationProblem) + +``` +Enum.LineStationProblem: LineStationProblem +``` + +### Enum.VehicleProblem[πŸ”—](#$api.type~Enum.VehicleProblem) + +``` +Enum.VehicleProblem: VehicleProblem +``` + +### Enum.VehicleIconType[πŸ”—](#$api.type~Enum.VehicleIconType) + +``` +Enum.VehicleIconType: VehicleIconType +``` + +### Enum.TownProblem[πŸ”—](#$api.type~Enum.TownProblem) + +``` +Enum.TownProblem: TownProblem +``` + +### Enum.StockListType[πŸ”—](#$api.type~Enum.StockListType) + +``` +Enum.StockListType: StockListType +``` + +### Enum.ConstructionType[πŸ”—](#$api.type~Enum.ConstructionType) + +``` +Enum.ConstructionType: ConstructionType +``` + +### Enum.TransportMode[πŸ”—](#$api.type~Enum.TransportMode) + +``` +Enum.TransportMode: TransportMode +``` + +### Enum.TramTrackType[πŸ”—](#$api.type~Enum.TramTrackType) + +``` +Enum.TramTrackType: TramTrackType +``` + +### Enum.LandUseType[πŸ”—](#$api.type~Enum.LandUseType) + +``` +Enum.LandUseType: LandUseType +``` + +### Enum.InputMode[πŸ”—](#$api.type~Enum.InputMode) + +``` +Enum.InputMode: InputMode +``` + +### Enum.GamepadType[πŸ”—](#$api.type~Enum.GamepadType) + +``` +Enum.GamepadType: GamepadType +``` + +### Enum.Platform[πŸ”—](#$api.type~Enum.Platform) + +``` +Enum.Platform: Platform +``` + +### Enum.Vendor[πŸ”—](#$api.type~Enum.Vendor) + +``` +Enum.Vendor: Vendor +``` + +### Enum.ConsoleGen[πŸ”—](#$api.type~Enum.ConsoleGen) + +``` +Enum.ConsoleGen: ConsoleGen +``` + +### Enum.TrafficLightPreference[πŸ”—](#$api.type~Enum.TrafficLightPreference) + +``` +Enum.TrafficLightPreference: TrafficLightPreference +``` + +### Enum.BaseEdgeType[πŸ”—](#$api.type~Enum.BaseEdgeType) + +``` +Enum.BaseEdgeType: BaseEdgeType +``` + +### Enum.MoveMode[πŸ”—](#$api.type~Enum.MoveMode) + +``` +Enum.MoveMode: MoveMode +``` + +### Enum.RoadType[πŸ”—](#$api.type~Enum.RoadType) + +``` +Enum.RoadType: RoadType +``` + +### Enum.ScriptParamType[πŸ”—](#$api.type~Enum.ScriptParamType) + +``` +Enum.ScriptParamType: ScriptParamType +``` + +### Enum.ScriptParamLocation[πŸ”—](#$api.type~Enum.ScriptParamLocation) + +``` +Enum.ScriptParamLocation: ScriptParamLocation +``` + +### Enum.ScriptParamDisplayMode[πŸ”—](#$api.type~Enum.ScriptParamDisplayMode) + +``` +Enum.ScriptParamDisplayMode: ScriptParamDisplayMode +``` + +### Enum.DistanceSpeedUnit[πŸ”—](#$api.type~Enum.DistanceSpeedUnit) + +``` +Enum.DistanceSpeedUnit: DistanceSpeedUnit +``` + +### Enum.HudEffectMode[πŸ”—](#$api.type~Enum.HudEffectMode) + +``` +Enum.HudEffectMode: HudEffectMode +``` + +### Enum.FontScaleClass[πŸ”—](#$api.type~Enum.FontScaleClass) + +``` +Enum.FontScaleClass: FontScaleClass +``` + +### Enum.MoneyMode[πŸ”—](#$api.type~Enum.MoneyMode) + +``` +Enum.MoneyMode: MoneyMode +``` + +### Enum.PowerUnit[πŸ”—](#$api.type~Enum.PowerUnit) + +``` +Enum.PowerUnit: PowerUnit +``` + +### Enum.WeightUnit[πŸ”—](#$api.type~Enum.WeightUnit) + +``` +Enum.WeightUnit: WeightUnit +``` + +### Enum.ForceUnit[πŸ”—](#$api.type~Enum.ForceUnit) + +``` +Enum.ForceUnit: ForceUnit +``` + +### Enum.Gender[πŸ”—](#$api.type~Enum.Gender) + +``` +Enum.Gender: Gender +``` + +### Enum.UgcAccessLimitedReason[πŸ”—](#$api.type~Enum.UgcAccessLimitedReason) + +``` +Enum.UgcAccessLimitedReason: UgcAccessLimitedReason +``` + +### Enum.FlightState[πŸ”—](#$api.type~Enum.FlightState) + +``` +Enum.FlightState: FlightState +``` + +### Enum.Easing[πŸ”—](#$api.type~Enum.Easing) + +``` +Enum.Easing: Easing +``` + +### Enum.PdxErrorCodes[πŸ”—](#$api.type~Enum.PdxErrorCodes) + +``` +Enum.PdxErrorCodes: PdxErrorCodes +``` + +### Enum.PdxLegalDocumentType[πŸ”—](#$api.type~Enum.PdxLegalDocumentType) + +``` +Enum.PdxLegalDocumentType: PdxLegalDocumentType +``` + +### Enum.PdxThirdPartyLinkState[πŸ”—](#$api.type~Enum.PdxThirdPartyLinkState) + +``` +Enum.PdxThirdPartyLinkState: PdxThirdPartyLinkState +``` + +### Enum.PdxThirdPartyAutoLoginPromptState[πŸ”—](#$api.type~Enum.PdxThirdPartyAutoLoginPromptState) + +``` +Enum.PdxThirdPartyAutoLoginPromptState: PdxThirdPartyAutoLoginPromptState +``` + +### Environment[πŸ”—](#$api.type~Environment) + +``` +[Expand All] [Collapse All] + +global record Environment record AthmostphereParams new: function(): AthmostphereParams + cloudCoverage: number + cloudBase: number + cloudTop: number + cloudScattering: number + dayOfYear: number + sunRotation: number +end + new: function(): Environment + atmosphere: AthmostphereParams + name: string + isToolEnvironment: boolean +end +``` + +Specification for environment + +### Environment.AthmostphereParams[πŸ”—](#$api.type~Environment.AthmostphereParams) + +``` +record Environment.AthmostphereParams new: function(): AthmostphereParams + cloudCoverage: number + cloudBase: number + cloudTop: number + cloudScattering: number + dayOfYear: number + sunRotation: number +end +``` + +Specification for atmosphere parameters + +### Environment.AthmostphereParams.new[πŸ”—](#$api.type~Environment.AthmostphereParams.new) + +``` +function Environment.AthmostphereParams.new(): AthmostphereParams +``` + +**Returns** + +1. `AthmostphereParams` + +### Environment.AthmostphereParams.cloudCoverage[πŸ”—](#$api.type~Environment.AthmostphereParams.cloudCoverage) + +``` +Environment.AthmostphereParams.cloudCoverage: number +``` + +### Environment.AthmostphereParams.cloudBase[πŸ”—](#$api.type~Environment.AthmostphereParams.cloudBase) + +``` +Environment.AthmostphereParams.cloudBase: number +``` + +### Environment.AthmostphereParams.cloudTop[πŸ”—](#$api.type~Environment.AthmostphereParams.cloudTop) + +``` +Environment.AthmostphereParams.cloudTop: number +``` + +### Environment.AthmostphereParams.cloudScattering[πŸ”—](#$api.type~Environment.AthmostphereParams.cloudScattering) + +``` +Environment.AthmostphereParams.cloudScattering: number +``` + +### Environment.AthmostphereParams.dayOfYear[πŸ”—](#$api.type~Environment.AthmostphereParams.dayOfYear) + +``` +Environment.AthmostphereParams.dayOfYear: number +``` + +### Environment.AthmostphereParams.sunRotation[πŸ”—](#$api.type~Environment.AthmostphereParams.sunRotation) + +``` +Environment.AthmostphereParams.sunRotation: number +``` + +### Environment.new[πŸ”—](#$api.type~Environment.new) + +``` +function Environment.new(): Environment +``` + +**Returns** + +1. `Environment` + +### Environment.atmosphere[πŸ”—](#$api.type~Environment.atmosphere) + +``` +Environment.atmosphere: AthmostphereParams +``` + +### Environment.name[πŸ”—](#$api.type~Environment.name) + +``` +Environment.name: string +``` + +### Environment.isToolEnvironment[πŸ”—](#$api.type~Environment.isToolEnvironment) + +``` +Environment.isToolEnvironment: boolean +``` + +### ExtPath[πŸ”—](#$api.type~ExtPath) + +``` +[Expand All] [Collapse All] + +global record ExtPath record ExtPathEdge range: EdgeRange + link: LinkEdge + record EdgeRange edgeId: EdgeId + params: {number, number} + dir: boolean +end + record LinkEdge points: {EdgePos, EdgePos} +end +end + edges: {ExtPathEdge} +end +``` + +A path comprised of EdgePathEdges that does not necessarily start/end on a Port + +### ExtPath.ExtPathEdge[πŸ”—](#$api.type~ExtPath.ExtPathEdge) + +``` +[Expand All] [Collapse All] + +record ExtPath.ExtPathEdge range: EdgeRange + link: LinkEdge + record EdgeRange edgeId: EdgeId + params: {number, number} + dir: boolean +end + record LinkEdge points: {EdgePos, EdgePos} +end +end +``` + +A path edge of an ExtPath. +It can be either an EdgeRange (a sub-interval of an edge) or a LinkEdge connecting two arbitrary points of different edges. + +### ExtPath.ExtPathEdge.range[πŸ”—](#$api.type~ExtPath.ExtPathEdge.range) + +``` +ExtPath.ExtPathEdge.range: EdgeRange +``` + +If the edge represents an EdgeRange, provides access to its data (nil otherwise) + +### ExtPath.ExtPathEdge.link[πŸ”—](#$api.type~ExtPath.ExtPathEdge.link) + +``` +ExtPath.ExtPathEdge.link: LinkEdge +``` + +If the edge represents a LinkEdge, provides access to its data (nil otherwise) + +### ExtPath.ExtPathEdge.EdgeRange[πŸ”—](#$api.type~ExtPath.ExtPathEdge.EdgeRange) + +``` +record ExtPath.ExtPathEdge.EdgeRange edgeId: EdgeId + params: {number, number} + dir: boolean +end +``` + +An EdgeRange of an ExtPath.ExtPathEdge + +### ExtPath.ExtPathEdge.EdgeRange.edgeId[πŸ”—](#$api.type~ExtPath.ExtPathEdge.EdgeRange.edgeId) + +``` +ExtPath.ExtPathEdge.EdgeRange.edgeId: EdgeId +``` + +The ID of the corresponding transport edge + +### ExtPath.ExtPathEdge.EdgeRange.params[πŸ”—](#$api.type~ExtPath.ExtPathEdge.EdgeRange.params) + +``` +ExtPath.ExtPathEdge.EdgeRange.params: {number, number} +``` + +The start and end positions (range: 0.0 - 1.0) + +### ExtPath.ExtPathEdge.EdgeRange.dir[πŸ”—](#$api.type~ExtPath.ExtPathEdge.EdgeRange.dir) + +``` +ExtPath.ExtPathEdge.EdgeRange.dir: boolean +``` + +Direction along the edge (true if along the direction of edgeId, false for reverse) + +### ExtPath.ExtPathEdge.LinkEdge[πŸ”—](#$api.type~ExtPath.ExtPathEdge.LinkEdge) + +``` +record ExtPath.ExtPathEdge.LinkEdge points: {EdgePos, EdgePos} +end +``` + +A LinkEdge of an ExtPath.ExtPathEdge + +### ExtPath.ExtPathEdge.LinkEdge.points[πŸ”—](#$api.type~ExtPath.ExtPathEdge.LinkEdge.points) + +``` +ExtPath.ExtPathEdge.LinkEdge.points: {EdgePos, EdgePos} +``` + +The two locations that are connected + +### ExtPath.edges[πŸ”—](#$api.type~ExtPath.edges) + +``` +ExtPath.edges: {ExtPathEdge} +``` + +### Extent[πŸ”—](#$api.type~Extent) + +``` +global record Extent new: function(): Extent + + bbMax: Vec3f + bbMin: Vec3f +end +``` + +Information about the game-logic related bounds, usually for vehicles (bbMax.x being the vehicle's front) + +### Extent.new()[πŸ”—](#$api.type~Extent.new()) + +``` +function Extent.new()(): Extent +``` + +Creates a new extent with zero bounds + +**Returns** + +1. `Extent` + +### Extent.new(Vec3f, Vec3f)[πŸ”—](#$api.type~Extent.new(Vec3f, Vec3f)) + +``` +function Extent.new(Vec3f, Vec3f)(bbMin : Vec3f, bbMax : Vec3f): Extent +``` + +Creates a new bounding info with specified bounds + +**Parameters** + +* `bbMin` :`Vec3f` β€” Corner with lowest coordinates +* `bbMax` :`Vec3f` β€” Corner with highest coordinates + +**Returns** + +1. `Extent` + +### Extent.bbMax[πŸ”—](#$api.type~Extent.bbMax) + +``` +Extent.bbMax: Vec3f +``` + +Corner with lowest coordinates + +### Extent.bbMin[πŸ”—](#$api.type~Extent.bbMin) + +``` +Extent.bbMin: Vec3f +``` + +Corner with highest coordinates + +### Failure[πŸ”—](#$api.type~Failure) + +``` +[Expand All] [Collapse All] + +global record Failure record Reason Unkown: Reason + NoPath: Reason + NoElectric: Reason + NoTram: Reason + NoTramButTramTrack: Reason + NoTramTrackButRail: Reason + NoRail: Reason + NoRoad: Reason + NoSmallAircraft: Reason + NoSmallShip: Reason +end + reason: Reason + pos: Vec3f +end +``` + +### Failure.Reason[πŸ”—](#$api.type~Failure.Reason) + +``` +record Failure.Reason Unkown: Reason + NoPath: Reason + NoElectric: Reason + NoTram: Reason + NoTramButTramTrack: Reason + NoTramTrackButRail: Reason + NoRail: Reason + NoRoad: Reason + NoSmallAircraft: Reason + NoSmallShip: Reason +end +``` + +### Failure.Reason.Unkown[πŸ”—](#$api.type~Failure.Reason.Unkown) + +``` +Failure.Reason.Unkown: Reason +``` + +### Failure.Reason.NoPath[πŸ”—](#$api.type~Failure.Reason.NoPath) + +``` +Failure.Reason.NoPath: Reason +``` + +### Failure.Reason.NoElectric[πŸ”—](#$api.type~Failure.Reason.NoElectric) + +``` +Failure.Reason.NoElectric: Reason +``` + +### Failure.Reason.NoTram[πŸ”—](#$api.type~Failure.Reason.NoTram) + +``` +Failure.Reason.NoTram: Reason +``` + +### Failure.Reason.NoTramButTramTrack[πŸ”—](#$api.type~Failure.Reason.NoTramButTramTrack) + +``` +Failure.Reason.NoTramButTramTrack: Reason +``` + +### Failure.Reason.NoTramTrackButRail[πŸ”—](#$api.type~Failure.Reason.NoTramTrackButRail) + +``` +Failure.Reason.NoTramTrackButRail: Reason +``` + +### Failure.Reason.NoRail[πŸ”—](#$api.type~Failure.Reason.NoRail) + +``` +Failure.Reason.NoRail: Reason +``` + +### Failure.Reason.NoRoad[πŸ”—](#$api.type~Failure.Reason.NoRoad) + +``` +Failure.Reason.NoRoad: Reason +``` + +### Failure.Reason.NoSmallAircraft[πŸ”—](#$api.type~Failure.Reason.NoSmallAircraft) + +``` +Failure.Reason.NoSmallAircraft: Reason +``` + +### Failure.Reason.NoSmallShip[πŸ”—](#$api.type~Failure.Reason.NoSmallShip) + +``` +Failure.Reason.NoSmallShip: Reason +``` + +### Failure.reason[πŸ”—](#$api.type~Failure.reason) + +``` +Failure.reason: Reason +``` + +### Failure.pos[πŸ”—](#$api.type~Failure.pos) + +``` +Failure.pos: Vec3f +``` + +### FilePath[πŸ”—](#$api.type~FilePath) + +``` +global type FilePath = string +``` + +### FinanceData[πŸ”—](#$api.type~FinanceData) + +``` +global record FinanceData equals: function(FinanceData, FinanceData): boolean + transport: {JournalEntry.Carrier : {integer : {integer}}} + investment: {integer : {integer}} + other: {JournalEntry.Other, {integer}} + loan: {integer} + interest: {integer} + loanBorrowing: {integer} + loanRepayment: {integer} + total: {integer} + balance: {integer} + header: {string} + unfoldKey: function(FinanceData, integer): {JournalEntry.Type, JournalEntry.Maintenance, JournalEntry.Construction} + foreach_carrier: function(FinanceData, function(JournalEntry.Carrier, {integer : {integer}})) + foreach_transport: function(FinanceData, function(integer, {integer}), JournalEntry.Carrier) + foreach_investment: function(FinanceData, function(integer, {integer})) + foreach_other: function(FinanceData, function(JournalEntry.Other, {integer})) +end +``` + +### FinanceData.equals[πŸ”—](#$api.type~FinanceData.equals) + +``` +function FinanceData.equals(FinanceData, FinanceData): boolean +``` + +**Parameters** + +* `FinanceData` +* `FinanceData` + +**Returns** + +1. `boolean` + +### FinanceData.transport[πŸ”—](#$api.type~FinanceData.transport) + +``` +FinanceData.transport: {JournalEntry.Carrier : {integer : {integer}}} +``` + +### FinanceData.investment[πŸ”—](#$api.type~FinanceData.investment) + +``` +FinanceData.investment: {integer : {integer}} +``` + +### FinanceData.other[πŸ”—](#$api.type~FinanceData.other) + +``` +FinanceData.other: {JournalEntry.Other, {integer}} +``` + +### FinanceData.loan[πŸ”—](#$api.type~FinanceData.loan) + +``` +FinanceData.loan: {integer} +``` + +### FinanceData.interest[πŸ”—](#$api.type~FinanceData.interest) + +``` +FinanceData.interest: {integer} +``` + +### FinanceData.loanBorrowing[πŸ”—](#$api.type~FinanceData.loanBorrowing) + +``` +FinanceData.loanBorrowing: {integer} +``` + +### FinanceData.loanRepayment[πŸ”—](#$api.type~FinanceData.loanRepayment) + +``` +FinanceData.loanRepayment: {integer} +``` + +### FinanceData.total[πŸ”—](#$api.type~FinanceData.total) + +``` +FinanceData.total: {integer} +``` + +### FinanceData.balance[πŸ”—](#$api.type~FinanceData.balance) + +``` +FinanceData.balance: {integer} +``` + +### FinanceData.header[πŸ”—](#$api.type~FinanceData.header) + +``` +FinanceData.header: {string} +``` + +### FinanceData.unfoldKey[πŸ”—](#$api.type~FinanceData.unfoldKey) + +``` +function FinanceData.unfoldKey(FinanceData, integer): {JournalEntry.Type, JournalEntry.Maintenance, JournalEntry.Construction} +``` + +**Parameters** + +* `FinanceData` +* `integer` + +**Returns** + +1. `{JournalEntry.Type, JournalEntry.Maintenance, JournalEntry.Construction}` + +### FinanceData.foreach\_carrier[πŸ”—](#$api.type~FinanceData.foreach_carrier) + +``` +function FinanceData.foreach_carrier(FinanceData, function(JournalEntry.Carrier, {integer : {integer}})) +``` + +**Parameters** + +* `FinanceData` +* `function(JournalEntry.Carrier, {integer : {integer}})` + +### FinanceData.foreach\_transport[πŸ”—](#$api.type~FinanceData.foreach_transport) + +``` +function FinanceData.foreach_transport(FinanceData, function(integer, {integer}), JournalEntry.Carrier) +``` + +**Parameters** + +* `FinanceData` +* `function(integer, {integer})` +* `JournalEntry.Carrier` + +### FinanceData.foreach\_investment[πŸ”—](#$api.type~FinanceData.foreach_investment) + +``` +function FinanceData.foreach_investment(FinanceData, function(integer, {integer})) +``` + +**Parameters** + +* `FinanceData` +* `function(integer, {integer})` + +### FinanceData.foreach\_other[πŸ”—](#$api.type~FinanceData.foreach_other) + +``` +function FinanceData.foreach_other(FinanceData, function(JournalEntry.Other, {integer})) +``` + +**Parameters** + +* `FinanceData` +* `function(JournalEntry.Other, {integer})` + +### FlightState[πŸ”—](#$api.type~FlightState) + +``` +global record FlightState Taxi0: FlightState + TakeOff: FlightState + Flight: FlightState + Approach: FlightState + Landing: FlightState + Taxi1: FlightState +end +``` + +Flight State of an Aircraft + +### FlightState.Taxi0[πŸ”—](#$api.type~FlightState.Taxi0) + +``` +FlightState.Taxi0: FlightState +``` + +### FlightState.TakeOff[πŸ”—](#$api.type~FlightState.TakeOff) + +``` +FlightState.TakeOff: FlightState +``` + +### FlightState.Flight[πŸ”—](#$api.type~FlightState.Flight) + +``` +FlightState.Flight: FlightState +``` + +### FlightState.Approach[πŸ”—](#$api.type~FlightState.Approach) + +``` +FlightState.Approach: FlightState +``` + +### FlightState.Landing[πŸ”—](#$api.type~FlightState.Landing) + +``` +FlightState.Landing: FlightState +``` + +### FlightState.Taxi1[πŸ”—](#$api.type~FlightState.Taxi1) + +``` +FlightState.Taxi1: FlightState +``` + +### FontScaleClass[πŸ”—](#$api.type~FontScaleClass) + +``` +global record FontScaleClass Small: FontScaleClass + Medium: FontScaleClass + Large: FontScaleClass +end +``` + +FontScaleClass represents the current UI font scaling factor. + +### FontScaleClass.Small[πŸ”—](#$api.type~FontScaleClass.Small) + +``` +FontScaleClass.Small: FontScaleClass +``` + +### FontScaleClass.Medium[πŸ”—](#$api.type~FontScaleClass.Medium) + +``` +FontScaleClass.Medium: FontScaleClass +``` + +### FontScaleClass.Large[πŸ”—](#$api.type~FontScaleClass.Large) + +``` +FontScaleClass.Large: FontScaleClass +``` + +### ForceUnit[πŸ”—](#$api.type~ForceUnit) + +``` +global record ForceUnit KN: ForceUnit + KGF: ForceUnit + LBF: ForceUnit +end +``` + +ForceUnit represents the unit of measurement used for force. + +### ForceUnit.KN[πŸ”—](#$api.type~ForceUnit.KN) + +``` +ForceUnit.KN: ForceUnit +``` + +### ForceUnit.KGF[πŸ”—](#$api.type~ForceUnit.KGF) + +``` +ForceUnit.KGF: ForceUnit +``` + +### ForceUnit.LBF[πŸ”—](#$api.type~ForceUnit.LBF) + +``` +ForceUnit.LBF: ForceUnit +``` + +### GPUCapabilities[πŸ”—](#$api.type~GPUCapabilities) + +``` +global record GPUCapabilities hasDiscreteGPU: boolean + hasUnsupportedGPU: boolean +end +``` + +### GPUCapabilities.hasDiscreteGPU[πŸ”—](#$api.type~GPUCapabilities.hasDiscreteGPU) + +``` +GPUCapabilities.hasDiscreteGPU: boolean +``` + +### GPUCapabilities.hasUnsupportedGPU[πŸ”—](#$api.type~GPUCapabilities.hasUnsupportedGPU) + +``` +GPUCapabilities.hasUnsupportedGPU: boolean +``` + +### GameMap[πŸ”—](#$api.type~GameMap) + +``` +[Expand All] [Collapse All] + +global record GameMap record Town new: function(): Town + pos: Vec2f + name: string + sizeFactors: {number} + landUse2CargoNeeds: {LandUseType : {{string, number}}} + existing: Engine.Entity +end + record Industry new: function(): Industry + pos: Vec2f + angle: number + onWater: boolean + fileName: string + tag: string + existing: Engine.Entity +end + record MapTree add: function(category : GameMap.MapTree, position : string, Vec3f) +end + record MapAsset add: function(category : GameMap.MapAsset, position : string, Mat4f) +end + record Tree id: integer + pos: Vec3f +end + record Asset id: integer + transf: Mat4f +end + new: function(): GameMap + + setHeightMap: function(GameMap, integer, number) + heightmap: {number} + numTilesX: integer + numTilesY: integer + levels: integer + offsetZ: number + waterLevel: number + climateId: string + resolution: Vec3f + towns: {GameMap.Town} + industries: {GameMap.Industry} + townConnections: {{integer, integer}} + trees: GameMap.MapTree + assets: GameMap.MapAsset +end +``` + +Information about the map, for map generation purposes. + +### GameMap.Town[πŸ”—](#$api.type~GameMap.Town) + +``` +record GameMap.Town new: function(): Town + pos: Vec2f + name: string + sizeFactors: {number} + landUse2CargoNeeds: {LandUseType : {{string, number}}} + existing: Engine.Entity +end +``` + +Information about towns on a map + +### GameMap.Town.new[πŸ”—](#$api.type~GameMap.Town.new) + +``` +function GameMap.Town.new(): Town +``` + +**Returns** + +1. `Town` + +### GameMap.Town.pos[πŸ”—](#$api.type~GameMap.Town.pos) + +``` +GameMap.Town.pos: Vec2f +``` + +Town placement position + +### GameMap.Town.name[πŸ”—](#$api.type~GameMap.Town.name) + +``` +GameMap.Town.name: string +``` + +Town name + +### GameMap.Town.sizeFactors[πŸ”—](#$api.type~GameMap.Town.sizeFactors) + +``` +GameMap.Town.sizeFactors: {number} +``` + +The size factor for each district + +### GameMap.Town.landUse2CargoNeeds[πŸ”—](#$api.type~GameMap.Town.landUse2CargoNeeds) + +``` +GameMap.Town.landUse2CargoNeeds: {LandUseType : {{string, number}}} +``` + +Cargo categories per land use type (note: these are *not* CargoTypeId's) + +### GameMap.Town.existing[πŸ”—](#$api.type~GameMap.Town.existing) + +``` +GameMap.Town.existing: Engine.Entity +``` + +The town entity if it already exists + +### GameMap.Industry[πŸ”—](#$api.type~GameMap.Industry) + +``` +record GameMap.Industry new: function(): Industry + pos: Vec2f + angle: number + onWater: boolean + fileName: string + tag: string + existing: Engine.Entity +end +``` + +Information about industries on a map + +### GameMap.Industry.new[πŸ”—](#$api.type~GameMap.Industry.new) + +``` +function GameMap.Industry.new(): Industry +``` + +**Returns** + +1. `Industry` + +### GameMap.Industry.pos[πŸ”—](#$api.type~GameMap.Industry.pos) + +``` +GameMap.Industry.pos: Vec2f +``` + +### GameMap.Industry.angle[πŸ”—](#$api.type~GameMap.Industry.angle) + +``` +GameMap.Industry.angle: number +``` + +### GameMap.Industry.onWater[πŸ”—](#$api.type~GameMap.Industry.onWater) + +``` +GameMap.Industry.onWater: boolean +``` + +### GameMap.Industry.fileName[πŸ”—](#$api.type~GameMap.Industry.fileName) + +``` +GameMap.Industry.fileName: string +``` + +### GameMap.Industry.tag[πŸ”—](#$api.type~GameMap.Industry.tag) + +``` +GameMap.Industry.tag: string +``` + +### GameMap.Industry.existing[πŸ”—](#$api.type~GameMap.Industry.existing) + +``` +GameMap.Industry.existing: Engine.Entity +``` + +The industry entity if it already exists + +### GameMap.MapTree[πŸ”—](#$api.type~GameMap.MapTree) + +``` +record GameMap.MapTree add: function(category : GameMap.MapTree, position : string, Vec3f) +end +``` + +Container for tree data to be placed on the map + +### GameMap.MapTree.add[πŸ”—](#$api.type~GameMap.MapTree.add) + +``` +function GameMap.MapTree.add(category : GameMap.MapTree, position : string, Vec3f) +``` + +Adds a tree to the map + +**Parameters** + +* `category` :`GameMap.MapTree` β€” The tree category +* `position` :`string` β€” The world position +* `Vec3f` + +### GameMap.MapAsset[πŸ”—](#$api.type~GameMap.MapAsset) + +``` +record GameMap.MapAsset add: function(category : GameMap.MapAsset, position : string, Mat4f) +end +``` + +Container for asset data to be placed on the map + +### GameMap.MapAsset.add[πŸ”—](#$api.type~GameMap.MapAsset.add) + +``` +function GameMap.MapAsset.add(category : GameMap.MapAsset, position : string, Mat4f) +``` + +Adds an asset to the map + +**Parameters** + +* `category` :`GameMap.MapAsset` β€” The asset category +* `position` :`string` β€” The world transform +* `Mat4f` + +### GameMap.Tree[πŸ”—](#$api.type~GameMap.Tree) + +``` +record GameMap.Tree id: integer + pos: Vec3f +end +``` + +A single tree on the map + +### GameMap.Tree.id[πŸ”—](#$api.type~GameMap.Tree.id) + +``` +GameMap.Tree.id: integer +``` + +Tree model id + +### GameMap.Tree.pos[πŸ”—](#$api.type~GameMap.Tree.pos) + +``` +GameMap.Tree.pos: Vec3f +``` + +Tree position + +### GameMap.Asset[πŸ”—](#$api.type~GameMap.Asset) + +``` +record GameMap.Asset id: integer + transf: Mat4f +end +``` + +A single asset on the map + +### GameMap.Asset.id[πŸ”—](#$api.type~GameMap.Asset.id) + +``` +GameMap.Asset.id: integer +``` + +Asset model id + +### GameMap.Asset.transf[πŸ”—](#$api.type~GameMap.Asset.transf) + +``` +GameMap.Asset.transf: Mat4f +``` + +Asset transform + +### GameMap.new()[πŸ”—](#$api.type~GameMap.new()) + +``` +function GameMap.new()(): GameMap +``` + +**Returns** + +1. `GameMap` + +### GameMap.new(GameMap)[πŸ”—](#$api.type~GameMap.new(GameMap)) + +``` +function GameMap.new(GameMap)(GameMap): GameMap +``` + +Copy constructor + +**Parameters** + +* `GameMap` + +**Returns** + +1. `GameMap` + +### GameMap.setHeightMap[πŸ”—](#$api.type~GameMap.setHeightMap) + +``` +function GameMap.setHeightMap(GameMap, integer, number) +``` + +**Parameters** + +* `GameMap` +* `integer` +* `number` + +### GameMap.heightmap[πŸ”—](#$api.type~GameMap.heightmap) + +``` +GameMap.heightmap: {number} +``` + +### GameMap.numTilesX[πŸ”—](#$api.type~GameMap.numTilesX) + +``` +GameMap.numTilesX: integer +``` + +numTilesX number of tiles (256 m x 256 blocks) in X direction + +### GameMap.numTilesY[πŸ”—](#$api.type~GameMap.numTilesY) + +``` +GameMap.numTilesY: integer +``` + +numTilesY number of tiles (256 m x 256 blocks) in Y direction + +### GameMap.levels[πŸ”—](#$api.type~GameMap.levels) + +``` +GameMap.levels: integer +``` + +### GameMap.offsetZ[πŸ”—](#$api.type~GameMap.offsetZ) + +``` +GameMap.offsetZ: number +``` + +### GameMap.waterLevel[πŸ”—](#$api.type~GameMap.waterLevel) + +``` +GameMap.waterLevel: number +``` + +### GameMap.climateId[πŸ”—](#$api.type~GameMap.climateId) + +``` +GameMap.climateId: string +``` + +### GameMap.resolution[πŸ”—](#$api.type~GameMap.resolution) + +``` +GameMap.resolution: Vec3f +``` + +### GameMap.towns[πŸ”—](#$api.type~GameMap.towns) + +``` +GameMap.towns: {GameMap.Town} +``` + +### GameMap.industries[πŸ”—](#$api.type~GameMap.industries) + +``` +GameMap.industries: {GameMap.Industry} +``` + +### GameMap.townConnections[πŸ”—](#$api.type~GameMap.townConnections) + +``` +GameMap.townConnections: {{integer, integer}} +``` + +### GameMap.trees[πŸ”—](#$api.type~GameMap.trees) + +``` +GameMap.trees: GameMap.MapTree +``` + +### GameMap.assets[πŸ”—](#$api.type~GameMap.assets) + +``` +GameMap.assets: GameMap.MapAsset +``` + +### GameMetadata[πŸ”—](#$api.type~GameMetadata) + +``` +global record GameMetadata date: integer + balance: integer + population: integer + startYear: integer + numVehicleModels: integer + terrainDimensions: Vec2i + companyValue: CompanyValue + transportationStats: TransportationStats + scriptMetadata: SavegameScriptMetadata + gameModDescs: {Mod.GameModDesc} + achievementsEarnable: boolean + screenshot: GameScreenshot +end +``` + +Game metadata from a savegame + +### GameMetadata.date[πŸ”—](#$api.type~GameMetadata.date) + +``` +GameMetadata.date: integer +``` + +### GameMetadata.balance[πŸ”—](#$api.type~GameMetadata.balance) + +``` +GameMetadata.balance: integer +``` + +Player's account balance + +### GameMetadata.population[πŸ”—](#$api.type~GameMetadata.population) + +``` +GameMetadata.population: integer +``` + +Current world population + +### GameMetadata.startYear[πŸ”—](#$api.type~GameMetadata.startYear) + +``` +GameMetadata.startYear: integer +``` + +List of game mods used +Year the game was started + +### GameMetadata.numVehicleModels[πŸ”—](#$api.type~GameMetadata.numVehicleModels) + +``` +GameMetadata.numVehicleModels: integer +``` + +The number of vehicle models present in the savegame + +### GameMetadata.terrainDimensions[πŸ”—](#$api.type~GameMetadata.terrainDimensions) + +``` +GameMetadata.terrainDimensions: Vec2i +``` + +Map dimensions in meters + +### GameMetadata.companyValue[πŸ”—](#$api.type~GameMetadata.companyValue) + +``` +GameMetadata.companyValue: CompanyValue +``` + +### GameMetadata.transportationStats[πŸ”—](#$api.type~GameMetadata.transportationStats) + +``` +GameMetadata.transportationStats: TransportationStats +``` + +### GameMetadata.scriptMetadata[πŸ”—](#$api.type~GameMetadata.scriptMetadata) + +``` +GameMetadata.scriptMetadata: SavegameScriptMetadata +``` + +### GameMetadata.gameModDescs[πŸ”—](#$api.type~GameMetadata.gameModDescs) + +``` +GameMetadata.gameModDescs: {Mod.GameModDesc} +``` + +### GameMetadata.achievementsEarnable[πŸ”—](#$api.type~GameMetadata.achievementsEarnable) + +``` +GameMetadata.achievementsEarnable: boolean +``` + +Whether achievements can be earned + +### GameMetadata.screenshot[πŸ”—](#$api.type~GameMetadata.screenshot) + +``` +GameMetadata.screenshot: GameScreenshot +``` + +Screenshot of the game + +### GameScreenshot[πŸ”—](#$api.type~GameScreenshot) + +``` +global record GameScreenshot width: integer + height: integer + image: {integer} + image_native: Vector +end +``` + +Game screenshot data + +### GameScreenshot.width[πŸ”—](#$api.type~GameScreenshot.width) + +``` +GameScreenshot.width: integer +``` + +Screenshot width in pixels + +### GameScreenshot.height[πŸ”—](#$api.type~GameScreenshot.height) + +``` +GameScreenshot.height: integer +``` + +Screenshot height in pixels + +### GameScreenshot.image[πŸ”—](#$api.type~GameScreenshot.image) + +``` +GameScreenshot.image: {integer} +``` + +Raw image data + +### GameScreenshot.image\_native[πŸ”—](#$api.type~GameScreenshot.image_native) + +``` +GameScreenshot.image_native: Vector +``` + +Native vector of image data + +### GameScriptDesc[πŸ”—](#$api.type~GameScriptDesc) + +``` +global record GameScriptDesc new: function(): GameScriptDesc + + postUpdateScript: ScriptRef + handleEventScript: ScriptRef + guiUpdateScript: ScriptRef + guiHandleEventScript: ScriptRef + updateScript: ScriptRef +end +``` + +Contains all data describing a game script + +### GameScriptDesc.new()[πŸ”—](#$api.type~GameScriptDesc.new()) + +``` +function GameScriptDesc.new()(): GameScriptDesc +``` + +**Returns** + +1. `GameScriptDesc` + +### GameScriptDesc.new(GameScriptDesc)[πŸ”—](#$api.type~GameScriptDesc.new(GameScriptDesc)) + +``` +function GameScriptDesc.new(GameScriptDesc)(GameScriptDesc): GameScriptDesc +``` + +**Parameters** + +* `GameScriptDesc` + +**Returns** + +1. `GameScriptDesc` + +### GameScriptDesc.postUpdateScript[πŸ”—](#$api.type~GameScriptDesc.postUpdateScript) + +``` +GameScriptDesc.postUpdateScript: ScriptRef +``` + +### GameScriptDesc.handleEventScript[πŸ”—](#$api.type~GameScriptDesc.handleEventScript) + +``` +GameScriptDesc.handleEventScript: ScriptRef +``` + +### GameScriptDesc.guiUpdateScript[πŸ”—](#$api.type~GameScriptDesc.guiUpdateScript) + +``` +GameScriptDesc.guiUpdateScript: ScriptRef +``` + +### GameScriptDesc.guiHandleEventScript[πŸ”—](#$api.type~GameScriptDesc.guiHandleEventScript) + +``` +GameScriptDesc.guiHandleEventScript: ScriptRef +``` + +### GameScriptDesc.updateScript[πŸ”—](#$api.type~GameScriptDesc.updateScript) + +``` +GameScriptDesc.updateScript: ScriptRef +``` + +### GamepadType[πŸ”—](#$api.type~GamepadType) + +``` +global record GamepadType None: GamepadType + XBox: GamepadType + PlayStation5: GamepadType + PlayStation4: GamepadType +end +``` + +GamepadType represents the current gamepad. + +### GamepadType.None[πŸ”—](#$api.type~GamepadType.None) + +``` +GamepadType.None: GamepadType +``` + +### GamepadType.XBox[πŸ”—](#$api.type~GamepadType.XBox) + +``` +GamepadType.XBox: GamepadType +``` + +### GamepadType.PlayStation5[πŸ”—](#$api.type~GamepadType.PlayStation5) + +``` +GamepadType.PlayStation5: GamepadType +``` + +### GamepadType.PlayStation4[πŸ”—](#$api.type~GamepadType.PlayStation4) + +``` +GamepadType.PlayStation4: GamepadType +``` + +### Gender[πŸ”—](#$api.type~Gender) + +``` +global record Gender FEMALE: Gender + MALE: Gender +end +``` + +### Gender.FEMALE[πŸ”—](#$api.type~Gender.FEMALE) + +``` +Gender.FEMALE: Gender +``` + +### Gender.MALE[πŸ”—](#$api.type~Gender.MALE) + +``` +Gender.MALE: Gender +``` + +### GenericGameRes[πŸ”—](#$api.type~GenericGameRes) + +``` +global record GenericGameRes new: function(): GenericGameRes + type: string + data: { : } + setData: function(GenericGameRes, { : }) +end +``` + +Describes a generic game resource + +### GenericGameRes.new[πŸ”—](#$api.type~GenericGameRes.new) + +``` +function GenericGameRes.new(): GenericGameRes +``` + +Creates a new empty resource + +**Returns** + +1. `GenericGameRes` + +### GenericGameRes.type[πŸ”—](#$api.type~GenericGameRes.type) + +``` +GenericGameRes.type: string +``` + +Each generic resource has a type to differentiate its uses and enable querying by type + +### GenericGameRes.data[πŸ”—](#$api.type~GenericGameRes.data) + +``` +GenericGameRes.data: { : } +``` + +Any serializable data might be stored in a generic resource + +### GenericGameRes.setData[πŸ”—](#$api.type~GenericGameRes.setData) + +``` +function GenericGameRes.setData(GenericGameRes, { : }) +``` + +Utility function to quickly set a data table + +**Parameters** + +* `GenericGameRes` +* `{ : }` + +### GenericGameResT[πŸ”—](#$api.type~GenericGameResT) + +``` +global record GenericGameResT new: function(): GenericGameResT + type: string + data: T + setData: function(GenericGameResT, T) +end +``` + +Describes a generic game resource + +##### Type Parameters + +* **`T`** + +### GenericGameResT.new[πŸ”—](#$api.type~GenericGameResT.new) + +``` +function GenericGameResT.new(): GenericGameResT +``` + +Creates a new empty resource + +**Returns** + +1. `GenericGameResT` + +### GenericGameResT.type[πŸ”—](#$api.type~GenericGameResT.type) + +``` +GenericGameResT.type: string +``` + +Each generic resource has a type to differentiate its uses and enable querying by type + +### GenericGameResT.data[πŸ”—](#$api.type~GenericGameResT.data) + +``` +GenericGameResT.data: T +``` + +Any serializable data might be stored in a generic resource + +### GenericGameResT.setData[πŸ”—](#$api.type~GenericGameResT.setData) + +``` +function GenericGameResT.setData(GenericGameResT, T) +``` + +Utility function to quickly set a data table + +**Parameters** + +* `GenericGameResT` +* `T` + +### GlobalType[πŸ”—](#$api.type~GlobalType) + +``` +global GlobalType: Type +``` + +### GridCollisionSystem[πŸ”—](#$api.type~GridCollisionSystem) + +``` +global record GridCollisionSystem getCollisionDataAt: function(GridCollisionSystem, Vec2f): integer +end +``` + +A single instance of a grid collision system + +### GridCollisionSystem.getCollisionDataAt[πŸ”—](#$api.type~GridCollisionSystem.getCollisionDataAt) + +``` +function GridCollisionSystem.getCollisionDataAt(GridCollisionSystem, Vec2f): integer +``` + +Gets the collision data at the specified position + +**Parameters** + +* `GridCollisionSystem` +* `Vec2f` + +**Returns** + +1. `integer` + +### GridVec2f[πŸ”—](#$api.type~GridVec2f) + +``` +global record GridVec2f new: function(): GridVec2f + + width: integer + height: integer + x0: integer + y0: integer + at: function(grid : GridVec2f, pos : Vec2i): Vec2f +end +``` + +A 2D grid of Vec2f values + +### GridVec2f.new()[πŸ”—](#$api.type~GridVec2f.new()) + +``` +function GridVec2f.new()(): GridVec2f +``` + +Creates a new empty grid. + +**Returns** + +1. `GridVec2f` β€” New empty GridVec2f + +### GridVec2f.new(integer, integer, integer, integer)[πŸ”—](#$api.type~GridVec2f.new(integer, integer, integer, integer)) + +``` +function GridVec2f.new(integer, integer, integer, integer)(x0 : integer, y0 : integer, width : integer, height : integer): GridVec2f +``` + +Creates a new grid with specified dimensions. + +**Parameters** + +* `x0` :`integer` β€” X offset of the grid +* `y0` :`integer` β€” Y offset of the grid +* `width` :`integer` β€” Grid width +* `height` :`integer` β€” Grid height + +**Returns** + +1. `GridVec2f` β€” New GridVec2f + +### GridVec2f.new(integer, integer, integer, integer, number)[πŸ”—](#$api.type~GridVec2f.new(integer, integer, integer, integer, number)) + +``` +function GridVec2f.new(integer, integer, integer, integer, number)(x0 : integer, y0 : integer, width : integer, height : integer, value : number): GridVec2f +``` + +Creates a new grid with specified dimensions and initial value. + +**Parameters** + +* `x0` :`integer` β€” X offset of the grid +* `y0` :`integer` β€” Y offset of the grid +* `width` :`integer` β€” Grid width +* `height` :`integer` β€” Grid height +* `value` :`number` β€” Initial value for all cells + +**Returns** + +1. `GridVec2f` β€” New GridVec2f + +### GridVec2f.width[πŸ”—](#$api.type~GridVec2f.width) + +``` +GridVec2f.width: integer +``` + +Grid width + +### GridVec2f.height[πŸ”—](#$api.type~GridVec2f.height) + +``` +GridVec2f.height: integer +``` + +Grid height + +### GridVec2f.x0[πŸ”—](#$api.type~GridVec2f.x0) + +``` +GridVec2f.x0: integer +``` + +X offset of the grid + +### GridVec2f.y0[πŸ”—](#$api.type~GridVec2f.y0) + +``` +GridVec2f.y0: integer +``` + +Y offset of the grid + +### GridVec2f.at[πŸ”—](#$api.type~GridVec2f.at) + +``` +function GridVec2f.at(grid : GridVec2f, pos : Vec2i): Vec2f +``` + +Get value at position + +**Parameters** + +* `grid` :`GridVec2f` β€” Grid to query +* `pos` :`Vec2i` β€” Grid position + +**Returns** + +1. `Vec2f` β€” Vec2f value at position + +### Gridf[πŸ”—](#$api.type~Gridf) + +``` +global record Gridf new: function(): Gridf + + width: integer + height: integer + at: function(pos : Vec2i): number +end +``` + +A 2D grid of float values + +### Gridf.new()[πŸ”—](#$api.type~Gridf.new()) + +``` +function Gridf.new()(): Gridf +``` + +Creates a new empty grid. + +**Returns** + +1. `Gridf` β€” New empty Gridf + +### Gridf.new(integer, integer, integer, integer)[πŸ”—](#$api.type~Gridf.new(integer, integer, integer, integer)) + +``` +function Gridf.new(integer, integer, integer, integer)(x0 : integer, y0 : integer, width : integer, height : integer): Gridf +``` + +Creates a new grid with specified dimensions. + +**Parameters** + +* `x0` :`integer` β€” X offset of the grid +* `y0` :`integer` β€” Y offset of the grid +* `width` :`integer` β€” Grid width +* `height` :`integer` β€” Grid height + +**Returns** + +1. `Gridf` β€” New Gridf + +### Gridf.new(integer, integer, integer, integer, number)[πŸ”—](#$api.type~Gridf.new(integer, integer, integer, integer, number)) + +``` +function Gridf.new(integer, integer, integer, integer, number)(x0 : integer, y0 : integer, width : integer, height : integer, value : number): Gridf +``` + +Creates a new grid with specified dimensions and initial value. + +**Parameters** + +* `x0` :`integer` β€” X offset of the grid +* `y0` :`integer` β€” Y offset of the grid +* `width` :`integer` β€” Grid width +* `height` :`integer` β€” Grid height +* `value` :`number` β€” Initial value for all cells + +**Returns** + +1. `Gridf` β€” New Gridf + +### Gridf.width[πŸ”—](#$api.type~Gridf.width) + +``` +Gridf.width: integer +``` + +Grid width + +### Gridf.height[πŸ”—](#$api.type~Gridf.height) + +``` +Gridf.height: integer +``` + +Grid height + +### Gridf.at[πŸ”—](#$api.type~Gridf.at) + +``` +function Gridf.at(pos : Vec2i): number +``` + +Get value at position. Returns 0 if position is out of bounds. + +**Parameters** + +* `pos` :`Vec2i` β€” Grid position + +**Returns** + +1. `number` β€” Value at position + +### GroundTexture[πŸ”—](#$api.type~GroundTexture) + +``` +[Expand All] [Collapse All] + +global record GroundTexture new: function(): GroundTexture + + matIndexMap: { : } + indices: { : } + priority: integer + texSize: number + record Data data: { : } + size: integer +end +end +``` + +Specification for ground textures + +### GroundTexture.new()[πŸ”—](#$api.type~GroundTexture.new()) + +``` +function GroundTexture.new()(): GroundTexture +``` + +**Returns** + +1. `GroundTexture` + +### GroundTexture.new(GroundTexture)[πŸ”—](#$api.type~GroundTexture.new(GroundTexture)) + +``` +function GroundTexture.new(GroundTexture)(GroundTexture): GroundTexture +``` + +**Parameters** + +* `GroundTexture` + +**Returns** + +1. `GroundTexture` + +### GroundTexture.matIndexMap[πŸ”—](#$api.type~GroundTexture.matIndexMap) + +``` +GroundTexture.matIndexMap: { : } +``` + +Mapping of material indices + +### GroundTexture.indices[πŸ”—](#$api.type~GroundTexture.indices) + +``` +GroundTexture.indices: { : } +``` + +Texture indices + +### GroundTexture.priority[πŸ”—](#$api.type~GroundTexture.priority) + +``` +GroundTexture.priority: integer +``` + +Priority for texture selection + +### GroundTexture.texSize[πŸ”—](#$api.type~GroundTexture.texSize) + +``` +GroundTexture.texSize: number +``` + +Size of the texture + +### GroundTexture.Data[πŸ”—](#$api.type~GroundTexture.Data) + +``` +record GroundTexture.Data data: { : } + size: integer +end +``` + +Extra information for ground textures + +### GroundTexture.Data.data[πŸ”—](#$api.type~GroundTexture.Data.data) + +``` +GroundTexture.Data.data: { : } +``` + +Raw texture data + +### GroundTexture.Data.size[πŸ”—](#$api.type~GroundTexture.Data.size) + +``` +GroundTexture.Data.size: integer +``` + +Size of the texture data + +### HeighmapGenerationMode[πŸ”—](#$api.type~HeighmapGenerationMode) + +``` +global record HeighmapGenerationMode new: function(): HeighmapGenerationMode + terrainGenerator: string + generateTowns: boolean + generateIndustries: boolean + generateAssets: boolean + keepHeightmap: boolean +end +``` + +Map generation mode for heightmap generation + +### HeighmapGenerationMode.new[πŸ”—](#$api.type~HeighmapGenerationMode.new) + +``` +function HeighmapGenerationMode.new(): HeighmapGenerationMode +``` + +**Returns** + +1. `HeighmapGenerationMode` + +### HeighmapGenerationMode.terrainGenerator[πŸ”—](#$api.type~HeighmapGenerationMode.terrainGenerator) + +``` +HeighmapGenerationMode.terrainGenerator: string +``` + +Terrain generator script resource name + +### HeighmapGenerationMode.generateTowns[πŸ”—](#$api.type~HeighmapGenerationMode.generateTowns) + +``` +HeighmapGenerationMode.generateTowns: boolean +``` + +Whether to generate towns + +### HeighmapGenerationMode.generateIndustries[πŸ”—](#$api.type~HeighmapGenerationMode.generateIndustries) + +``` +HeighmapGenerationMode.generateIndustries: boolean +``` + +Whether to generate industries + +### HeighmapGenerationMode.generateAssets[πŸ”—](#$api.type~HeighmapGenerationMode.generateAssets) + +``` +HeighmapGenerationMode.generateAssets: boolean +``` + +Whether to generate assets + +### HeighmapGenerationMode.keepHeightmap[πŸ”—](#$api.type~HeighmapGenerationMode.keepHeightmap) + +``` +HeighmapGenerationMode.keepHeightmap: boolean +``` + +Whether to keep the heightmap + +### HeightmapNew[πŸ”—](#$api.type~HeightmapNew) + +``` +global record HeightmapNew getSize: function(): Vec2i + at: function(x : integer, y : integer): number +end +``` + +Abstraction of heightmap data, consisting of a cell with floating point values at each point + +### HeightmapNew.getSize[πŸ”—](#$api.type~HeightmapNew.getSize) + +``` +function HeightmapNew.getSize(): Vec2i +``` + +The total size of the heightmap (x, y) + +**Returns** + +1. `Vec2i` + +### HeightmapNew.at[πŸ”—](#$api.type~HeightmapNew.at) + +``` +function HeightmapNew.at(x : integer, y : integer): number +``` + +Get the value of the heightmap at the given x, y coordinate + +**Parameters** + +* `x` :`integer` β€” x coordinate +* `y` :`integer` β€” y coordinate + +**Returns** + +1. `number` + +### HudEffectMode[πŸ”—](#$api.type~HudEffectMode) + +``` +global record HudEffectMode Always: HudEffectMode + CockpitOnly: HudEffectMode + Never: HudEffectMode +end +``` + +HudEffectMode configures the HUD effects + +### HudEffectMode.Always[πŸ”—](#$api.type~HudEffectMode.Always) + +``` +HudEffectMode.Always: HudEffectMode +``` + +### HudEffectMode.CockpitOnly[πŸ”—](#$api.type~HudEffectMode.CockpitOnly) + +``` +HudEffectMode.CockpitOnly: HudEffectMode +``` + +### HudEffectMode.Never[πŸ”—](#$api.type~HudEffectMode.Never) + +``` +HudEffectMode.Never: HudEffectMode +``` + +### ImportExportHeightmapMode[πŸ”—](#$api.type~ImportExportHeightmapMode) + +``` +global record ImportExportHeightmapMode new: function(): ImportExportHeightmapMode + fileName: string + import: boolean + generateAssets: boolean + minH: number + maxH: number +end +``` + +Map generation mode for importing or exporting heightmaps + +### ImportExportHeightmapMode.new[πŸ”—](#$api.type~ImportExportHeightmapMode.new) + +``` +function ImportExportHeightmapMode.new(): ImportExportHeightmapMode +``` + +**Returns** + +1. `ImportExportHeightmapMode` + +### ImportExportHeightmapMode.fileName[πŸ”—](#$api.type~ImportExportHeightmapMode.fileName) + +``` +ImportExportHeightmapMode.fileName: string +``` + +File name for import/export + +### ImportExportHeightmapMode.import[πŸ”—](#$api.type~ImportExportHeightmapMode.import) + +``` +ImportExportHeightmapMode.import: boolean +``` + +Whether to import (true) or export (false) + +### ImportExportHeightmapMode.generateAssets[πŸ”—](#$api.type~ImportExportHeightmapMode.generateAssets) + +``` +ImportExportHeightmapMode.generateAssets: boolean +``` + +Whether to generate assets + +### ImportExportHeightmapMode.minH[πŸ”—](#$api.type~ImportExportHeightmapMode.minH) + +``` +ImportExportHeightmapMode.minH: number +``` + +Minimum height value + +### ImportExportHeightmapMode.maxH[πŸ”—](#$api.type~ImportExportHeightmapMode.maxH) + +``` +ImportExportHeightmapMode.maxH: number +``` + +Maximum height value + +### Index[πŸ”—](#$api.type~Index) + +``` +global type Index = integer +``` + +### IndustryInfo[πŸ”—](#$api.type~IndustryInfo) + +``` +global record IndustryInfo fileName: string + bbox: Box2f + streetPoint: Vec2i + transf: Mat4f + onWater: boolean +end +``` + +Industry placement information + +### IndustryInfo.fileName[πŸ”—](#$api.type~IndustryInfo.fileName) + +``` +IndustryInfo.fileName: string +``` + +### IndustryInfo.bbox[πŸ”—](#$api.type~IndustryInfo.bbox) + +``` +IndustryInfo.bbox: Box2f +``` + +### IndustryInfo.streetPoint[πŸ”—](#$api.type~IndustryInfo.streetPoint) + +``` +IndustryInfo.streetPoint: Vec2i +``` + +### IndustryInfo.transf[πŸ”—](#$api.type~IndustryInfo.transf) + +``` +IndustryInfo.transf: Mat4f +``` + +### IndustryInfo.onWater[πŸ”—](#$api.type~IndustryInfo.onWater) + +``` +IndustryInfo.onWater: boolean +``` + +### IndustryResult[πŸ”—](#$api.type~IndustryResult) + +``` +global record IndustryResult toRemove: {Engine.Entity} + toAdd: {IndustryInfo} +end +``` + +Results of industry generation operations + +### IndustryResult.toRemove[πŸ”—](#$api.type~IndustryResult.toRemove) + +``` +IndustryResult.toRemove: {Engine.Entity} +``` + +### IndustryResult.toAdd[πŸ”—](#$api.type~IndustryResult.toAdd) + +``` +IndustryResult.toAdd: {IndustryInfo} +``` + +### InputActionDesc[πŸ”—](#$api.type~InputActionDesc) + +``` +global record InputActionDesc uiName: string + type: integer + defaultBindings: {KeyComboDef} + modifierOnly: boolean + uiCategory: string + uiOrder: integer + duplicateOf: string + duplicatedKeybindings: boolean +end +``` + +Description of an input action for key binding + +### InputActionDesc.uiName[πŸ”—](#$api.type~InputActionDesc.uiName) + +``` +InputActionDesc.uiName: string +``` + +Display name in UI + +### InputActionDesc.type[πŸ”—](#$api.type~InputActionDesc.type) + +``` +InputActionDesc.type: integer +``` + +Type index +`0`: Simple +`1`: AxisLinear +`2`: AxisRadial + +### InputActionDesc.defaultBindings[πŸ”—](#$api.type~InputActionDesc.defaultBindings) + +``` +InputActionDesc.defaultBindings: {KeyComboDef} +``` + +Default key bindings for this action + +### InputActionDesc.modifierOnly[πŸ”—](#$api.type~InputActionDesc.modifierOnly) + +``` +InputActionDesc.modifierOnly: boolean +``` + +Whether this action is modifier-only (i.e. has no trigger key and can be triggered even if the keys are already used elsewhere) + +### InputActionDesc.uiCategory[πŸ”—](#$api.type~InputActionDesc.uiCategory) + +``` +InputActionDesc.uiCategory: string +``` + +UI category for organization in settings menu + +### InputActionDesc.uiOrder[πŸ”—](#$api.type~InputActionDesc.uiOrder) + +``` +InputActionDesc.uiOrder: integer +``` + +Display order inside the category in settings menu + +### InputActionDesc.duplicateOf[πŸ”—](#$api.type~InputActionDesc.duplicateOf) + +``` +InputActionDesc.duplicateOf: string +``` + +This is supposed to be an alias only duplicateOf + +### InputActionDesc.duplicatedKeybindings[πŸ”—](#$api.type~InputActionDesc.duplicatedKeybindings) + +``` +InputActionDesc.duplicatedKeybindings: boolean +``` + +If keybindings are configured exactly as for the duplicateOf. UI should hide the entry in this case. + +### InputActionRep[πŸ”—](#$api.type~InputActionRep) + +``` +global record InputActionRep getAll: function(InputActionRep): {string} + get: function(InputActionRep, string): InputActionDesc +end +``` + +### InputActionRep.getAll[πŸ”—](#$api.type~InputActionRep.getAll) + +``` +function InputActionRep.getAll(InputActionRep): {string} +``` + +**Parameters** + +* `InputActionRep` + +**Returns** + +1. `{string}` + +### InputActionRep.get[πŸ”—](#$api.type~InputActionRep.get) + +``` +function InputActionRep.get(InputActionRep, string): InputActionDesc +``` + +**Parameters** + +* `InputActionRep` +* `string` + +**Returns** + +1. `InputActionDesc` + +### InputMode[πŸ”—](#$api.type~InputMode) + +``` +global record InputMode Undefined: InputMode + KeyboardMouse: InputMode + Gamepad: InputMode +end +``` + +InputMode represents the current input mode. + +### InputMode.Undefined[πŸ”—](#$api.type~InputMode.Undefined) + +``` +InputMode.Undefined: InputMode +``` + +### InputMode.KeyboardMouse[πŸ”—](#$api.type~InputMode.KeyboardMouse) + +``` +InputMode.KeyboardMouse: InputMode +``` + +### InputMode.Gamepad[πŸ”—](#$api.type~InputMode.Gamepad) + +``` +InputMode.Gamepad: InputMode +``` + +### KeyCombo[πŸ”—](#$api.type~KeyCombo) + +``` +global record KeyCombo new: function(KeyComboDef): KeyCombo + toString: function(KeyCombo): string + isModifierOnly: function(KeyCombo): boolean + relevantFor: function(KeyCombo, InputMode): boolean +end +``` + +Key combination for input binding + +### KeyCombo.new[πŸ”—](#$api.type~KeyCombo.new) + +``` +function KeyCombo.new(KeyComboDef): KeyCombo +``` + +**Parameters** + +* `KeyComboDef` + +**Returns** + +1. `KeyCombo` + +### KeyCombo.toString[πŸ”—](#$api.type~KeyCombo.toString) + +``` +function KeyCombo.toString(KeyCombo): string +``` + +**Parameters** + +* `KeyCombo` + +**Returns** + +1. `string` + +### KeyCombo.isModifierOnly[πŸ”—](#$api.type~KeyCombo.isModifierOnly) + +``` +function KeyCombo.isModifierOnly(KeyCombo): boolean +``` + +**Parameters** + +* `KeyCombo` + +**Returns** + +1. `boolean` + +### KeyCombo.relevantFor[πŸ”—](#$api.type~KeyCombo.relevantFor) + +``` +function KeyCombo.relevantFor(KeyCombo, InputMode): boolean +``` + +**Parameters** + +* `KeyCombo` +* `InputMode` + +**Returns** + +1. `boolean` + +### KeyComboDef[πŸ”—](#$api.type~KeyComboDef) + +``` +global record KeyComboDef new: function(): KeyComboDef + + setKeyScancode: function(KeyComboDef, integer) + addModifierKey: function(KeyComboDef, integer) + condition: integer +end +``` + +Key combination definition for input binding + +### KeyComboDef.new()[πŸ”—](#$api.type~KeyComboDef.new()) + +``` +function KeyComboDef.new()(): KeyComboDef +``` + +**Returns** + +1. `KeyComboDef` + +### KeyComboDef.new(KeyComboDef)[πŸ”—](#$api.type~KeyComboDef.new(KeyComboDef)) + +``` +function KeyComboDef.new(KeyComboDef)(KeyComboDef): KeyComboDef +``` + +**Parameters** + +* `KeyComboDef` + +**Returns** + +1. `KeyComboDef` + +### KeyComboDef.setKeyScancode[πŸ”—](#$api.type~KeyComboDef.setKeyScancode) + +``` +function KeyComboDef.setKeyScancode(KeyComboDef, integer) +``` + +Set the trigger key to this scancode (ignored if scancode is a modifier key) + +**Parameters** + +* `KeyComboDef` +* `integer` + +### KeyComboDef.addModifierKey[πŸ”—](#$api.type~KeyComboDef.addModifierKey) + +``` +function KeyComboDef.addModifierKey(KeyComboDef, integer) +``` + +Add a modifier scancode to this combination (ignored if scancode is not a modifier key) + +**Parameters** + +* `KeyComboDef` +* `integer` + +### KeyComboDef.condition[πŸ”—](#$api.type~KeyComboDef.condition) + +``` +KeyComboDef.condition: integer +``` + +Trigger condition for the key combination +`0`: Initial trigger on keydown or when conflicting longpress is rejected + +`1`: Initial triggers when keycombo is pressed for X time) + +### LandUseType[πŸ”—](#$api.type~LandUseType) + +``` +global record LandUseType RESIDENTIAL: LandUseType + COMMERCIAL: LandUseType + INDUSTRIAL: LandUseType +end +``` + +Enumeration for land use types + +### LandUseType.RESIDENTIAL[πŸ”—](#$api.type~LandUseType.RESIDENTIAL) + +``` +LandUseType.RESIDENTIAL: LandUseType +``` + +### LandUseType.COMMERCIAL[πŸ”—](#$api.type~LandUseType.COMMERCIAL) + +``` +LandUseType.COMMERCIAL: LandUseType +``` + +### LandUseType.INDUSTRIAL[πŸ”—](#$api.type~LandUseType.INDUSTRIAL) + +``` +LandUseType.INDUSTRIAL: LandUseType +``` + +### LandVehicleMoveInfo[πŸ”—](#$api.type~LandVehicleMoveInfo) + +``` +global record LandVehicleMoveInfo availPower: number + traction: number + tractiveEffort: number + vehicleAvailPower: {number} +end +``` + +Movement information for land vehicles (trains, trams, road vehicles) + +### LandVehicleMoveInfo.availPower[πŸ”—](#$api.type~LandVehicleMoveInfo.availPower) + +``` +LandVehicleMoveInfo.availPower: number +``` + +### LandVehicleMoveInfo.traction[πŸ”—](#$api.type~LandVehicleMoveInfo.traction) + +``` +LandVehicleMoveInfo.traction: number +``` + +### LandVehicleMoveInfo.tractiveEffort[πŸ”—](#$api.type~LandVehicleMoveInfo.tractiveEffort) + +``` +LandVehicleMoveInfo.tractiveEffort: number +``` + +### LandVehicleMoveInfo.vehicleAvailPower[πŸ”—](#$api.type~LandVehicleMoveInfo.vehicleAvailPower) + +``` +LandVehicleMoveInfo.vehicleAvailPower: {number} +``` + +Available power per vehicle part + +### LaneConfig[πŸ”—](#$api.type~LaneConfig) + +``` +global record LaneConfig speed: number + width: number + height: number + forward: boolean + transportModes: {TransportMode : boolean} + offset: number +end +``` + +Specification for the lanes of street + +### LaneConfig.speed[πŸ”—](#$api.type~LaneConfig.speed) + +``` +LaneConfig.speed: number +``` + +Speed limit for the lane + +### LaneConfig.width[πŸ”—](#$api.type~LaneConfig.width) + +``` +LaneConfig.width: number +``` + +Width of the lane + +### LaneConfig.height[πŸ”—](#$api.type~LaneConfig.height) + +``` +LaneConfig.height: number +``` + +Height of the lane + +### LaneConfig.forward[πŸ”—](#$api.type~LaneConfig.forward) + +``` +LaneConfig.forward: boolean +``` + +Whether the lane is in forward direction + +### LaneConfig.transportModes[πŸ”—](#$api.type~LaneConfig.transportModes) + +``` +LaneConfig.transportModes: {TransportMode : boolean} +``` + +Transport modes allowed on this lane + +### LaneConfig.offset[πŸ”—](#$api.type~LaneConfig.offset) + +``` +LaneConfig.offset: number +``` + +Offset from center + +### LaneConnection[πŸ”—](#$api.type~LaneConnection) + +``` +global record LaneConnection segment0: Engine.Entity + lane0: integer + segment1: Engine.Entity + lane1: integer + withRoad: boolean + withTram: boolean +end +``` + +A custom configuration for lanes on crossings + +### LaneConnection.segment0[πŸ”—](#$api.type~LaneConnection.segment0) + +``` +LaneConnection.segment0: Engine.Entity +``` + +Incoming segment entity + +### LaneConnection.lane0[πŸ”—](#$api.type~LaneConnection.lane0) + +``` +LaneConnection.lane0: integer +``` + +Incoming lane index (zero-based, from left to right when looking from the Node to segment0) + +### LaneConnection.segment1[πŸ”—](#$api.type~LaneConnection.segment1) + +``` +LaneConnection.segment1: Engine.Entity +``` + +Outgoing segment entity + +### LaneConnection.lane1[πŸ”—](#$api.type~LaneConnection.lane1) + +``` +LaneConnection.lane1: integer +``` + +Outgoing lane index (zero-based, from left to right when looking from the Node to segment1) + +### LaneConnection.withRoad[πŸ”—](#$api.type~LaneConnection.withRoad) + +``` +LaneConnection.withRoad: boolean +``` + +Whether connection supports road + +### LaneConnection.withTram[πŸ”—](#$api.type~LaneConnection.withTram) + +``` +LaneConnection.withTram: boolean +``` + +Whether connection supports tram + +### LangKey[πŸ”—](#$api.type~LangKey) + +``` +global record LangKey new: function(): LangKey + equals: function(LangKey, LangKey): boolean + code: string + mod: Mod.ModId +end +``` + +Localization information + +### LangKey.new[πŸ”—](#$api.type~LangKey.new) + +``` +function LangKey.new(): LangKey +``` + +**Returns** + +1. `LangKey` + +### LangKey.equals[πŸ”—](#$api.type~LangKey.equals) + +``` +function LangKey.equals(LangKey, LangKey): boolean +``` + +**Parameters** + +* `LangKey` +* `LangKey` + +**Returns** + +1. `boolean` + +### LangKey.code[πŸ”—](#$api.type~LangKey.code) + +``` +LangKey.code: string +``` + +Language code as two characters code or two characters and a two character rvariant code separated by underscore + +### LangKey.mod[πŸ”—](#$api.type~LangKey.mod) + +``` +LangKey.mod: Mod.ModId +``` + +Mod from which the lanuage is originating from + +### LanguageRep[πŸ”—](#$api.type~LanguageRep) + +``` +global record LanguageRep getAllLanguages: function(LanguageRep): {{string, LangKey}} +end +``` + +Contains all available languages of the application, including languages added by mods + +### LanguageRep.getAllLanguages[πŸ”—](#$api.type~LanguageRep.getAllLanguages) + +``` +function LanguageRep.getAllLanguages(LanguageRep): {{string, LangKey}} +``` + +**Parameters** + +* `LanguageRep` + +**Returns** + +1. `{{string, LangKey}}` + +### LayerConfig[πŸ”—](#$api.type~LayerConfig) + +``` +[Expand All] [Collapse All] + +global record LayerConfig new: function(): LayerConfig + + record EmissionColorMap new: function(): EmissionColorMap + + record Colors new: function(): Colors + + numberOfLevels: integer + colors: {Vec4f} + thresholds: {number} +end + record VisualizationType DecibelCurrent: VisualizationType + DecibelAverage: VisualizationType + Combined: VisualizationType +end + colors: Colors + currentEmissionId: Engine.Component.EmissionGrid.Type + visualizationType: VisualizationType +end + record TerrainColorMap new: function(): TerrainColorMap + + record Colors new: function(): Colors + + numberOfLevels: integer + colors: {Vec4f} + thresholds: {number} + water: Vec4f + navigableWater: Vec4f + interpolateNavigableWater: boolean +end + colors: Colors +end + record TerrainContours new: function(): TerrainContours + + record Contour new: function(): Contour + + color: Vec4f + level: number + thickness: number + fadeDistance: number +end + contours: {Contour} +end + record ColorPassFn new: function(): ColorPassFn + + record BaseColor new: function(BaseColor): BaseColor + fromColor: function(Vec4f, boolean): BaseColor + value: Vec4f + overrideColorMap: boolean +end + record BaseMappedColor new: function(): BaseMappedColor + + thresholds: {number} + colors: {Vec4f} + nearest: boolean + overrideColorMap: boolean +end + record BaseRangeColor new: function(): BaseRangeColor + + minMax: {Vec4f} + overrideColorMap: boolean +end + record CargoColor new: function(): CargoColor + clone: function(CargoColor): CargoColor + residential: BaseRangeColor + industrial: BaseRangeColor + commercial: BaseRangeColor + numBuildingLevels: integer + includePassengers: boolean +end + record DestinationColor new: function(): DestinationColor + + town: Engine.Entity + showPlayerTransport: boolean + showPrivateTransport: boolean + residential: BaseRangeColor + industrial: BaseRangeColor + commercial: BaseRangeColor + numBuildingLevels: integer +end + record EmissionEmitterColor new: function(): EmissionEmitterColor + + color: BaseRangeColor + currentEmissionId: Engine.Component.EmissionGrid.Type + lowerBound: number + upperBound: number + goodColor: BaseRangeColor + goodColorLowerBound: number + goodColorUpperBound: number +end + record EmissionImpactColor new: function(): EmissionImpactColor + + color: BaseRangeColor + currentEmissionId: Engine.Component.EmissionGrid.Type + useAverage: boolean + lowerBoundDB: number + upperBoundDB: number +end + record FallbackColor new: function(): FallbackColor + + terrain: BaseColor + water: BaseColor + edge: BaseColor + node: BaseColor + parallelStrip: BaseColor + whatever: BaseColor +end + record IndustryColor new: function(): IndustryColor + + industry: BaseColor + onlyWithPersonCapacity: boolean +end + record LandUseColor new: function(): LandUseColor + + residential: BaseRangeColor + industrial: BaseRangeColor + commercial: BaseRangeColor +end + record LineVehicleColor new: function(): LineVehicleColor + + highlightedEntities: {Engine.Entity} + carriers: {Carrier} +end + record MaintainedTransportVehicleColor new: function(): MaintainedTransportVehicleColor + + color: BaseColor + maintenanceStationEntity: Engine.Entity +end + record StationOvercrowdedColor new: function(): StationOvercrowdedColor + + color: BaseMappedColor +end + record SpeedLimitsColor new: function(): SpeedLimitsColor + + slowToFast: {BaseColor} + numberOfLevels: integer + hideNonPlayerOwned: boolean + hideNonLocked: boolean +end + record TrafficColor new: function(): TrafficColor + + poorToGood: {BaseColor} + numberOfLevels: integer + discrete: boolean +end + record HappinessColor new: function(): HappinessColor + + normalToPoor: {BaseColor} +end + terrainPainter: any + waterPainter: any + townBuildingPainter: any + industryPainter: any + emissionEmitterPainter: any + stationPainter: any + warehousePainter: any + transportNetworkPainter: any + transportVehiclePainter: any + landVehiclePainter: any + simAtTerminalPainter: any + fallbackColor: FallbackColor +end + record BuildingRenderableConfig new: function(): BuildingRenderableConfig + + isVisible: boolean + includeTownBuildings: boolean + includeTownBuildingModels: boolean + includeTownBuildingMainModel: boolean + includeIndustries: boolean + includeWarehouses: boolean + includeStations: boolean + includeEdges: boolean +end + record CatchmentAreaDisplaySettings new: function(): CatchmentAreaDisplaySettings + + personBaseColor: Vec3f + cargoBaseColor: Vec3f + inactiveColor: Vec3f + unreachableColor: Vec3f + deleteColor: Vec3f + maintenanceColor: Vec3f + noiseColor: Vec3f + pollutionColor: Vec3f + borderAlpha: number + borderAlphaPassive: number + godrayAlpha: number + godrayAlphaPassive: number + innerAlpha: number + buildingAlpha: number + borderWidth: number +end + record CatchmentAreaRenderableConfig new: function(): CatchmentAreaRenderableConfig + + isVisible: boolean + displaySettings: CatchmentAreaDisplaySettings + cargo: boolean + person: boolean + maintenance: boolean + noise: boolean + pollution: boolean + addGodrays: boolean + entity: Engine.Entity + carriers: {Carrier} +end + record PlotsRenderableConfig new: function(): PlotsRenderableConfig + + triangles: {Vec2f} +end + record SignConfig new: function(): SignConfig + + signRenderDistance: number +end + record CargoEdgesRenderables new: function(): CargoEdgesRenderables + + town: Engine.Entity + cargoTypes: {CargoTypeId} + showPlayerTransport: boolean + showPrivateTransport: boolean + playerTransportColor: {Vec4f, Vec4f} + privateTransportColor: {Vec4f, Vec4f} + numTransportLevels: integer + signConfig: SignConfig +end + record SatisfactionEdgesRenderables new: function(): SatisfactionEdgesRenderables + + town: Engine.Entity + cargoTypes: {CargoTypeId} + colors: {Vec4f} + thresholds: {number} + signConfig: SignConfig +end + record SpeedLimitsEdgesRenderables new: function(): SpeedLimitsEdgesRenderables + + speedColor: {Vec4f, Vec4f, Vec4f} + undergroundSpeedColor: {Vec4f, Vec4f, Vec4f} + numberOfLevels: integer + tunnelOutlineColor: Vec4f + tunnelOutlineSize: number + signConfig: SignConfig + hideNonPlayerOwned: boolean + hideNonLocked: boolean +end + record TrafficEdgesRenderables new: function(): TrafficEdgesRenderables + + trafficColor: {Vec4f, Vec4f, Vec4f} + undergroundTrafficColor: {Vec4f, Vec4f, Vec4f} + numberOfLevels: integer + discrete: boolean + tunnelOutlineColor: Vec4f + tunnelOutlineSize: number +end + record VoronoiRenderableConfig new: function(): VoronoiRenderableConfig + + showTowns: boolean + townsOfInterest: {Engine.Entity} + showMapBorder: boolean + lineWidth: number + colors: {Vec4f} + sectionsPerColor: integer + fadingMinHeight: number + fadingDeltaHeight: number +end + record WindRenderableConfig new: function(): WindRenderableConfig + + isVisible: boolean + emissionType: Engine.Component.EmissionGrid.Type +end + record CargoFlowRenderableConfig new: function(): CargoFlowRenderableConfig + + record FlowData new: function(): FlowData + + from: Vec3f + to: Vec3f + speed: number + arrowColors: {Vec4f} + cargoIconAlpha: number + cargoTypes: {CargoTypeId} +end + flowData: {FlowData} +end + colorMap: any + contours: TerrainContours + colorPassFn: ColorPassFn + colorPassFnForBuildingRenderableOnly: boolean + buildingRenderableConfig: BuildingRenderableConfig + catchmentAreaRenderableConfig: CatchmentAreaRenderableConfig + edgeRenderableConfig: any + voronoiRenderableConfig: VoronoiRenderableConfig + windRenderableConfig: WindRenderableConfig + plotsRenderableConfig: PlotsRenderableConfig + cargoFlowRenderableConfig: CargoFlowRenderableConfig + undergroundMode: boolean + showOneWay: boolean +end +``` + +Describes configuration for 3d layers that can be enabled with the react interface + +### LayerConfig.new()[πŸ”—](#$api.type~LayerConfig.new()) + +``` +function LayerConfig.new()(): LayerConfig +``` + +**Returns** + +1. `LayerConfig` + +### LayerConfig.new(LayerConfig)[πŸ”—](#$api.type~LayerConfig.new(LayerConfig)) + +``` +function LayerConfig.new(LayerConfig)(LayerConfig): LayerConfig +``` + +**Parameters** + +* `LayerConfig` + +**Returns** + +1. `LayerConfig` + +### LayerConfig.EmissionColorMap[πŸ”—](#$api.type~LayerConfig.EmissionColorMap) + +``` +[Expand All] [Collapse All] + +record LayerConfig.EmissionColorMap new: function(): EmissionColorMap + + record Colors new: function(): Colors + + numberOfLevels: integer + colors: {Vec4f} + thresholds: {number} +end + record VisualizationType DecibelCurrent: VisualizationType + DecibelAverage: VisualizationType + Combined: VisualizationType +end + colors: Colors + currentEmissionId: Engine.Component.EmissionGrid.Type + visualizationType: VisualizationType +end +``` + +Colors entities and terrain based on + +### LayerConfig.EmissionColorMap.new()[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.new()) + +``` +function LayerConfig.EmissionColorMap.new()(): EmissionColorMap +``` + +**Returns** + +1. `EmissionColorMap` + +### LayerConfig.EmissionColorMap.new(EmissionColorMap)[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.new(EmissionColorMap)) + +``` +function LayerConfig.EmissionColorMap.new(EmissionColorMap)(EmissionColorMap): EmissionColorMap +``` + +**Parameters** + +* `EmissionColorMap` + +**Returns** + +1. `EmissionColorMap` + +### LayerConfig.EmissionColorMap.Colors[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.Colors) + +``` +record LayerConfig.EmissionColorMap.Colors new: function(): Colors + + numberOfLevels: integer + colors: {Vec4f} + thresholds: {number} +end +``` + +Thresholds and colors for the emission visualization gradient + +### LayerConfig.EmissionColorMap.Colors.new()[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.Colors.new()) + +``` +function LayerConfig.EmissionColorMap.Colors.new()(): Colors +``` + +**Returns** + +1. `Colors` + +### LayerConfig.EmissionColorMap.Colors.new(Colors)[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.Colors.new(Colors)) + +``` +function LayerConfig.EmissionColorMap.Colors.new(Colors)(Colors): Colors +``` + +**Parameters** + +* `Colors` + +**Returns** + +1. `Colors` + +### LayerConfig.EmissionColorMap.Colors.numberOfLevels[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.Colors.numberOfLevels) + +``` +LayerConfig.EmissionColorMap.Colors.numberOfLevels: integer +``` + +### LayerConfig.EmissionColorMap.Colors.colors[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.Colors.colors) + +``` +LayerConfig.EmissionColorMap.Colors.colors: {Vec4f} +``` + +### LayerConfig.EmissionColorMap.Colors.thresholds[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.Colors.thresholds) + +``` +LayerConfig.EmissionColorMap.Colors.thresholds: {number} +``` + +### LayerConfig.EmissionColorMap.VisualizationType[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.VisualizationType) + +``` +record LayerConfig.EmissionColorMap.VisualizationType DecibelCurrent: VisualizationType + DecibelAverage: VisualizationType + Combined: VisualizationType +end +``` + +Type of visualization for the emission color + +### LayerConfig.EmissionColorMap.VisualizationType.DecibelCurrent[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.VisualizationType.DecibelCurrent) + +``` +LayerConfig.EmissionColorMap.VisualizationType.DecibelCurrent: VisualizationType +``` + +### LayerConfig.EmissionColorMap.VisualizationType.DecibelAverage[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.VisualizationType.DecibelAverage) + +``` +LayerConfig.EmissionColorMap.VisualizationType.DecibelAverage: VisualizationType +``` + +### LayerConfig.EmissionColorMap.VisualizationType.Combined[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.VisualizationType.Combined) + +``` +LayerConfig.EmissionColorMap.VisualizationType.Combined: VisualizationType +``` + +### LayerConfig.EmissionColorMap.colors[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.colors) + +``` +LayerConfig.EmissionColorMap.colors: Colors +``` + +Configures colors as a gradient map from the given threshold + +### LayerConfig.EmissionColorMap.currentEmissionId[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.currentEmissionId) + +``` +LayerConfig.EmissionColorMap.currentEmissionId: Engine.Component.EmissionGrid.Type +``` + +Choose among visualization of noise or pollution + +### LayerConfig.EmissionColorMap.visualizationType[πŸ”—](#$api.type~LayerConfig.EmissionColorMap.visualizationType) + +``` +LayerConfig.EmissionColorMap.visualizationType: VisualizationType +``` + +The type of emission visualization to dsplay: average or instant + +### LayerConfig.TerrainColorMap[πŸ”—](#$api.type~LayerConfig.TerrainColorMap) + +``` +[Expand All] [Collapse All] + +record LayerConfig.TerrainColorMap new: function(): TerrainColorMap + + record Colors new: function(): Colors + + numberOfLevels: integer + colors: {Vec4f} + thresholds: {number} + water: Vec4f + navigableWater: Vec4f + interpolateNavigableWater: boolean +end + colors: Colors +end +``` + +Configures the terrain to be visualize terrain heightmap features like elevation and presence of navigable waters + +### LayerConfig.TerrainColorMap.new()[πŸ”—](#$api.type~LayerConfig.TerrainColorMap.new()) + +``` +function LayerConfig.TerrainColorMap.new()(): TerrainColorMap +``` + +Iniztialize a new TerrainColorMap object + +**Returns** + +1. `TerrainColorMap` + +### LayerConfig.TerrainColorMap.new(TerrainColorMap)[πŸ”—](#$api.type~LayerConfig.TerrainColorMap.new(TerrainColorMap)) + +``` +function LayerConfig.TerrainColorMap.new(TerrainColorMap)(TerrainColorMap): TerrainColorMap +``` + +Copy constructs a TerrainColorMap + +**Parameters** + +* `TerrainColorMap` + +**Returns** + +1. `TerrainColorMap` + +### LayerConfig.TerrainColorMap.Colors[πŸ”—](#$api.type~LayerConfig.TerrainColorMap.Colors) + +``` +record LayerConfig.TerrainColorMap.Colors new: function(): Colors + + numberOfLevels: integer + colors: {Vec4f} + thresholds: {number} + water: Vec4f + navigableWater: Vec4f + interpolateNavigableWater: boolean +end +``` + +Actual color configuration for the terrain visualization + +### LayerConfig.TerrainColorMap.Colors.new()[πŸ”—](#$api.type~LayerConfig.TerrainColorMap.Colors.new()) + +``` +function LayerConfig.TerrainColorMap.Colors.new()(): Colors +``` + +**Returns** + +1. `Colors` + +### LayerConfig.TerrainColorMap.Colors.new(Colors)[πŸ”—](#$api.type~LayerConfig.TerrainColorMap.Colors.new(Colors)) + +``` +function LayerConfig.TerrainColorMap.Colors.new(Colors)(Colors): Colors +``` + +**Parameters** + +* `Colors` + +**Returns** + +1. `Colors` + +### LayerConfig.TerrainColorMap.Colors.numberOfLevels[πŸ”—](#$api.type~LayerConfig.TerrainColorMap.Colors.numberOfLevels) + +``` +LayerConfig.TerrainColorMap.Colors.numberOfLevels: integer +``` + +### LayerConfig.TerrainColorMap.Colors.colors[πŸ”—](#$api.type~LayerConfig.TerrainColorMap.Colors.colors) + +``` +LayerConfig.TerrainColorMap.Colors.colors: {Vec4f} +``` + +Set the colors corrsponding to the thresholds, length must be equal to numerOfLevels and less than 4 + +### LayerConfig.TerrainColorMap.Colors.thresholds[πŸ”—](#$api.type~LayerConfig.TerrainColorMap.Colors.thresholds) + +``` +LayerConfig.TerrainColorMap.Colors.thresholds: {number} +``` + +Elevation thresholds (in meters above water) for the matching colors + +### LayerConfig.TerrainColorMap.Colors.water[πŸ”—](#$api.type~LayerConfig.TerrainColorMap.Colors.water) + +``` +LayerConfig.TerrainColorMap.Colors.water: Vec4f +``` + +Color (as RGBA value) of non-navigable waters + +### LayerConfig.TerrainColorMap.Colors.navigableWater[πŸ”—](#$api.type~LayerConfig.TerrainColorMap.Colors.navigableWater) + +``` +LayerConfig.TerrainColorMap.Colors.navigableWater: Vec4f +``` + +Color (as RGBA value) of navigable waters + +### LayerConfig.TerrainColorMap.Colors.interpolateNavigableWater[πŸ”—](#$api.type~LayerConfig.TerrainColorMap.Colors.interpolateNavigableWater) + +``` +LayerConfig.TerrainColorMap.Colors.interpolateNavigableWater: boolean +``` + +Smoothen edges of navigable water grid with linear interpolation for more pleasant (yet imprecise) look + +### LayerConfig.TerrainColorMap.colors[πŸ”—](#$api.type~LayerConfig.TerrainColorMap.colors) + +``` +LayerConfig.TerrainColorMap.colors: Colors +``` + +Color configuration for the TerrainColorMap + +### LayerConfig.TerrainContours[πŸ”—](#$api.type~LayerConfig.TerrainContours) + +``` +[Expand All] [Collapse All] + +record LayerConfig.TerrainContours new: function(): TerrainContours + + record Contour new: function(): Contour + + color: Vec4f + level: number + thickness: number + fadeDistance: number +end + contours: {Contour} +end +``` + +Configuration for contour lines + +### LayerConfig.TerrainContours.new()[πŸ”—](#$api.type~LayerConfig.TerrainContours.new()) + +``` +function LayerConfig.TerrainContours.new()(): TerrainContours +``` + +**Returns** + +1. `TerrainContours` + +### LayerConfig.TerrainContours.new(TerrainContours)[πŸ”—](#$api.type~LayerConfig.TerrainContours.new(TerrainContours)) + +``` +function LayerConfig.TerrainContours.new(TerrainContours)(TerrainContours): TerrainContours +``` + +**Parameters** + +* `TerrainContours` + +**Returns** + +1. `TerrainContours` + +### LayerConfig.TerrainContours.Contour[πŸ”—](#$api.type~LayerConfig.TerrainContours.Contour) + +``` +record LayerConfig.TerrainContours.Contour new: function(): Contour + + color: Vec4f + level: number + thickness: number + fadeDistance: number +end +``` + +Configuration of a single contour (level line) + +### LayerConfig.TerrainContours.Contour.new()[πŸ”—](#$api.type~LayerConfig.TerrainContours.Contour.new()) + +``` +function LayerConfig.TerrainContours.Contour.new()(): Contour +``` + +**Returns** + +1. `Contour` + +### LayerConfig.TerrainContours.Contour.new(Contour)[πŸ”—](#$api.type~LayerConfig.TerrainContours.Contour.new(Contour)) + +``` +function LayerConfig.TerrainContours.Contour.new(Contour)(Contour): Contour +``` + +**Parameters** + +* `Contour` + +**Returns** + +1. `Contour` + +### LayerConfig.TerrainContours.Contour.color[πŸ”—](#$api.type~LayerConfig.TerrainContours.Contour.color) + +``` +LayerConfig.TerrainContours.Contour.color: Vec4f +``` + +### LayerConfig.TerrainContours.Contour.level[πŸ”—](#$api.type~LayerConfig.TerrainContours.Contour.level) + +``` +LayerConfig.TerrainContours.Contour.level: number +``` + +### LayerConfig.TerrainContours.Contour.thickness[πŸ”—](#$api.type~LayerConfig.TerrainContours.Contour.thickness) + +``` +LayerConfig.TerrainContours.Contour.thickness: number +``` + +Thicknes of the contour + +### LayerConfig.TerrainContours.Contour.fadeDistance[πŸ”—](#$api.type~LayerConfig.TerrainContours.Contour.fadeDistance) + +``` +LayerConfig.TerrainContours.Contour.fadeDistance: number +``` + +how far the countour lines will be visible for + +### LayerConfig.TerrainContours.contours[πŸ”—](#$api.type~LayerConfig.TerrainContours.contours) + +``` +LayerConfig.TerrainContours.contours: {Contour} +``` + +List of contours for the terrain (at most 10) + +### LayerConfig.ColorPassFn[πŸ”—](#$api.type~LayerConfig.ColorPassFn) + +``` +[Expand All] [Collapse All] + +record LayerConfig.ColorPassFn new: function(): ColorPassFn + + record BaseColor new: function(BaseColor): BaseColor + fromColor: function(Vec4f, boolean): BaseColor + value: Vec4f + overrideColorMap: boolean +end + record BaseMappedColor new: function(): BaseMappedColor + + thresholds: {number} + colors: {Vec4f} + nearest: boolean + overrideColorMap: boolean +end + record BaseRangeColor new: function(): BaseRangeColor + + minMax: {Vec4f} + overrideColorMap: boolean +end + record CargoColor new: function(): CargoColor + clone: function(CargoColor): CargoColor + residential: BaseRangeColor + industrial: BaseRangeColor + commercial: BaseRangeColor + numBuildingLevels: integer + includePassengers: boolean +end + record DestinationColor new: function(): DestinationColor + + town: Engine.Entity + showPlayerTransport: boolean + showPrivateTransport: boolean + residential: BaseRangeColor + industrial: BaseRangeColor + commercial: BaseRangeColor + numBuildingLevels: integer +end + record EmissionEmitterColor new: function(): EmissionEmitterColor + + color: BaseRangeColor + currentEmissionId: Engine.Component.EmissionGrid.Type + lowerBound: number + upperBound: number + goodColor: BaseRangeColor + goodColorLowerBound: number + goodColorUpperBound: number +end + record EmissionImpactColor new: function(): EmissionImpactColor + + color: BaseRangeColor + currentEmissionId: Engine.Component.EmissionGrid.Type + useAverage: boolean + lowerBoundDB: number + upperBoundDB: number +end + record FallbackColor new: function(): FallbackColor + + terrain: BaseColor + water: BaseColor + edge: BaseColor + node: BaseColor + parallelStrip: BaseColor + whatever: BaseColor +end + record IndustryColor new: function(): IndustryColor + + industry: BaseColor + onlyWithPersonCapacity: boolean +end + record LandUseColor new: function(): LandUseColor + + residential: BaseRangeColor + industrial: BaseRangeColor + commercial: BaseRangeColor +end + record LineVehicleColor new: function(): LineVehicleColor + + highlightedEntities: {Engine.Entity} + carriers: {Carrier} +end + record MaintainedTransportVehicleColor new: function(): MaintainedTransportVehicleColor + + color: BaseColor + maintenanceStationEntity: Engine.Entity +end + record StationOvercrowdedColor new: function(): StationOvercrowdedColor + + color: BaseMappedColor +end + record SpeedLimitsColor new: function(): SpeedLimitsColor + + slowToFast: {BaseColor} + numberOfLevels: integer + hideNonPlayerOwned: boolean + hideNonLocked: boolean +end + record TrafficColor new: function(): TrafficColor + + poorToGood: {BaseColor} + numberOfLevels: integer + discrete: boolean +end + record HappinessColor new: function(): HappinessColor + + normalToPoor: {BaseColor} +end + terrainPainter: any + waterPainter: any + townBuildingPainter: any + industryPainter: any + emissionEmitterPainter: any + stationPainter: any + warehousePainter: any + transportNetworkPainter: any + transportVehiclePainter: any + landVehiclePainter: any + simAtTerminalPainter: any + fallbackColor: FallbackColor +end +``` + +Configures the coloring for entities: each entity type can be configured with its own specific coloring +among a selection of available modes + +### LayerConfig.ColorPassFn.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.new()) + +``` +function LayerConfig.ColorPassFn.new()(): ColorPassFn +``` + +Creates a new isntance of a color pass configuration + +**Returns** + +1. `ColorPassFn` + +### LayerConfig.ColorPassFn.new(ColorPassFn)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.new(ColorPassFn)) + +``` +function LayerConfig.ColorPassFn.new(ColorPassFn)(ColorPassFn): ColorPassFn +``` + +Copy the color pass function + +**Parameters** + +* `ColorPassFn` + +**Returns** + +1. `ColorPassFn` + +### LayerConfig.ColorPassFn.BaseColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseColor) + +``` +record LayerConfig.ColorPassFn.BaseColor new: function(BaseColor): BaseColor + fromColor: function(Vec4f, boolean): BaseColor + value: Vec4f + overrideColorMap: boolean +end +``` + +Generic static constant color for this type of entity, can be applied to any entity + +### LayerConfig.ColorPassFn.BaseColor.new[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseColor.new) + +``` +function LayerConfig.ColorPassFn.BaseColor.new(BaseColor): BaseColor +``` + +Creates a new instance of a basic color with default values or as a copy of an existing color + +**Parameters** + +* `BaseColor` + +**Returns** + +1. `BaseColor` + +### LayerConfig.ColorPassFn.BaseColor.fromColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseColor.fromColor) + +``` +function LayerConfig.ColorPassFn.BaseColor.fromColor(Vec4f, boolean): BaseColor +``` + +Create an instance of base color from a color + +**Parameters** + +* `Vec4f` +* `boolean` + +**Returns** + +1. `BaseColor` + +### LayerConfig.ColorPassFn.BaseColor.value[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseColor.value) + +``` +LayerConfig.ColorPassFn.BaseColor.value: Vec4f +``` + +Color RGBA value + +### LayerConfig.ColorPassFn.BaseColor.overrideColorMap[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseColor.overrideColorMap) + +``` +LayerConfig.ColorPassFn.BaseColor.overrideColorMap: boolean +``` + +If this value is set, the value of a configured color map (such as emission) will be overridden + +### LayerConfig.ColorPassFn.BaseMappedColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseMappedColor) + +``` +record LayerConfig.ColorPassFn.BaseMappedColor new: function(): BaseMappedColor + + thresholds: {number} + colors: {Vec4f} + nearest: boolean + overrideColorMap: boolean +end +``` + +A color that depends on the given input values and applies a different gradient depending on the input + +### LayerConfig.ColorPassFn.BaseMappedColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseMappedColor.new()) + +``` +function LayerConfig.ColorPassFn.BaseMappedColor.new()(): BaseMappedColor +``` + +**Returns** + +1. `BaseMappedColor` + +### LayerConfig.ColorPassFn.BaseMappedColor.new(BaseMappedColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseMappedColor.new(BaseMappedColor)) + +``` +function LayerConfig.ColorPassFn.BaseMappedColor.new(BaseMappedColor)(BaseMappedColor): BaseMappedColor +``` + +**Parameters** + +* `BaseMappedColor` + +**Returns** + +1. `BaseMappedColor` + +### LayerConfig.ColorPassFn.BaseMappedColor.new({number}, {Vec4f}, boolean, boolean)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseMappedColor.new({number}, {Vec4f}, boolean, boolean)) + +``` +function LayerConfig.ColorPassFn.BaseMappedColor.new({number}, {Vec4f}, boolean, boolean)({number}, {Vec4f}, boolean, boolean): BaseRangeColor +``` + +**Parameters** + +* `{number}` +* `{Vec4f}` +* `boolean` +* `boolean` + +**Returns** + +1. `BaseRangeColor` + +### LayerConfig.ColorPassFn.BaseMappedColor.thresholds[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseMappedColor.thresholds) + +``` +LayerConfig.ColorPassFn.BaseMappedColor.thresholds: {number} +``` + +Specifies values that are assigned to the specific colors + +### LayerConfig.ColorPassFn.BaseMappedColor.colors[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseMappedColor.colors) + +``` +LayerConfig.ColorPassFn.BaseMappedColor.colors: {Vec4f} +``` + +List of colors for the matching thresholds. Must have the same length as thresholds + +### LayerConfig.ColorPassFn.BaseMappedColor.nearest[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseMappedColor.nearest) + +``` +LayerConfig.ColorPassFn.BaseMappedColor.nearest: boolean +``` + +Interpolation applied to color: if neares the gradient will only pick exact values of the color that are specified + +### LayerConfig.ColorPassFn.BaseMappedColor.overrideColorMap[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseMappedColor.overrideColorMap) + +``` +LayerConfig.ColorPassFn.BaseMappedColor.overrideColorMap: boolean +``` + +If this value is set, the value of a configured color map (such as emission) will be overridden + +### LayerConfig.ColorPassFn.BaseRangeColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseRangeColor) + +``` +record LayerConfig.ColorPassFn.BaseRangeColor new: function(): BaseRangeColor + + minMax: {Vec4f} + overrideColorMap: boolean +end +``` + +Specify two colors that will be mixed based on the input value + +### LayerConfig.ColorPassFn.BaseRangeColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseRangeColor.new()) + +``` +function LayerConfig.ColorPassFn.BaseRangeColor.new()(): BaseRangeColor +``` + +Constructs a new empty BaseRangeColor + +**Returns** + +1. `BaseRangeColor` + +### LayerConfig.ColorPassFn.BaseRangeColor.new(BaseRangeColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseRangeColor.new(BaseRangeColor)) + +``` +function LayerConfig.ColorPassFn.BaseRangeColor.new(BaseRangeColor)(BaseRangeColor): BaseRangeColor +``` + +Constructs a copy of the input color range + +**Parameters** + +* `BaseRangeColor` + +**Returns** + +1. `BaseRangeColor` + +### LayerConfig.ColorPassFn.BaseRangeColor.new({Vec4f}, boolean)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseRangeColor.new({Vec4f}, boolean)) + +``` +function LayerConfig.ColorPassFn.BaseRangeColor.new({Vec4f}, boolean)({Vec4f}, boolean): BaseRangeColor +``` + +Constructs a BaseRangeColor given a pair of colorsx + +**Parameters** + +* `{Vec4f}` +* `boolean` + +**Returns** + +1. `BaseRangeColor` + +### LayerConfig.ColorPassFn.BaseRangeColor.minMax[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseRangeColor.minMax) + +``` +LayerConfig.ColorPassFn.BaseRangeColor.minMax: {Vec4f} +``` + +A pair of colors among which the final color will be mixed + +### LayerConfig.ColorPassFn.BaseRangeColor.overrideColorMap[πŸ”—](#$api.type~LayerConfig.ColorPassFn.BaseRangeColor.overrideColorMap) + +``` +LayerConfig.ColorPassFn.BaseRangeColor.overrideColorMap: boolean +``` + +If this value is set, the value of a configured color map (such as emission) will be overridden + +### LayerConfig.ColorPassFn.CargoColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.CargoColor) + +``` +record LayerConfig.ColorPassFn.CargoColor new: function(): CargoColor + clone: function(CargoColor): CargoColor + residential: BaseRangeColor + industrial: BaseRangeColor + commercial: BaseRangeColor + numBuildingLevels: integer + includePassengers: boolean +end +``` + +Specifies colors for town buildings for each land use type based on production rating + +### LayerConfig.ColorPassFn.CargoColor.new[πŸ”—](#$api.type~LayerConfig.ColorPassFn.CargoColor.new) + +``` +function LayerConfig.ColorPassFn.CargoColor.new(): CargoColor +``` + +Constructs a new empty CargoColor + +**Returns** + +1. `CargoColor` + +### LayerConfig.ColorPassFn.CargoColor.clone[πŸ”—](#$api.type~LayerConfig.ColorPassFn.CargoColor.clone) + +``` +function LayerConfig.ColorPassFn.CargoColor.clone(CargoColor): CargoColor +``` + +Constructs a copy of the input cargo color + +**Parameters** + +* `CargoColor` + +**Returns** + +1. `CargoColor` + +### LayerConfig.ColorPassFn.CargoColor.residential[πŸ”—](#$api.type~LayerConfig.ColorPassFn.CargoColor.residential) + +``` +LayerConfig.ColorPassFn.CargoColor.residential: BaseRangeColor +``` + +Color that applies to commercial land use type + +### LayerConfig.ColorPassFn.CargoColor.industrial[πŸ”—](#$api.type~LayerConfig.ColorPassFn.CargoColor.industrial) + +``` +LayerConfig.ColorPassFn.CargoColor.industrial: BaseRangeColor +``` + +Color that applies to industrial land use type + +### LayerConfig.ColorPassFn.CargoColor.commercial[πŸ”—](#$api.type~LayerConfig.ColorPassFn.CargoColor.commercial) + +``` +LayerConfig.ColorPassFn.CargoColor.commercial: BaseRangeColor +``` + +Color that applies to commercial land use type + +### LayerConfig.ColorPassFn.CargoColor.numBuildingLevels[πŸ”—](#$api.type~LayerConfig.ColorPassFn.CargoColor.numBuildingLevels) + +``` +LayerConfig.ColorPassFn.CargoColor.numBuildingLevels: integer +``` + +Number of discrete steps the color is interpolated into (e.g. a value of 3 will result in interpolation values of 0, 0.5 and 1) + +### LayerConfig.ColorPassFn.CargoColor.includePassengers[πŸ”—](#$api.type~LayerConfig.ColorPassFn.CargoColor.includePassengers) + +``` +LayerConfig.ColorPassFn.CargoColor.includePassengers: boolean +``` + +Whether to include passengers cargo for the coloring (rating also includes line usage for inhabitants) + +### LayerConfig.ColorPassFn.DestinationColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.DestinationColor) + +``` +record LayerConfig.ColorPassFn.DestinationColor new: function(): DestinationColor + + town: Engine.Entity + showPlayerTransport: boolean + showPrivateTransport: boolean + residential: BaseRangeColor + industrial: BaseRangeColor + commercial: BaseRangeColor + numBuildingLevels: integer +end +``` + +Specifiers colors for PersonCapacity entities based on whether any SimPerson has a destination to it, based +on the specified filtering criteria. + +### LayerConfig.ColorPassFn.DestinationColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.DestinationColor.new()) + +``` +function LayerConfig.ColorPassFn.DestinationColor.new()(): DestinationColor +``` + +Constructs an empty DestinationColor + +**Returns** + +1. `DestinationColor` + +### LayerConfig.ColorPassFn.DestinationColor.new(DestinationColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.DestinationColor.new(DestinationColor)) + +``` +function LayerConfig.ColorPassFn.DestinationColor.new(DestinationColor)(DestinationColor): DestinationColor +``` + +Copies a given destination color + +**Parameters** + +* `DestinationColor` + +**Returns** + +1. `DestinationColor` + +### LayerConfig.ColorPassFn.DestinationColor.town[πŸ”—](#$api.type~LayerConfig.ColorPassFn.DestinationColor.town) + +``` +LayerConfig.ColorPassFn.DestinationColor.town: Engine.Entity +``` + +Only consider TownBuildings that belong to a given Town + +### LayerConfig.ColorPassFn.DestinationColor.showPlayerTransport[πŸ”—](#$api.type~LayerConfig.ColorPassFn.DestinationColor.showPlayerTransport) + +``` +LayerConfig.ColorPassFn.DestinationColor.showPlayerTransport: boolean +``` + +Do consider SimPersons moving using Line movement types + +### LayerConfig.ColorPassFn.DestinationColor.showPrivateTransport[πŸ”—](#$api.type~LayerConfig.ColorPassFn.DestinationColor.showPrivateTransport) + +``` +LayerConfig.ColorPassFn.DestinationColor.showPrivateTransport: boolean +``` + +Do consider SimPersons moving using Drive or Walk movement types + +### LayerConfig.ColorPassFn.DestinationColor.residential[πŸ”—](#$api.type~LayerConfig.ColorPassFn.DestinationColor.residential) + +``` +LayerConfig.ColorPassFn.DestinationColor.residential: BaseRangeColor +``` + +Select colors for people moving to residential destinations, if any filtered person satifies the criteria, +the max color will be applied, otherwise the min color will be used + +### LayerConfig.ColorPassFn.DestinationColor.industrial[πŸ”—](#$api.type~LayerConfig.ColorPassFn.DestinationColor.industrial) + +``` +LayerConfig.ColorPassFn.DestinationColor.industrial: BaseRangeColor +``` + +Select colors for people moving to industrial destinations, if any filtered person satifies the criteria, +the max color will be applied, otherwise the min color will be used + +### LayerConfig.ColorPassFn.DestinationColor.commercial[πŸ”—](#$api.type~LayerConfig.ColorPassFn.DestinationColor.commercial) + +``` +LayerConfig.ColorPassFn.DestinationColor.commercial: BaseRangeColor +``` + +Select colors for people moving to commercial destinations, if any filtered person satifies the criteria, +the max color will be applied, otherwise the min color will be used + +### LayerConfig.ColorPassFn.DestinationColor.numBuildingLevels[πŸ”—](#$api.type~LayerConfig.ColorPassFn.DestinationColor.numBuildingLevels) + +``` +LayerConfig.ColorPassFn.DestinationColor.numBuildingLevels: integer +``` + +Number of discrete steps the color is interpolated into (e.g. a value of 3 will result in interpolation values of 0, 0.5 and 1) +No effect in this case, always set it to two + +### LayerConfig.ColorPassFn.EmissionEmitterColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionEmitterColor) + +``` +record LayerConfig.ColorPassFn.EmissionEmitterColor new: function(): EmissionEmitterColor + + color: BaseRangeColor + currentEmissionId: Engine.Component.EmissionGrid.Type + lowerBound: number + upperBound: number + goodColor: BaseRangeColor + goodColorLowerBound: number + goodColorUpperBound: number +end +``` + +Color EmissionEmitter entities based on emission type and value + +### LayerConfig.ColorPassFn.EmissionEmitterColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionEmitterColor.new()) + +``` +function LayerConfig.ColorPassFn.EmissionEmitterColor.new()(): EmissionEmitterColor +``` + +Creates a new empty instance of EmissionEmitterColor + +**Returns** + +1. `EmissionEmitterColor` + +### LayerConfig.ColorPassFn.EmissionEmitterColor.new(EmissionEmitterColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionEmitterColor.new(EmissionEmitterColor)) + +``` +function LayerConfig.ColorPassFn.EmissionEmitterColor.new(EmissionEmitterColor)(EmissionEmitterColor): EmissionImpactColor +``` + +Creates a new copy of an instance of EmissionEmitterColor + +**Parameters** + +* `EmissionEmitterColor` + +**Returns** + +1. `EmissionImpactColor` + +### LayerConfig.ColorPassFn.EmissionEmitterColor.color[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionEmitterColor.color) + +``` +LayerConfig.ColorPassFn.EmissionEmitterColor.color: BaseRangeColor +``` + +A pair of colors that will be interpolated, based on the value of the emission + +### LayerConfig.ColorPassFn.EmissionEmitterColor.currentEmissionId[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionEmitterColor.currentEmissionId) + +``` +LayerConfig.ColorPassFn.EmissionEmitterColor.currentEmissionId: Engine.Component.EmissionGrid.Type +``` + +Selects the type of emission toconsider between noise and pollution + +### LayerConfig.ColorPassFn.EmissionEmitterColor.lowerBound[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionEmitterColor.lowerBound) + +``` +LayerConfig.ColorPassFn.EmissionEmitterColor.lowerBound: number +``` + +Lower bound for the range, at which min color of color will be chosen + +### LayerConfig.ColorPassFn.EmissionEmitterColor.upperBound[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionEmitterColor.upperBound) + +``` +LayerConfig.ColorPassFn.EmissionEmitterColor.upperBound: number +``` + +Upper bound for the range, at which max color of color will be chosen + +### LayerConfig.ColorPassFn.EmissionEmitterColor.goodColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionEmitterColor.goodColor) + +``` +LayerConfig.ColorPassFn.EmissionEmitterColor.goodColor: BaseRangeColor +``` + +A pair of colors that will be interpolated, based on the value of the emission, when the emission is negative + +### LayerConfig.ColorPassFn.EmissionEmitterColor.goodColorLowerBound[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionEmitterColor.goodColorLowerBound) + +``` +LayerConfig.ColorPassFn.EmissionEmitterColor.goodColorLowerBound: number +``` + +Lower bound for the negative range, at which min color of color will be chosen + +### LayerConfig.ColorPassFn.EmissionEmitterColor.goodColorUpperBound[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionEmitterColor.goodColorUpperBound) + +``` +LayerConfig.ColorPassFn.EmissionEmitterColor.goodColorUpperBound: number +``` + +Upper bound for the negative range, at which max color of color will be chosen + +### LayerConfig.ColorPassFn.EmissionImpactColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionImpactColor) + +``` +record LayerConfig.ColorPassFn.EmissionImpactColor new: function(): EmissionImpactColor + + color: BaseRangeColor + currentEmissionId: Engine.Component.EmissionGrid.Type + useAverage: boolean + lowerBoundDB: number + upperBoundDB: number +end +``` + +Color the entity based on the current level of emission the entity is experiencing + +### LayerConfig.ColorPassFn.EmissionImpactColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionImpactColor.new()) + +``` +function LayerConfig.ColorPassFn.EmissionImpactColor.new()(): EmissionImpactColor +``` + +**Returns** + +1. `EmissionImpactColor` + +### LayerConfig.ColorPassFn.EmissionImpactColor.new(EmissionImpactColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionImpactColor.new(EmissionImpactColor)) + +``` +function LayerConfig.ColorPassFn.EmissionImpactColor.new(EmissionImpactColor)(EmissionImpactColor): EmissionImpactColor +``` + +**Parameters** + +* `EmissionImpactColor` + +**Returns** + +1. `EmissionImpactColor` + +### LayerConfig.ColorPassFn.EmissionImpactColor.color[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionImpactColor.color) + +``` +LayerConfig.ColorPassFn.EmissionImpactColor.color: BaseRangeColor +``` + +A pair of colors that maps lowerBoundDB (the min experienced emission) to uppedBoundDB (the max experienced emission) + +### LayerConfig.ColorPassFn.EmissionImpactColor.currentEmissionId[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionImpactColor.currentEmissionId) + +``` +LayerConfig.ColorPassFn.EmissionImpactColor.currentEmissionId: Engine.Component.EmissionGrid.Type +``` + +Selects the type of emission toconsider between noise and pollution + +### LayerConfig.ColorPassFn.EmissionImpactColor.useAverage[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionImpactColor.useAverage) + +``` +LayerConfig.ColorPassFn.EmissionImpactColor.useAverage: boolean +``` + +Choose to apply smoothed (averaged) emission isntead of instantaneous one + +### LayerConfig.ColorPassFn.EmissionImpactColor.lowerBoundDB[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionImpactColor.lowerBoundDB) + +``` +LayerConfig.ColorPassFn.EmissionImpactColor.lowerBoundDB: number +``` + +This value maps to min color in color + +### LayerConfig.ColorPassFn.EmissionImpactColor.upperBoundDB[πŸ”—](#$api.type~LayerConfig.ColorPassFn.EmissionImpactColor.upperBoundDB) + +``` +LayerConfig.ColorPassFn.EmissionImpactColor.upperBoundDB: number +``` + +This value maps to max color in color + +### LayerConfig.ColorPassFn.FallbackColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.FallbackColor) + +``` +record LayerConfig.ColorPassFn.FallbackColor new: function(): FallbackColor + + terrain: BaseColor + water: BaseColor + edge: BaseColor + node: BaseColor + parallelStrip: BaseColor + whatever: BaseColor +end +``` + +Color chosen if no other selected type matches the entity + +### LayerConfig.ColorPassFn.FallbackColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.FallbackColor.new()) + +``` +function LayerConfig.ColorPassFn.FallbackColor.new()(): FallbackColor +``` + +Creates a new empty isntance FallbackColor + +**Returns** + +1. `FallbackColor` + +### LayerConfig.ColorPassFn.FallbackColor.new(FallbackColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.FallbackColor.new(FallbackColor)) + +``` +function LayerConfig.ColorPassFn.FallbackColor.new(FallbackColor)(FallbackColor): FallbackColor +``` + +Creates a copy of FallbackColor + +**Parameters** + +* `FallbackColor` + +**Returns** + +1. `FallbackColor` + +### LayerConfig.ColorPassFn.FallbackColor.terrain[πŸ”—](#$api.type~LayerConfig.ColorPassFn.FallbackColor.terrain) + +``` +LayerConfig.ColorPassFn.FallbackColor.terrain: BaseColor +``` + +Color applied to the terrain and terrain-like entities + +### LayerConfig.ColorPassFn.FallbackColor.water[πŸ”—](#$api.type~LayerConfig.ColorPassFn.FallbackColor.water) + +``` +LayerConfig.ColorPassFn.FallbackColor.water: BaseColor +``` + +Color applied to water meshes + +### LayerConfig.ColorPassFn.FallbackColor.edge[πŸ”—](#$api.type~LayerConfig.ColorPassFn.FallbackColor.edge) + +``` +LayerConfig.ColorPassFn.FallbackColor.edge: BaseColor +``` + +Color applied to entities with BaseEdge components + +### LayerConfig.ColorPassFn.FallbackColor.node[πŸ”—](#$api.type~LayerConfig.ColorPassFn.FallbackColor.node) + +``` +LayerConfig.ColorPassFn.FallbackColor.node: BaseColor +``` + +Color applied to entities with BaseNode components + +### LayerConfig.ColorPassFn.FallbackColor.parallelStrip[πŸ”—](#$api.type~LayerConfig.ColorPassFn.FallbackColor.parallelStrip) + +``` +LayerConfig.ColorPassFn.FallbackColor.parallelStrip: BaseColor +``` + +Color applied to entities with ParallelStrip components + +### LayerConfig.ColorPassFn.FallbackColor.whatever[πŸ”—](#$api.type~LayerConfig.ColorPassFn.FallbackColor.whatever) + +``` +LayerConfig.ColorPassFn.FallbackColor.whatever: BaseColor +``` + +Color applied to any other entity not matching a specific type + +### LayerConfig.ColorPassFn.IndustryColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.IndustryColor) + +``` +record LayerConfig.ColorPassFn.IndustryColor new: function(): IndustryColor + + industry: BaseColor + onlyWithPersonCapacity: boolean +end +``` + +Apply a color to Industry entities + +### LayerConfig.ColorPassFn.IndustryColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.IndustryColor.new()) + +``` +function LayerConfig.ColorPassFn.IndustryColor.new()(): IndustryColor +``` + +Creates a new empty IndustryColor + +**Returns** + +1. `IndustryColor` + +### LayerConfig.ColorPassFn.IndustryColor.new(IndustryColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.IndustryColor.new(IndustryColor)) + +``` +function LayerConfig.ColorPassFn.IndustryColor.new(IndustryColor)(IndustryColor): IndustryColor +``` + +Creates a copy of an existing IndustryColor + +**Parameters** + +* `IndustryColor` + +**Returns** + +1. `IndustryColor` + +### LayerConfig.ColorPassFn.IndustryColor.industry[πŸ”—](#$api.type~LayerConfig.ColorPassFn.IndustryColor.industry) + +``` +LayerConfig.ColorPassFn.IndustryColor.industry: BaseColor +``` + +The color to apply + +### LayerConfig.ColorPassFn.IndustryColor.onlyWithPersonCapacity[πŸ”—](#$api.type~LayerConfig.ColorPassFn.IndustryColor.onlyWithPersonCapacity) + +``` +LayerConfig.ColorPassFn.IndustryColor.onlyWithPersonCapacity: boolean +``` + +Only apply the color if the entity also has an industrial PersonCapacity color + +### LayerConfig.ColorPassFn.LandUseColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.LandUseColor) + +``` +record LayerConfig.ColorPassFn.LandUseColor new: function(): LandUseColor + + residential: BaseRangeColor + industrial: BaseRangeColor + commercial: BaseRangeColor +end +``` + +Apply colors to an entity based on the level of the TownBuilding, based on the LandUseType + +### LayerConfig.ColorPassFn.LandUseColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.LandUseColor.new()) + +``` +function LayerConfig.ColorPassFn.LandUseColor.new()(): LandUseColor +``` + +Creates a new empty LandUseColor + +**Returns** + +1. `LandUseColor` + +### LayerConfig.ColorPassFn.LandUseColor.new(LandUseColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.LandUseColor.new(LandUseColor)) + +``` +function LayerConfig.ColorPassFn.LandUseColor.new(LandUseColor)(LandUseColor): LandUseColor +``` + +Creates a copy of an existing LandUseColor + +**Parameters** + +* `LandUseColor` + +**Returns** + +1. `LandUseColor` + +### LayerConfig.ColorPassFn.LandUseColor.residential[πŸ”—](#$api.type~LayerConfig.ColorPassFn.LandUseColor.residential) + +``` +LayerConfig.ColorPassFn.LandUseColor.residential: BaseRangeColor +``` + +Color to be applied to residential LandUseType + +### LayerConfig.ColorPassFn.LandUseColor.industrial[πŸ”—](#$api.type~LayerConfig.ColorPassFn.LandUseColor.industrial) + +``` +LayerConfig.ColorPassFn.LandUseColor.industrial: BaseRangeColor +``` + +Color to be applied to industrial LandUseType + +### LayerConfig.ColorPassFn.LandUseColor.commercial[πŸ”—](#$api.type~LayerConfig.ColorPassFn.LandUseColor.commercial) + +``` +LayerConfig.ColorPassFn.LandUseColor.commercial: BaseRangeColor +``` + +Color to be applied to commercial LandUseType + +### LayerConfig.ColorPassFn.LineVehicleColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.LineVehicleColor) + +``` +record LayerConfig.ColorPassFn.LineVehicleColor new: function(): LineVehicleColor + + highlightedEntities: {Engine.Entity} + carriers: {Carrier} +end +``` + +Apply colors to vehicles based on the line color + +### LayerConfig.ColorPassFn.LineVehicleColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.LineVehicleColor.new()) + +``` +function LayerConfig.ColorPassFn.LineVehicleColor.new()(): LineVehicleColor +``` + +Creates a new empty LineVehicleColor + +**Returns** + +1. `LineVehicleColor` + +### LayerConfig.ColorPassFn.LineVehicleColor.new(LineVehicleColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.LineVehicleColor.new(LineVehicleColor)) + +``` +function LayerConfig.ColorPassFn.LineVehicleColor.new(LineVehicleColor)(LineVehicleColor): LandUseColor +``` + +Creates a copy of an existing LineVehicleColor + +**Parameters** + +* `LineVehicleColor` + +**Returns** + +1. `LandUseColor` + +### LayerConfig.ColorPassFn.LineVehicleColor.highlightedEntities[πŸ”—](#$api.type~LayerConfig.ColorPassFn.LineVehicleColor.highlightedEntities) + +``` +LayerConfig.ColorPassFn.LineVehicleColor.highlightedEntities: {Engine.Entity} +``` + +Specify specific entites to apply an highlight effect to + +### LayerConfig.ColorPassFn.LineVehicleColor.carriers[πŸ”—](#$api.type~LayerConfig.ColorPassFn.LineVehicleColor.carriers) + +``` +LayerConfig.ColorPassFn.LineVehicleColor.carriers: {Carrier} +``` + +Only apply the color to the selected entities + +### LayerConfig.ColorPassFn.MaintainedTransportVehicleColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.MaintainedTransportVehicleColor) + +``` +record LayerConfig.ColorPassFn.MaintainedTransportVehicleColor new: function(): MaintainedTransportVehicleColor + + color: BaseColor + maintenanceStationEntity: Engine.Entity +end +``` + +Apply colors based on the maintenance state of a specific vehicle + +### LayerConfig.ColorPassFn.MaintainedTransportVehicleColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.MaintainedTransportVehicleColor.new()) + +``` +function LayerConfig.ColorPassFn.MaintainedTransportVehicleColor.new()(): MaintainedTransportVehicleColor +``` + +Creates a new empty MaintainedTransportVehicleColor + +**Returns** + +1. `MaintainedTransportVehicleColor` + +### LayerConfig.ColorPassFn.MaintainedTransportVehicleColor.new(MaintainedTransportVehicleColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.MaintainedTransportVehicleColor.new(MaintainedTransportVehicleColor)) + +``` +function LayerConfig.ColorPassFn.MaintainedTransportVehicleColor.new(MaintainedTransportVehicleColor)(MaintainedTransportVehicleColor): MaintainedTransportVehicleColor +``` + +Creates a copy of an existing MaintainedTransportVehicleColor + +**Parameters** + +* `MaintainedTransportVehicleColor` + +**Returns** + +1. `MaintainedTransportVehicleColor` + +### LayerConfig.ColorPassFn.MaintainedTransportVehicleColor.color[πŸ”—](#$api.type~LayerConfig.ColorPassFn.MaintainedTransportVehicleColor.color) + +``` +LayerConfig.ColorPassFn.MaintainedTransportVehicleColor.color: BaseColor +``` + +The color to apply if the entity is being maintaned + +### LayerConfig.ColorPassFn.MaintainedTransportVehicleColor.maintenanceStationEntity[πŸ”—](#$api.type~LayerConfig.ColorPassFn.MaintainedTransportVehicleColor.maintenanceStationEntity) + +``` +LayerConfig.ColorPassFn.MaintainedTransportVehicleColor.maintenanceStationEntity: Engine.Entity +``` + +Filter the vehicle based on the specific maintenance station it is maintained with + +### LayerConfig.ColorPassFn.StationOvercrowdedColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.StationOvercrowdedColor) + +``` +record LayerConfig.ColorPassFn.StationOvercrowdedColor new: function(): StationOvercrowdedColor + + color: BaseMappedColor +end +``` + +Color stations based on the overcrowdedness of the station + +### LayerConfig.ColorPassFn.StationOvercrowdedColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.StationOvercrowdedColor.new()) + +``` +function LayerConfig.ColorPassFn.StationOvercrowdedColor.new()(): StationOvercrowdedColor +``` + +Creates a new empty StationOvercrowdedColor + +**Returns** + +1. `StationOvercrowdedColor` + +### LayerConfig.ColorPassFn.StationOvercrowdedColor.new(StationOvercrowdedColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.StationOvercrowdedColor.new(StationOvercrowdedColor)) + +``` +function LayerConfig.ColorPassFn.StationOvercrowdedColor.new(StationOvercrowdedColor)(StationOvercrowdedColor): StationOvercrowdedColor +``` + +Creates a copy of an existing StationOvercrowdedColor + +**Parameters** + +* `StationOvercrowdedColor` + +**Returns** + +1. `StationOvercrowdedColor` + +### LayerConfig.ColorPassFn.StationOvercrowdedColor.color[πŸ”—](#$api.type~LayerConfig.ColorPassFn.StationOvercrowdedColor.color) + +``` +LayerConfig.ColorPassFn.StationOvercrowdedColor.color: BaseMappedColor +``` + +### LayerConfig.ColorPassFn.SpeedLimitsColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.SpeedLimitsColor) + +``` +record LayerConfig.ColorPassFn.SpeedLimitsColor new: function(): SpeedLimitsColor + + slowToFast: {BaseColor} + numberOfLevels: integer + hideNonPlayerOwned: boolean + hideNonLocked: boolean +end +``` + +Color transport network extes based on the max speed of the transport network edge + +### LayerConfig.ColorPassFn.SpeedLimitsColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.SpeedLimitsColor.new()) + +``` +function LayerConfig.ColorPassFn.SpeedLimitsColor.new()(): SpeedLimitsColor +``` + +Creates a new empty SpeedLimitsColor + +**Returns** + +1. `SpeedLimitsColor` + +### LayerConfig.ColorPassFn.SpeedLimitsColor.new(SpeedLimitsColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.SpeedLimitsColor.new(SpeedLimitsColor)) + +``` +function LayerConfig.ColorPassFn.SpeedLimitsColor.new(SpeedLimitsColor)(SpeedLimitsColor): SpeedLimitsColor +``` + +Creates a copy of an existing SpeedLimitsColor + +**Parameters** + +* `SpeedLimitsColor` + +**Returns** + +1. `SpeedLimitsColor` + +### LayerConfig.ColorPassFn.SpeedLimitsColor.slowToFast[πŸ”—](#$api.type~LayerConfig.ColorPassFn.SpeedLimitsColor.slowToFast) + +``` +LayerConfig.ColorPassFn.SpeedLimitsColor.slowToFast: {BaseColor} +``` + +Interolates colors in this list between the min speed and max speed, based on all available street templates for the year + +### LayerConfig.ColorPassFn.SpeedLimitsColor.numberOfLevels[πŸ”—](#$api.type~LayerConfig.ColorPassFn.SpeedLimitsColor.numberOfLevels) + +``` +LayerConfig.ColorPassFn.SpeedLimitsColor.numberOfLevels: integer +``` + +Discretize the number of levels based on this value + +### LayerConfig.ColorPassFn.SpeedLimitsColor.hideNonPlayerOwned[πŸ”—](#$api.type~LayerConfig.ColorPassFn.SpeedLimitsColor.hideNonPlayerOwned) + +``` +LayerConfig.ColorPassFn.SpeedLimitsColor.hideNonPlayerOwned: boolean +``` + +Hide edges that are not owned by the player + +### LayerConfig.ColorPassFn.SpeedLimitsColor.hideNonLocked[πŸ”—](#$api.type~LayerConfig.ColorPassFn.SpeedLimitsColor.hideNonLocked) + +``` +LayerConfig.ColorPassFn.SpeedLimitsColor.hideNonLocked: boolean +``` + +Hide edges that do not have the roadDevelopmentLocked flag + +### LayerConfig.ColorPassFn.TrafficColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.TrafficColor) + +``` +record LayerConfig.ColorPassFn.TrafficColor new: function(): TrafficColor + + poorToGood: {BaseColor} + numberOfLevels: integer + discrete: boolean +end +``` + +Color the base edge based on the amount of traffic present on it + +### LayerConfig.ColorPassFn.TrafficColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.TrafficColor.new()) + +``` +function LayerConfig.ColorPassFn.TrafficColor.new()(): TrafficColor +``` + +Creates a new empty TrafficColor + +**Returns** + +1. `TrafficColor` + +### LayerConfig.ColorPassFn.TrafficColor.new(TrafficColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.TrafficColor.new(TrafficColor)) + +``` +function LayerConfig.ColorPassFn.TrafficColor.new(TrafficColor)(TrafficColor): TrafficColor +``` + +Creates a copy of an existing TrafficColor + +**Parameters** + +* `TrafficColor` + +**Returns** + +1. `TrafficColor` + +### LayerConfig.ColorPassFn.TrafficColor.poorToGood[πŸ”—](#$api.type~LayerConfig.ColorPassFn.TrafficColor.poorToGood) + +``` +LayerConfig.ColorPassFn.TrafficColor.poorToGood: {BaseColor} +``` + +Interpolates colors in this list (must have three elements) based on the traffic rating of the edge + +### LayerConfig.ColorPassFn.TrafficColor.numberOfLevels[πŸ”—](#$api.type~LayerConfig.ColorPassFn.TrafficColor.numberOfLevels) + +``` +LayerConfig.ColorPassFn.TrafficColor.numberOfLevels: integer +``` + +Discretize the number of levels based on this value + +### LayerConfig.ColorPassFn.TrafficColor.discrete[πŸ”—](#$api.type~LayerConfig.ColorPassFn.TrafficColor.discrete) + +``` +LayerConfig.ColorPassFn.TrafficColor.discrete: boolean +``` + +Unused + +### LayerConfig.ColorPassFn.HappinessColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.HappinessColor) + +``` +record LayerConfig.ColorPassFn.HappinessColor new: function(): HappinessColor + + normalToPoor: {BaseColor} +end +``` + +Apply color to entities (station, terminal and warehouse) based on the average happines of their users + +### LayerConfig.ColorPassFn.HappinessColor.new()[πŸ”—](#$api.type~LayerConfig.ColorPassFn.HappinessColor.new()) + +``` +function LayerConfig.ColorPassFn.HappinessColor.new()(): HappinessColor +``` + +Creates a new empty HappinessColor + +**Returns** + +1. `HappinessColor` + +### LayerConfig.ColorPassFn.HappinessColor.new(HappinessColor)[πŸ”—](#$api.type~LayerConfig.ColorPassFn.HappinessColor.new(HappinessColor)) + +``` +function LayerConfig.ColorPassFn.HappinessColor.new(HappinessColor)(HappinessColor): HappinessColor +``` + +Creates a copy of an existing HappinessColor + +**Parameters** + +* `HappinessColor` + +**Returns** + +1. `HappinessColor` + +### LayerConfig.ColorPassFn.HappinessColor.normalToPoor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.HappinessColor.normalToPoor) + +``` +LayerConfig.ColorPassFn.HappinessColor.normalToPoor: {BaseColor} +``` + +Interpolates colors in this list (must have three elements) based on the average happines of the entity + +### LayerConfig.ColorPassFn.terrainPainter[πŸ”—](#$api.type~LayerConfig.ColorPassFn.terrainPainter) + +``` +LayerConfig.ColorPassFn.terrainPainter: any +``` + +Optional terrain painter configuration: nil or BaseColor + +### LayerConfig.ColorPassFn.waterPainter[πŸ”—](#$api.type~LayerConfig.ColorPassFn.waterPainter) + +``` +LayerConfig.ColorPassFn.waterPainter: any +``` + +Optional water painter configuration: nil or BaseColor + +### LayerConfig.ColorPassFn.townBuildingPainter[πŸ”—](#$api.type~LayerConfig.ColorPassFn.townBuildingPainter) + +``` +LayerConfig.ColorPassFn.townBuildingPainter: any +``` + +Optional town building painter configuration: nil, BaseColor, CargoColor, DestinationColor, EmissionImpactColor or LandUseColor + +### LayerConfig.ColorPassFn.industryPainter[πŸ”—](#$api.type~LayerConfig.ColorPassFn.industryPainter) + +``` +LayerConfig.ColorPassFn.industryPainter: any +``` + +Optional industry painter configuration: nil, IndustryColor or DestinationColor + +### LayerConfig.ColorPassFn.emissionEmitterPainter[πŸ”—](#$api.type~LayerConfig.ColorPassFn.emissionEmitterPainter) + +``` +LayerConfig.ColorPassFn.emissionEmitterPainter: any +``` + +Optional emission emitter painter configuration: nil or EmissionEmitterColor + +### LayerConfig.ColorPassFn.stationPainter[πŸ”—](#$api.type~LayerConfig.ColorPassFn.stationPainter) + +``` +LayerConfig.ColorPassFn.stationPainter: any +``` + +Optional station painter configuration: nil, BaseColor, HappinessColor or StationOvercrowdedColor + +### LayerConfig.ColorPassFn.warehousePainter[πŸ”—](#$api.type~LayerConfig.ColorPassFn.warehousePainter) + +``` +LayerConfig.ColorPassFn.warehousePainter: any +``` + +Optional warehouse painter configuration: nil or HappinessColor + +### LayerConfig.ColorPassFn.transportNetworkPainter[πŸ”—](#$api.type~LayerConfig.ColorPassFn.transportNetworkPainter) + +``` +LayerConfig.ColorPassFn.transportNetworkPainter: any +``` + +Optional transport network painter configuration: nil, peedLimitsColor or TrafficColor + +### LayerConfig.ColorPassFn.transportVehiclePainter[πŸ”—](#$api.type~LayerConfig.ColorPassFn.transportVehiclePainter) + +``` +LayerConfig.ColorPassFn.transportVehiclePainter: any +``` + +Optional transport vehicle painter configuration: nil, LineVehicleColor, TrafficColor or EmissionEmitterColor + +### LayerConfig.ColorPassFn.landVehiclePainter[πŸ”—](#$api.type~LayerConfig.ColorPassFn.landVehiclePainter) + +``` +LayerConfig.ColorPassFn.landVehiclePainter: any +``` + +Optional land vehicle painter configuration: nil or TrafficColor + +### LayerConfig.ColorPassFn.simAtTerminalPainter[πŸ”—](#$api.type~LayerConfig.ColorPassFn.simAtTerminalPainter) + +``` +LayerConfig.ColorPassFn.simAtTerminalPainter: any +``` + +Optional sim at terminal painter configuration: nil or HappinessColor + +### LayerConfig.ColorPassFn.fallbackColor[πŸ”—](#$api.type~LayerConfig.ColorPassFn.fallbackColor) + +``` +LayerConfig.ColorPassFn.fallbackColor: FallbackColor +``` + +Fallback color (if none of the above matches) + +### LayerConfig.BuildingRenderableConfig[πŸ”—](#$api.type~LayerConfig.BuildingRenderableConfig) + +``` +record LayerConfig.BuildingRenderableConfig new: function(): BuildingRenderableConfig + + isVisible: boolean + includeTownBuildings: boolean + includeTownBuildingModels: boolean + includeTownBuildingMainModel: boolean + includeIndustries: boolean + includeWarehouses: boolean + includeStations: boolean + includeEdges: boolean +end +``` + +Configures a preview showing town buildings and parcels + +### LayerConfig.BuildingRenderableConfig.new()[πŸ”—](#$api.type~LayerConfig.BuildingRenderableConfig.new()) + +``` +function LayerConfig.BuildingRenderableConfig.new()(): BuildingRenderableConfig +``` + +Creates a new empty BuildingRenerableConfig + +**Returns** + +1. `BuildingRenderableConfig` + +### LayerConfig.BuildingRenderableConfig.new(BuildingRenderableConfig)[πŸ”—](#$api.type~LayerConfig.BuildingRenderableConfig.new(BuildingRenderableConfig)) + +``` +function LayerConfig.BuildingRenderableConfig.new(BuildingRenderableConfig)(BuildingRenderableConfig): BuildingRenderableConfig +``` + +Creates a copy of BuildingRenderableConfig object + +**Parameters** + +* `BuildingRenderableConfig` + +**Returns** + +1. `BuildingRenderableConfig` + +### LayerConfig.BuildingRenderableConfig.isVisible[πŸ”—](#$api.type~LayerConfig.BuildingRenderableConfig.isVisible) + +``` +LayerConfig.BuildingRenderableConfig.isVisible: boolean +``` + +Actually render this preview + +### LayerConfig.BuildingRenderableConfig.includeTownBuildings[πŸ”—](#$api.type~LayerConfig.BuildingRenderableConfig.includeTownBuildings) + +``` +LayerConfig.BuildingRenderableConfig.includeTownBuildings: boolean +``` + +Apply the rendering to town building parcel faces + +### LayerConfig.BuildingRenderableConfig.includeTownBuildingModels[πŸ”—](#$api.type~LayerConfig.BuildingRenderableConfig.includeTownBuildingModels) + +``` +LayerConfig.BuildingRenderableConfig.includeTownBuildingModels: boolean +``` + +Apply the rendering to the actual model instances of the town building + +### LayerConfig.BuildingRenderableConfig.includeTownBuildingMainModel[πŸ”—](#$api.type~LayerConfig.BuildingRenderableConfig.includeTownBuildingMainModel) + +``` +LayerConfig.BuildingRenderableConfig.includeTownBuildingMainModel: boolean +``` + +Apply the rendering to the main model instance of the town building only, without set dressing + +### LayerConfig.BuildingRenderableConfig.includeIndustries[πŸ”—](#$api.type~LayerConfig.BuildingRenderableConfig.includeIndustries) + +``` +LayerConfig.BuildingRenderableConfig.includeIndustries: boolean +``` + +Apply the rendering to entities with Industry component + +### LayerConfig.BuildingRenderableConfig.includeWarehouses[πŸ”—](#$api.type~LayerConfig.BuildingRenderableConfig.includeWarehouses) + +``` +LayerConfig.BuildingRenderableConfig.includeWarehouses: boolean +``` + +Apply the rendering to entities with Warehouse component + +### LayerConfig.BuildingRenderableConfig.includeStations[πŸ”—](#$api.type~LayerConfig.BuildingRenderableConfig.includeStations) + +``` +LayerConfig.BuildingRenderableConfig.includeStations: boolean +``` + +Apply the rendering to entities with Station component + +### LayerConfig.BuildingRenderableConfig.includeEdges[πŸ”—](#$api.type~LayerConfig.BuildingRenderableConfig.includeEdges) + +``` +LayerConfig.BuildingRenderableConfig.includeEdges: boolean +``` + +Apply the rendering to entities with BaseEdge component + +### LayerConfig.CatchmentAreaDisplaySettings[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings) + +``` +record LayerConfig.CatchmentAreaDisplaySettings new: function(): CatchmentAreaDisplaySettings + + personBaseColor: Vec3f + cargoBaseColor: Vec3f + inactiveColor: Vec3f + unreachableColor: Vec3f + deleteColor: Vec3f + maintenanceColor: Vec3f + noiseColor: Vec3f + pollutionColor: Vec3f + borderAlpha: number + borderAlphaPassive: number + godrayAlpha: number + godrayAlphaPassive: number + innerAlpha: number + buildingAlpha: number + borderWidth: number +end +``` + +Configures the rendering of catchment area of entities + +### LayerConfig.CatchmentAreaDisplaySettings.new()[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.new()) + +``` +function LayerConfig.CatchmentAreaDisplaySettings.new()(): CatchmentAreaDisplaySettings +``` + +Creates a new empty CatchmentAreaDisplaySettings + +**Returns** + +1. `CatchmentAreaDisplaySettings` + +### LayerConfig.CatchmentAreaDisplaySettings.new(CatchmentAreaDisplaySettings)[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.new(CatchmentAreaDisplaySettings)) + +``` +function LayerConfig.CatchmentAreaDisplaySettings.new(CatchmentAreaDisplaySettings)(CatchmentAreaDisplaySettings): CatchmentAreaDisplaySettings +``` + +Creates a copy of CatchmentAreaDisplaySettings object + +**Parameters** + +* `CatchmentAreaDisplaySettings` + +**Returns** + +1. `CatchmentAreaDisplaySettings` + +### LayerConfig.CatchmentAreaDisplaySettings.personBaseColor[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.personBaseColor) + +``` +LayerConfig.CatchmentAreaDisplaySettings.personBaseColor: Vec3f +``` + +Color for catchment areas that apply to pasengers + +### LayerConfig.CatchmentAreaDisplaySettings.cargoBaseColor[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.cargoBaseColor) + +``` +LayerConfig.CatchmentAreaDisplaySettings.cargoBaseColor: Vec3f +``` + +Color for catchment areas that apply to non-passenger cargo + +### LayerConfig.CatchmentAreaDisplaySettings.inactiveColor[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.inactiveColor) + +``` +LayerConfig.CatchmentAreaDisplaySettings.inactiveColor: Vec3f +``` + +Color for catchment areas that are not affected by current selections + +### LayerConfig.CatchmentAreaDisplaySettings.unreachableColor[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.unreachableColor) + +``` +LayerConfig.CatchmentAreaDisplaySettings.unreachableColor: Vec3f +``` + +Color for catchment areas that are not reachable + +### LayerConfig.CatchmentAreaDisplaySettings.deleteColor[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.deleteColor) + +``` +LayerConfig.CatchmentAreaDisplaySettings.deleteColor: Vec3f +``` + +Color for catchment areas that are being removed + +### LayerConfig.CatchmentAreaDisplaySettings.maintenanceColor[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.maintenanceColor) + +``` +LayerConfig.CatchmentAreaDisplaySettings.maintenanceColor: Vec3f +``` + +Color for catchment areas for maintenance stations repairs + +### LayerConfig.CatchmentAreaDisplaySettings.noiseColor[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.noiseColor) + +``` +LayerConfig.CatchmentAreaDisplaySettings.noiseColor: Vec3f +``` + +Color for radii of noise emitters + +### LayerConfig.CatchmentAreaDisplaySettings.pollutionColor[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.pollutionColor) + +``` +LayerConfig.CatchmentAreaDisplaySettings.pollutionColor: Vec3f +``` + +Color for radii of pollution emitters + +### LayerConfig.CatchmentAreaDisplaySettings.borderAlpha[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.borderAlpha) + +``` +LayerConfig.CatchmentAreaDisplaySettings.borderAlpha: number +``` + +Transparency of the catchment area border + +### LayerConfig.CatchmentAreaDisplaySettings.borderAlphaPassive[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.borderAlphaPassive) + +``` +LayerConfig.CatchmentAreaDisplaySettings.borderAlphaPassive: number +``` + +Transparency of the catchment area border when the catchment area is not involved + +### LayerConfig.CatchmentAreaDisplaySettings.godrayAlpha[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.godrayAlpha) + +``` +LayerConfig.CatchmentAreaDisplaySettings.godrayAlpha: number +``` + +Transparency of the middle positioning beam + +### LayerConfig.CatchmentAreaDisplaySettings.godrayAlphaPassive[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.godrayAlphaPassive) + +``` +LayerConfig.CatchmentAreaDisplaySettings.godrayAlphaPassive: number +``` + +Transparency of the middle positioning beam when the catchment area is not involved + +### LayerConfig.CatchmentAreaDisplaySettings.innerAlpha[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.innerAlpha) + +``` +LayerConfig.CatchmentAreaDisplaySettings.innerAlpha: number +``` + +Transparency of the inside part of the circle + +### LayerConfig.CatchmentAreaDisplaySettings.buildingAlpha[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.buildingAlpha) + +``` +LayerConfig.CatchmentAreaDisplaySettings.buildingAlpha: number +``` + +Transparency of the town building + +### LayerConfig.CatchmentAreaDisplaySettings.borderWidth[πŸ”—](#$api.type~LayerConfig.CatchmentAreaDisplaySettings.borderWidth) + +``` +LayerConfig.CatchmentAreaDisplaySettings.borderWidth: number +``` + +Width of the catchment are circle's perimeter + +### LayerConfig.CatchmentAreaRenderableConfig[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig) + +``` +record LayerConfig.CatchmentAreaRenderableConfig new: function(): CatchmentAreaRenderableConfig + + isVisible: boolean + displaySettings: CatchmentAreaDisplaySettings + cargo: boolean + person: boolean + maintenance: boolean + noise: boolean + pollution: boolean + addGodrays: boolean + entity: Engine.Entity + carriers: {Carrier} +end +``` + +Configures which catchment areas to render + +### LayerConfig.CatchmentAreaRenderableConfig.new()[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig.new()) + +``` +function LayerConfig.CatchmentAreaRenderableConfig.new()(): CatchmentAreaRenderableConfig +``` + +**Returns** + +1. `CatchmentAreaRenderableConfig` + +### LayerConfig.CatchmentAreaRenderableConfig.new(CatchmentAreaRenderableConfig)[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig.new(CatchmentAreaRenderableConfig)) + +``` +function LayerConfig.CatchmentAreaRenderableConfig.new(CatchmentAreaRenderableConfig)(CatchmentAreaRenderableConfig): VoronoiRenderableConfig +``` + +**Parameters** + +* `CatchmentAreaRenderableConfig` + +**Returns** + +1. `VoronoiRenderableConfig` + +### LayerConfig.CatchmentAreaRenderableConfig.isVisible[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig.isVisible) + +``` +LayerConfig.CatchmentAreaRenderableConfig.isVisible: boolean +``` + +Activates and deactivate rendering of catchment areas + +### LayerConfig.CatchmentAreaRenderableConfig.displaySettings[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig.displaySettings) + +``` +LayerConfig.CatchmentAreaRenderableConfig.displaySettings: CatchmentAreaDisplaySettings +``` + +Configures the look and feel of the areas + +### LayerConfig.CatchmentAreaRenderableConfig.cargo[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig.cargo) + +``` +LayerConfig.CatchmentAreaRenderableConfig.cargo: boolean +``` + +Do display cargo-compatible areas + +### LayerConfig.CatchmentAreaRenderableConfig.person[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig.person) + +``` +LayerConfig.CatchmentAreaRenderableConfig.person: boolean +``` + +Do display passenger-compatible areas + +### LayerConfig.CatchmentAreaRenderableConfig.maintenance[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig.maintenance) + +``` +LayerConfig.CatchmentAreaRenderableConfig.maintenance: boolean +``` + +Do display maintenance station radii + +### LayerConfig.CatchmentAreaRenderableConfig.noise[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig.noise) + +``` +LayerConfig.CatchmentAreaRenderableConfig.noise: boolean +``` + +Do display emission emitter noise radii + +### LayerConfig.CatchmentAreaRenderableConfig.pollution[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig.pollution) + +``` +LayerConfig.CatchmentAreaRenderableConfig.pollution: boolean +``` + +Do display emission emitter pollution radii + +### LayerConfig.CatchmentAreaRenderableConfig.addGodrays[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig.addGodrays) + +``` +LayerConfig.CatchmentAreaRenderableConfig.addGodrays: boolean +``` + +Add positioning beams in the middle of the circle + +### LayerConfig.CatchmentAreaRenderableConfig.entity[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig.entity) + +``` +LayerConfig.CatchmentAreaRenderableConfig.entity: Engine.Entity +``` + +Only add areas to the specific entity + +### LayerConfig.CatchmentAreaRenderableConfig.carriers[πŸ”—](#$api.type~LayerConfig.CatchmentAreaRenderableConfig.carriers) + +``` +LayerConfig.CatchmentAreaRenderableConfig.carriers: {Carrier} +``` + +Only add areas that are affected by specific carriers + +### LayerConfig.PlotsRenderableConfig[πŸ”—](#$api.type~LayerConfig.PlotsRenderableConfig) + +``` +record LayerConfig.PlotsRenderableConfig new: function(): PlotsRenderableConfig + + triangles: {Vec2f} +end +``` + +Configure industry plots renderable + +### LayerConfig.PlotsRenderableConfig.new()[πŸ”—](#$api.type~LayerConfig.PlotsRenderableConfig.new()) + +``` +function LayerConfig.PlotsRenderableConfig.new()(): PlotsRenderableConfig +``` + +**Returns** + +1. `PlotsRenderableConfig` + +### LayerConfig.PlotsRenderableConfig.new(PlotsRenderableConfig)[πŸ”—](#$api.type~LayerConfig.PlotsRenderableConfig.new(PlotsRenderableConfig)) + +``` +function LayerConfig.PlotsRenderableConfig.new(PlotsRenderableConfig)(PlotsRenderableConfig): PlotsRenderableConfig +``` + +**Parameters** + +* `PlotsRenderableConfig` + +**Returns** + +1. `PlotsRenderableConfig` + +### LayerConfig.PlotsRenderableConfig.triangles[πŸ”—](#$api.type~LayerConfig.PlotsRenderableConfig.triangles) + +``` +LayerConfig.PlotsRenderableConfig.triangles: {Vec2f} +``` + +### LayerConfig.SignConfig[πŸ”—](#$api.type~LayerConfig.SignConfig) + +``` +record LayerConfig.SignConfig new: function(): SignConfig + + signRenderDistance: number +end +``` + +Configures the texttual display on edges + +### LayerConfig.SignConfig.new()[πŸ”—](#$api.type~LayerConfig.SignConfig.new()) + +``` +function LayerConfig.SignConfig.new()(): SignConfig +``` + +Creates an empty SignConfig object + +**Returns** + +1. `SignConfig` + +### LayerConfig.SignConfig.new(SignConfig)[πŸ”—](#$api.type~LayerConfig.SignConfig.new(SignConfig)) + +``` +function LayerConfig.SignConfig.new(SignConfig)(SignConfig): SignConfig +``` + +Copies a given SignConfig object + +**Parameters** + +* `SignConfig` + +**Returns** + +1. `SignConfig` + +### LayerConfig.SignConfig.signRenderDistance[πŸ”—](#$api.type~LayerConfig.SignConfig.signRenderDistance) + +``` +LayerConfig.SignConfig.signRenderDistance: number +``` + +Maximal render distance for spped limits + +### LayerConfig.CargoEdgesRenderables[πŸ”—](#$api.type~LayerConfig.CargoEdgesRenderables) + +``` +record LayerConfig.CargoEdgesRenderables new: function(): CargoEdgesRenderables + + town: Engine.Entity + cargoTypes: {CargoTypeId} + showPlayerTransport: boolean + showPrivateTransport: boolean + playerTransportColor: {Vec4f, Vec4f} + privateTransportColor: {Vec4f, Vec4f} + numTransportLevels: integer + signConfig: SignConfig +end +``` + +Add an extra layer on top of base edges showing cargo that flowed onto this edge + +### LayerConfig.CargoEdgesRenderables.new()[πŸ”—](#$api.type~LayerConfig.CargoEdgesRenderables.new()) + +``` +function LayerConfig.CargoEdgesRenderables.new()(): CargoEdgesRenderables +``` + +Creates a new empty object of type CargoEdgesRenderables + +**Returns** + +1. `CargoEdgesRenderables` + +### LayerConfig.CargoEdgesRenderables.new(CargoEdgesRenderables)[πŸ”—](#$api.type~LayerConfig.CargoEdgesRenderables.new(CargoEdgesRenderables)) + +``` +function LayerConfig.CargoEdgesRenderables.new(CargoEdgesRenderables)(CargoEdgesRenderables): CargoEdgesRenderables +``` + +Creates a copy of an object of type CargoEdgesRenderables + +**Parameters** + +* `CargoEdgesRenderables` + +**Returns** + +1. `CargoEdgesRenderables` + +### LayerConfig.CargoEdgesRenderables.town[πŸ”—](#$api.type~LayerConfig.CargoEdgesRenderables.town) + +``` +LayerConfig.CargoEdgesRenderables.town: Engine.Entity +``` + +Filter only cargo types flowing towards this town entitsy + +### LayerConfig.CargoEdgesRenderables.cargoTypes[πŸ”—](#$api.type~LayerConfig.CargoEdgesRenderables.cargoTypes) + +``` +LayerConfig.CargoEdgesRenderables.cargoTypes: {CargoTypeId} +``` + +Filter only cargo transported of the given type + +### LayerConfig.CargoEdgesRenderables.showPlayerTransport[πŸ”—](#$api.type~LayerConfig.CargoEdgesRenderables.showPlayerTransport) + +``` +LayerConfig.CargoEdgesRenderables.showPlayerTransport: boolean +``` + +Consider cargo transported via lines + +### LayerConfig.CargoEdgesRenderables.showPrivateTransport[πŸ”—](#$api.type~LayerConfig.CargoEdgesRenderables.showPrivateTransport) + +``` +LayerConfig.CargoEdgesRenderables.showPrivateTransport: boolean +``` + +Consider cargo transported via private transport + +### LayerConfig.CargoEdgesRenderables.playerTransportColor[πŸ”—](#$api.type~LayerConfig.CargoEdgesRenderables.playerTransportColor) + +``` +LayerConfig.CargoEdgesRenderables.playerTransportColor: {Vec4f, Vec4f} +``` + +Color for low and hight occupancy of transported cargo on public transport (lines) + +### LayerConfig.CargoEdgesRenderables.privateTransportColor[πŸ”—](#$api.type~LayerConfig.CargoEdgesRenderables.privateTransportColor) + +``` +LayerConfig.CargoEdgesRenderables.privateTransportColor: {Vec4f, Vec4f} +``` + +Color for low and hight occupancy of transported cargo on private transport (cargo) + +### LayerConfig.CargoEdgesRenderables.numTransportLevels[πŸ”—](#$api.type~LayerConfig.CargoEdgesRenderables.numTransportLevels) + +``` +LayerConfig.CargoEdgesRenderables.numTransportLevels: integer +``` + +Discretization levels for the cargo + +### LayerConfig.CargoEdgesRenderables.signConfig[πŸ”—](#$api.type~LayerConfig.CargoEdgesRenderables.signConfig) + +``` +LayerConfig.CargoEdgesRenderables.signConfig: SignConfig +``` + +Configures look and feel of labels + +### LayerConfig.SatisfactionEdgesRenderables[πŸ”—](#$api.type~LayerConfig.SatisfactionEdgesRenderables) + +``` +record LayerConfig.SatisfactionEdgesRenderables new: function(): SatisfactionEdgesRenderables + + town: Engine.Entity + cargoTypes: {CargoTypeId} + colors: {Vec4f} + thresholds: {number} + signConfig: SignConfig +end +``` + +Configures the rendering of cargo satisfaction on the edge + +### LayerConfig.SatisfactionEdgesRenderables.new()[πŸ”—](#$api.type~LayerConfig.SatisfactionEdgesRenderables.new()) + +``` +function LayerConfig.SatisfactionEdgesRenderables.new()(): SatisfactionEdgesRenderables +``` + +Creates a new empty object of type SatisfactionEdgesRenderables + +**Returns** + +1. `SatisfactionEdgesRenderables` + +### LayerConfig.SatisfactionEdgesRenderables.new(SatisfactionEdgesRenderables)[πŸ”—](#$api.type~LayerConfig.SatisfactionEdgesRenderables.new(SatisfactionEdgesRenderables)) + +``` +function LayerConfig.SatisfactionEdgesRenderables.new(SatisfactionEdgesRenderables)(SatisfactionEdgesRenderables): SatisfactionEdgesRenderables +``` + +Creates a copy of an object of type SatisfactionEdgesRenderables + +**Parameters** + +* `SatisfactionEdgesRenderables` + +**Returns** + +1. `SatisfactionEdgesRenderables` + +### LayerConfig.SatisfactionEdgesRenderables.town[πŸ”—](#$api.type~LayerConfig.SatisfactionEdgesRenderables.town) + +``` +LayerConfig.SatisfactionEdgesRenderables.town: Engine.Entity +``` + +### LayerConfig.SatisfactionEdgesRenderables.cargoTypes[πŸ”—](#$api.type~LayerConfig.SatisfactionEdgesRenderables.cargoTypes) + +``` +LayerConfig.SatisfactionEdgesRenderables.cargoTypes: {CargoTypeId} +``` + +Only consider this cargo types + +### LayerConfig.SatisfactionEdgesRenderables.colors[πŸ”—](#$api.type~LayerConfig.SatisfactionEdgesRenderables.colors) + +``` +LayerConfig.SatisfactionEdgesRenderables.colors: {Vec4f} +``` + +Interpotate based on satisfaction percentage of cargo transited through the edge + +### LayerConfig.SatisfactionEdgesRenderables.thresholds[πŸ”—](#$api.type~LayerConfig.SatisfactionEdgesRenderables.thresholds) + +``` +LayerConfig.SatisfactionEdgesRenderables.thresholds: {number} +``` + +Values for the gradient of colors (must have same length as colors) + +### LayerConfig.SatisfactionEdgesRenderables.signConfig[πŸ”—](#$api.type~LayerConfig.SatisfactionEdgesRenderables.signConfig) + +``` +LayerConfig.SatisfactionEdgesRenderables.signConfig: SignConfig +``` + +Configures look and feel of text labels + +### LayerConfig.SpeedLimitsEdgesRenderables[πŸ”—](#$api.type~LayerConfig.SpeedLimitsEdgesRenderables) + +``` +record LayerConfig.SpeedLimitsEdgesRenderables new: function(): SpeedLimitsEdgesRenderables + + speedColor: {Vec4f, Vec4f, Vec4f} + undergroundSpeedColor: {Vec4f, Vec4f, Vec4f} + numberOfLevels: integer + tunnelOutlineColor: Vec4f + tunnelOutlineSize: number + signConfig: SignConfig + hideNonPlayerOwned: boolean + hideNonLocked: boolean +end +``` + +Configures the rendering of the speed limits on edges + +### LayerConfig.SpeedLimitsEdgesRenderables.new()[πŸ”—](#$api.type~LayerConfig.SpeedLimitsEdgesRenderables.new()) + +``` +function LayerConfig.SpeedLimitsEdgesRenderables.new()(): SpeedLimitsEdgesRenderables +``` + +Creates a new empty object of type SpeedLimitsEdgesRenderables + +**Returns** + +1. `SpeedLimitsEdgesRenderables` + +### LayerConfig.SpeedLimitsEdgesRenderables.new(SpeedLimitsEdgesRenderables)[πŸ”—](#$api.type~LayerConfig.SpeedLimitsEdgesRenderables.new(SpeedLimitsEdgesRenderables)) + +``` +function LayerConfig.SpeedLimitsEdgesRenderables.new(SpeedLimitsEdgesRenderables)(SpeedLimitsEdgesRenderables): SpeedLimitsEdgesRenderables +``` + +Creates a copy of an object of type SpeedLimitsEdgesRenderables + +**Parameters** + +* `SpeedLimitsEdgesRenderables` + +**Returns** + +1. `SpeedLimitsEdgesRenderables` + +### LayerConfig.SpeedLimitsEdgesRenderables.speedColor[πŸ”—](#$api.type~LayerConfig.SpeedLimitsEdgesRenderables.speedColor) + +``` +LayerConfig.SpeedLimitsEdgesRenderables.speedColor: {Vec4f, Vec4f, Vec4f} +``` + +Intepolate between these colors based on the speed of the edges + +### LayerConfig.SpeedLimitsEdgesRenderables.undergroundSpeedColor[πŸ”—](#$api.type~LayerConfig.SpeedLimitsEdgesRenderables.undergroundSpeedColor) + +``` +LayerConfig.SpeedLimitsEdgesRenderables.undergroundSpeedColor: {Vec4f, Vec4f, Vec4f} +``` + +Intepolate between these colors based on the speed of the edges (applied to tunnels) + +### LayerConfig.SpeedLimitsEdgesRenderables.numberOfLevels[πŸ”—](#$api.type~LayerConfig.SpeedLimitsEdgesRenderables.numberOfLevels) + +``` +LayerConfig.SpeedLimitsEdgesRenderables.numberOfLevels: integer +``` + +### LayerConfig.SpeedLimitsEdgesRenderables.tunnelOutlineColor[πŸ”—](#$api.type~LayerConfig.SpeedLimitsEdgesRenderables.tunnelOutlineColor) + +``` +LayerConfig.SpeedLimitsEdgesRenderables.tunnelOutlineColor: Vec4f +``` + +Color of the outline on tunnels + +### LayerConfig.SpeedLimitsEdgesRenderables.tunnelOutlineSize[πŸ”—](#$api.type~LayerConfig.SpeedLimitsEdgesRenderables.tunnelOutlineSize) + +``` +LayerConfig.SpeedLimitsEdgesRenderables.tunnelOutlineSize: number +``` + +Width of the outline on tunnels + +### LayerConfig.SpeedLimitsEdgesRenderables.signConfig[πŸ”—](#$api.type~LayerConfig.SpeedLimitsEdgesRenderables.signConfig) + +``` +LayerConfig.SpeedLimitsEdgesRenderables.signConfig: SignConfig +``` + +Configures look and feel of text labels + +### LayerConfig.SpeedLimitsEdgesRenderables.hideNonPlayerOwned[πŸ”—](#$api.type~LayerConfig.SpeedLimitsEdgesRenderables.hideNonPlayerOwned) + +``` +LayerConfig.SpeedLimitsEdgesRenderables.hideNonPlayerOwned: boolean +``` + +Hide edges that are not owned by the player + +### LayerConfig.SpeedLimitsEdgesRenderables.hideNonLocked[πŸ”—](#$api.type~LayerConfig.SpeedLimitsEdgesRenderables.hideNonLocked) + +``` +LayerConfig.SpeedLimitsEdgesRenderables.hideNonLocked: boolean +``` + +Hide edges that do not have the roadDevelopmentLocked flag + +### LayerConfig.TrafficEdgesRenderables[πŸ”—](#$api.type~LayerConfig.TrafficEdgesRenderables) + +``` +record LayerConfig.TrafficEdgesRenderables new: function(): TrafficEdgesRenderables + + trafficColor: {Vec4f, Vec4f, Vec4f} + undergroundTrafficColor: {Vec4f, Vec4f, Vec4f} + numberOfLevels: integer + discrete: boolean + tunnelOutlineColor: Vec4f + tunnelOutlineSize: number +end +``` + +Configures the rendering of traffic in edges + +### LayerConfig.TrafficEdgesRenderables.new()[πŸ”—](#$api.type~LayerConfig.TrafficEdgesRenderables.new()) + +``` +function LayerConfig.TrafficEdgesRenderables.new()(): TrafficEdgesRenderables +``` + +Creates a new empty object of type TrafficEdgesRenderables + +**Returns** + +1. `TrafficEdgesRenderables` + +### LayerConfig.TrafficEdgesRenderables.new(TrafficEdgesRenderables)[πŸ”—](#$api.type~LayerConfig.TrafficEdgesRenderables.new(TrafficEdgesRenderables)) + +``` +function LayerConfig.TrafficEdgesRenderables.new(TrafficEdgesRenderables)(TrafficEdgesRenderables): TrafficEdgesRenderables +``` + +Creates a copy of an object of type TrafficEdgesRenderables + +**Parameters** + +* `TrafficEdgesRenderables` + +**Returns** + +1. `TrafficEdgesRenderables` + +### LayerConfig.TrafficEdgesRenderables.trafficColor[πŸ”—](#$api.type~LayerConfig.TrafficEdgesRenderables.trafficColor) + +``` +LayerConfig.TrafficEdgesRenderables.trafficColor: {Vec4f, Vec4f, Vec4f} +``` + +Interpolate bewteen these colors based on the amount of traffic on the edges + +### LayerConfig.TrafficEdgesRenderables.undergroundTrafficColor[πŸ”—](#$api.type~LayerConfig.TrafficEdgesRenderables.undergroundTrafficColor) + +``` +LayerConfig.TrafficEdgesRenderables.undergroundTrafficColor: {Vec4f, Vec4f, Vec4f} +``` + +Interpolate bewteen these colors based on the amount of traffic on the edges (applied to tunnels) + +### LayerConfig.TrafficEdgesRenderables.numberOfLevels[πŸ”—](#$api.type~LayerConfig.TrafficEdgesRenderables.numberOfLevels) + +``` +LayerConfig.TrafficEdgesRenderables.numberOfLevels: integer +``` + +Number of discretizaton levels of speedColor + +### LayerConfig.TrafficEdgesRenderables.discrete[πŸ”—](#$api.type~LayerConfig.TrafficEdgesRenderables.discrete) + +``` +LayerConfig.TrafficEdgesRenderables.discrete: boolean +``` + +Unused + +### LayerConfig.TrafficEdgesRenderables.tunnelOutlineColor[πŸ”—](#$api.type~LayerConfig.TrafficEdgesRenderables.tunnelOutlineColor) + +``` +LayerConfig.TrafficEdgesRenderables.tunnelOutlineColor: Vec4f +``` + +Color of the outline on tunnels + +### LayerConfig.TrafficEdgesRenderables.tunnelOutlineSize[πŸ”—](#$api.type~LayerConfig.TrafficEdgesRenderables.tunnelOutlineSize) + +``` +LayerConfig.TrafficEdgesRenderables.tunnelOutlineSize: number +``` + +Width of the outline on tunnels + +### LayerConfig.VoronoiRenderableConfig[πŸ”—](#$api.type~LayerConfig.VoronoiRenderableConfig) + +``` +record LayerConfig.VoronoiRenderableConfig new: function(): VoronoiRenderableConfig + + showTowns: boolean + townsOfInterest: {Engine.Entity} + showMapBorder: boolean + lineWidth: number + colors: {Vec4f} + sectionsPerColor: integer + fadingMinHeight: number + fadingDeltaHeight: number +end +``` + +Configure the rendering of town limits (based on closest distance to towns) + +### LayerConfig.VoronoiRenderableConfig.new()[πŸ”—](#$api.type~LayerConfig.VoronoiRenderableConfig.new()) + +``` +function LayerConfig.VoronoiRenderableConfig.new()(): VoronoiRenderableConfig +``` + +Creates a new empty object of type VoronoiRenderableConfig + +**Returns** + +1. `VoronoiRenderableConfig` + +### LayerConfig.VoronoiRenderableConfig.new(VoronoiRenderableConfig)[πŸ”—](#$api.type~LayerConfig.VoronoiRenderableConfig.new(VoronoiRenderableConfig)) + +``` +function LayerConfig.VoronoiRenderableConfig.new(VoronoiRenderableConfig)(VoronoiRenderableConfig): VoronoiRenderableConfig +``` + +Creates a copy of an object of type VoronoiRenderableConfig + +**Parameters** + +* `VoronoiRenderableConfig` + +**Returns** + +1. `VoronoiRenderableConfig` + +### LayerConfig.VoronoiRenderableConfig.showTowns[πŸ”—](#$api.type~LayerConfig.VoronoiRenderableConfig.showTowns) + +``` +LayerConfig.VoronoiRenderableConfig.showTowns: boolean +``` + +Only consider towns of interest + +### LayerConfig.VoronoiRenderableConfig.townsOfInterest[πŸ”—](#$api.type~LayerConfig.VoronoiRenderableConfig.townsOfInterest) + +``` +LayerConfig.VoronoiRenderableConfig.townsOfInterest: {Engine.Entity} +``` + +Optional towns of interest: If set AND `showTowns` is true, only those townns are considered + +### LayerConfig.VoronoiRenderableConfig.showMapBorder[πŸ”—](#$api.type~LayerConfig.VoronoiRenderableConfig.showMapBorder) + +``` +LayerConfig.VoronoiRenderableConfig.showMapBorder: boolean +``` + +Display also borders at the edge of the map + +### LayerConfig.VoronoiRenderableConfig.lineWidth[πŸ”—](#$api.type~LayerConfig.VoronoiRenderableConfig.lineWidth) + +``` +LayerConfig.VoronoiRenderableConfig.lineWidth: number +``` + +Width of the line + +### LayerConfig.VoronoiRenderableConfig.colors[πŸ”—](#$api.type~LayerConfig.VoronoiRenderableConfig.colors) + +``` +LayerConfig.VoronoiRenderableConfig.colors: {Vec4f} +``` + +Colors of the line (alternatings) + +### LayerConfig.VoronoiRenderableConfig.sectionsPerColor[πŸ”—](#$api.type~LayerConfig.VoronoiRenderableConfig.sectionsPerColor) + +``` +LayerConfig.VoronoiRenderableConfig.sectionsPerColor: integer +``` + +Number of section for each color + +### LayerConfig.VoronoiRenderableConfig.fadingMinHeight[πŸ”—](#$api.type~LayerConfig.VoronoiRenderableConfig.fadingMinHeight) + +``` +LayerConfig.VoronoiRenderableConfig.fadingMinHeight: number +``` + +Height at which rendering is no longer visible + +### LayerConfig.VoronoiRenderableConfig.fadingDeltaHeight[πŸ”—](#$api.type~LayerConfig.VoronoiRenderableConfig.fadingDeltaHeight) + +``` +LayerConfig.VoronoiRenderableConfig.fadingDeltaHeight: number +``` + +Height at which rendering stops is fadingMinHeight+fadingDeltaHeight + +### LayerConfig.WindRenderableConfig[πŸ”—](#$api.type~LayerConfig.WindRenderableConfig) + +``` +record LayerConfig.WindRenderableConfig new: function(): WindRenderableConfig + + isVisible: boolean + emissionType: Engine.Component.EmissionGrid.Type +end +``` + +Configure wind display and its impact on diverse emisson types + +### LayerConfig.WindRenderableConfig.new()[πŸ”—](#$api.type~LayerConfig.WindRenderableConfig.new()) + +``` +function LayerConfig.WindRenderableConfig.new()(): WindRenderableConfig +``` + +Creates a new empty object of type WindRenderableConfig + +**Returns** + +1. `WindRenderableConfig` + +### LayerConfig.WindRenderableConfig.new(WindRenderableConfig)[πŸ”—](#$api.type~LayerConfig.WindRenderableConfig.new(WindRenderableConfig)) + +``` +function LayerConfig.WindRenderableConfig.new(WindRenderableConfig)(WindRenderableConfig): WindRenderableConfig +``` + +Creates a copy of an object of type WindRenderableConfig + +**Parameters** + +* `WindRenderableConfig` + +**Returns** + +1. `WindRenderableConfig` + +### LayerConfig.WindRenderableConfig.isVisible[πŸ”—](#$api.type~LayerConfig.WindRenderableConfig.isVisible) + +``` +LayerConfig.WindRenderableConfig.isVisible: boolean +``` + +Enables or disable rendering of the visualization + +### LayerConfig.WindRenderableConfig.emissionType[πŸ”—](#$api.type~LayerConfig.WindRenderableConfig.emissionType) + +``` +LayerConfig.WindRenderableConfig.emissionType: Engine.Component.EmissionGrid.Type +``` + +Grid to use to chose the wind direction (usually applies only to pollution) + +### LayerConfig.CargoFlowRenderableConfig[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig) + +``` +[Expand All] [Collapse All] + +record LayerConfig.CargoFlowRenderableConfig new: function(): CargoFlowRenderableConfig + + record FlowData new: function(): FlowData + + from: Vec3f + to: Vec3f + speed: number + arrowColors: {Vec4f} + cargoIconAlpha: number + cargoTypes: {CargoTypeId} +end + flowData: {FlowData} +end +``` + +Configure 3d cargo flow arrows + +### LayerConfig.CargoFlowRenderableConfig.new()[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig.new()) + +``` +function LayerConfig.CargoFlowRenderableConfig.new()(): CargoFlowRenderableConfig +``` + +Creates a new empty object of type CargoFlowRenderableConfig + +**Returns** + +1. `CargoFlowRenderableConfig` + +### LayerConfig.CargoFlowRenderableConfig.new(CargoFlowRenderableConfig)[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig.new(CargoFlowRenderableConfig)) + +``` +function LayerConfig.CargoFlowRenderableConfig.new(CargoFlowRenderableConfig)(CargoFlowRenderableConfig): CargoFlowRenderableConfig +``` + +Creates a copy of an object of type CargoFlowRenderableConfig + +**Parameters** + +* `CargoFlowRenderableConfig` + +**Returns** + +1. `CargoFlowRenderableConfig` + +### LayerConfig.CargoFlowRenderableConfig.FlowData[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig.FlowData) + +``` +record LayerConfig.CargoFlowRenderableConfig.FlowData new: function(): FlowData + + from: Vec3f + to: Vec3f + speed: number + arrowColors: {Vec4f} + cargoIconAlpha: number + cargoTypes: {CargoTypeId} +end +``` + +### LayerConfig.CargoFlowRenderableConfig.FlowData.new()[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig.FlowData.new()) + +``` +function LayerConfig.CargoFlowRenderableConfig.FlowData.new()(): FlowData +``` + +**Returns** + +1. `FlowData` + +### LayerConfig.CargoFlowRenderableConfig.FlowData.new(FlowData)[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig.FlowData.new(FlowData)) + +``` +function LayerConfig.CargoFlowRenderableConfig.FlowData.new(FlowData)(FlowData): FlowData +``` + +**Parameters** + +* `FlowData` + +**Returns** + +1. `FlowData` + +### LayerConfig.CargoFlowRenderableConfig.FlowData.from[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig.FlowData.from) + +``` +LayerConfig.CargoFlowRenderableConfig.FlowData.from: Vec3f +``` + +### LayerConfig.CargoFlowRenderableConfig.FlowData.to[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig.FlowData.to) + +``` +LayerConfig.CargoFlowRenderableConfig.FlowData.to: Vec3f +``` + +### LayerConfig.CargoFlowRenderableConfig.FlowData.speed[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig.FlowData.speed) + +``` +LayerConfig.CargoFlowRenderableConfig.FlowData.speed: number +``` + +### LayerConfig.CargoFlowRenderableConfig.FlowData.arrowColors[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig.FlowData.arrowColors) + +``` +LayerConfig.CargoFlowRenderableConfig.FlowData.arrowColors: {Vec4f} +``` + +### LayerConfig.CargoFlowRenderableConfig.FlowData.cargoIconAlpha[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig.FlowData.cargoIconAlpha) + +``` +LayerConfig.CargoFlowRenderableConfig.FlowData.cargoIconAlpha: number +``` + +### LayerConfig.CargoFlowRenderableConfig.FlowData.cargoTypes[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig.FlowData.cargoTypes) + +``` +LayerConfig.CargoFlowRenderableConfig.FlowData.cargoTypes: {CargoTypeId} +``` + +### LayerConfig.CargoFlowRenderableConfig.flowData[πŸ”—](#$api.type~LayerConfig.CargoFlowRenderableConfig.flowData) + +``` +LayerConfig.CargoFlowRenderableConfig.flowData: {FlowData} +``` + +### LayerConfig.colorMap[πŸ”—](#$api.type~LayerConfig.colorMap) + +``` +LayerConfig.colorMap: any +``` + +Optional color map config: nil, EmissionColorMap or TerrainColorMap + +### LayerConfig.contours[πŸ”—](#$api.type~LayerConfig.contours) + +``` +LayerConfig.contours: TerrainContours +``` + +### LayerConfig.colorPassFn[πŸ”—](#$api.type~LayerConfig.colorPassFn) + +``` +LayerConfig.colorPassFn: ColorPassFn +``` + +### LayerConfig.colorPassFnForBuildingRenderableOnly[πŸ”—](#$api.type~LayerConfig.colorPassFnForBuildingRenderableOnly) + +``` +LayerConfig.colorPassFnForBuildingRenderableOnly: boolean +``` + +### LayerConfig.buildingRenderableConfig[πŸ”—](#$api.type~LayerConfig.buildingRenderableConfig) + +``` +LayerConfig.buildingRenderableConfig: BuildingRenderableConfig +``` + +### LayerConfig.catchmentAreaRenderableConfig[πŸ”—](#$api.type~LayerConfig.catchmentAreaRenderableConfig) + +``` +LayerConfig.catchmentAreaRenderableConfig: CatchmentAreaRenderableConfig +``` + +### LayerConfig.edgeRenderableConfig[πŸ”—](#$api.type~LayerConfig.edgeRenderableConfig) + +``` +LayerConfig.edgeRenderableConfig: any +``` + +### LayerConfig.voronoiRenderableConfig[πŸ”—](#$api.type~LayerConfig.voronoiRenderableConfig) + +``` +LayerConfig.voronoiRenderableConfig: VoronoiRenderableConfig +``` + +### LayerConfig.windRenderableConfig[πŸ”—](#$api.type~LayerConfig.windRenderableConfig) + +``` +LayerConfig.windRenderableConfig: WindRenderableConfig +``` + +### LayerConfig.plotsRenderableConfig[πŸ”—](#$api.type~LayerConfig.plotsRenderableConfig) + +``` +LayerConfig.plotsRenderableConfig: PlotsRenderableConfig +``` + +### LayerConfig.cargoFlowRenderableConfig[πŸ”—](#$api.type~LayerConfig.cargoFlowRenderableConfig) + +``` +LayerConfig.cargoFlowRenderableConfig: CargoFlowRenderableConfig +``` + +### LayerConfig.undergroundMode[πŸ”—](#$api.type~LayerConfig.undergroundMode) + +``` +LayerConfig.undergroundMode: boolean +``` + +Underground mode enables rendering and snapping of underground entities + +### LayerConfig.showOneWay[πŸ”—](#$api.type~LayerConfig.showOneWay) + +``` +LayerConfig.showOneWay: boolean +``` + +Display one way arrows on streets + +### LineCargoInfo[πŸ”—](#$api.type~LineCargoInfo) + +``` +global record LineCargoInfo realSectionTimes: {{number, integer}} + sectionTimes: {number} + frequency: number + driveRealSectionTimes: {{number, integer}} + driveSectionTimes: {number} + numVehicles: integer + totalCapacity: integer + availableCapacities: {integer} + comfortFactor: number + priceFactor: number +end +``` + +Information about cargo on a line + +### LineCargoInfo.realSectionTimes[πŸ”—](#$api.type~LineCargoInfo.realSectionTimes) + +``` +LineCargoInfo.realSectionTimes: {{number, integer}} +``` + +Real times for each section + +### LineCargoInfo.sectionTimes[πŸ”—](#$api.type~LineCargoInfo.sectionTimes) + +``` +LineCargoInfo.sectionTimes: {number} +``` + +Scheduled times for each section + +### LineCargoInfo.frequency[πŸ”—](#$api.type~LineCargoInfo.frequency) + +``` +LineCargoInfo.frequency: number +``` + +Frequency of the cargo on the line + +### LineCargoInfo.driveRealSectionTimes[πŸ”—](#$api.type~LineCargoInfo.driveRealSectionTimes) + +``` +LineCargoInfo.driveRealSectionTimes: {{number, integer}} +``` + +Real drive times for each section + +### LineCargoInfo.driveSectionTimes[πŸ”—](#$api.type~LineCargoInfo.driveSectionTimes) + +``` +LineCargoInfo.driveSectionTimes: {number} +``` + +Drive times for each section + +### LineCargoInfo.numVehicles[πŸ”—](#$api.type~LineCargoInfo.numVehicles) + +``` +LineCargoInfo.numVehicles: integer +``` + +Number of vehicles + +### LineCargoInfo.totalCapacity[πŸ”—](#$api.type~LineCargoInfo.totalCapacity) + +``` +LineCargoInfo.totalCapacity: integer +``` + +Total capacity + +### LineCargoInfo.availableCapacities[πŸ”—](#$api.type~LineCargoInfo.availableCapacities) + +``` +LineCargoInfo.availableCapacities: {integer} +``` + +Available capacities + +### LineCargoInfo.comfortFactor[πŸ”—](#$api.type~LineCargoInfo.comfortFactor) + +``` +LineCargoInfo.comfortFactor: number +``` + +Comfort factor for this cargo on the line + +### LineCargoInfo.priceFactor[πŸ”—](#$api.type~LineCargoInfo.priceFactor) + +``` +LineCargoInfo.priceFactor: number +``` + +Price factor for this cargo on the line + +### LineIssue[πŸ”—](#$api.type~LineIssue) + +``` +[Expand All] [Collapse All] + +global record LineIssue record Type NowhereToLoad: Type + NowhereToUnload: Type + NoVehicleToLoadCargo: Type + VehicleUseless: Type + LineCargoConfig: Type + None: Type +end + type: Type + stopIndex: integer + cargoType: CargoTypeId +end +``` + +### LineIssue.Type[πŸ”—](#$api.type~LineIssue.Type) + +``` +record LineIssue.Type NowhereToLoad: Type + NowhereToUnload: Type + NoVehicleToLoadCargo: Type + VehicleUseless: Type + LineCargoConfig: Type + None: Type +end +``` + +### LineIssue.Type.NowhereToLoad[πŸ”—](#$api.type~LineIssue.Type.NowhereToLoad) + +``` +LineIssue.Type.NowhereToLoad: Type +``` + +### LineIssue.Type.NowhereToUnload[πŸ”—](#$api.type~LineIssue.Type.NowhereToUnload) + +``` +LineIssue.Type.NowhereToUnload: Type +``` + +### LineIssue.Type.NoVehicleToLoadCargo[πŸ”—](#$api.type~LineIssue.Type.NoVehicleToLoadCargo) + +``` +LineIssue.Type.NoVehicleToLoadCargo: Type +``` + +### LineIssue.Type.VehicleUseless[πŸ”—](#$api.type~LineIssue.Type.VehicleUseless) + +``` +LineIssue.Type.VehicleUseless: Type +``` + +### LineIssue.Type.LineCargoConfig[πŸ”—](#$api.type~LineIssue.Type.LineCargoConfig) + +``` +LineIssue.Type.LineCargoConfig: Type +``` + +### LineIssue.Type.None[πŸ”—](#$api.type~LineIssue.Type.None) + +``` +LineIssue.Type.None: Type +``` + +### LineIssue.type[πŸ”—](#$api.type~LineIssue.type) + +``` +LineIssue.type: Type +``` + +### LineIssue.stopIndex[πŸ”—](#$api.type~LineIssue.stopIndex) + +``` +LineIssue.stopIndex: integer +``` + +### LineIssue.cargoType[πŸ”—](#$api.type~LineIssue.cargoType) + +``` +LineIssue.cargoType: CargoTypeId +``` + +### LineOrEdges[πŸ”—](#$api.type~LineOrEdges) + +``` +global record LineOrEdges line: Engine.Entity + lineStop0: integer + lineStop1: integer + lineTerminal1: {Engine.Entity, integer} + edges: {EdgePos} +end +``` + +### LineOrEdges.line[πŸ”—](#$api.type~LineOrEdges.line) + +``` +LineOrEdges.line: Engine.Entity +``` + +### LineOrEdges.lineStop0[πŸ”—](#$api.type~LineOrEdges.lineStop0) + +``` +LineOrEdges.lineStop0: integer +``` + +### LineOrEdges.lineStop1[πŸ”—](#$api.type~LineOrEdges.lineStop1) + +``` +LineOrEdges.lineStop1: integer +``` + +### LineOrEdges.lineTerminal1[πŸ”—](#$api.type~LineOrEdges.lineTerminal1) + +``` +LineOrEdges.lineTerminal1: {Engine.Entity, integer} +``` + +### LineOrEdges.edges[πŸ”—](#$api.type~LineOrEdges.edges) + +``` +LineOrEdges.edges: {EdgePos} +``` + +### LineProblem[πŸ”—](#$api.type~LineProblem) + +``` +global record LineProblem NOTHING: integer + ZERO_OR_ONE_STATION: integer + DOUBLE_STATIONS: integer + INCOMPATIBLE_STATIONS: integer + NO_PATH: integer + BAD_ALTERNATIVE_TERMINAL: integer +end +``` + +Information about the problem of a line. + +### LineProblem.NOTHING[πŸ”—](#$api.type~LineProblem.NOTHING) + +``` +LineProblem.NOTHING: integer +``` + +### LineProblem.ZERO\_OR\_ONE\_STATION[πŸ”—](#$api.type~LineProblem.ZERO_OR_ONE_STATION) + +``` +LineProblem.ZERO_OR_ONE_STATION: integer +``` + +### LineProblem.DOUBLE\_STATIONS[πŸ”—](#$api.type~LineProblem.DOUBLE_STATIONS) + +``` +LineProblem.DOUBLE_STATIONS: integer +``` + +### LineProblem.INCOMPATIBLE\_STATIONS[πŸ”—](#$api.type~LineProblem.INCOMPATIBLE_STATIONS) + +``` +LineProblem.INCOMPATIBLE_STATIONS: integer +``` + +### LineProblem.NO\_PATH[πŸ”—](#$api.type~LineProblem.NO_PATH) + +``` +LineProblem.NO_PATH: integer +``` + +### LineProblem.BAD\_ALTERNATIVE\_TERMINAL[πŸ”—](#$api.type~LineProblem.BAD_ALTERNATIVE_TERMINAL) + +``` +LineProblem.BAD_ALTERNATIVE_TERMINAL: integer +``` + +### LineStationProblem[πŸ”—](#$api.type~LineStationProblem) + +``` +global record LineStationProblem StopUseless: integer + PassengerStopUseless: integer + CargoStopUseless: integer + AllPassengerStopUseless: integer + CargoTypeUnloadUseless: integer + CargoTypeLoadUseless: integer +end +``` + +Information about the problem of station within a line. + +### LineStationProblem.StopUseless[πŸ”—](#$api.type~LineStationProblem.StopUseless) + +``` +LineStationProblem.StopUseless: integer +``` + +### LineStationProblem.PassengerStopUseless[πŸ”—](#$api.type~LineStationProblem.PassengerStopUseless) + +``` +LineStationProblem.PassengerStopUseless: integer +``` + +### LineStationProblem.CargoStopUseless[πŸ”—](#$api.type~LineStationProblem.CargoStopUseless) + +``` +LineStationProblem.CargoStopUseless: integer +``` + +### LineStationProblem.AllPassengerStopUseless[πŸ”—](#$api.type~LineStationProblem.AllPassengerStopUseless) + +``` +LineStationProblem.AllPassengerStopUseless: integer +``` + +### LineStationProblem.CargoTypeUnloadUseless[πŸ”—](#$api.type~LineStationProblem.CargoTypeUnloadUseless) + +``` +LineStationProblem.CargoTypeUnloadUseless: integer +``` + +### LineStationProblem.CargoTypeLoadUseless[πŸ”—](#$api.type~LineStationProblem.CargoTypeLoadUseless) + +``` +LineStationProblem.CargoTypeLoadUseless: integer +``` + +### LineVehicleInfo[πŸ”—](#$api.type~LineVehicleInfo) + +``` +global record LineVehicleInfo transportModes: {TransportMode : boolean} +end +``` + +Configuration of vehicles that can use the line + +### LineVehicleInfo.transportModes[πŸ”—](#$api.type~LineVehicleInfo.transportModes) + +``` +LineVehicleInfo.transportModes: {TransportMode : boolean} +``` + +Type of tranport modes that can use the line + +### LoadConfig[πŸ”—](#$api.type~LoadConfig) + +``` +global record LoadConfig new: function(): LoadConfig + loadConfigIndex: integer + cargoTypeId: CargoTypeId +end +``` + +Configuration for loading cargo into a vehicle compartment + +### LoadConfig.new[πŸ”—](#$api.type~LoadConfig.new) + +``` +function LoadConfig.new(): LoadConfig +``` + +**Returns** + +1. `LoadConfig` + +### LoadConfig.loadConfigIndex[πŸ”—](#$api.type~LoadConfig.loadConfigIndex) + +``` +LoadConfig.loadConfigIndex: integer +``` + +Index of the load configuration + +### LoadConfig.cargoTypeId[πŸ”—](#$api.type~LoadConfig.cargoTypeId) + +``` +LoadConfig.cargoTypeId: CargoTypeId +``` + +Type of cargo to load + +### LoaderHelper[πŸ”—](#$api.type~LoaderHelper) + +``` +global record LoaderHelper useFn: function(LoaderHelper, string) +end +``` + +Helper class that allows loading and calling files in other modules + +### LoaderHelper.useFn[πŸ”—](#$api.type~LoaderHelper.useFn) + +``` +function LoaderHelper.useFn(LoaderHelper, string) +``` + +**Parameters** + +* `LoaderHelper` +* `string` + +### LogLevel[πŸ”—](#$api.type~LogLevel) + +``` +global record LogLevel Raw: LogLevel + Error: LogLevel + Warning: LogLevel + Message: LogLevel + Verbose: LogLevel +end +``` + +Log level enumeration + +### LogLevel.Raw[πŸ”—](#$api.type~LogLevel.Raw) + +``` +LogLevel.Raw: LogLevel +``` + +### LogLevel.Error[πŸ”—](#$api.type~LogLevel.Error) + +``` +LogLevel.Error: LogLevel +``` + +### LogLevel.Warning[πŸ”—](#$api.type~LogLevel.Warning) + +``` +LogLevel.Warning: LogLevel +``` + +### LogLevel.Message[πŸ”—](#$api.type~LogLevel.Message) + +``` +LogLevel.Message: LogLevel +``` + +### LogLevel.Verbose[πŸ”—](#$api.type~LogLevel.Verbose) + +``` +LogLevel.Verbose: LogLevel +``` + +### Map[πŸ”—](#$api.type~Map) + +``` +global record Map find: function(Map, K): V + insert: function(Map, K, V) + size: function(Map): integer + asTable: function(Map): {K : V} + next: function(K): K +end +``` + +##### Type Parameters + +* **`K`** +* **`V`** + +### Map.find[πŸ”—](#$api.type~Map.find) + +``` +function Map.find(Map, K): V +``` + +**Parameters** + +* `Map` +* `K` + +**Returns** + +1. `V` + +### Map.insert[πŸ”—](#$api.type~Map.insert) + +``` +function Map.insert(Map, K, V) +``` + +**Parameters** + +* `Map` +* `K` +* `V` + +### Map.size[πŸ”—](#$api.type~Map.size) + +``` +function Map.size(Map): integer +``` + +**Parameters** + +* `Map` + +**Returns** + +1. `integer` + +### Map.asTable[πŸ”—](#$api.type~Map.asTable) + +``` +function Map.asTable(Map): {K : V} +``` + +**Parameters** + +* `Map` + +**Returns** + +1. `{K : V}` + +### Map.next[πŸ”—](#$api.type~Map.next) + +``` +function Map.next(K): K +``` + +**Parameters** + +* `K` + +**Returns** + +1. `K` + +### Mat4f[πŸ”—](#$api.type~Mat4f) + +``` +global record Mat4f new: function(): Mat4f + + clone: function(Mat4f): Mat4f + cols: function(matrix : Mat4f, colIndex : integer): Vec4f + getTransl: function(Mat4f): Vec3f + setTransl: function(v : Mat4f, Vec3f): Mat4f + transformPosition: function(v : Mat4f, Vec3f): Vec3f + transformDirection: function(v : Mat4f, Vec3f): Vec3f + rotZ: function(angle : number): Mat4f + rotY: function(angle : number): Mat4f + rotX: function(angle : number): Mat4f + rotZTransl: function(angle : number, transl : Vec3f): Mat4f + rotZYTransl: function(angles : Vec2f, transl : Vec3f): Mat4f + scale: function(scale : Vec3f): Mat4f + scaleRotZTransl: function(scale : Vec3f, angle : number, transl : Vec3f): Mat4f + scaleTransl: function(scale : Vec3f, transl : Vec3f): Mat4f + transl: function(transl : Vec3f): Mat4f + metamethod __index: function(Mat4f, integer): number + +end +``` + +A 4x4 transformation matrix +Supports addition `+`, subtraction `-` and multiplication `*`. Supports array subscript with `mat[i]` access (16 elements in column-major order). + +### Mat4f.new()[πŸ”—](#$api.type~Mat4f.new()) + +``` +function Mat4f.new()(): Mat4f +``` + +Creates a new matrix. + +**Returns** + +1. `Mat4f` β€” Identity matrix + +### Mat4f.new(Vec4f)[πŸ”—](#$api.type~Mat4f.new(Vec4f)) + +``` +function Mat4f.new(Vec4f)(v : Vec4f): Mat4f +``` + +Creates a new matrix from Vec4f. + +**Parameters** + +* `v` :`Vec4f` β€” Vec4f to initialize all columns + +**Returns** + +1. `Mat4f` β€” New Mat4f + +### Mat4f.new(Vec4f, Vec4f, Vec4f, Vec4f)[πŸ”—](#$api.type~Mat4f.new(Vec4f, Vec4f, Vec4f, Vec4f)) + +``` +function Mat4f.new(Vec4f, Vec4f, Vec4f, Vec4f)(col1 : Vec4f, col2 : Vec4f, col3 : Vec4f, col4 : Vec4f): Mat4f +``` + +Creates a new matrix from four column vectors. + +**Parameters** + +* `col1` :`Vec4f` β€” First column +* `col2` :`Vec4f` β€” Second column +* `col3` :`Vec4f` β€” Third column +* `col4` :`Vec4f` β€” Fourth column + +**Returns** + +1. `Mat4f` β€” New Mat4f + +### Mat4f.clone[πŸ”—](#$api.type~Mat4f.clone) + +``` +function Mat4f.clone(Mat4f): Mat4f +``` + +Create a copy of the matrix + +**Parameters** + +* `Mat4f` + +**Returns** + +1. `Mat4f` β€” Cloned matrix + +### Mat4f.cols[πŸ”—](#$api.type~Mat4f.cols) + +``` +function Mat4f.cols(matrix : Mat4f, colIndex : integer): Vec4f +``` + +Get column vector at index + +**Parameters** + +* `matrix` :`Mat4f` β€” the matrix +* `colIndex` :`integer` β€” Column index (1-4) + +**Returns** + +1. `Vec4f` β€” Column vector + +### Mat4f.getTransl[πŸ”—](#$api.type~Mat4f.getTransl) + +``` +function Mat4f.getTransl(Mat4f): Vec3f +``` + +Get translation component of the matrix + +**Parameters** + +* `Mat4f` + +**Returns** + +1. `Vec3f` β€” Translation vector + +### Mat4f.setTransl[πŸ”—](#$api.type~Mat4f.setTransl) + +``` +function Mat4f.setTransl(v : Mat4f, Vec3f): Mat4f +``` + +Set translation component of the matrix + +**Parameters** + +* `v` :`Mat4f` β€” Translation vector +* `Vec3f` + +**Returns** + +1. `Mat4f` β€” Modified matrix + +### Mat4f.transformPosition[πŸ”—](#$api.type~Mat4f.transformPosition) + +``` +function Mat4f.transformPosition(v : Mat4f, Vec3f): Vec3f +``` + +Transform a position by the matrix + +**Parameters** + +* `v` :`Mat4f` β€” Position to transform +* `Vec3f` + +**Returns** + +1. `Vec3f` β€” Transformed position + +### Mat4f.transformDirection[πŸ”—](#$api.type~Mat4f.transformDirection) + +``` +function Mat4f.transformDirection(v : Mat4f, Vec3f): Vec3f +``` + +Transform a direction by the matrix + +**Parameters** + +* `v` :`Mat4f` β€” Direction to transform +* `Vec3f` + +**Returns** + +1. `Vec3f` β€” Transformed direction + +### Mat4f.rotZ[πŸ”—](#$api.type~Mat4f.rotZ) + +``` +function Mat4f.rotZ(angle : number): Mat4f +``` + +Creates a new Z-axis rotation + +**Parameters** + +* `angle` :`number` β€” Rotation angle in radians + +**Returns** + +1. `Mat4f` β€” Rotation matrix + +### Mat4f.rotY[πŸ”—](#$api.type~Mat4f.rotY) + +``` +function Mat4f.rotY(angle : number): Mat4f +``` + +Creates a new Y-axis rotation + +**Parameters** + +* `angle` :`number` β€” Rotation angle in radians + +**Returns** + +1. `Mat4f` β€” Rotation matrix + +### Mat4f.rotX[πŸ”—](#$api.type~Mat4f.rotX) + +``` +function Mat4f.rotX(angle : number): Mat4f +``` + +Creates a new X-axis rotation + +**Parameters** + +* `angle` :`number` β€” Rotation angle in radians + +**Returns** + +1. `Mat4f` β€” Rotation matrix + +### Mat4f.rotZTransl[πŸ”—](#$api.type~Mat4f.rotZTransl) + +``` +function Mat4f.rotZTransl(angle : number, transl : Vec3f): Mat4f +``` + +Creates a new Z-axis rotation matrix plus translation + +**Parameters** + +* `angle` :`number` β€” Rotation angle in radians +* `transl` :`Vec3f` β€” Translation vector + +**Returns** + +1. `Mat4f` β€” Transformation matrix + +### Mat4f.rotZYTransl[πŸ”—](#$api.type~Mat4f.rotZYTransl) + +``` +function Mat4f.rotZYTransl(angles : Vec2f, transl : Vec3f): Mat4f +``` + +Creates a new Z-axis and Y-axis rotation matrix plus translation + +**Parameters** + +* `angles` :`Vec2f` β€” Rotation angles (x: Z angle, y: Y angle) +* `transl` :`Vec3f` β€” Translation vector + +**Returns** + +1. `Mat4f` β€” Transformation matrix + +### Mat4f.scale[πŸ”—](#$api.type~Mat4f.scale) + +``` +function Mat4f.scale(scale : Vec3f): Mat4f +``` + +Create scale matrix + +**Parameters** + +* `scale` :`Vec3f` β€” Scale factors + +**Returns** + +1. `Mat4f` β€” Scale matrix + +### Mat4f.scaleRotZTransl[πŸ”—](#$api.type~Mat4f.scaleRotZTransl) + +``` +function Mat4f.scaleRotZTransl(scale : Vec3f, angle : number, transl : Vec3f): Mat4f +``` + +Creates a new Z-axis rotation matrix plus translation and scale + +**Parameters** + +* `scale` :`Vec3f` β€” Scale factors +* `angle` :`number` β€” Rotation angle in radians +* `transl` :`Vec3f` β€” Translation vector + +**Returns** + +1. `Mat4f` β€” Transformation matrix + +### Mat4f.scaleTransl[πŸ”—](#$api.type~Mat4f.scaleTransl) + +``` +function Mat4f.scaleTransl(scale : Vec3f, transl : Vec3f): Mat4f +``` + +Creates a new translation and scaling matrix + +**Parameters** + +* `scale` :`Vec3f` β€” Scale factors +* `transl` :`Vec3f` β€” Translation vector + +**Returns** + +1. `Mat4f` β€” Transformation matrix + +### Mat4f.transl[πŸ”—](#$api.type~Mat4f.transl) + +``` +function Mat4f.transl(transl : Vec3f): Mat4f +``` + +Creates a new translation matrix + +**Parameters** + +* `transl` :`Vec3f` β€” Translation vector + +**Returns** + +1. `Mat4f` β€” Translation matrix + +### Mat4f.$meta.\_\_index[πŸ”—](#$api.type~Mat4f.$meta.__index) + +``` +metamethod Mat4f.$meta.__index(Mat4f, integer): number +``` + +**Parameters** + +* `Mat4f` +* `integer` + +**Returns** + +1. `number` + +### Mat4f.$meta.\_\_add[πŸ”—](#$api.type~Mat4f.$meta.__add) + +``` +metamethod Mat4f.$meta.__add(Mat4f, Mat4f): Mat4f +``` + +**Parameters** + +* `Mat4f` +* `Mat4f` + +**Returns** + +1. `Mat4f` + +### Mat4f.$meta.\_\_sub[πŸ”—](#$api.type~Mat4f.$meta.__sub) + +``` +metamethod Mat4f.$meta.__sub(Mat4f, Mat4f): Mat4f +``` + +**Parameters** + +* `Mat4f` +* `Mat4f` + +**Returns** + +1. `Mat4f` + +### Mat4f.$meta.\_\_mul[πŸ”—](#$api.type~Mat4f.$meta.__mul) + +``` +metamethod Mat4f.$meta.__mul(Mat4f, Mat4f): Mat4f +``` + +**Parameters** + +* `Mat4f` +* `Mat4f` + +**Returns** + +1. `Mat4f` + +### MemoryStatistics[πŸ”—](#$api.type~MemoryStatistics) + +``` +global record MemoryStatistics vidMemUsage: integer + trackedVidMemUsage: integer + vidMemMax: integer + peakVidMem: integer + ramUsage: integer + trackedRamUsage: integer + ramMax: integer + peakRam: integer + peakTotalMem: integer + largestFreeBlock: integer +end +``` + +Collection of useful memory statistics + +### MemoryStatistics.vidMemUsage[πŸ”—](#$api.type~MemoryStatistics.vidMemUsage) + +``` +MemoryStatistics.vidMemUsage: integer +``` + +Video memory usage + +### MemoryStatistics.trackedVidMemUsage[πŸ”—](#$api.type~MemoryStatistics.trackedVidMemUsage) + +``` +MemoryStatistics.trackedVidMemUsage: integer +``` + +Tracked video memory usage + +### MemoryStatistics.vidMemMax[πŸ”—](#$api.type~MemoryStatistics.vidMemMax) + +``` +MemoryStatistics.vidMemMax: integer +``` + +Maximum video memory + +### MemoryStatistics.peakVidMem[πŸ”—](#$api.type~MemoryStatistics.peakVidMem) + +``` +MemoryStatistics.peakVidMem: integer +``` + +Peak video memory usage + +### MemoryStatistics.ramUsage[πŸ”—](#$api.type~MemoryStatistics.ramUsage) + +``` +MemoryStatistics.ramUsage: integer +``` + +RAM usage + +### MemoryStatistics.trackedRamUsage[πŸ”—](#$api.type~MemoryStatistics.trackedRamUsage) + +``` +MemoryStatistics.trackedRamUsage: integer +``` + +Tracked RAM usage + +### MemoryStatistics.ramMax[πŸ”—](#$api.type~MemoryStatistics.ramMax) + +``` +MemoryStatistics.ramMax: integer +``` + +Maximum RAM + +### MemoryStatistics.peakRam[πŸ”—](#$api.type~MemoryStatistics.peakRam) + +``` +MemoryStatistics.peakRam: integer +``` + +Peak RAM usage + +### MemoryStatistics.peakTotalMem[πŸ”—](#$api.type~MemoryStatistics.peakTotalMem) + +``` +MemoryStatistics.peakTotalMem: integer +``` + +Peak total memory usage + +### MemoryStatistics.largestFreeBlock[πŸ”—](#$api.type~MemoryStatistics.largestFreeBlock) + +``` +MemoryStatistics.largestFreeBlock: integer +``` + +Largest free memory block + +### MetaConstructionDesc[πŸ”—](#$api.type~MetaConstructionDesc) + +``` +global record MetaConstructionDesc new: function(MetaConstructionDesc): MetaConstructionDesc + availability: ModelMetadata.Availability + description: ModelMetadata.Description + soundConfig: ModelMetadata.SoundConfig + categoryList: ModelMetadata.CategoryList + params: {ConstructionScriptParam} + menuCategory: ModelMetadata.MenuCategory + undergroundView: boolean + heightAdjustable: boolean + isIndustry: boolean + heightModView: boolean + configureLayerScript: ScriptRef + configureHudIconsScript: ScriptRef + metadata: ConstructionDescMetadata + relativePath: string + createTemplateScript: ScriptRef + order: integer +end +``` + +A Metaconstruction is a collection of constructions and modules that can be simultaneously be built +(replaces the deprecated construction templates) + +### MetaConstructionDesc.new[πŸ”—](#$api.type~MetaConstructionDesc.new) + +``` +function MetaConstructionDesc.new(MetaConstructionDesc): MetaConstructionDesc +``` + +Creates a new MetaConstructionDesc object + +**Parameters** + +* `MetaConstructionDesc` + +**Returns** + +1. `MetaConstructionDesc` + +### MetaConstructionDesc.availability[πŸ”—](#$api.type~MetaConstructionDesc.availability) + +``` +MetaConstructionDesc.availability: ModelMetadata.Availability +``` + +Main menu availability range + +### MetaConstructionDesc.description[πŸ”—](#$api.type~MetaConstructionDesc.description) + +``` +MetaConstructionDesc.description: ModelMetadata.Description +``` + +Textual description and icons + +### MetaConstructionDesc.soundConfig[πŸ”—](#$api.type~MetaConstructionDesc.soundConfig) + +``` +MetaConstructionDesc.soundConfig: ModelMetadata.SoundConfig +``` + +Configuration for building sounds + +### MetaConstructionDesc.categoryList[πŸ”—](#$api.type~MetaConstructionDesc.categoryList) + +``` +MetaConstructionDesc.categoryList: ModelMetadata.CategoryList +``` + +Additional tags + +### MetaConstructionDesc.params[πŸ”—](#$api.type~MetaConstructionDesc.params) + +``` +MetaConstructionDesc.params: {ConstructionScriptParam} +``` + +Parameters passed to the template function + +### MetaConstructionDesc.menuCategory[πŸ”—](#$api.type~MetaConstructionDesc.menuCategory) + +``` +MetaConstructionDesc.menuCategory: ModelMetadata.MenuCategory +``` + +Menu category + +### MetaConstructionDesc.undergroundView[πŸ”—](#$api.type~MetaConstructionDesc.undergroundView) + +``` +MetaConstructionDesc.undergroundView: boolean +``` + +Enable underground parameters when building + +### MetaConstructionDesc.heightAdjustable[πŸ”—](#$api.type~MetaConstructionDesc.heightAdjustable) + +``` +MetaConstructionDesc.heightAdjustable: boolean +``` + +Enable height adjustment options when building + +### MetaConstructionDesc.isIndustry[πŸ”—](#$api.type~MetaConstructionDesc.isIndustry) + +``` +MetaConstructionDesc.isIndustry: boolean +``` + +### MetaConstructionDesc.heightModView[πŸ”—](#$api.type~MetaConstructionDesc.heightModView) + +``` +MetaConstructionDesc.heightModView: boolean +``` + +Enable heigh modification grid visualization when building + +### MetaConstructionDesc.configureLayerScript[πŸ”—](#$api.type~MetaConstructionDesc.configureLayerScript) + +``` +MetaConstructionDesc.configureLayerScript: ScriptRef +``` + +Custom layer function for display when building + +### MetaConstructionDesc.configureHudIconsScript[πŸ”—](#$api.type~MetaConstructionDesc.configureHudIconsScript) + +``` +MetaConstructionDesc.configureHudIconsScript: ScriptRef +``` + +Custom layer function for display when building + +### MetaConstructionDesc.metadata[πŸ”—](#$api.type~MetaConstructionDesc.metadata) + +``` +MetaConstructionDesc.metadata: ConstructionDescMetadata +``` + +Additional user defined metadata + +### MetaConstructionDesc.relativePath[πŸ”—](#$api.type~MetaConstructionDesc.relativePath) + +``` +MetaConstructionDesc.relativePath: string +``` + +Relative path to use withing template script + +### MetaConstructionDesc.createTemplateScript[πŸ”—](#$api.type~MetaConstructionDesc.createTemplateScript) + +``` +MetaConstructionDesc.createTemplateScript: ScriptRef +``` + +A definition of a script function returning a list of construction, modules and transforms + +### MetaConstructionDesc.order[πŸ”—](#$api.type~MetaConstructionDesc.order) + +``` +MetaConstructionDesc.order: integer +``` + +### MissionCampaign[πŸ”—](#$api.type~MissionCampaign) + +``` +global record MissionCampaign campaign: ResName + mission: ResName +end +``` + +Campaign and mission identifier + +### MissionCampaign.campaign[πŸ”—](#$api.type~MissionCampaign.campaign) + +``` +MissionCampaign.campaign: ResName +``` + +### MissionCampaign.mission[πŸ”—](#$api.type~MissionCampaign.mission) + +``` +MissionCampaign.mission: ResName +``` + +### MissionDesc[πŸ”—](#$api.type~MissionDesc) + +``` +[Expand All] [Collapse All] + +global record MissionDesc record Medal id: string + name: string + nameLocked: string + iconLocked: string + iconCompleted: string +end + record Star id: string + name: string + description: string + iconLocked: string + iconCompleted: string +end + record Character name: string + info: string + portrait: string +end + name: string + description: string + campaign: string + characters: {Character} + order: integer + image: string + imagePreview: string + imageSuccess: string + imageFailure: string + loadscreen: string + loadscreenDescription: string + loadscreenVoiceOver: string + savegame: string + languageScript: string + playlistOverride: string + medals: {Medal} + starsDescription: string + stars: {Star} + voiceOver: string + location: string + year: string + musicTracks: {{ResName, boolean}} +end +``` + +Campaign mission description + +### MissionDesc.Medal[πŸ”—](#$api.type~MissionDesc.Medal) + +``` +record MissionDesc.Medal id: string + name: string + nameLocked: string + iconLocked: string + iconCompleted: string +end +``` + +Campaign mission medal information + +### MissionDesc.Medal.id[πŸ”—](#$api.type~MissionDesc.Medal.id) + +``` +MissionDesc.Medal.id: string +``` + +### MissionDesc.Medal.name[πŸ”—](#$api.type~MissionDesc.Medal.name) + +``` +MissionDesc.Medal.name: string +``` + +### MissionDesc.Medal.nameLocked[πŸ”—](#$api.type~MissionDesc.Medal.nameLocked) + +``` +MissionDesc.Medal.nameLocked: string +``` + +### MissionDesc.Medal.iconLocked[πŸ”—](#$api.type~MissionDesc.Medal.iconLocked) + +``` +MissionDesc.Medal.iconLocked: string +``` + +### MissionDesc.Medal.iconCompleted[πŸ”—](#$api.type~MissionDesc.Medal.iconCompleted) + +``` +MissionDesc.Medal.iconCompleted: string +``` + +### MissionDesc.Star[πŸ”—](#$api.type~MissionDesc.Star) + +``` +record MissionDesc.Star id: string + name: string + description: string + iconLocked: string + iconCompleted: string +end +``` + +Campaign mission star (achievement) information + +### MissionDesc.Star.id[πŸ”—](#$api.type~MissionDesc.Star.id) + +``` +MissionDesc.Star.id: string +``` + +### MissionDesc.Star.name[πŸ”—](#$api.type~MissionDesc.Star.name) + +``` +MissionDesc.Star.name: string +``` + +### MissionDesc.Star.description[πŸ”—](#$api.type~MissionDesc.Star.description) + +``` +MissionDesc.Star.description: string +``` + +### MissionDesc.Star.iconLocked[πŸ”—](#$api.type~MissionDesc.Star.iconLocked) + +``` +MissionDesc.Star.iconLocked: string +``` + +### MissionDesc.Star.iconCompleted[πŸ”—](#$api.type~MissionDesc.Star.iconCompleted) + +``` +MissionDesc.Star.iconCompleted: string +``` + +### MissionDesc.Character[πŸ”—](#$api.type~MissionDesc.Character) + +``` +record MissionDesc.Character name: string + info: string + portrait: string +end +``` + +Campaign mission character information + +### MissionDesc.Character.name[πŸ”—](#$api.type~MissionDesc.Character.name) + +``` +MissionDesc.Character.name: string +``` + +### MissionDesc.Character.info[πŸ”—](#$api.type~MissionDesc.Character.info) + +``` +MissionDesc.Character.info: string +``` + +### MissionDesc.Character.portrait[πŸ”—](#$api.type~MissionDesc.Character.portrait) + +``` +MissionDesc.Character.portrait: string +``` + +### MissionDesc.name[πŸ”—](#$api.type~MissionDesc.name) + +``` +MissionDesc.name: string +``` + +### MissionDesc.description[πŸ”—](#$api.type~MissionDesc.description) + +``` +MissionDesc.description: string +``` + +### MissionDesc.campaign[πŸ”—](#$api.type~MissionDesc.campaign) + +``` +MissionDesc.campaign: string +``` + +### MissionDesc.characters[πŸ”—](#$api.type~MissionDesc.characters) + +``` +MissionDesc.characters: {Character} +``` + +### MissionDesc.order[πŸ”—](#$api.type~MissionDesc.order) + +``` +MissionDesc.order: integer +``` + +### MissionDesc.image[πŸ”—](#$api.type~MissionDesc.image) + +``` +MissionDesc.image: string +``` + +### MissionDesc.imagePreview[πŸ”—](#$api.type~MissionDesc.imagePreview) + +``` +MissionDesc.imagePreview: string +``` + +### MissionDesc.imageSuccess[πŸ”—](#$api.type~MissionDesc.imageSuccess) + +``` +MissionDesc.imageSuccess: string +``` + +### MissionDesc.imageFailure[πŸ”—](#$api.type~MissionDesc.imageFailure) + +``` +MissionDesc.imageFailure: string +``` + +### MissionDesc.loadscreen[πŸ”—](#$api.type~MissionDesc.loadscreen) + +``` +MissionDesc.loadscreen: string +``` + +### MissionDesc.loadscreenDescription[πŸ”—](#$api.type~MissionDesc.loadscreenDescription) + +``` +MissionDesc.loadscreenDescription: string +``` + +### MissionDesc.loadscreenVoiceOver[πŸ”—](#$api.type~MissionDesc.loadscreenVoiceOver) + +``` +MissionDesc.loadscreenVoiceOver: string +``` + +### MissionDesc.savegame[πŸ”—](#$api.type~MissionDesc.savegame) + +``` +MissionDesc.savegame: string +``` + +### MissionDesc.languageScript[πŸ”—](#$api.type~MissionDesc.languageScript) + +``` +MissionDesc.languageScript: string +``` + +### MissionDesc.playlistOverride[πŸ”—](#$api.type~MissionDesc.playlistOverride) + +``` +MissionDesc.playlistOverride: string +``` + +### MissionDesc.medals[πŸ”—](#$api.type~MissionDesc.medals) + +``` +MissionDesc.medals: {Medal} +``` + +### MissionDesc.starsDescription[πŸ”—](#$api.type~MissionDesc.starsDescription) + +``` +MissionDesc.starsDescription: string +``` + +### MissionDesc.stars[πŸ”—](#$api.type~MissionDesc.stars) + +``` +MissionDesc.stars: {Star} +``` + +### MissionDesc.voiceOver[πŸ”—](#$api.type~MissionDesc.voiceOver) + +``` +MissionDesc.voiceOver: string +``` + +### MissionDesc.location[πŸ”—](#$api.type~MissionDesc.location) + +``` +MissionDesc.location: string +``` + +### MissionDesc.year[πŸ”—](#$api.type~MissionDesc.year) + +``` +MissionDesc.year: string +``` + +### MissionDesc.musicTracks[πŸ”—](#$api.type~MissionDesc.musicTracks) + +``` +MissionDesc.musicTracks: {{ResName, boolean}} +``` + +### ModRep[πŸ”—](#$api.type~ModRep) + +``` +global record ModRep getInstalledMods: function(ModRep): {Mod.ModId} + exists: function(ModRep, Mod.ModId): boolean + + getModDesc: function(ModRep, Mod.ModId): Mod.ModDesc + getModSize: function(ModRep, Mod.ModId): Mod.ModSize + getGameModDesc: function(ModRep, Mod.ModId): Mod.GameModDesc + getModSource: function(ModRep, Mod.ModId): string + wouldForceActivateAchievements: function(ModRep, {Mod.ModId}): boolean + couldAchievementsBeEarned: function(ModRep, {Mod.ModId}): boolean +end +``` + +Contains all active and installed mods and their description + +### ModRep.getInstalledMods[πŸ”—](#$api.type~ModRep.getInstalledMods) + +``` +function ModRep.getInstalledMods(ModRep): {Mod.ModId} +``` + +**Parameters** + +* `ModRep` + +**Returns** + +1. `{Mod.ModId}` + +### ModRep.exists(ModRep, Mod.ModId)[πŸ”—](#$api.type~ModRep.exists(ModRep, Mod.ModId)) + +``` +function ModRep.exists(ModRep, Mod.ModId)(ModRep, Mod.ModId): boolean +``` + +**Parameters** + +* `ModRep` +* `Mod.ModId` + +**Returns** + +1. `boolean` + +### ModRep.exists(ModRep, Mod.ModId)[πŸ”—](#$api.type~ModRep.exists(ModRep, Mod.ModId)) + +``` +function ModRep.exists(ModRep, Mod.ModId)(ModRep, Mod.ModId): boolean +``` + +**Parameters** + +* `ModRep` +* `Mod.ModId` + +**Returns** + +1. `boolean` + +### ModRep.getModDesc[πŸ”—](#$api.type~ModRep.getModDesc) + +``` +function ModRep.getModDesc(ModRep, Mod.ModId): Mod.ModDesc +``` + +**Parameters** + +* `ModRep` +* `Mod.ModId` + +**Returns** + +1. `Mod.ModDesc` + +### ModRep.getModSize[πŸ”—](#$api.type~ModRep.getModSize) + +``` +function ModRep.getModSize(ModRep, Mod.ModId): Mod.ModSize +``` + +**Parameters** + +* `ModRep` +* `Mod.ModId` + +**Returns** + +1. `Mod.ModSize` + +### ModRep.getGameModDesc[πŸ”—](#$api.type~ModRep.getGameModDesc) + +``` +function ModRep.getGameModDesc(ModRep, Mod.ModId): Mod.GameModDesc +``` + +**Parameters** + +* `ModRep` +* `Mod.ModId` + +**Returns** + +1. `Mod.GameModDesc` + +### ModRep.getModSource[πŸ”—](#$api.type~ModRep.getModSource) + +``` +function ModRep.getModSource(ModRep, Mod.ModId): string +``` + +**Parameters** + +* `ModRep` +* `Mod.ModId` + +**Returns** + +1. `string` + +### ModRep.wouldForceActivateAchievements[πŸ”—](#$api.type~ModRep.wouldForceActivateAchievements) + +``` +function ModRep.wouldForceActivateAchievements(ModRep, {Mod.ModId}): boolean +``` + +**Parameters** + +* `ModRep` +* `{Mod.ModId}` + +**Returns** + +1. `boolean` + +### ModRep.couldAchievementsBeEarned[πŸ”—](#$api.type~ModRep.couldAchievementsBeEarned) + +``` +function ModRep.couldAchievementsBeEarned(ModRep, {Mod.ModId}): boolean +``` + +**Parameters** + +* `ModRep` +* `{Mod.ModId}` + +**Returns** + +1. `boolean` + +### Model[πŸ”—](#$api.type~Model) + +``` +global record Model metadata: { : } + boundingInfo: BoundingInfo + collider: { : } + modelPath: ResName +end +``` + +Information about a single model file: metadata and bounding information + +### Model.metadata[πŸ”—](#$api.type~Model.metadata) + +``` +Model.metadata: { : } +``` + +Additional information about the model + +### Model.boundingInfo[πŸ”—](#$api.type~Model.boundingInfo) + +``` +Model.boundingInfo: BoundingInfo +``` + +Bounding box for the model + +### Model.collider[πŸ”—](#$api.type~Model.collider) + +``` +Model.collider: { : } +``` + +Collider information + +### Model.modelPath[πŸ”—](#$api.type~Model.modelPath) + +``` +Model.modelPath: ResName +``` + +### ModelInstance[πŸ”—](#$api.type~ModelInstance) + +``` +global record ModelInstance modelId: integer + transf0: Mat4f + transf: Mat4f + transformator: integer +end +``` + +A model in the world, with complete information + +### ModelInstance.modelId[πŸ”—](#$api.type~ModelInstance.modelId) + +``` +ModelInstance.modelId: integer +``` + +The model id, referenced in modelRep + +### ModelInstance.transf0[πŸ”—](#$api.type~ModelInstance.transf0) + +``` +ModelInstance.transf0: Mat4f +``` + +The model transform at the previous frame + +### ModelInstance.transf[πŸ”—](#$api.type~ModelInstance.transf) + +``` +ModelInstance.transf: Mat4f +``` + +The model transform + +### ModelInstance.transformator[πŸ”—](#$api.type~ModelInstance.transformator) + +``` +ModelInstance.transformator: integer +``` + +Zero-basd index of the transformator for the model (-1 if none) + +### ModelMetadata[πŸ”—](#$api.type~ModelMetadata) + +``` +[Expand All] [Collapse All] + +global record ModelMetadata record Animal record MovementType description: string +end + record Config density: number + fish: boolean +end + config: Config + movementTypes: {MovementType} + idForAchievement: string +end + record Description name: string + description: string + iconSmall: string + iconSmallCblend: string + icon: string + icon20: string + icon3d: string + icon20cblend: string + lockedIcon: string + previewIcon: string + attributes: {string : {number, number}} + attributes_native: Map + cargoTypeSet: CargoTypeSet +end + record Category categories: {string} +end + record CategoryList categories: {string} +end + record MenuCategory record CategoryWithOrder new: function(): CategoryWithOrder + category: string + order: integer + filterCategories: {string} +end + categories: {CategoryWithOrder} +end + record Availability yearFrom: integer + yearTo: integer + notifyWhenAvailable: boolean + notificationGroup: string + notificationSortKey: integer +end + record SoundConfig record SoundSet name: string +end + soundSet: SoundSet + effects: {string : {string}} + builderAudioRes: ResName +end + record Maintenance lifespan: integer + runningCosts: number + runningCostScale: number + maintenanceScale: number + topSpeedMaintenanceFactorPenaltyPerLevel: number +end + record Emission idle: number + speed: number + power: number + score: number +end + record Emissions noise: Emission + pollution: Emission +end + record VehicleEngine power: number + tractiveEffort: number + type: VehicleEngineType +end + record TransportVehicle record CargoEntry cargoTypeSet: CargoTypeSet + capacity: integer + seats: {integer} + loadIndicator: string +end + record LoadConfig new: function(): LoadConfig + cargoEntry: CargoEntry + toHide: {string} +end + record Compartment loadConfigs: {LoadConfig} +end + line: Engine.Entity + carrier: Carrier + compartments: {Compartment} + loadSpeed: number + reversible: boolean + arrivalDelay: integer + departureDelay: integer + groupFileName: ResName + transportModes: {TransportMode} + engineTransportModes: {TransportMode} + filterTags: {string} + comfortFactor: number + priceFactor: number + maintenanceFactor: number + noCblendMask: boolean +end + record Cost priceScale: number + price: integer +end + record LandVehicle topSpeed: number + weightEmpty: number + weightMaxPayload: number + engines: {VehicleEngine} + friction: number +end + record WaterVehicle topSpeed: number + weightEmpty: number + weightMaxPayload: number + availPower: number + maxRpm: number + area: number +end + record AirVehicle topSpeed: number + weightEmpty: number + weightMaxPayload: number + maxThrust: number + isHelicopter: boolean +end + record Person gender: Gender +end + record Tree reputationFactor: number +end +end +``` + +Contains all metadata of a model. A specific metadata might be nil. + +### ModelMetadata.Animal[πŸ”—](#$api.type~ModelMetadata.Animal) + +``` +[Expand All] [Collapse All] + +record ModelMetadata.Animal record MovementType description: string +end + record Config density: number + fish: boolean +end + config: Config + movementTypes: {MovementType} + idForAchievement: string +end +``` + +### ModelMetadata.Animal.MovementType[πŸ”—](#$api.type~ModelMetadata.Animal.MovementType) + +``` +record ModelMetadata.Animal.MovementType description: string +end +``` + +### ModelMetadata.Animal.MovementType.description[πŸ”—](#$api.type~ModelMetadata.Animal.MovementType.description) + +``` +ModelMetadata.Animal.MovementType.description: string +``` + +### ModelMetadata.Animal.Config[πŸ”—](#$api.type~ModelMetadata.Animal.Config) + +``` +record ModelMetadata.Animal.Config density: number + fish: boolean +end +``` + +### ModelMetadata.Animal.Config.density[πŸ”—](#$api.type~ModelMetadata.Animal.Config.density) + +``` +ModelMetadata.Animal.Config.density: number +``` + +### ModelMetadata.Animal.Config.fish[πŸ”—](#$api.type~ModelMetadata.Animal.Config.fish) + +``` +ModelMetadata.Animal.Config.fish: boolean +``` + +### ModelMetadata.Animal.config[πŸ”—](#$api.type~ModelMetadata.Animal.config) + +``` +ModelMetadata.Animal.config: Config +``` + +### ModelMetadata.Animal.movementTypes[πŸ”—](#$api.type~ModelMetadata.Animal.movementTypes) + +``` +ModelMetadata.Animal.movementTypes: {MovementType} +``` + +### ModelMetadata.Animal.idForAchievement[πŸ”—](#$api.type~ModelMetadata.Animal.idForAchievement) + +``` +ModelMetadata.Animal.idForAchievement: string +``` + +### ModelMetadata.Description[πŸ”—](#$api.type~ModelMetadata.Description) + +``` +record ModelMetadata.Description name: string + description: string + iconSmall: string + iconSmallCblend: string + icon: string + icon20: string + icon3d: string + icon20cblend: string + lockedIcon: string + previewIcon: string + attributes: {string : {number, number}} + attributes_native: Map + cargoTypeSet: CargoTypeSet +end +``` + +### ModelMetadata.Description.name[πŸ”—](#$api.type~ModelMetadata.Description.name) + +``` +ModelMetadata.Description.name: string +``` + +### ModelMetadata.Description.description[πŸ”—](#$api.type~ModelMetadata.Description.description) + +``` +ModelMetadata.Description.description: string +``` + +### ModelMetadata.Description.iconSmall[πŸ”—](#$api.type~ModelMetadata.Description.iconSmall) + +``` +ModelMetadata.Description.iconSmall: string +``` + +### ModelMetadata.Description.iconSmallCblend[πŸ”—](#$api.type~ModelMetadata.Description.iconSmallCblend) + +``` +ModelMetadata.Description.iconSmallCblend: string +``` + +### ModelMetadata.Description.icon[πŸ”—](#$api.type~ModelMetadata.Description.icon) + +``` +ModelMetadata.Description.icon: string +``` + +### ModelMetadata.Description.icon20[πŸ”—](#$api.type~ModelMetadata.Description.icon20) + +``` +ModelMetadata.Description.icon20: string +``` + +### ModelMetadata.Description.icon3d[πŸ”—](#$api.type~ModelMetadata.Description.icon3d) + +``` +ModelMetadata.Description.icon3d: string +``` + +### ModelMetadata.Description.icon20cblend[πŸ”—](#$api.type~ModelMetadata.Description.icon20cblend) + +``` +ModelMetadata.Description.icon20cblend: string +``` + +### ModelMetadata.Description.lockedIcon[πŸ”—](#$api.type~ModelMetadata.Description.lockedIcon) + +``` +ModelMetadata.Description.lockedIcon: string +``` + +### ModelMetadata.Description.previewIcon[πŸ”—](#$api.type~ModelMetadata.Description.previewIcon) + +``` +ModelMetadata.Description.previewIcon: string +``` + +### ModelMetadata.Description.attributes[πŸ”—](#$api.type~ModelMetadata.Description.attributes) + +``` +ModelMetadata.Description.attributes: {string : {number, number}} +``` + +### ModelMetadata.Description.attributes\_native[πŸ”—](#$api.type~ModelMetadata.Description.attributes_native) + +``` +ModelMetadata.Description.attributes_native: Map +``` + +### ModelMetadata.Description.cargoTypeSet[πŸ”—](#$api.type~ModelMetadata.Description.cargoTypeSet) + +``` +ModelMetadata.Description.cargoTypeSet: CargoTypeSet +``` + +### ModelMetadata.Category[πŸ”—](#$api.type~ModelMetadata.Category) + +``` +record ModelMetadata.Category categories: {string} +end +``` + +### ModelMetadata.Category.categories[πŸ”—](#$api.type~ModelMetadata.Category.categories) + +``` +ModelMetadata.Category.categories: {string} +``` + +### ModelMetadata.CategoryList[πŸ”—](#$api.type~ModelMetadata.CategoryList) + +``` +record ModelMetadata.CategoryList categories: {string} +end +``` + +### ModelMetadata.CategoryList.categories[πŸ”—](#$api.type~ModelMetadata.CategoryList.categories) + +``` +ModelMetadata.CategoryList.categories: {string} +``` + +### ModelMetadata.MenuCategory[πŸ”—](#$api.type~ModelMetadata.MenuCategory) + +``` +[Expand All] [Collapse All] + +record ModelMetadata.MenuCategory record CategoryWithOrder new: function(): CategoryWithOrder + category: string + order: integer + filterCategories: {string} +end + categories: {CategoryWithOrder} +end +``` + +### ModelMetadata.MenuCategory.CategoryWithOrder[πŸ”—](#$api.type~ModelMetadata.MenuCategory.CategoryWithOrder) + +``` +record ModelMetadata.MenuCategory.CategoryWithOrder new: function(): CategoryWithOrder + category: string + order: integer + filterCategories: {string} +end +``` + +### ModelMetadata.MenuCategory.CategoryWithOrder.new[πŸ”—](#$api.type~ModelMetadata.MenuCategory.CategoryWithOrder.new) + +``` +function ModelMetadata.MenuCategory.CategoryWithOrder.new(): CategoryWithOrder +``` + +**Returns** + +1. `CategoryWithOrder` + +### ModelMetadata.MenuCategory.CategoryWithOrder.category[πŸ”—](#$api.type~ModelMetadata.MenuCategory.CategoryWithOrder.category) + +``` +ModelMetadata.MenuCategory.CategoryWithOrder.category: string +``` + +### ModelMetadata.MenuCategory.CategoryWithOrder.order[πŸ”—](#$api.type~ModelMetadata.MenuCategory.CategoryWithOrder.order) + +``` +ModelMetadata.MenuCategory.CategoryWithOrder.order: integer +``` + +### ModelMetadata.MenuCategory.CategoryWithOrder.filterCategories[πŸ”—](#$api.type~ModelMetadata.MenuCategory.CategoryWithOrder.filterCategories) + +``` +ModelMetadata.MenuCategory.CategoryWithOrder.filterCategories: {string} +``` + +### ModelMetadata.MenuCategory.categories[πŸ”—](#$api.type~ModelMetadata.MenuCategory.categories) + +``` +ModelMetadata.MenuCategory.categories: {CategoryWithOrder} +``` + +### ModelMetadata.Availability[πŸ”—](#$api.type~ModelMetadata.Availability) + +``` +record ModelMetadata.Availability yearFrom: integer + yearTo: integer + notifyWhenAvailable: boolean + notificationGroup: string + notificationSortKey: integer +end +``` + +### ModelMetadata.Availability.yearFrom[πŸ”—](#$api.type~ModelMetadata.Availability.yearFrom) + +``` +ModelMetadata.Availability.yearFrom: integer +``` + +### ModelMetadata.Availability.yearTo[πŸ”—](#$api.type~ModelMetadata.Availability.yearTo) + +``` +ModelMetadata.Availability.yearTo: integer +``` + +### ModelMetadata.Availability.notifyWhenAvailable[πŸ”—](#$api.type~ModelMetadata.Availability.notifyWhenAvailable) + +``` +ModelMetadata.Availability.notifyWhenAvailable: boolean +``` + +### ModelMetadata.Availability.notificationGroup[πŸ”—](#$api.type~ModelMetadata.Availability.notificationGroup) + +``` +ModelMetadata.Availability.notificationGroup: string +``` + +### ModelMetadata.Availability.notificationSortKey[πŸ”—](#$api.type~ModelMetadata.Availability.notificationSortKey) + +``` +ModelMetadata.Availability.notificationSortKey: integer +``` + +### ModelMetadata.SoundConfig[πŸ”—](#$api.type~ModelMetadata.SoundConfig) + +``` +[Expand All] [Collapse All] + +record ModelMetadata.SoundConfig record SoundSet name: string +end + soundSet: SoundSet + effects: {string : {string}} + builderAudioRes: ResName +end +``` + +### ModelMetadata.SoundConfig.SoundSet[πŸ”—](#$api.type~ModelMetadata.SoundConfig.SoundSet) + +``` +record ModelMetadata.SoundConfig.SoundSet name: string +end +``` + +### ModelMetadata.SoundConfig.SoundSet.name[πŸ”—](#$api.type~ModelMetadata.SoundConfig.SoundSet.name) + +``` +ModelMetadata.SoundConfig.SoundSet.name: string +``` + +### ModelMetadata.SoundConfig.soundSet[πŸ”—](#$api.type~ModelMetadata.SoundConfig.soundSet) + +``` +ModelMetadata.SoundConfig.soundSet: SoundSet +``` + +### ModelMetadata.SoundConfig.effects[πŸ”—](#$api.type~ModelMetadata.SoundConfig.effects) + +``` +ModelMetadata.SoundConfig.effects: {string : {string}} +``` + +Sound effects, map from key to list of file paths +used to overwrite certain clips in SoundSet (if SoundSet is set and has those) + +### ModelMetadata.SoundConfig.builderAudioRes[πŸ”—](#$api.type~ModelMetadata.SoundConfig.builderAudioRes) + +``` +ModelMetadata.SoundConfig.builderAudioRes: ResName +``` + +### ModelMetadata.Maintenance[πŸ”—](#$api.type~ModelMetadata.Maintenance) + +``` +record ModelMetadata.Maintenance lifespan: integer + runningCosts: number + runningCostScale: number + maintenanceScale: number + topSpeedMaintenanceFactorPenaltyPerLevel: number +end +``` + +### ModelMetadata.Maintenance.lifespan[πŸ”—](#$api.type~ModelMetadata.Maintenance.lifespan) + +``` +ModelMetadata.Maintenance.lifespan: integer +``` + +### ModelMetadata.Maintenance.runningCosts[πŸ”—](#$api.type~ModelMetadata.Maintenance.runningCosts) + +``` +ModelMetadata.Maintenance.runningCosts: number +``` + +### ModelMetadata.Maintenance.runningCostScale[πŸ”—](#$api.type~ModelMetadata.Maintenance.runningCostScale) + +``` +ModelMetadata.Maintenance.runningCostScale: number +``` + +### ModelMetadata.Maintenance.maintenanceScale[πŸ”—](#$api.type~ModelMetadata.Maintenance.maintenanceScale) + +``` +ModelMetadata.Maintenance.maintenanceScale: number +``` + +### ModelMetadata.Maintenance.topSpeedMaintenanceFactorPenaltyPerLevel[πŸ”—](#$api.type~ModelMetadata.Maintenance.topSpeedMaintenanceFactorPenaltyPerLevel) + +``` +ModelMetadata.Maintenance.topSpeedMaintenanceFactorPenaltyPerLevel: number +``` + +### ModelMetadata.Emission[πŸ”—](#$api.type~ModelMetadata.Emission) + +``` +record ModelMetadata.Emission idle: number + speed: number + power: number + score: number +end +``` + +### ModelMetadata.Emission.idle[πŸ”—](#$api.type~ModelMetadata.Emission.idle) + +``` +ModelMetadata.Emission.idle: number +``` + +### ModelMetadata.Emission.speed[πŸ”—](#$api.type~ModelMetadata.Emission.speed) + +``` +ModelMetadata.Emission.speed: number +``` + +### ModelMetadata.Emission.power[πŸ”—](#$api.type~ModelMetadata.Emission.power) + +``` +ModelMetadata.Emission.power: number +``` + +### ModelMetadata.Emission.score[πŸ”—](#$api.type~ModelMetadata.Emission.score) + +``` +ModelMetadata.Emission.score: number +``` + +### ModelMetadata.Emissions[πŸ”—](#$api.type~ModelMetadata.Emissions) + +``` +record ModelMetadata.Emissions noise: Emission + pollution: Emission +end +``` + +### ModelMetadata.Emissions.noise[πŸ”—](#$api.type~ModelMetadata.Emissions.noise) + +``` +ModelMetadata.Emissions.noise: Emission +``` + +### ModelMetadata.Emissions.pollution[πŸ”—](#$api.type~ModelMetadata.Emissions.pollution) + +``` +ModelMetadata.Emissions.pollution: Emission +``` + +### ModelMetadata.VehicleEngine[πŸ”—](#$api.type~ModelMetadata.VehicleEngine) + +``` +record ModelMetadata.VehicleEngine power: number + tractiveEffort: number + type: VehicleEngineType +end +``` + +### ModelMetadata.VehicleEngine.power[πŸ”—](#$api.type~ModelMetadata.VehicleEngine.power) + +``` +ModelMetadata.VehicleEngine.power: number +``` + +### ModelMetadata.VehicleEngine.tractiveEffort[πŸ”—](#$api.type~ModelMetadata.VehicleEngine.tractiveEffort) + +``` +ModelMetadata.VehicleEngine.tractiveEffort: number +``` + +### ModelMetadata.VehicleEngine.type[πŸ”—](#$api.type~ModelMetadata.VehicleEngine.type) + +``` +ModelMetadata.VehicleEngine.type: VehicleEngineType +``` + +### ModelMetadata.TransportVehicle[πŸ”—](#$api.type~ModelMetadata.TransportVehicle) + +``` +[Expand All] [Collapse All] + +record ModelMetadata.TransportVehicle record CargoEntry cargoTypeSet: CargoTypeSet + capacity: integer + seats: {integer} + loadIndicator: string +end + record LoadConfig new: function(): LoadConfig + cargoEntry: CargoEntry + toHide: {string} +end + record Compartment loadConfigs: {LoadConfig} +end + line: Engine.Entity + carrier: Carrier + compartments: {Compartment} + loadSpeed: number + reversible: boolean + arrivalDelay: integer + departureDelay: integer + groupFileName: ResName + transportModes: {TransportMode} + engineTransportModes: {TransportMode} + filterTags: {string} + comfortFactor: number + priceFactor: number + maintenanceFactor: number + noCblendMask: boolean +end +``` + +### ModelMetadata.TransportVehicle.CargoEntry[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.CargoEntry) + +``` +record ModelMetadata.TransportVehicle.CargoEntry cargoTypeSet: CargoTypeSet + capacity: integer + seats: {integer} + loadIndicator: string +end +``` + +### ModelMetadata.TransportVehicle.CargoEntry.cargoTypeSet[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.CargoEntry.cargoTypeSet) + +``` +ModelMetadata.TransportVehicle.CargoEntry.cargoTypeSet: CargoTypeSet +``` + +### ModelMetadata.TransportVehicle.CargoEntry.capacity[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.CargoEntry.capacity) + +``` +ModelMetadata.TransportVehicle.CargoEntry.capacity: integer +``` + +### ModelMetadata.TransportVehicle.CargoEntry.seats[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.CargoEntry.seats) + +``` +ModelMetadata.TransportVehicle.CargoEntry.seats: {integer} +``` + +### ModelMetadata.TransportVehicle.CargoEntry.loadIndicator[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.CargoEntry.loadIndicator) + +``` +ModelMetadata.TransportVehicle.CargoEntry.loadIndicator: string +``` + +Used in conjunction with transport vehicle / industry metadata to define cargo positioning of custom cargo models + +### ModelMetadata.TransportVehicle.LoadConfig[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.LoadConfig) + +``` +record ModelMetadata.TransportVehicle.LoadConfig new: function(): LoadConfig + cargoEntry: CargoEntry + toHide: {string} +end +``` + +### ModelMetadata.TransportVehicle.LoadConfig.new[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.LoadConfig.new) + +``` +function ModelMetadata.TransportVehicle.LoadConfig.new(): LoadConfig +``` + +**Returns** + +1. `LoadConfig` + +### ModelMetadata.TransportVehicle.LoadConfig.cargoEntry[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.LoadConfig.cargoEntry) + +``` +ModelMetadata.TransportVehicle.LoadConfig.cargoEntry: CargoEntry +``` + +### ModelMetadata.TransportVehicle.LoadConfig.toHide[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.LoadConfig.toHide) + +``` +ModelMetadata.TransportVehicle.LoadConfig.toHide: {string} +``` + +### ModelMetadata.TransportVehicle.Compartment[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.Compartment) + +``` +record ModelMetadata.TransportVehicle.Compartment loadConfigs: {LoadConfig} +end +``` + +### ModelMetadata.TransportVehicle.Compartment.loadConfigs[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.Compartment.loadConfigs) + +``` +ModelMetadata.TransportVehicle.Compartment.loadConfigs: {LoadConfig} +``` + +### ModelMetadata.TransportVehicle.line[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.line) + +``` +ModelMetadata.TransportVehicle.line: Engine.Entity +``` + +### ModelMetadata.TransportVehicle.carrier[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.carrier) + +``` +ModelMetadata.TransportVehicle.carrier: Carrier +``` + +### ModelMetadata.TransportVehicle.compartments[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.compartments) + +``` +ModelMetadata.TransportVehicle.compartments: {Compartment} +``` + +### ModelMetadata.TransportVehicle.loadSpeed[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.loadSpeed) + +``` +ModelMetadata.TransportVehicle.loadSpeed: number +``` + +### ModelMetadata.TransportVehicle.reversible[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.reversible) + +``` +ModelMetadata.TransportVehicle.reversible: boolean +``` + +### ModelMetadata.TransportVehicle.arrivalDelay[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.arrivalDelay) + +``` +ModelMetadata.TransportVehicle.arrivalDelay: integer +``` + +### ModelMetadata.TransportVehicle.departureDelay[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.departureDelay) + +``` +ModelMetadata.TransportVehicle.departureDelay: integer +``` + +### ModelMetadata.TransportVehicle.groupFileName[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.groupFileName) + +``` +ModelMetadata.TransportVehicle.groupFileName: ResName +``` + +### ModelMetadata.TransportVehicle.transportModes[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.transportModes) + +``` +ModelMetadata.TransportVehicle.transportModes: {TransportMode} +``` + +### ModelMetadata.TransportVehicle.engineTransportModes[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.engineTransportModes) + +``` +ModelMetadata.TransportVehicle.engineTransportModes: {TransportMode} +``` + +### ModelMetadata.TransportVehicle.filterTags[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.filterTags) + +``` +ModelMetadata.TransportVehicle.filterTags: {string} +``` + +### ModelMetadata.TransportVehicle.comfortFactor[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.comfortFactor) + +``` +ModelMetadata.TransportVehicle.comfortFactor: number +``` + +### ModelMetadata.TransportVehicle.priceFactor[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.priceFactor) + +``` +ModelMetadata.TransportVehicle.priceFactor: number +``` + +### ModelMetadata.TransportVehicle.maintenanceFactor[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.maintenanceFactor) + +``` +ModelMetadata.TransportVehicle.maintenanceFactor: number +``` + +### ModelMetadata.TransportVehicle.noCblendMask[πŸ”—](#$api.type~ModelMetadata.TransportVehicle.noCblendMask) + +``` +ModelMetadata.TransportVehicle.noCblendMask: boolean +``` + +### ModelMetadata.Cost[πŸ”—](#$api.type~ModelMetadata.Cost) + +``` +record ModelMetadata.Cost priceScale: number + price: integer +end +``` + +### ModelMetadata.Cost.priceScale[πŸ”—](#$api.type~ModelMetadata.Cost.priceScale) + +``` +ModelMetadata.Cost.priceScale: number +``` + +### ModelMetadata.Cost.price[πŸ”—](#$api.type~ModelMetadata.Cost.price) + +``` +ModelMetadata.Cost.price: integer +``` + +### ModelMetadata.LandVehicle[πŸ”—](#$api.type~ModelMetadata.LandVehicle) + +``` +record ModelMetadata.LandVehicle topSpeed: number + weightEmpty: number + weightMaxPayload: number + engines: {VehicleEngine} + friction: number +end +``` + +### ModelMetadata.LandVehicle.topSpeed[πŸ”—](#$api.type~ModelMetadata.LandVehicle.topSpeed) + +``` +ModelMetadata.LandVehicle.topSpeed: number +``` + +### ModelMetadata.LandVehicle.weightEmpty[πŸ”—](#$api.type~ModelMetadata.LandVehicle.weightEmpty) + +``` +ModelMetadata.LandVehicle.weightEmpty: number +``` + +### ModelMetadata.LandVehicle.weightMaxPayload[πŸ”—](#$api.type~ModelMetadata.LandVehicle.weightMaxPayload) + +``` +ModelMetadata.LandVehicle.weightMaxPayload: number +``` + +### ModelMetadata.LandVehicle.engines[πŸ”—](#$api.type~ModelMetadata.LandVehicle.engines) + +``` +ModelMetadata.LandVehicle.engines: {VehicleEngine} +``` + +### ModelMetadata.LandVehicle.friction[πŸ”—](#$api.type~ModelMetadata.LandVehicle.friction) + +``` +ModelMetadata.LandVehicle.friction: number +``` + +### ModelMetadata.WaterVehicle[πŸ”—](#$api.type~ModelMetadata.WaterVehicle) + +``` +record ModelMetadata.WaterVehicle topSpeed: number + weightEmpty: number + weightMaxPayload: number + availPower: number + maxRpm: number + area: number +end +``` + +### ModelMetadata.WaterVehicle.topSpeed[πŸ”—](#$api.type~ModelMetadata.WaterVehicle.topSpeed) + +``` +ModelMetadata.WaterVehicle.topSpeed: number +``` + +### ModelMetadata.WaterVehicle.weightEmpty[πŸ”—](#$api.type~ModelMetadata.WaterVehicle.weightEmpty) + +``` +ModelMetadata.WaterVehicle.weightEmpty: number +``` + +### ModelMetadata.WaterVehicle.weightMaxPayload[πŸ”—](#$api.type~ModelMetadata.WaterVehicle.weightMaxPayload) + +``` +ModelMetadata.WaterVehicle.weightMaxPayload: number +``` + +### ModelMetadata.WaterVehicle.availPower[πŸ”—](#$api.type~ModelMetadata.WaterVehicle.availPower) + +``` +ModelMetadata.WaterVehicle.availPower: number +``` + +### ModelMetadata.WaterVehicle.maxRpm[πŸ”—](#$api.type~ModelMetadata.WaterVehicle.maxRpm) + +``` +ModelMetadata.WaterVehicle.maxRpm: number +``` + +### ModelMetadata.WaterVehicle.area[πŸ”—](#$api.type~ModelMetadata.WaterVehicle.area) + +``` +ModelMetadata.WaterVehicle.area: number +``` + +### ModelMetadata.AirVehicle[πŸ”—](#$api.type~ModelMetadata.AirVehicle) + +``` +record ModelMetadata.AirVehicle topSpeed: number + weightEmpty: number + weightMaxPayload: number + maxThrust: number + isHelicopter: boolean +end +``` + +### ModelMetadata.AirVehicle.topSpeed[πŸ”—](#$api.type~ModelMetadata.AirVehicle.topSpeed) + +``` +ModelMetadata.AirVehicle.topSpeed: number +``` + +### ModelMetadata.AirVehicle.weightEmpty[πŸ”—](#$api.type~ModelMetadata.AirVehicle.weightEmpty) + +``` +ModelMetadata.AirVehicle.weightEmpty: number +``` + +### ModelMetadata.AirVehicle.weightMaxPayload[πŸ”—](#$api.type~ModelMetadata.AirVehicle.weightMaxPayload) + +``` +ModelMetadata.AirVehicle.weightMaxPayload: number +``` + +### ModelMetadata.AirVehicle.maxThrust[πŸ”—](#$api.type~ModelMetadata.AirVehicle.maxThrust) + +``` +ModelMetadata.AirVehicle.maxThrust: number +``` + +### ModelMetadata.AirVehicle.isHelicopter[πŸ”—](#$api.type~ModelMetadata.AirVehicle.isHelicopter) + +``` +ModelMetadata.AirVehicle.isHelicopter: boolean +``` + +### ModelMetadata.Person[πŸ”—](#$api.type~ModelMetadata.Person) + +``` +record ModelMetadata.Person gender: Gender +end +``` + +### ModelMetadata.Person.gender[πŸ”—](#$api.type~ModelMetadata.Person.gender) + +``` +ModelMetadata.Person.gender: Gender +``` + +### ModelMetadata.Tree[πŸ”—](#$api.type~ModelMetadata.Tree) + +``` +record ModelMetadata.Tree reputationFactor: number +end +``` + +### ModelMetadata.Tree.reputationFactor[πŸ”—](#$api.type~ModelMetadata.Tree.reputationFactor) + +``` +ModelMetadata.Tree.reputationFactor: number +``` + +### Modifiers[πŸ”—](#$api.type~Modifiers) + +``` +global record Modifiers new: function(): Modifiers + + equals: function(Modifiers, Modifiers): boolean + noiseModifier: number + pollutionModifier: number + maxSpeedModifier: number +end +``` + +Configure additiive modifiers for specific entities + +### Modifiers.new()[πŸ”—](#$api.type~Modifiers.new()) + +``` +function Modifiers.new()(): Modifiers +``` + +Create a new Modifiers object + +**Returns** + +1. `Modifiers` + +### Modifiers.new(Modifiers)[πŸ”—](#$api.type~Modifiers.new(Modifiers)) + +``` +function Modifiers.new(Modifiers)(Modifiers): Modifiers +``` + +Create a copy of a Modifier object + +**Parameters** + +* `Modifiers` + +**Returns** + +1. `Modifiers` + +### Modifiers.equals[πŸ”—](#$api.type~Modifiers.equals) + +``` +function Modifiers.equals(Modifiers, Modifiers): boolean +``` + +Compare Modifier for equality + +**Parameters** + +* `Modifiers` +* `Modifiers` + +**Returns** + +1. `boolean` + +### Modifiers.noiseModifier[πŸ”—](#$api.type~Modifiers.noiseModifier) + +``` +Modifiers.noiseModifier: number +``` + +A value of X will mean that noise produced by the entity is equal to (baseValue \* (1 + X)) + +### Modifiers.pollutionModifier[πŸ”—](#$api.type~Modifiers.pollutionModifier) + +``` +Modifiers.pollutionModifier: number +``` + +A value of X will mean that pollution produced by the entity is equal to (baseValue \* (1 + X)) + +### Modifiers.maxSpeedModifier[πŸ”—](#$api.type~Modifiers.maxSpeedModifier) + +``` +Modifiers.maxSpeedModifier: number +``` + +A value of X will mean that the top speed of the entity entity is equal to (baseValue \* (1 + X)) + +### ModuleDesc[πŸ”—](#$api.type~ModuleDesc) + +``` +global record ModuleDesc new: function(): ModuleDesc + fileName: ResName + type: string + autoRemovable: boolean + availability: ModelMetadata.Availability + description: ModelMetadata.Description + category: ModelMetadata.Category + cost: ModelMetadata.Cost + menuCategory: ModelMetadata.MenuCategory + builderAudioRes: ResName + metadata: { : } + metadata_native: Map + relativePath: string + updateScript: ScriptRef + getModelsScript: ScriptRef +end +``` + +Used to configure new modules + +### ModuleDesc.new[πŸ”—](#$api.type~ModuleDesc.new) + +``` +function ModuleDesc.new(): ModuleDesc +``` + +**Returns** + +1. `ModuleDesc` + +### ModuleDesc.fileName[πŸ”—](#$api.type~ModuleDesc.fileName) + +``` +ModuleDesc.fileName: ResName +``` + +Resource name of the module file + +### ModuleDesc.type[πŸ”—](#$api.type~ModuleDesc.type) + +``` +ModuleDesc.type: string +``` + +Type of the module, a module of a specific type can be built only on slots with the same type + +### ModuleDesc.autoRemovable[πŸ”—](#$api.type~ModuleDesc.autoRemovable) + +``` +ModuleDesc.autoRemovable: boolean +``` + +Whether it is automatically removed when building something on it (e.g. farm fields) + +### ModuleDesc.availability[πŸ”—](#$api.type~ModuleDesc.availability) + +``` +ModuleDesc.availability: ModelMetadata.Availability +``` + +Availability by year for module builder + +### ModuleDesc.description[πŸ”—](#$api.type~ModuleDesc.description) + +``` +ModuleDesc.description: ModelMetadata.Description +``` + +Localized strings and icons paths for user interface + +### ModuleDesc.category[πŸ”—](#$api.type~ModuleDesc.category) + +``` +ModuleDesc.category: ModelMetadata.Category +``` + +Unused + +### ModuleDesc.cost[πŸ”—](#$api.type~ModuleDesc.cost) + +``` +ModuleDesc.cost: ModelMetadata.Cost +``` + +Cost per unit + +### ModuleDesc.menuCategory[πŸ”—](#$api.type~ModuleDesc.menuCategory) + +``` +ModuleDesc.menuCategory: ModelMetadata.MenuCategory +``` + +Configure category, order and filter behaviour in the construction menu + +### ModuleDesc.builderAudioRes[πŸ”—](#$api.type~ModuleDesc.builderAudioRes) + +``` +ModuleDesc.builderAudioRes: ResName +``` + +### ModuleDesc.metadata[πŸ”—](#$api.type~ModuleDesc.metadata) + +``` +ModuleDesc.metadata: { : } +``` + +Additional metadata as table + +### ModuleDesc.metadata\_native[πŸ”—](#$api.type~ModuleDesc.metadata_native) + +``` +ModuleDesc.metadata_native: Map +``` + +Additional metadata as native map + +### ModuleDesc.relativePath[πŸ”—](#$api.type~ModuleDesc.relativePath) + +``` +ModuleDesc.relativePath: string +``` + +Deprecated + +### ModuleDesc.updateScript[πŸ”—](#$api.type~ModuleDesc.updateScript) + +``` +ModuleDesc.updateScript: ScriptRef +``` + +Script function that gets called once per build module after the updateScript of the construction has run + +### ModuleDesc.getModelsScript[πŸ”—](#$api.type~ModuleDesc.getModelsScript) + +``` +ModuleDesc.getModelsScript: ScriptRef +``` + +Script function used to generate module preview when building with module builder + +### MoneyMode[πŸ”—](#$api.type~MoneyMode) + +``` +global record MoneyMode RAW: MoneyMode + KMB: MoneyMode +end +``` + +MoneyMode represents the money mode. + +### MoneyMode.RAW[πŸ”—](#$api.type~MoneyMode.RAW) + +``` +MoneyMode.RAW: MoneyMode +``` + +### MoneyMode.KMB[πŸ”—](#$api.type~MoneyMode.KMB) + +``` +MoneyMode.KMB: MoneyMode +``` + +### MoveMode[πŸ”—](#$api.type~MoveMode) + +``` +global record MoveMode WALK: MoveMode + DRIVE: MoveMode + LINES: MoveMode +end +``` + +### MoveMode.WALK[πŸ”—](#$api.type~MoveMode.WALK) + +``` +MoveMode.WALK: MoveMode +``` + +### MoveMode.DRIVE[πŸ”—](#$api.type~MoveMode.DRIVE) + +``` +MoveMode.DRIVE: MoveMode +``` + +### MoveMode.LINES[πŸ”—](#$api.type~MoveMode.LINES) + +``` +MoveMode.LINES: MoveMode +``` + +### MultipleUnit[πŸ”—](#$api.type~MultipleUnit) + +``` +[Expand All] [Collapse All] + +global record MultipleUnit new: function(): MultipleUnit + + vehicles: {MultipleUnit.Vehicle} + name: string + desc: string + filterTags: {string} + availabilityNotificationGroup: string + availabilityNotificationSortKey: integer + groupFileName: string + record Vehicle name: string + forward: boolean +end +end +``` + +Specification for multiple units + +### MultipleUnit.new()[πŸ”—](#$api.type~MultipleUnit.new()) + +``` +function MultipleUnit.new()(): MultipleUnit +``` + +Create a new MultipleUnit object + +**Returns** + +1. `MultipleUnit` + +### MultipleUnit.new(MultipleUnit)[πŸ”—](#$api.type~MultipleUnit.new(MultipleUnit)) + +``` +function MultipleUnit.new(MultipleUnit)(MultipleUnit): MultipleUnit +``` + +Create a copy of a MultiplUnit object + +**Parameters** + +* `MultipleUnit` + +**Returns** + +1. `MultipleUnit` + +### MultipleUnit.vehicles[πŸ”—](#$api.type~MultipleUnit.vehicles) + +``` +MultipleUnit.vehicles: {MultipleUnit.Vehicle} +``` + +List of models of which the multiple unit is compsed of + +### MultipleUnit.name[πŸ”—](#$api.type~MultipleUnit.name) + +``` +MultipleUnit.name: string +``` + +Localized display name for the unit + +### MultipleUnit.desc[πŸ”—](#$api.type~MultipleUnit.desc) + +``` +MultipleUnit.desc: string +``` + +Localized display description for the unit + +### MultipleUnit.filterTags[πŸ”—](#$api.type~MultipleUnit.filterTags) + +``` +MultipleUnit.filterTags: {string} +``` + +Vehicle filter tags + +### MultipleUnit.availabilityNotificationGroup[πŸ”—](#$api.type~MultipleUnit.availabilityNotificationGroup) + +``` +MultipleUnit.availabilityNotificationGroup: string +``` + +Group string to combine availability notifications of related vehicles + +### MultipleUnit.availabilityNotificationSortKey[πŸ”—](#$api.type~MultipleUnit.availabilityNotificationSortKey) + +``` +MultipleUnit.availabilityNotificationSortKey: integer +``` + +sortkey for availability notification group + +### MultipleUnit.groupFileName[πŸ”—](#$api.type~MultipleUnit.groupFileName) + +``` +MultipleUnit.groupFileName: string +``` + +Used for variant goupings: multiple units belonging to the same group will be shown as variants of each other + +### MultipleUnit.Vehicle[πŸ”—](#$api.type~MultipleUnit.Vehicle) + +``` +record MultipleUnit.Vehicle name: string + forward: boolean +end +``` + +Specification for multiple units individual vehicles + +### MultipleUnit.Vehicle.name[πŸ”—](#$api.type~MultipleUnit.Vehicle.name) + +``` +MultipleUnit.Vehicle.name: string +``` + +Vehicle resource name + +### MultipleUnit.Vehicle.forward[πŸ”—](#$api.type~MultipleUnit.Vehicle.forward) + +``` +MultipleUnit.Vehicle.forward: boolean +``` + +Whether the vehicle faces forward + +### NameDesc[πŸ”—](#$api.type~NameDesc) + +``` +global record NameDesc name: string + personNamesScript: string + townNamesScript: string + streetNamesScript: string +end +``` + +Name list description for procedural name generation + +### NameDesc.name[πŸ”—](#$api.type~NameDesc.name) + +``` +NameDesc.name: string +``` + +### NameDesc.personNamesScript[πŸ”—](#$api.type~NameDesc.personNamesScript) + +``` +NameDesc.personNamesScript: string +``` + +### NameDesc.townNamesScript[πŸ”—](#$api.type~NameDesc.townNamesScript) + +``` +NameDesc.townNamesScript: string +``` + +### NameDesc.streetNamesScript[πŸ”—](#$api.type~NameDesc.streetNamesScript) + +``` +NameDesc.streetNamesScript: string +``` + +### NativeLuaTable[πŸ”—](#$api.type~NativeLuaTable) + +``` +global record NativeLuaTable find: function(NativeLuaTable, NativeLuaValue): NativeLuaValue + findPath: function(NativeLuaTable, {NativeLuaValue}): NativeLuaValue + insert: function(NativeLuaTable, NativeLuaValue, any) + insert_native: function(NativeLuaTable, NativeLuaValue, NativeLuaValue) + remove: function(NativeLuaTable, NativeLuaValue) + size: function(NativeLuaTable): integer + asTable: function(NativeLuaTable): { : } + clone: function(NativeLuaTable): NativeLuaTable + next: function(NativeLuaTable, NativeLuaValue): NativeLuaValue +end +``` + +### NativeLuaTable.find[πŸ”—](#$api.type~NativeLuaTable.find) + +``` +function NativeLuaTable.find(NativeLuaTable, NativeLuaValue): NativeLuaValue +``` + +**Parameters** + +* `NativeLuaTable` +* `NativeLuaValue` + +**Returns** + +1. `NativeLuaValue` + +### NativeLuaTable.findPath[πŸ”—](#$api.type~NativeLuaTable.findPath) + +``` +function NativeLuaTable.findPath(NativeLuaTable, {NativeLuaValue}): NativeLuaValue +``` + +**Parameters** + +* `NativeLuaTable` +* `{NativeLuaValue}` + +**Returns** + +1. `NativeLuaValue` + +### NativeLuaTable.insert[πŸ”—](#$api.type~NativeLuaTable.insert) + +``` +function NativeLuaTable.insert(NativeLuaTable, NativeLuaValue, any) +``` + +**Parameters** + +* `NativeLuaTable` +* `NativeLuaValue` +* `any` + +### NativeLuaTable.insert\_native[πŸ”—](#$api.type~NativeLuaTable.insert_native) + +``` +function NativeLuaTable.insert_native(NativeLuaTable, NativeLuaValue, NativeLuaValue) +``` + +**Parameters** + +* `NativeLuaTable` +* `NativeLuaValue` +* `NativeLuaValue` + +### NativeLuaTable.remove[πŸ”—](#$api.type~NativeLuaTable.remove) + +``` +function NativeLuaTable.remove(NativeLuaTable, NativeLuaValue) +``` + +**Parameters** + +* `NativeLuaTable` +* `NativeLuaValue` + +### NativeLuaTable.size[πŸ”—](#$api.type~NativeLuaTable.size) + +``` +function NativeLuaTable.size(NativeLuaTable): integer +``` + +**Parameters** + +* `NativeLuaTable` + +**Returns** + +1. `integer` + +### NativeLuaTable.asTable[πŸ”—](#$api.type~NativeLuaTable.asTable) + +``` +function NativeLuaTable.asTable(NativeLuaTable): { : } +``` + +**Parameters** + +* `NativeLuaTable` + +**Returns** + +1. `{ : }` + +### NativeLuaTable.clone[πŸ”—](#$api.type~NativeLuaTable.clone) + +``` +function NativeLuaTable.clone(NativeLuaTable): NativeLuaTable +``` + +**Parameters** + +* `NativeLuaTable` + +**Returns** + +1. `NativeLuaTable` + +### NativeLuaTable.next[πŸ”—](#$api.type~NativeLuaTable.next) + +``` +function NativeLuaTable.next(NativeLuaTable, NativeLuaValue): NativeLuaValue +``` + +**Parameters** + +* `NativeLuaTable` +* `NativeLuaValue` + +**Returns** + +1. `NativeLuaValue` + +### NativeLuaValue[πŸ”—](#$api.type~NativeLuaValue) + +``` +global type NativeLuaValue = string | number | boolean | nil | NativeLuaTable +``` + +### Node[πŸ”—](#$api.type~Node) + +``` +global record Nodeend +``` + +A single node within a TRANSPORT\_NETWORK component. + +### NodeId[πŸ”—](#$api.type~NodeId) + +``` +global record NodeId new: function(): NodeId + + entity: Engine.Entity + index: integer +end +``` + +References a single transport network node within a transport network entity + +### NodeId.new()[πŸ”—](#$api.type~NodeId.new()) + +``` +function NodeId.new()(): NodeId +``` + +**Returns** + +1. `NodeId` + +### NodeId.new(Engine.Entity, integer)[πŸ”—](#$api.type~NodeId.new(Engine.Entity, integer)) + +``` +function NodeId.new(Engine.Entity, integer)(entity : Engine.Entity, index : integer): NodeId +``` + +Constructor + +**Parameters** + +* `entity` :`Engine.Entity` β€” The TransportNetwork entity +* `index` :`integer` β€” The zero-based index within the nodes field of the TransportNetwork component + +**Returns** + +1. `NodeId` + +### NodeId.entity[πŸ”—](#$api.type~NodeId.entity) + +``` +NodeId.entity: Engine.Entity +``` + +The TransportNetwork entity + +### NodeId.index[πŸ”—](#$api.type~NodeId.index) + +``` +NodeId.index: integer +``` + +The zero-based index within the nodes field of the TransportNetwork component + +### NodeViewerData[πŸ”—](#$api.type~NodeViewerData) + +``` +global record NodeViewerData new: function(): NodeViewerData + clone: function(NodeViewerData): NodeViewerData + edgeIdx: integer + colors: {Vec4f} + order: integer + width: number +end +``` + +Struct containing information for rendering transport network edges of a BaseNode + +### NodeViewerData.new[πŸ”—](#$api.type~NodeViewerData.new) + +``` +function NodeViewerData.new(): NodeViewerData +``` + +**Returns** + +1. `NodeViewerData` + +### NodeViewerData.clone[πŸ”—](#$api.type~NodeViewerData.clone) + +``` +function NodeViewerData.clone(NodeViewerData): NodeViewerData +``` + +**Parameters** + +* `NodeViewerData` + +**Returns** + +1. `NodeViewerData` + +### NodeViewerData.edgeIdx[πŸ”—](#$api.type~NodeViewerData.edgeIdx) + +``` +NodeViewerData.edgeIdx: integer +``` + +### NodeViewerData.colors[πŸ”—](#$api.type~NodeViewerData.colors) + +``` +NodeViewerData.colors: {Vec4f} +``` + +Colors that will be smoothly interpolated from the beginning to the end of the edge + +### NodeViewerData.order[πŸ”—](#$api.type~NodeViewerData.order) + +``` +NodeViewerData.order: integer +``` + +Rendering order of the edge + +### NodeViewerData.width[πŸ”—](#$api.type~NodeViewerData.width) + +``` +NodeViewerData.width: number +``` + +Width of the edge + +### ParcelData[πŸ”—](#$api.type~ParcelData) + +``` +global record ParcelData leftEntities: {Engine.Entity} + rightParcels: {Engine.Entity} +end +``` + +Entities attached to a segment + +### ParcelData.leftEntities[πŸ”—](#$api.type~ParcelData.leftEntities) + +``` +ParcelData.leftEntities: {Engine.Entity} +``` + +Parcels on the left of the segment + +### ParcelData.rightParcels[πŸ”—](#$api.type~ParcelData.rightParcels) + +``` +ParcelData.rightParcels: {Engine.Entity} +``` + +Parcels on the right of the segment + +### ParsedSavegameName[πŸ”—](#$api.type~ParsedSavegameName) + +``` +global record ParsedSavegameName type: SaveGameType + groupName: string + ingameTimestamp: string + fileTimestamp: string +end +``` + +Savegame info extracted solely from its filename + +### ParsedSavegameName.type[πŸ”—](#$api.type~ParsedSavegameName.type) + +``` +ParsedSavegameName.type: SaveGameType +``` + +### ParsedSavegameName.groupName[πŸ”—](#$api.type~ParsedSavegameName.groupName) + +``` +ParsedSavegameName.groupName: string +``` + +### ParsedSavegameName.ingameTimestamp[πŸ”—](#$api.type~ParsedSavegameName.ingameTimestamp) + +``` +ParsedSavegameName.ingameTimestamp: string +``` + +### ParsedSavegameName.fileTimestamp[πŸ”—](#$api.type~ParsedSavegameName.fileTimestamp) + +``` +ParsedSavegameName.fileTimestamp: string +``` + +### ParticleParamCurveFloat[πŸ”—](#$api.type~ParticleParamCurveFloat) + +``` +[Expand All] [Collapse All] + +global record ParticleParamCurveFloat new: function(): ParticleParamCurveFloat + + record CurvePoint new: function(): CurvePoint + + time: number + value: number + easing: integer +end + curve: {CurvePoint} +end +``` + +Particle system parameter curve for float values + +### ParticleParamCurveFloat.new()[πŸ”—](#$api.type~ParticleParamCurveFloat.new()) + +``` +function ParticleParamCurveFloat.new()(): ParticleParamCurveFloat +``` + +Creates a new particle parameter curve + +**Returns** + +1. `ParticleParamCurveFloat` + +### ParticleParamCurveFloat.new({CurvePoint})[πŸ”—](#$api.type~ParticleParamCurveFloat.new({CurvePoint})) + +``` +function ParticleParamCurveFloat.new({CurvePoint})({CurvePoint}): ParticleParamCurveFloat +``` + +Creates a new particle parameter curve with curve points + +**Parameters** + +* `{CurvePoint}` + +**Returns** + +1. `ParticleParamCurveFloat` + +### ParticleParamCurveFloat.CurvePoint[πŸ”—](#$api.type~ParticleParamCurveFloat.CurvePoint) + +``` +record ParticleParamCurveFloat.CurvePoint new: function(): CurvePoint + + time: number + value: number + easing: integer +end +``` + +Curve point for float curve + +### ParticleParamCurveFloat.CurvePoint.new()[πŸ”—](#$api.type~ParticleParamCurveFloat.CurvePoint.new()) + +``` +function ParticleParamCurveFloat.CurvePoint.new()(): CurvePoint +``` + +**Returns** + +1. `CurvePoint` + +### ParticleParamCurveFloat.CurvePoint.new(number, number, integer)[πŸ”—](#$api.type~ParticleParamCurveFloat.CurvePoint.new(number, number, integer)) + +``` +function ParticleParamCurveFloat.CurvePoint.new(number, number, integer)(number, number, integer): CurvePoint +``` + +**Parameters** + +* `number` +* `number` +* `integer` + +**Returns** + +1. `CurvePoint` + +### ParticleParamCurveFloat.CurvePoint.time[πŸ”—](#$api.type~ParticleParamCurveFloat.CurvePoint.time) + +``` +ParticleParamCurveFloat.CurvePoint.time: number +``` + +Time point (0.0 to 1.0) + +### ParticleParamCurveFloat.CurvePoint.value[πŸ”—](#$api.type~ParticleParamCurveFloat.CurvePoint.value) + +``` +ParticleParamCurveFloat.CurvePoint.value: number +``` + +Value at this time point + +### ParticleParamCurveFloat.CurvePoint.easing[πŸ”—](#$api.type~ParticleParamCurveFloat.CurvePoint.easing) + +``` +ParticleParamCurveFloat.CurvePoint.easing: integer +``` + +Easing function (enum.Easing) + +### ParticleParamCurveFloat.curve[πŸ”—](#$api.type~ParticleParamCurveFloat.curve) + +``` +ParticleParamCurveFloat.curve: {CurvePoint} +``` + +Array of curve points + +### ParticleParamCurveVec2f[πŸ”—](#$api.type~ParticleParamCurveVec2f) + +``` +[Expand All] [Collapse All] + +global record ParticleParamCurveVec2f new: function(): ParticleParamCurveVec2f + + record CurvePoint new: function(): CurvePoint + + time: number + value: Vec2f + easing: integer +end + curve: {CurvePoint} +end +``` + +Particle system parameter curve for vec2f values + +### ParticleParamCurveVec2f.new()[πŸ”—](#$api.type~ParticleParamCurveVec2f.new()) + +``` +function ParticleParamCurveVec2f.new()(): ParticleParamCurveVec2f +``` + +Creates a new particle parameter curve + +**Returns** + +1. `ParticleParamCurveVec2f` + +### ParticleParamCurveVec2f.new({CurvePoint})[πŸ”—](#$api.type~ParticleParamCurveVec2f.new({CurvePoint})) + +``` +function ParticleParamCurveVec2f.new({CurvePoint})({CurvePoint}): ParticleParamCurveVec2f +``` + +Creates a new particle parameter curve with curve points + +**Parameters** + +* `{CurvePoint}` + +**Returns** + +1. `ParticleParamCurveVec2f` + +### ParticleParamCurveVec2f.CurvePoint[πŸ”—](#$api.type~ParticleParamCurveVec2f.CurvePoint) + +``` +record ParticleParamCurveVec2f.CurvePoint new: function(): CurvePoint + + time: number + value: Vec2f + easing: integer +end +``` + +Curve point for vec2f curve + +### ParticleParamCurveVec2f.CurvePoint.new()[πŸ”—](#$api.type~ParticleParamCurveVec2f.CurvePoint.new()) + +``` +function ParticleParamCurveVec2f.CurvePoint.new()(): CurvePoint +``` + +**Returns** + +1. `CurvePoint` + +### ParticleParamCurveVec2f.CurvePoint.new(number, Vec2f, integer)[πŸ”—](#$api.type~ParticleParamCurveVec2f.CurvePoint.new(number, Vec2f, integer)) + +``` +function ParticleParamCurveVec2f.CurvePoint.new(number, Vec2f, integer)(number, Vec2f, integer): CurvePoint +``` + +**Parameters** + +* `number` +* `Vec2f` +* `integer` + +**Returns** + +1. `CurvePoint` + +### ParticleParamCurveVec2f.CurvePoint.time[πŸ”—](#$api.type~ParticleParamCurveVec2f.CurvePoint.time) + +``` +ParticleParamCurveVec2f.CurvePoint.time: number +``` + +Time point (0.0 to 1.0) + +### ParticleParamCurveVec2f.CurvePoint.value[πŸ”—](#$api.type~ParticleParamCurveVec2f.CurvePoint.value) + +``` +ParticleParamCurveVec2f.CurvePoint.value: Vec2f +``` + +Value at this time point + +### ParticleParamCurveVec2f.CurvePoint.easing[πŸ”—](#$api.type~ParticleParamCurveVec2f.CurvePoint.easing) + +``` +ParticleParamCurveVec2f.CurvePoint.easing: integer +``` + +Easing function (enum.Easing) + +### ParticleParamCurveVec2f.curve[πŸ”—](#$api.type~ParticleParamCurveVec2f.curve) + +``` +ParticleParamCurveVec2f.curve: {CurvePoint} +``` + +Array of curve points + +### ParticleParamCurveVec3f[πŸ”—](#$api.type~ParticleParamCurveVec3f) + +``` +[Expand All] [Collapse All] + +global record ParticleParamCurveVec3f new: function(): ParticleParamCurveVec3f + + record CurvePoint new: function(): CurvePoint + + time: number + value: Vec3f + easing: integer +end + curve: {CurvePoint} +end +``` + +Particle system parameter curve for vec3f values + +### ParticleParamCurveVec3f.new()[πŸ”—](#$api.type~ParticleParamCurveVec3f.new()) + +``` +function ParticleParamCurveVec3f.new()(): ParticleParamCurveVec3f +``` + +Creates a new particle parameter curve + +**Returns** + +1. `ParticleParamCurveVec3f` + +### ParticleParamCurveVec3f.new({CurvePoint})[πŸ”—](#$api.type~ParticleParamCurveVec3f.new({CurvePoint})) + +``` +function ParticleParamCurveVec3f.new({CurvePoint})({CurvePoint}): ParticleParamCurveVec3f +``` + +Creates a new particle parameter curve with curve points + +**Parameters** + +* `{CurvePoint}` + +**Returns** + +1. `ParticleParamCurveVec3f` + +### ParticleParamCurveVec3f.CurvePoint[πŸ”—](#$api.type~ParticleParamCurveVec3f.CurvePoint) + +``` +record ParticleParamCurveVec3f.CurvePoint new: function(): CurvePoint + + time: number + value: Vec3f + easing: integer +end +``` + +Curve point for vec3f curve + +### ParticleParamCurveVec3f.CurvePoint.new()[πŸ”—](#$api.type~ParticleParamCurveVec3f.CurvePoint.new()) + +``` +function ParticleParamCurveVec3f.CurvePoint.new()(): CurvePoint +``` + +**Returns** + +1. `CurvePoint` + +### ParticleParamCurveVec3f.CurvePoint.new(number, Vec3f, integer)[πŸ”—](#$api.type~ParticleParamCurveVec3f.CurvePoint.new(number, Vec3f, integer)) + +``` +function ParticleParamCurveVec3f.CurvePoint.new(number, Vec3f, integer)(number, Vec3f, integer): CurvePoint +``` + +**Parameters** + +* `number` +* `Vec3f` +* `integer` + +**Returns** + +1. `CurvePoint` + +### ParticleParamCurveVec3f.CurvePoint.time[πŸ”—](#$api.type~ParticleParamCurveVec3f.CurvePoint.time) + +``` +ParticleParamCurveVec3f.CurvePoint.time: number +``` + +Time point (0.0 to 1.0) + +### ParticleParamCurveVec3f.CurvePoint.value[πŸ”—](#$api.type~ParticleParamCurveVec3f.CurvePoint.value) + +``` +ParticleParamCurveVec3f.CurvePoint.value: Vec3f +``` + +Value at this time point + +### ParticleParamCurveVec3f.CurvePoint.easing[πŸ”—](#$api.type~ParticleParamCurveVec3f.CurvePoint.easing) + +``` +ParticleParamCurveVec3f.CurvePoint.easing: integer +``` + +Easing function (enum.Easing) + +### ParticleParamCurveVec3f.curve[πŸ”—](#$api.type~ParticleParamCurveVec3f.curve) + +``` +ParticleParamCurveVec3f.curve: {CurvePoint} +``` + +Array of curve points + +### ParticleParamFloat[πŸ”—](#$api.type~ParticleParamFloat) + +``` +[Expand All] [Collapse All] + +global record ParticleParamFloat new: function(): ParticleParamFloat + + record RandomMinMax new: function(): RandomMinMax + + min: number + max: number +end + record ComponentWiseMinMax new: function(): ComponentWiseMinMax + + min: number + max: number +end + value: any +end +``` + +Particle system parameter for float values + +### ParticleParamFloat.new()[πŸ”—](#$api.type~ParticleParamFloat.new()) + +``` +function ParticleParamFloat.new()(): ParticleParamFloat +``` + +Creates a new particle parameter + +**Returns** + +1. `ParticleParamFloat` + +### ParticleParamFloat.new(number)[πŸ”—](#$api.type~ParticleParamFloat.new(number)) + +``` +function ParticleParamFloat.new(number)(number): ParticleParamFloat +``` + +Creates a new particle parameter with a value + +**Parameters** + +* `number` + +**Returns** + +1. `ParticleParamFloat` + +### ParticleParamFloat.new(RandomMinMax)[πŸ”—](#$api.type~ParticleParamFloat.new(RandomMinMax)) + +``` +function ParticleParamFloat.new(RandomMinMax)(RandomMinMax): ParticleParamFloat +``` + +Creates a new particle parameter with a range + +**Parameters** + +* `RandomMinMax` + +**Returns** + +1. `ParticleParamFloat` + +### ParticleParamFloat.new(ComponentWiseMinMax)[πŸ”—](#$api.type~ParticleParamFloat.new(ComponentWiseMinMax)) + +``` +function ParticleParamFloat.new(ComponentWiseMinMax)(ComponentWiseMinMax): ParticleParamFloat +``` + +Creates a new particle parameter with a component-wise range + +**Parameters** + +* `ComponentWiseMinMax` + +**Returns** + +1. `ParticleParamFloat` + +### ParticleParamFloat.RandomMinMax[πŸ”—](#$api.type~ParticleParamFloat.RandomMinMax) + +``` +record ParticleParamFloat.RandomMinMax new: function(): RandomMinMax + + min: number + max: number +end +``` + +Random min/max range for particle parameters + +### ParticleParamFloat.RandomMinMax.new()[πŸ”—](#$api.type~ParticleParamFloat.RandomMinMax.new()) + +``` +function ParticleParamFloat.RandomMinMax.new()(): RandomMinMax +``` + +**Returns** + +1. `RandomMinMax` + +### ParticleParamFloat.RandomMinMax.new(number, number)[πŸ”—](#$api.type~ParticleParamFloat.RandomMinMax.new(number, number)) + +``` +function ParticleParamFloat.RandomMinMax.new(number, number)(number, number): RandomMinMax +``` + +**Parameters** + +* `number` +* `number` + +**Returns** + +1. `RandomMinMax` + +### ParticleParamFloat.RandomMinMax.min[πŸ”—](#$api.type~ParticleParamFloat.RandomMinMax.min) + +``` +ParticleParamFloat.RandomMinMax.min: number +``` + +Minimum value + +### ParticleParamFloat.RandomMinMax.max[πŸ”—](#$api.type~ParticleParamFloat.RandomMinMax.max) + +``` +ParticleParamFloat.RandomMinMax.max: number +``` + +Maximum value + +### ParticleParamFloat.ComponentWiseMinMax[πŸ”—](#$api.type~ParticleParamFloat.ComponentWiseMinMax) + +``` +record ParticleParamFloat.ComponentWiseMinMax new: function(): ComponentWiseMinMax + + min: number + max: number +end +``` + +Random min/max range for particle parameters + +### ParticleParamFloat.ComponentWiseMinMax.new()[πŸ”—](#$api.type~ParticleParamFloat.ComponentWiseMinMax.new()) + +``` +function ParticleParamFloat.ComponentWiseMinMax.new()(): ComponentWiseMinMax +``` + +**Returns** + +1. `ComponentWiseMinMax` + +### ParticleParamFloat.ComponentWiseMinMax.new(number, number)[πŸ”—](#$api.type~ParticleParamFloat.ComponentWiseMinMax.new(number, number)) + +``` +function ParticleParamFloat.ComponentWiseMinMax.new(number, number)(number, number): ComponentWiseMinMax +``` + +**Parameters** + +* `number` +* `number` + +**Returns** + +1. `ComponentWiseMinMax` + +### ParticleParamFloat.ComponentWiseMinMax.min[πŸ”—](#$api.type~ParticleParamFloat.ComponentWiseMinMax.min) + +``` +ParticleParamFloat.ComponentWiseMinMax.min: number +``` + +Minimum value + +### ParticleParamFloat.ComponentWiseMinMax.max[πŸ”—](#$api.type~ParticleParamFloat.ComponentWiseMinMax.max) + +``` +ParticleParamFloat.ComponentWiseMinMax.max: number +``` + +Maximum value + +### ParticleParamFloat.value[πŸ”—](#$api.type~ParticleParamFloat.value) + +``` +ParticleParamFloat.value: any +``` + +Value or range (variant of number or RandomMinMax) + +### ParticleParamVec2f[πŸ”—](#$api.type~ParticleParamVec2f) + +``` +[Expand All] [Collapse All] + +global record ParticleParamVec2f new: function(): ParticleParamVec2f + + record RandomMinMax new: function(): RandomMinMax + + min: Vec2f + max: Vec2f +end + record ComponentWiseMinMax new: function(): ComponentWiseMinMax + + min: Vec2f + max: Vec2f +end + value: any +end +``` + +Particle system parameter for vec2f values + +### ParticleParamVec2f.new()[πŸ”—](#$api.type~ParticleParamVec2f.new()) + +``` +function ParticleParamVec2f.new()(): ParticleParamVec2f +``` + +Creates a new particle parameter + +**Returns** + +1. `ParticleParamVec2f` + +### ParticleParamVec2f.new(Vec2f)[πŸ”—](#$api.type~ParticleParamVec2f.new(Vec2f)) + +``` +function ParticleParamVec2f.new(Vec2f)(Vec2f): ParticleParamVec2f +``` + +Creates a new particle parameter with a value + +**Parameters** + +* `Vec2f` + +**Returns** + +1. `ParticleParamVec2f` + +### ParticleParamVec2f.new(RandomMinMax)[πŸ”—](#$api.type~ParticleParamVec2f.new(RandomMinMax)) + +``` +function ParticleParamVec2f.new(RandomMinMax)(RandomMinMax): ParticleParamVec2f +``` + +Creates a new particle parameter with a range + +**Parameters** + +* `RandomMinMax` + +**Returns** + +1. `ParticleParamVec2f` + +### ParticleParamVec2f.new(ComponentWiseMinMax)[πŸ”—](#$api.type~ParticleParamVec2f.new(ComponentWiseMinMax)) + +``` +function ParticleParamVec2f.new(ComponentWiseMinMax)(ComponentWiseMinMax): ParticleParamVec2f +``` + +Creates a new particle parameter with a component-wise range + +**Parameters** + +* `ComponentWiseMinMax` + +**Returns** + +1. `ParticleParamVec2f` + +### ParticleParamVec2f.RandomMinMax[πŸ”—](#$api.type~ParticleParamVec2f.RandomMinMax) + +``` +record ParticleParamVec2f.RandomMinMax new: function(): RandomMinMax + + min: Vec2f + max: Vec2f +end +``` + +Random min/max range for particle parameters + +### ParticleParamVec2f.RandomMinMax.new()[πŸ”—](#$api.type~ParticleParamVec2f.RandomMinMax.new()) + +``` +function ParticleParamVec2f.RandomMinMax.new()(): RandomMinMax +``` + +**Returns** + +1. `RandomMinMax` + +### ParticleParamVec2f.RandomMinMax.new(Vec2f, Vec2f)[πŸ”—](#$api.type~ParticleParamVec2f.RandomMinMax.new(Vec2f, Vec2f)) + +``` +function ParticleParamVec2f.RandomMinMax.new(Vec2f, Vec2f)(Vec2f, Vec2f): RandomMinMax +``` + +**Parameters** + +* `Vec2f` +* `Vec2f` + +**Returns** + +1. `RandomMinMax` + +### ParticleParamVec2f.RandomMinMax.min[πŸ”—](#$api.type~ParticleParamVec2f.RandomMinMax.min) + +``` +ParticleParamVec2f.RandomMinMax.min: Vec2f +``` + +Minimum value + +### ParticleParamVec2f.RandomMinMax.max[πŸ”—](#$api.type~ParticleParamVec2f.RandomMinMax.max) + +``` +ParticleParamVec2f.RandomMinMax.max: Vec2f +``` + +Maximum value + +### ParticleParamVec2f.ComponentWiseMinMax[πŸ”—](#$api.type~ParticleParamVec2f.ComponentWiseMinMax) + +``` +record ParticleParamVec2f.ComponentWiseMinMax new: function(): ComponentWiseMinMax + + min: Vec2f + max: Vec2f +end +``` + +Random min/max range for particle parameters + +### ParticleParamVec2f.ComponentWiseMinMax.new()[πŸ”—](#$api.type~ParticleParamVec2f.ComponentWiseMinMax.new()) + +``` +function ParticleParamVec2f.ComponentWiseMinMax.new()(): ComponentWiseMinMax +``` + +**Returns** + +1. `ComponentWiseMinMax` + +### ParticleParamVec2f.ComponentWiseMinMax.new(Vec2f, Vec2f)[πŸ”—](#$api.type~ParticleParamVec2f.ComponentWiseMinMax.new(Vec2f, Vec2f)) + +``` +function ParticleParamVec2f.ComponentWiseMinMax.new(Vec2f, Vec2f)(Vec2f, Vec2f): ComponentWiseMinMax +``` + +**Parameters** + +* `Vec2f` +* `Vec2f` + +**Returns** + +1. `ComponentWiseMinMax` + +### ParticleParamVec2f.ComponentWiseMinMax.min[πŸ”—](#$api.type~ParticleParamVec2f.ComponentWiseMinMax.min) + +``` +ParticleParamVec2f.ComponentWiseMinMax.min: Vec2f +``` + +Minimum value + +### ParticleParamVec2f.ComponentWiseMinMax.max[πŸ”—](#$api.type~ParticleParamVec2f.ComponentWiseMinMax.max) + +``` +ParticleParamVec2f.ComponentWiseMinMax.max: Vec2f +``` + +Maximum value + +### ParticleParamVec2f.value[πŸ”—](#$api.type~ParticleParamVec2f.value) + +``` +ParticleParamVec2f.value: any +``` + +Value or range (variant of Vec2f or RandomMinMax) + +### Path[πŸ”—](#$api.type~Path) + +``` +global record Path new: function(): Path + edges: {{EdgeId, boolean}} + endOffset: integer + terminalDecisionOffset: integer + earlyArrivalIndices: integer +end +``` + +A path comprised of EdgeId and directions + +### Path.new[πŸ”—](#$api.type~Path.new) + +``` +function Path.new(): Path +``` + +Create a new instance of a Path object + +**Returns** + +1. `Path` + +### Path.edges[πŸ”—](#$api.type~Path.edges) + +``` +Path.edges: {{EdgeId, boolean}} +``` + +List of edges and their directions (true = forward, false = reverse) + +### Path.endOffset[πŸ”—](#$api.type~Path.endOffset) + +``` +Path.endOffset: integer +``` + +The actual end of the path (i.e. where to stop) as offset from the end + +### Path.terminalDecisionOffset[πŸ”—](#$api.type~Path.terminalDecisionOffset) + +``` +Path.terminalDecisionOffset: integer +``` + +The position at which the alternative terminal choice will start, as an offset from the end + +### Path.earlyArrivalIndices[πŸ”—](#$api.type~Path.earlyArrivalIndices) + +``` +Path.earlyArrivalIndices: integer +``` + +### PathFactoryInput[πŸ”—](#$api.type~PathFactoryInput) + +``` +global record PathFactoryInput fromEdgesWalk: {EdgePos} + fromEdgesDrive: {EdgePos} + fromLineOrEdges: LineOrEdges + moveMode2costFactor: {number, number, number} + toEntityWalk: Engine.Entity + toEdgesDrive: {EdgePos} + fromEdgesWalkForDrive: {EdgePos} + toEdgesWalkForDrive: {EdgePos} + cargoType: CargoTypeId +end +``` + +### PathFactoryInput.fromEdgesWalk[πŸ”—](#$api.type~PathFactoryInput.fromEdgesWalk) + +``` +PathFactoryInput.fromEdgesWalk: {EdgePos} +``` + +### PathFactoryInput.fromEdgesDrive[πŸ”—](#$api.type~PathFactoryInput.fromEdgesDrive) + +``` +PathFactoryInput.fromEdgesDrive: {EdgePos} +``` + +### PathFactoryInput.fromLineOrEdges[πŸ”—](#$api.type~PathFactoryInput.fromLineOrEdges) + +``` +PathFactoryInput.fromLineOrEdges: LineOrEdges +``` + +### PathFactoryInput.moveMode2costFactor[πŸ”—](#$api.type~PathFactoryInput.moveMode2costFactor) + +``` +PathFactoryInput.moveMode2costFactor: {number, number, number} +``` + +### PathFactoryInput.toEntityWalk[πŸ”—](#$api.type~PathFactoryInput.toEntityWalk) + +``` +PathFactoryInput.toEntityWalk: Engine.Entity +``` + +### PathFactoryInput.toEdgesDrive[πŸ”—](#$api.type~PathFactoryInput.toEdgesDrive) + +``` +PathFactoryInput.toEdgesDrive: {EdgePos} +``` + +### PathFactoryInput.fromEdgesWalkForDrive[πŸ”—](#$api.type~PathFactoryInput.fromEdgesWalkForDrive) + +``` +PathFactoryInput.fromEdgesWalkForDrive: {EdgePos} +``` + +### PathFactoryInput.toEdgesWalkForDrive[πŸ”—](#$api.type~PathFactoryInput.toEdgesWalkForDrive) + +``` +PathFactoryInput.toEdgesWalkForDrive: {EdgePos} +``` + +### PathFactoryInput.cargoType[πŸ”—](#$api.type~PathFactoryInput.cargoType) + +``` +PathFactoryInput.cargoType: CargoTypeId +``` + +### PathFactoryOutput[πŸ”—](#$api.type~PathFactoryOutput) + +``` +[Expand All] [Collapse All] + +global record PathFactoryOutput record LineSection line: Engine.Entity + lineStop0: integer + lineStop1: integer +end + line0: LineSection + line1: LineSection + path: ExtPath + cost: number + moveMode: MoveMode +end +``` + +Output result from pathfinding + +### PathFactoryOutput.LineSection[πŸ”—](#$api.type~PathFactoryOutput.LineSection) + +``` +record PathFactoryOutput.LineSection line: Engine.Entity + lineStop0: integer + lineStop1: integer +end +``` + +### PathFactoryOutput.LineSection.line[πŸ”—](#$api.type~PathFactoryOutput.LineSection.line) + +``` +PathFactoryOutput.LineSection.line: Engine.Entity +``` + +### PathFactoryOutput.LineSection.lineStop0[πŸ”—](#$api.type~PathFactoryOutput.LineSection.lineStop0) + +``` +PathFactoryOutput.LineSection.lineStop0: integer +``` + +### PathFactoryOutput.LineSection.lineStop1[πŸ”—](#$api.type~PathFactoryOutput.LineSection.lineStop1) + +``` +PathFactoryOutput.LineSection.lineStop1: integer +``` + +### PathFactoryOutput.line0[πŸ”—](#$api.type~PathFactoryOutput.line0) + +``` +PathFactoryOutput.line0: LineSection +``` + +### PathFactoryOutput.line1[πŸ”—](#$api.type~PathFactoryOutput.line1) + +``` +PathFactoryOutput.line1: LineSection +``` + +### PathFactoryOutput.path[πŸ”—](#$api.type~PathFactoryOutput.path) + +``` +PathFactoryOutput.path: ExtPath +``` + +### PathFactoryOutput.cost[πŸ”—](#$api.type~PathFactoryOutput.cost) + +``` +PathFactoryOutput.cost: number +``` + +### PathFactoryOutput.moveMode[πŸ”—](#$api.type~PathFactoryOutput.moveMode) + +``` +PathFactoryOutput.moveMode: MoveMode +``` + +### PathPos[πŸ”—](#$api.type~PathPos) + +``` +global record PathPos new: function(): PathPos + edgeIndex: integer + pos: number + pos01: number +end +``` + +The position on a Path + +### PathPos.new[πŸ”—](#$api.type~PathPos.new) + +``` +function PathPos.new(): PathPos +``` + +Create a new instance of a PathPos object + +**Returns** + +1. `PathPos` + +### PathPos.edgeIndex[πŸ”—](#$api.type~PathPos.edgeIndex) + +``` +PathPos.edgeIndex: integer +``` + +The zero-based index within a path + +### PathPos.pos[πŸ”—](#$api.type~PathPos.pos) + +``` +PathPos.pos: number +``` + +The position on the spline, relative to the length of the spline + +### PathPos.pos01[πŸ”—](#$api.type~PathPos.pos01) + +``` +PathPos.pos01: number +``` + +The position on the spline, normalized as parameter from 0 to 1 + +### PathPosData[πŸ”—](#$api.type~PathPosData) + +``` +global record PathPosData position: Vec3f + pPrime: Vec3f + pPrimePrime: Vec3f +end +``` + +The position in the world + +### PathPosData.position[πŸ”—](#$api.type~PathPosData.position) + +``` +PathPosData.position: Vec3f +``` + +Position in world coordinates + +### PathPosData.pPrime[πŸ”—](#$api.type~PathPosData.pPrime) + +``` +PathPosData.pPrime: Vec3f +``` + +First derivative of position (velocity direction) + +### PathPosData.pPrimePrime[πŸ”—](#$api.type~PathPosData.pPrimePrime) + +``` +PathPosData.pPrimePrime: Vec3f +``` + +Second derivative of position (acceleration direction) + +### PdxAccountInfo[πŸ”—](#$api.type~PdxAccountInfo) + +``` +global record PdxAccountInfo email: string +end +``` + +### PdxAccountInfo.email[πŸ”—](#$api.type~PdxAccountInfo.email) + +``` +PdxAccountInfo.email: string +``` + +### PdxCountry[πŸ”—](#$api.type~PdxCountry) + +``` +global record PdxCountry name: string + code: integer +end +``` + +### PdxCountry.name[πŸ”—](#$api.type~PdxCountry.name) + +``` +PdxCountry.name: string +``` + +### PdxCountry.code[πŸ”—](#$api.type~PdxCountry.code) + +``` +PdxCountry.code: integer +``` + +### PdxErrorCodes[πŸ”—](#$api.type~PdxErrorCodes) + +``` +global record PdxErrorCodes AccountAlreadyExists: PdxErrorCodes + BadEmailAddressFormat: PdxErrorCodes + BadPasswordLength: PdxErrorCodes + BadDateFormat: PdxErrorCodes + UnderAgeAccount: PdxErrorCodes + MissingAccountInfo: PdxErrorCodes + ProfileDoesNotExist: PdxErrorCodes + ProfileAlreadyTaken: PdxErrorCodes + ProfileAlreadyExists: PdxErrorCodes + ProfileNameTooLong: PdxErrorCodes + ProfileNameTooShort: PdxErrorCodes + ProfileNameInvalid: PdxErrorCodes +end +``` + +### PdxErrorCodes.AccountAlreadyExists[πŸ”—](#$api.type~PdxErrorCodes.AccountAlreadyExists) + +``` +PdxErrorCodes.AccountAlreadyExists: PdxErrorCodes +``` + +### PdxErrorCodes.BadEmailAddressFormat[πŸ”—](#$api.type~PdxErrorCodes.BadEmailAddressFormat) + +``` +PdxErrorCodes.BadEmailAddressFormat: PdxErrorCodes +``` + +### PdxErrorCodes.BadPasswordLength[πŸ”—](#$api.type~PdxErrorCodes.BadPasswordLength) + +``` +PdxErrorCodes.BadPasswordLength: PdxErrorCodes +``` + +### PdxErrorCodes.BadDateFormat[πŸ”—](#$api.type~PdxErrorCodes.BadDateFormat) + +``` +PdxErrorCodes.BadDateFormat: PdxErrorCodes +``` + +### PdxErrorCodes.UnderAgeAccount[πŸ”—](#$api.type~PdxErrorCodes.UnderAgeAccount) + +``` +PdxErrorCodes.UnderAgeAccount: PdxErrorCodes +``` + +### PdxErrorCodes.MissingAccountInfo[πŸ”—](#$api.type~PdxErrorCodes.MissingAccountInfo) + +``` +PdxErrorCodes.MissingAccountInfo: PdxErrorCodes +``` + +### PdxErrorCodes.ProfileDoesNotExist[πŸ”—](#$api.type~PdxErrorCodes.ProfileDoesNotExist) + +``` +PdxErrorCodes.ProfileDoesNotExist: PdxErrorCodes +``` + +### PdxErrorCodes.ProfileAlreadyTaken[πŸ”—](#$api.type~PdxErrorCodes.ProfileAlreadyTaken) + +``` +PdxErrorCodes.ProfileAlreadyTaken: PdxErrorCodes +``` + +### PdxErrorCodes.ProfileAlreadyExists[πŸ”—](#$api.type~PdxErrorCodes.ProfileAlreadyExists) + +``` +PdxErrorCodes.ProfileAlreadyExists: PdxErrorCodes +``` + +### PdxErrorCodes.ProfileNameTooLong[πŸ”—](#$api.type~PdxErrorCodes.ProfileNameTooLong) + +``` +PdxErrorCodes.ProfileNameTooLong: PdxErrorCodes +``` + +### PdxErrorCodes.ProfileNameTooShort[πŸ”—](#$api.type~PdxErrorCodes.ProfileNameTooShort) + +``` +PdxErrorCodes.ProfileNameTooShort: PdxErrorCodes +``` + +### PdxErrorCodes.ProfileNameInvalid[πŸ”—](#$api.type~PdxErrorCodes.ProfileNameInvalid) + +``` +PdxErrorCodes.ProfileNameInvalid: PdxErrorCodes +``` + +### PdxFuture[πŸ”—](#$api.type~PdxFuture) + +``` +global record PdxFuture getResult: function(PdxFuture): T +end +``` + +##### Type Parameters + +* **`T`** + +### PdxFuture.getResult[πŸ”—](#$api.type~PdxFuture.getResult) + +``` +function PdxFuture.getResult(PdxFuture): T +``` + +**Parameters** + +* `PdxFuture` + +**Returns** + +1. `T` + +### PdxLegalDocument[πŸ”—](#$api.type~PdxLegalDocument) + +``` +global record PdxLegalDocument title: string + text: string +end +``` + +### PdxLegalDocument.title[πŸ”—](#$api.type~PdxLegalDocument.title) + +``` +PdxLegalDocument.title: string +``` + +### PdxLegalDocument.text[πŸ”—](#$api.type~PdxLegalDocument.text) + +``` +PdxLegalDocument.text: string +``` + +### PdxLegalDocumentType[πŸ”—](#$api.type~PdxLegalDocumentType) + +``` +global record PdxLegalDocumentType UserAgreement: PdxLegalDocumentType + PrivacyPolicy: PdxLegalDocumentType +end +``` + +### PdxLegalDocumentType.UserAgreement[πŸ”—](#$api.type~PdxLegalDocumentType.UserAgreement) + +``` +PdxLegalDocumentType.UserAgreement: PdxLegalDocumentType +``` + +### PdxLegalDocumentType.PrivacyPolicy[πŸ”—](#$api.type~PdxLegalDocumentType.PrivacyPolicy) + +``` +PdxLegalDocumentType.PrivacyPolicy: PdxLegalDocumentType +``` + +### PdxLoginResult[πŸ”—](#$api.type~PdxLoginResult) + +``` +global record PdxLoginResultend +``` + +### PdxProfileResult[πŸ”—](#$api.type~PdxProfileResult) + +``` +global record PdxProfileResult id: string + name: string +end +``` + +### PdxProfileResult.id[πŸ”—](#$api.type~PdxProfileResult.id) + +``` +PdxProfileResult.id: string +``` + +### PdxProfileResult.name[πŸ”—](#$api.type~PdxProfileResult.name) + +``` +PdxProfileResult.name: string +``` + +### PdxResult[πŸ”—](#$api.type~PdxResult) + +``` +global interface PdxResult success: boolean + errorCode: PdxErrorCodes +end +``` + +### PdxResult.success[πŸ”—](#$api.type~PdxResult.success) + +``` +PdxResult.success: boolean +``` + +### PdxResult.errorCode[πŸ”—](#$api.type~PdxResult.errorCode) + +``` +PdxResult.errorCode: PdxErrorCodes +``` + +### PdxThirdPartyAutoLoginPromptState[πŸ”—](#$api.type~PdxThirdPartyAutoLoginPromptState) + +``` +global record PdxThirdPartyAutoLoginPromptState NotShown: PdxThirdPartyAutoLoginPromptState + Accepted: PdxThirdPartyAutoLoginPromptState + Rejected: PdxThirdPartyAutoLoginPromptState +end +``` + +### PdxThirdPartyAutoLoginPromptState.NotShown[πŸ”—](#$api.type~PdxThirdPartyAutoLoginPromptState.NotShown) + +``` +PdxThirdPartyAutoLoginPromptState.NotShown: PdxThirdPartyAutoLoginPromptState +``` + +### PdxThirdPartyAutoLoginPromptState.Accepted[πŸ”—](#$api.type~PdxThirdPartyAutoLoginPromptState.Accepted) + +``` +PdxThirdPartyAutoLoginPromptState.Accepted: PdxThirdPartyAutoLoginPromptState +``` + +### PdxThirdPartyAutoLoginPromptState.Rejected[πŸ”—](#$api.type~PdxThirdPartyAutoLoginPromptState.Rejected) + +``` +PdxThirdPartyAutoLoginPromptState.Rejected: PdxThirdPartyAutoLoginPromptState +``` + +### PdxThirdPartyLinkState[πŸ”—](#$api.type~PdxThirdPartyLinkState) + +``` +global record PdxThirdPartyLinkState NeitherAccountHasLink: PdxThirdPartyLinkState + ParadoxAccountHasLink: PdxThirdPartyLinkState + ThirdPartyAccountHasLink: PdxThirdPartyLinkState + BothAccountsHaveLinks: PdxThirdPartyLinkState + BothAccountsAreLinked: PdxThirdPartyLinkState +end +``` + +### PdxThirdPartyLinkState.NeitherAccountHasLink[πŸ”—](#$api.type~PdxThirdPartyLinkState.NeitherAccountHasLink) + +``` +PdxThirdPartyLinkState.NeitherAccountHasLink: PdxThirdPartyLinkState +``` + +### PdxThirdPartyLinkState.ParadoxAccountHasLink[πŸ”—](#$api.type~PdxThirdPartyLinkState.ParadoxAccountHasLink) + +``` +PdxThirdPartyLinkState.ParadoxAccountHasLink: PdxThirdPartyLinkState +``` + +### PdxThirdPartyLinkState.ThirdPartyAccountHasLink[πŸ”—](#$api.type~PdxThirdPartyLinkState.ThirdPartyAccountHasLink) + +``` +PdxThirdPartyLinkState.ThirdPartyAccountHasLink: PdxThirdPartyLinkState +``` + +### PdxThirdPartyLinkState.BothAccountsHaveLinks[πŸ”—](#$api.type~PdxThirdPartyLinkState.BothAccountsHaveLinks) + +``` +PdxThirdPartyLinkState.BothAccountsHaveLinks: PdxThirdPartyLinkState +``` + +### PdxThirdPartyLinkState.BothAccountsAreLinked[πŸ”—](#$api.type~PdxThirdPartyLinkState.BothAccountsAreLinked) + +``` +PdxThirdPartyLinkState.BothAccountsAreLinked: PdxThirdPartyLinkState +``` + +### PlacementParams[πŸ”—](#$api.type~PlacementParams) + +``` +global record PlacementParams requiredIndustryTags: {string} + tags: {string} + distanceWeights: {string : number} + allowedOnLand: boolean + allowedOnWater: boolean + buildOrder: integer + initWeight: integer + tier: integer + weights: {string : number} +end +``` + +### PlacementParams.requiredIndustryTags[πŸ”—](#$api.type~PlacementParams.requiredIndustryTags) + +``` +PlacementParams.requiredIndustryTags: {string} +``` + +### PlacementParams.tags[πŸ”—](#$api.type~PlacementParams.tags) + +``` +PlacementParams.tags: {string} +``` + +### PlacementParams.distanceWeights[πŸ”—](#$api.type~PlacementParams.distanceWeights) + +``` +PlacementParams.distanceWeights: {string : number} +``` + +### PlacementParams.allowedOnLand[πŸ”—](#$api.type~PlacementParams.allowedOnLand) + +``` +PlacementParams.allowedOnLand: boolean +``` + +### PlacementParams.allowedOnWater[πŸ”—](#$api.type~PlacementParams.allowedOnWater) + +``` +PlacementParams.allowedOnWater: boolean +``` + +### PlacementParams.buildOrder[πŸ”—](#$api.type~PlacementParams.buildOrder) + +``` +PlacementParams.buildOrder: integer +``` + +### PlacementParams.initWeight[πŸ”—](#$api.type~PlacementParams.initWeight) + +``` +PlacementParams.initWeight: integer +``` + +### PlacementParams.tier[πŸ”—](#$api.type~PlacementParams.tier) + +``` +PlacementParams.tier: integer +``` + +### PlacementParams.weights[πŸ”—](#$api.type~PlacementParams.weights) + +``` +PlacementParams.weights: {string : number} +``` + +### Platform[πŸ”—](#$api.type~Platform) + +``` +global record Platform Windows: Platform + Linux: Platform + Mac: Platform + XBoxSeries: Platform + PS5: Platform + PS: Platform + XBox: Platform + Desktop: Platform + Console: Platform +end +``` + +Platform represents the platform type. + +### Platform.Windows[πŸ”—](#$api.type~Platform.Windows) + +``` +Platform.Windows: Platform +``` + +### Platform.Linux[πŸ”—](#$api.type~Platform.Linux) + +``` +Platform.Linux: Platform +``` + +### Platform.Mac[πŸ”—](#$api.type~Platform.Mac) + +``` +Platform.Mac: Platform +``` + +### Platform.XBoxSeries[πŸ”—](#$api.type~Platform.XBoxSeries) + +``` +Platform.XBoxSeries: Platform +``` + +### Platform.PS5[πŸ”—](#$api.type~Platform.PS5) + +``` +Platform.PS5: Platform +``` + +### Platform.PS[πŸ”—](#$api.type~Platform.PS) + +``` +Platform.PS: Platform +``` + +### Platform.XBox[πŸ”—](#$api.type~Platform.XBox) + +``` +Platform.XBox: Platform +``` + +### Platform.Desktop[πŸ”—](#$api.type~Platform.Desktop) + +``` +Platform.Desktop: Platform +``` + +### Platform.Console[πŸ”—](#$api.type~Platform.Console) + +``` +Platform.Console: Platform +``` + +### PlatformDeviceSpec[πŸ”—](#$api.type~PlatformDeviceSpec) + +``` +global record PlatformDeviceSpec gen: ConsoleGen + resolution: Vec2i +end +``` + +Platform device specifications + +### PlatformDeviceSpec.gen[πŸ”—](#$api.type~PlatformDeviceSpec.gen) + +``` +PlatformDeviceSpec.gen: ConsoleGen +``` + +### PlatformDeviceSpec.resolution[πŸ”—](#$api.type~PlatformDeviceSpec.resolution) + +``` +PlatformDeviceSpec.resolution: Vec2i +``` + +### PlayerStatDesc[πŸ”—](#$api.type~PlayerStatDesc) + +``` +global record PlayerStatDesc id: string +end +``` + +A player stat, used for start tracking + +### PlayerStatDesc.id[πŸ”—](#$api.type~PlayerStatDesc.id) + +``` +PlayerStatDesc.id: string +``` + +The unique id for that stat + +### PlayerStatProgress[πŸ”—](#$api.type~PlayerStatProgress) + +``` +global record PlayerStatProgress id: string + getValue: function(PlayerStatProgress): number +end +``` + +The value of a player stat + +### PlayerStatProgress.id[πŸ”—](#$api.type~PlayerStatProgress.id) + +``` +PlayerStatProgress.id: string +``` + +the unique id for the stat + +### PlayerStatProgress.getValue[πŸ”—](#$api.type~PlayerStatProgress.getValue) + +``` +function PlayerStatProgress.getValue(PlayerStatProgress): number +``` + +the value of the stats (either the current value or a target value depending on the use context) + +**Parameters** + +* `PlayerStatProgress` + +**Returns** + +1. `number` + +### PlayerStatRep[πŸ”—](#$api.type~PlayerStatRep) + +``` +global record PlayerStatRep get: function(playerStatRep : PlayerStatRep, statId : string): PlayerStatDesc +end +``` + +Repository for all player stat types (static data) +Access the current state of a player stats, use UserProfile:getPlayerStatProgress + +### PlayerStatRep.get[πŸ”—](#$api.type~PlayerStatRep.get) + +``` +function PlayerStatRep.get(playerStatRep : PlayerStatRep, statId : string): PlayerStatDesc +``` + +Get a player stat description from its id + +**Parameters** + +* `playerStatRep` :`PlayerStatRep` β€” the player start rep +* `statId` :`string` β€” the player stat id + +**Returns** + +1. `PlayerStatDesc` β€” the player stat desc + +### PlaylistDesc[πŸ”—](#$api.type~PlaylistDesc) + +``` +global record PlaylistDesc name: string + tracks: {PlaylistTrack} + order: integer + hidden: boolean + allFilter: boolean +end +``` + +Music playlist description + +### PlaylistDesc.name[πŸ”—](#$api.type~PlaylistDesc.name) + +``` +PlaylistDesc.name: string +``` + +### PlaylistDesc.tracks[πŸ”—](#$api.type~PlaylistDesc.tracks) + +``` +PlaylistDesc.tracks: {PlaylistTrack} +``` + +### PlaylistDesc.order[πŸ”—](#$api.type~PlaylistDesc.order) + +``` +PlaylistDesc.order: integer +``` + +### PlaylistDesc.hidden[πŸ”—](#$api.type~PlaylistDesc.hidden) + +``` +PlaylistDesc.hidden: boolean +``` + +### PlaylistDesc.allFilter[πŸ”—](#$api.type~PlaylistDesc.allFilter) + +``` +PlaylistDesc.allFilter: boolean +``` + +### PlaylistTrack[πŸ”—](#$api.type~PlaylistTrack) + +``` +global record PlaylistTrack name: string + fileName: string + yearFrom: integer + yearTo: integer +end +``` + +Music playlist track information + +### PlaylistTrack.name[πŸ”—](#$api.type~PlaylistTrack.name) + +``` +PlaylistTrack.name: string +``` + +id + +### PlaylistTrack.fileName[πŸ”—](#$api.type~PlaylistTrack.fileName) + +``` +PlaylistTrack.fileName: string +``` + +file path to the music file + +### PlaylistTrack.yearFrom[πŸ”—](#$api.type~PlaylistTrack.yearFrom) + +``` +PlaylistTrack.yearFrom: integer +``` + +Year when track becomes available + +### PlaylistTrack.yearTo[πŸ”—](#$api.type~PlaylistTrack.yearTo) + +``` +PlaylistTrack.yearTo: integer +``` + +Last year before track becomes unavailable + +### PortId[πŸ”—](#$api.type~PortId) + +``` +global record PortId nodeId: NodeId + port: integer +end +``` + +Identifies a Port of a Node within a transport network + +### PortId.nodeId[πŸ”—](#$api.type~PortId.nodeId) + +``` +PortId.nodeId: NodeId +``` + +The NodeId of the node this port belongs to + +### PortId.port[πŸ”—](#$api.type~PortId.port) + +``` +PortId.port: integer +``` + +The zero-based port index on the node + +### PowerUnit[πŸ”—](#$api.type~PowerUnit) + +``` +global record PowerUnit KW: PowerUnit + HP: PowerUnit +end +``` + +PowerUnit represents the unit of measurement used for power. + +### PowerUnit.KW[πŸ”—](#$api.type~PowerUnit.KW) + +``` +PowerUnit.KW: PowerUnit +``` + +### PowerUnit.HP[πŸ”—](#$api.type~PowerUnit.HP) + +``` +PowerUnit.HP: PowerUnit +``` + +### PrecedencePreference[πŸ”—](#$api.type~PrecedencePreference) + +``` +global record PrecedencePreference YES: PrecedencePreference + NO: PrecedencePreference + AUTO: PrecedencePreference +end +``` + +### PrecedencePreference.YES[πŸ”—](#$api.type~PrecedencePreference.YES) + +``` +PrecedencePreference.YES: PrecedencePreference +``` + +### PrecedencePreference.NO[πŸ”—](#$api.type~PrecedencePreference.NO) + +``` +PrecedencePreference.NO: PrecedencePreference +``` + +### PrecedencePreference.AUTO[πŸ”—](#$api.type~PrecedencePreference.AUTO) + +``` +PrecedencePreference.AUTO: PrecedencePreference +``` + +### PreviewColoring[πŸ”—](#$api.type~PreviewColoring) + +``` +global record PreviewColoringend +``` + +### Proposal[πŸ”—](#$api.type~Proposal) + +``` +[Expand All] [Collapse All] + +global record Proposal record EdgeObject resultEntity: Engine.Entity + category: integer + modelInstance: ModelInstance + playerEntity: Engine.Entity + left: boolean +end + record NodeAndEntity new: function(): NodeAndEntity + entity: Engine.Entity + comp: Engine.Component.BaseNode +end + record SegmentAndEntity new: function(): SegmentAndEntity + entity: Engine.Entity + comp: Engine.Component.BaseEdge + type: integer + streetEdge: Engine.Component.BaseEdgeStreet + emissionEmitter: Engine.Component.EmissionEmitter + playerOwned: Engine.Component.PlayerOwned +end + record BaseNodeLaneConnectionAndEntity new: function(): BaseNodeLaneConnectionAndEntity + comp: Engine.Component.BaseNodeConfig + entity: Engine.Entity +end + record StreetProposal addedNodes: {NodeAndEntity} + addedNodes_native: Vector + addedSegments: {SegmentAndEntity} + addedSegments_native: Vector + removedSegments: {SegmentAndEntity} + removedNodes: {NodeAndEntity} + edgeObjectsToAdd: {EdgeObject} + new2oldEdgeObjects: {Engine.Entity : {Engine.Entity}} + old2newEdgeObjects: {Engine.Entity : {Engine.Entity}} + nodeConfigsToAdd: {BaseNodeLaneConnectionAndEntity} + nodeConfigsToRemove: {Engine.Entity} +end + record TransformedModel id: string + tag: integer + transf: Mat4f + thin: boolean +end + record Subconstruction models: {TransformedModel} + models_native: Vector + metadata: SubconstructionInstanceMetadata + station: Station + colliders: {Collider} +end + record Construction subconstructions: {Subconstruction} + subconstructions_native: Vector + fileName: string + frozenNodes: {Engine.Entity} + frozenEdges: {Engine.Entity} + depots: {Engine.Entity} + stations: {Engine.Entity} + industries: {Engine.Entity} + townBuildings: {Engine.Entity} + persistentMetadata: ConstructionInstanceMetadata + params: { : } +end + record StreetTerminal cargo: boolean + passengers: boolean + capacity: integer + wantSymmetric: boolean + cargoUnload: boolean + cargoLoad: boolean +end + record Signal type: SignalType +end + record ConstructionEntity fileName: ResName + hasCargoPlatform: boolean + desc: ConstructionDesc + construction: Construction + transf: Mat4f + playerEntity: Engine.Entity +end + record Terrain baseHeightMod: GridVec2f +end + new: function(): Proposal + clone: function(Proposal): Proposal + proposal: StreetProposal + toRemove: {Engine.Entity} + toRemove_native: Vector + old2new: {Engine.Entity : integer} + toAdd: {ConstructionEntity} + toAdd_native: Vector + terrain: Terrain +end +``` + +A more complete version of the SimpleProposal. +Most data can be read from a ProposalData or in the result of api.cmd.makeWorldBuildProposalCmd. + +### Proposal.EdgeObject[πŸ”—](#$api.type~Proposal.EdgeObject) + +``` +record Proposal.EdgeObject resultEntity: Engine.Entity + category: integer + modelInstance: ModelInstance + playerEntity: Engine.Entity + left: boolean +end +``` + +Edge object information + +### Proposal.EdgeObject.resultEntity[πŸ”—](#$api.type~Proposal.EdgeObject.resultEntity) + +``` +Proposal.EdgeObject.resultEntity: Engine.Entity +``` + +Resulting entity + +### Proposal.EdgeObject.category[πŸ”—](#$api.type~Proposal.EdgeObject.category) + +``` +Proposal.EdgeObject.category: integer +``` + +Category (0 = stop, 1 = waypoint, 2 = signal) + +### Proposal.EdgeObject.modelInstance[πŸ”—](#$api.type~Proposal.EdgeObject.modelInstance) + +``` +Proposal.EdgeObject.modelInstance: ModelInstance +``` + +Model instance for the edge object + +### Proposal.EdgeObject.playerEntity[πŸ”—](#$api.type~Proposal.EdgeObject.playerEntity) + +``` +Proposal.EdgeObject.playerEntity: Engine.Entity +``` + +Player entity that owns this edge object + +### Proposal.EdgeObject.left[πŸ”—](#$api.type~Proposal.EdgeObject.left) + +``` +Proposal.EdgeObject.left: boolean +``` + +Whether on left side + +### Proposal.NodeAndEntity[πŸ”—](#$api.type~Proposal.NodeAndEntity) + +``` +record Proposal.NodeAndEntity new: function(): NodeAndEntity + entity: Engine.Entity + comp: Engine.Component.BaseNode +end +``` + +An entity with a BaseNode. +Used to specify a new base node entity to be added. + +### Proposal.NodeAndEntity.new[πŸ”—](#$api.type~Proposal.NodeAndEntity.new) + +``` +function Proposal.NodeAndEntity.new(): NodeAndEntity +``` + +**Returns** + +1. `NodeAndEntity` + +### Proposal.NodeAndEntity.entity[πŸ”—](#$api.type~Proposal.NodeAndEntity.entity) + +``` +Proposal.NodeAndEntity.entity: Engine.Entity +``` + +### Proposal.NodeAndEntity.comp[πŸ”—](#$api.type~Proposal.NodeAndEntity.comp) + +``` +Proposal.NodeAndEntity.comp: Engine.Component.BaseNode +``` + +### Proposal.SegmentAndEntity[πŸ”—](#$api.type~Proposal.SegmentAndEntity) + +``` +record Proposal.SegmentAndEntity new: function(): SegmentAndEntity + entity: Engine.Entity + comp: Engine.Component.BaseEdge + type: integer + streetEdge: Engine.Component.BaseEdgeStreet + emissionEmitter: Engine.Component.EmissionEmitter + playerOwned: Engine.Component.PlayerOwned +end +``` + +An entity with a BaseEdge component and extra information. + +### Proposal.SegmentAndEntity.new[πŸ”—](#$api.type~Proposal.SegmentAndEntity.new) + +``` +function Proposal.SegmentAndEntity.new(): SegmentAndEntity +``` + +**Returns** + +1. `SegmentAndEntity` + +### Proposal.SegmentAndEntity.entity[πŸ”—](#$api.type~Proposal.SegmentAndEntity.entity) + +``` +Proposal.SegmentAndEntity.entity: Engine.Entity +``` + +### Proposal.SegmentAndEntity.comp[πŸ”—](#$api.type~Proposal.SegmentAndEntity.comp) + +``` +Proposal.SegmentAndEntity.comp: Engine.Component.BaseEdge +``` + +### Proposal.SegmentAndEntity.type[πŸ”—](#$api.type~Proposal.SegmentAndEntity.type) + +``` +Proposal.SegmentAndEntity.type: integer +``` + +Type (0 = street, 1 = track) + +### Proposal.SegmentAndEntity.streetEdge[πŸ”—](#$api.type~Proposal.SegmentAndEntity.streetEdge) + +``` +Proposal.SegmentAndEntity.streetEdge: Engine.Component.BaseEdgeStreet +``` + +Street edge component + +### Proposal.SegmentAndEntity.emissionEmitter[πŸ”—](#$api.type~Proposal.SegmentAndEntity.emissionEmitter) + +``` +Proposal.SegmentAndEntity.emissionEmitter: Engine.Component.EmissionEmitter +``` + +Emission emitter component (optional) + +### Proposal.SegmentAndEntity.playerOwned[πŸ”—](#$api.type~Proposal.SegmentAndEntity.playerOwned) + +``` +Proposal.SegmentAndEntity.playerOwned: Engine.Component.PlayerOwned +``` + +Player owned component (optional) + +### Proposal.BaseNodeLaneConnectionAndEntity[πŸ”—](#$api.type~Proposal.BaseNodeLaneConnectionAndEntity) + +``` +record Proposal.BaseNodeLaneConnectionAndEntity new: function(): BaseNodeLaneConnectionAndEntity + comp: Engine.Component.BaseNodeConfig + entity: Engine.Entity +end +``` + +An entity with a BaseNodeLaneConnection component. +Used to specify a new base node configuration entity to be added. + +### Proposal.BaseNodeLaneConnectionAndEntity.new[πŸ”—](#$api.type~Proposal.BaseNodeLaneConnectionAndEntity.new) + +``` +function Proposal.BaseNodeLaneConnectionAndEntity.new(): BaseNodeLaneConnectionAndEntity +``` + +**Returns** + +1. `BaseNodeLaneConnectionAndEntity` + +### Proposal.BaseNodeLaneConnectionAndEntity.comp[πŸ”—](#$api.type~Proposal.BaseNodeLaneConnectionAndEntity.comp) + +``` +Proposal.BaseNodeLaneConnectionAndEntity.comp: Engine.Component.BaseNodeConfig +``` + +### Proposal.BaseNodeLaneConnectionAndEntity.entity[πŸ”—](#$api.type~Proposal.BaseNodeLaneConnectionAndEntity.entity) + +``` +Proposal.BaseNodeLaneConnectionAndEntity.entity: Engine.Entity +``` + +### Proposal.StreetProposal[πŸ”—](#$api.type~Proposal.StreetProposal) + +``` +record Proposal.StreetProposal addedNodes: {NodeAndEntity} + addedNodes_native: Vector + addedSegments: {SegmentAndEntity} + addedSegments_native: Vector + removedSegments: {SegmentAndEntity} + removedNodes: {NodeAndEntity} + edgeObjectsToAdd: {EdgeObject} + new2oldEdgeObjects: {Engine.Entity : {Engine.Entity}} + old2newEdgeObjects: {Engine.Entity : {Engine.Entity}} + nodeConfigsToAdd: {BaseNodeLaneConnectionAndEntity} + nodeConfigsToRemove: {Engine.Entity} +end +``` + +A more complete version of the SimpleStreetProposal. +Most data can be read from a ProposalData or in the result of cmd.makeWorldBuildProposalCmd. + +### Proposal.StreetProposal.addedNodes[πŸ”—](#$api.type~Proposal.StreetProposal.addedNodes) + +``` +Proposal.StreetProposal.addedNodes: {NodeAndEntity} +``` + +Added nodes + +### Proposal.StreetProposal.addedNodes\_native[πŸ”—](#$api.type~Proposal.StreetProposal.addedNodes_native) + +``` +Proposal.StreetProposal.addedNodes_native: Vector +``` + +Added nodes as native vector + +### Proposal.StreetProposal.addedSegments[πŸ”—](#$api.type~Proposal.StreetProposal.addedSegments) + +``` +Proposal.StreetProposal.addedSegments: {SegmentAndEntity} +``` + +Added segments + +### Proposal.StreetProposal.addedSegments\_native[πŸ”—](#$api.type~Proposal.StreetProposal.addedSegments_native) + +``` +Proposal.StreetProposal.addedSegments_native: Vector +``` + +Added segments as native vector + +### Proposal.StreetProposal.removedSegments[πŸ”—](#$api.type~Proposal.StreetProposal.removedSegments) + +``` +Proposal.StreetProposal.removedSegments: {SegmentAndEntity} +``` + +Removed segments + +### Proposal.StreetProposal.removedNodes[πŸ”—](#$api.type~Proposal.StreetProposal.removedNodes) + +``` +Proposal.StreetProposal.removedNodes: {NodeAndEntity} +``` + +Removed nodes + +### Proposal.StreetProposal.edgeObjectsToAdd[πŸ”—](#$api.type~Proposal.StreetProposal.edgeObjectsToAdd) + +``` +Proposal.StreetProposal.edgeObjectsToAdd: {EdgeObject} +``` + +Edge objects to add + +### Proposal.StreetProposal.new2oldEdgeObjects[πŸ”—](#$api.type~Proposal.StreetProposal.new2oldEdgeObjects) + +``` +Proposal.StreetProposal.new2oldEdgeObjects: {Engine.Entity : {Engine.Entity}} +``` + +Mapping of new to old edge objects + +### Proposal.StreetProposal.old2newEdgeObjects[πŸ”—](#$api.type~Proposal.StreetProposal.old2newEdgeObjects) + +``` +Proposal.StreetProposal.old2newEdgeObjects: {Engine.Entity : {Engine.Entity}} +``` + +Mapping of old to new edge objects + +### Proposal.StreetProposal.nodeConfigsToAdd[πŸ”—](#$api.type~Proposal.StreetProposal.nodeConfigsToAdd) + +``` +Proposal.StreetProposal.nodeConfigsToAdd: {BaseNodeLaneConnectionAndEntity} +``` + +Node configurations that will be added + +### Proposal.StreetProposal.nodeConfigsToRemove[πŸ”—](#$api.type~Proposal.StreetProposal.nodeConfigsToRemove) + +``` +Proposal.StreetProposal.nodeConfigsToRemove: {Engine.Entity} +``` + +Node configurations that will be removed (node itself cannot be removed at the same time) + +### Proposal.TransformedModel[πŸ”—](#$api.type~Proposal.TransformedModel) + +``` +record Proposal.TransformedModel id: string + tag: integer + transf: Mat4f + thin: boolean +end +``` + +Transformed model information + +### Proposal.TransformedModel.id[πŸ”—](#$api.type~Proposal.TransformedModel.id) + +``` +Proposal.TransformedModel.id: string +``` + +### Proposal.TransformedModel.tag[πŸ”—](#$api.type~Proposal.TransformedModel.tag) + +``` +Proposal.TransformedModel.tag: integer +``` + +### Proposal.TransformedModel.transf[πŸ”—](#$api.type~Proposal.TransformedModel.transf) + +``` +Proposal.TransformedModel.transf: Mat4f +``` + +### Proposal.TransformedModel.thin[πŸ”—](#$api.type~Proposal.TransformedModel.thin) + +``` +Proposal.TransformedModel.thin: boolean +``` + +### Proposal.Subconstruction[πŸ”—](#$api.type~Proposal.Subconstruction) + +``` +record Proposal.Subconstruction models: {TransformedModel} + models_native: Vector + metadata: SubconstructionInstanceMetadata + station: Station + colliders: {Collider} +end +``` + +### Proposal.Subconstruction.models[πŸ”—](#$api.type~Proposal.Subconstruction.models) + +``` +Proposal.Subconstruction.models: {TransformedModel} +``` + +### Proposal.Subconstruction.models\_native[πŸ”—](#$api.type~Proposal.Subconstruction.models_native) + +``` +Proposal.Subconstruction.models_native: Vector +``` + +### Proposal.Subconstruction.metadata[πŸ”—](#$api.type~Proposal.Subconstruction.metadata) + +``` +Proposal.Subconstruction.metadata: SubconstructionInstanceMetadata +``` + +### Proposal.Subconstruction.station[πŸ”—](#$api.type~Proposal.Subconstruction.station) + +``` +Proposal.Subconstruction.station: Station +``` + +### Proposal.Subconstruction.colliders[πŸ”—](#$api.type~Proposal.Subconstruction.colliders) + +``` +Proposal.Subconstruction.colliders: {Collider} +``` + +### Proposal.Construction[πŸ”—](#$api.type~Proposal.Construction) + +``` +record Proposal.Construction subconstructions: {Subconstruction} + subconstructions_native: Vector + fileName: string + frozenNodes: {Engine.Entity} + frozenEdges: {Engine.Entity} + depots: {Engine.Entity} + stations: {Engine.Entity} + industries: {Engine.Entity} + townBuildings: {Engine.Entity} + persistentMetadata: ConstructionInstanceMetadata + params: { : } +end +``` + +A construction: usually contains stations, depots, town buildings or industries. + +### Proposal.Construction.subconstructions[πŸ”—](#$api.type~Proposal.Construction.subconstructions) + +``` +Proposal.Construction.subconstructions: {Subconstruction} +``` + +all subconstructions generated by the construction + +### Proposal.Construction.subconstructions\_native[πŸ”—](#$api.type~Proposal.Construction.subconstructions_native) + +``` +Proposal.Construction.subconstructions_native: Vector +``` + +all subconstructions generated by the construction, as native vector + +### Proposal.Construction.fileName[πŸ”—](#$api.type~Proposal.Construction.fileName) + +``` +Proposal.Construction.fileName: string +``` + +the resource name of the construction (or the id in case of dynamic constructions) + +### Proposal.Construction.frozenNodes[πŸ”—](#$api.type~Proposal.Construction.frozenNodes) + +``` +Proposal.Construction.frozenNodes: {Engine.Entity} +``` + +nodes that belong to the construction and cannot be moved + +### Proposal.Construction.frozenEdges[πŸ”—](#$api.type~Proposal.Construction.frozenEdges) + +``` +Proposal.Construction.frozenEdges: {Engine.Entity} +``` + +frozenEdges edges that belong to the construction and cannot be moved + +### Proposal.Construction.depots[πŸ”—](#$api.type~Proposal.Construction.depots) + +``` +Proposal.Construction.depots: {Engine.Entity} +``` + +depots that belong to the construction + +### Proposal.Construction.stations[πŸ”—](#$api.type~Proposal.Construction.stations) + +``` +Proposal.Construction.stations: {Engine.Entity} +``` + +stations that belong to the construction + +### Proposal.Construction.industries[πŸ”—](#$api.type~Proposal.Construction.industries) + +``` +Proposal.Construction.industries: {Engine.Entity} +``` + +industries that belong to the construction + +### Proposal.Construction.townBuildings[πŸ”—](#$api.type~Proposal.Construction.townBuildings) + +``` +Proposal.Construction.townBuildings: {Engine.Entity} +``` + +town buildings that belong to the construction + +### Proposal.Construction.persistentMetadata[πŸ”—](#$api.type~Proposal.Construction.persistentMetadata) + +``` +Proposal.Construction.persistentMetadata: ConstructionInstanceMetadata +``` + +Construction metadata persisted per instance + +### Proposal.Construction.params[πŸ”—](#$api.type~Proposal.Construction.params) + +``` +Proposal.Construction.params: { : } +``` + +construction params + +### Proposal.StreetTerminal[πŸ”—](#$api.type~Proposal.StreetTerminal) + +``` +record Proposal.StreetTerminal cargo: boolean + passengers: boolean + capacity: integer + wantSymmetric: boolean + cargoUnload: boolean + cargoLoad: boolean +end +``` + +### Proposal.StreetTerminal.cargo[πŸ”—](#$api.type~Proposal.StreetTerminal.cargo) + +``` +Proposal.StreetTerminal.cargo: boolean +``` + +### Proposal.StreetTerminal.passengers[πŸ”—](#$api.type~Proposal.StreetTerminal.passengers) + +``` +Proposal.StreetTerminal.passengers: boolean +``` + +### Proposal.StreetTerminal.capacity[πŸ”—](#$api.type~Proposal.StreetTerminal.capacity) + +``` +Proposal.StreetTerminal.capacity: integer +``` + +### Proposal.StreetTerminal.wantSymmetric[πŸ”—](#$api.type~Proposal.StreetTerminal.wantSymmetric) + +``` +Proposal.StreetTerminal.wantSymmetric: boolean +``` + +### Proposal.StreetTerminal.cargoUnload[πŸ”—](#$api.type~Proposal.StreetTerminal.cargoUnload) + +``` +Proposal.StreetTerminal.cargoUnload: boolean +``` + +### Proposal.StreetTerminal.cargoLoad[πŸ”—](#$api.type~Proposal.StreetTerminal.cargoLoad) + +``` +Proposal.StreetTerminal.cargoLoad: boolean +``` + +### Proposal.Signal[πŸ”—](#$api.type~Proposal.Signal) + +``` +record Proposal.Signal type: SignalType +end +``` + +### Proposal.Signal.type[πŸ”—](#$api.type~Proposal.Signal.type) + +``` +Proposal.Signal.type: SignalType +``` + +### Proposal.ConstructionEntity[πŸ”—](#$api.type~Proposal.ConstructionEntity) + +``` +record Proposal.ConstructionEntity fileName: ResName + hasCargoPlatform: boolean + desc: ConstructionDesc + construction: Construction + transf: Mat4f + playerEntity: Engine.Entity +end +``` + +Construction entity data for use in proposals +Most data can be read from a ProposalData or in the result of cmd.makeWorldBuildProposalCmd. + +### Proposal.ConstructionEntity.fileName[πŸ”—](#$api.type~Proposal.ConstructionEntity.fileName) + +``` +Proposal.ConstructionEntity.fileName: ResName +``` + +Construction resource name + +### Proposal.ConstructionEntity.hasCargoPlatform[πŸ”—](#$api.type~Proposal.ConstructionEntity.hasCargoPlatform) + +``` +Proposal.ConstructionEntity.hasCargoPlatform: boolean +``` + +Whether it has cargo platform + +### Proposal.ConstructionEntity.desc[πŸ”—](#$api.type~Proposal.ConstructionEntity.desc) + +``` +Proposal.ConstructionEntity.desc: ConstructionDesc +``` + +Construction description + +### Proposal.ConstructionEntity.construction[πŸ”—](#$api.type~Proposal.ConstructionEntity.construction) + +``` +Proposal.ConstructionEntity.construction: Construction +``` + +Construction data + +### Proposal.ConstructionEntity.transf[πŸ”—](#$api.type~Proposal.ConstructionEntity.transf) + +``` +Proposal.ConstructionEntity.transf: Mat4f +``` + +Transformation matrix + +### Proposal.ConstructionEntity.playerEntity[πŸ”—](#$api.type~Proposal.ConstructionEntity.playerEntity) + +``` +Proposal.ConstructionEntity.playerEntity: Engine.Entity +``` + +Owning player entity + +### Proposal.Terrain[πŸ”—](#$api.type~Proposal.Terrain) + +``` +record Proposal.Terrain baseHeightMod: GridVec2f +end +``` + +Contains proposal terrain modifications. + +### Proposal.Terrain.baseHeightMod[πŸ”—](#$api.type~Proposal.Terrain.baseHeightMod) + +``` +Proposal.Terrain.baseHeightMod: GridVec2f +``` + +### Proposal.new[πŸ”—](#$api.type~Proposal.new) + +``` +function Proposal.new(): Proposal +``` + +**Returns** + +1. `Proposal` + +### Proposal.clone[πŸ”—](#$api.type~Proposal.clone) + +``` +function Proposal.clone(Proposal): Proposal +``` + +**Parameters** + +* `Proposal` + +**Returns** + +1. `Proposal` + +### Proposal.proposal[πŸ”—](#$api.type~Proposal.proposal) + +``` +Proposal.proposal: StreetProposal +``` + +Street proposal + +### Proposal.toRemove[πŸ”—](#$api.type~Proposal.toRemove) + +``` +Proposal.toRemove: {Engine.Entity} +``` + +Entities to remove + +### Proposal.toRemove\_native[πŸ”—](#$api.type~Proposal.toRemove_native) + +``` +Proposal.toRemove_native: Vector +``` + +Entities to remove as native vector + +### Proposal.old2new[πŸ”—](#$api.type~Proposal.old2new) + +``` +Proposal.old2new: {Engine.Entity : integer} +``` + +Mapping from old to new entities + +### Proposal.toAdd[πŸ”—](#$api.type~Proposal.toAdd) + +``` +Proposal.toAdd: {ConstructionEntity} +``` + +Construction entities to add + +### Proposal.toAdd\_native[πŸ”—](#$api.type~Proposal.toAdd_native) + +``` +Proposal.toAdd_native: Vector +``` + +Construction entities to add as native vector + +### Proposal.terrain[πŸ”—](#$api.type~Proposal.terrain) + +``` +Proposal.terrain: Terrain +``` + +Terrain modifications + +### ProposalData[πŸ”—](#$api.type~ProposalData) + +``` +[Expand All] [Collapse All] + +global record ProposalData record SubconstructionData station: Engine.Component.Station +end + record ConstructionData boundingVolume: Engine.Component.BoundingVolume + subconstructionDatas: {SubconstructionData} + subconstructionDatas_native: Vector +end + record CollisionInfo record EntityData entity: Engine.Entity +end + collisionEntities: {EntityData} + autoRemovalEntity2models: {Engine.Entity : {{integer, integer}}} + buildingEntities: {Engine.Entity} + removableModules: {Engine.Entity} +end + record ErrorState critical: boolean + messages: {string} + warnings: {string} + infos: {string} +end + record ParallelStripProposal toAdd: {Engine.Component.BaseParallelStrip} + toAdd_native: Vector + toRemove: {Engine.Entity} + toRemove_native: Vector +end + collisionInfo: CollisionInfo + old2new: {Engine.Entity : integer} + toAddData: {ConstructionData} + toAddData_native: Vector + parallelProposal: ParallelStripProposal + terrainPreviewHeightModLocations: {Vec3f} + terrainPreviewHeightModCutFill: {Vec2f} + errorState: ErrorState + entity2tn: {Engine.Entity : Engine.Component.TransportNetwork} + tpNetLinkProposal: TpNetLinkProposal + costs: integer +end +``` + +Contains the processed result of a Proposal. + +### ProposalData.SubconstructionData[πŸ”—](#$api.type~ProposalData.SubconstructionData) + +``` +record ProposalData.SubconstructionData station: Engine.Component.Station +end +``` + +### ProposalData.SubconstructionData.station[πŸ”—](#$api.type~ProposalData.SubconstructionData.station) + +``` +ProposalData.SubconstructionData.station: Engine.Component.Station +``` + +### ProposalData.ConstructionData[πŸ”—](#$api.type~ProposalData.ConstructionData) + +``` +record ProposalData.ConstructionData boundingVolume: Engine.Component.BoundingVolume + subconstructionDatas: {SubconstructionData} + subconstructionDatas_native: Vector +end +``` + +### ProposalData.ConstructionData.boundingVolume[πŸ”—](#$api.type~ProposalData.ConstructionData.boundingVolume) + +``` +ProposalData.ConstructionData.boundingVolume: Engine.Component.BoundingVolume +``` + +### ProposalData.ConstructionData.subconstructionDatas[πŸ”—](#$api.type~ProposalData.ConstructionData.subconstructionDatas) + +``` +ProposalData.ConstructionData.subconstructionDatas: {SubconstructionData} +``` + +### ProposalData.ConstructionData.subconstructionDatas\_native[πŸ”—](#$api.type~ProposalData.ConstructionData.subconstructionDatas_native) + +``` +ProposalData.ConstructionData.subconstructionDatas_native: Vector +``` + +### ProposalData.CollisionInfo[πŸ”—](#$api.type~ProposalData.CollisionInfo) + +``` +[Expand All] [Collapse All] + +record ProposalData.CollisionInfo record EntityData entity: Engine.Entity +end + collisionEntities: {EntityData} + autoRemovalEntity2models: {Engine.Entity : {{integer, integer}}} + buildingEntities: {Engine.Entity} + removableModules: {Engine.Entity} +end +``` + +### ProposalData.CollisionInfo.EntityData[πŸ”—](#$api.type~ProposalData.CollisionInfo.EntityData) + +``` +record ProposalData.CollisionInfo.EntityData entity: Engine.Entity +end +``` + +More data about the collision. + +### ProposalData.CollisionInfo.EntityData.entity[πŸ”—](#$api.type~ProposalData.CollisionInfo.EntityData.entity) + +``` +ProposalData.CollisionInfo.EntityData.entity: Engine.Entity +``` + +### ProposalData.CollisionInfo.collisionEntities[πŸ”—](#$api.type~ProposalData.CollisionInfo.collisionEntities) + +``` +ProposalData.CollisionInfo.collisionEntities: {EntityData} +``` + +### ProposalData.CollisionInfo.autoRemovalEntity2models[πŸ”—](#$api.type~ProposalData.CollisionInfo.autoRemovalEntity2models) + +``` +ProposalData.CollisionInfo.autoRemovalEntity2models: {Engine.Entity : {{integer, integer}}} +``` + +### ProposalData.CollisionInfo.buildingEntities[πŸ”—](#$api.type~ProposalData.CollisionInfo.buildingEntities) + +``` +ProposalData.CollisionInfo.buildingEntities: {Engine.Entity} +``` + +### ProposalData.CollisionInfo.removableModules[πŸ”—](#$api.type~ProposalData.CollisionInfo.removableModules) + +``` +ProposalData.CollisionInfo.removableModules: {Engine.Entity} +``` + +### ProposalData.ErrorState[πŸ”—](#$api.type~ProposalData.ErrorState) + +``` +record ProposalData.ErrorState critical: boolean + messages: {string} + warnings: {string} + infos: {string} +end +``` + +Contains error information for a proposal. +Wherever a construction cannot be built for any reason, then the ErrorState will contain +one or more message signaling the error type. + +### ProposalData.ErrorState.critical[πŸ”—](#$api.type~ProposalData.ErrorState.critical) + +``` +ProposalData.ErrorState.critical: boolean +``` + +### ProposalData.ErrorState.messages[πŸ”—](#$api.type~ProposalData.ErrorState.messages) + +``` +ProposalData.ErrorState.messages: {string} +``` + +### ProposalData.ErrorState.warnings[πŸ”—](#$api.type~ProposalData.ErrorState.warnings) + +``` +ProposalData.ErrorState.warnings: {string} +``` + +### ProposalData.ErrorState.infos[πŸ”—](#$api.type~ProposalData.ErrorState.infos) + +``` +ProposalData.ErrorState.infos: {string} +``` + +### ProposalData.ParallelStripProposal[πŸ”—](#$api.type~ProposalData.ParallelStripProposal) + +``` +record ProposalData.ParallelStripProposal toAdd: {Engine.Component.BaseParallelStrip} + toAdd_native: Vector + toRemove: {Engine.Entity} + toRemove_native: Vector +end +``` + +Information about a parallel strip proposal. + +### ProposalData.ParallelStripProposal.toAdd[πŸ”—](#$api.type~ProposalData.ParallelStripProposal.toAdd) + +``` +ProposalData.ParallelStripProposal.toAdd: {Engine.Component.BaseParallelStrip} +``` + +The parallel strips to add + +### ProposalData.ParallelStripProposal.toAdd\_native[πŸ”—](#$api.type~ProposalData.ParallelStripProposal.toAdd_native) + +``` +ProposalData.ParallelStripProposal.toAdd_native: Vector +``` + +The parallel strips to add as native vector + +### ProposalData.ParallelStripProposal.toRemove[πŸ”—](#$api.type~ProposalData.ParallelStripProposal.toRemove) + +``` +ProposalData.ParallelStripProposal.toRemove: {Engine.Entity} +``` + +The parallel strips to remove + +### ProposalData.ParallelStripProposal.toRemove\_native[πŸ”—](#$api.type~ProposalData.ParallelStripProposal.toRemove_native) + +``` +ProposalData.ParallelStripProposal.toRemove_native: Vector +``` + +The parallel strips to remove as native vector + +### ProposalData.collisionInfo[πŸ”—](#$api.type~ProposalData.collisionInfo) + +``` +ProposalData.collisionInfo: CollisionInfo +``` + +### ProposalData.old2new[πŸ”—](#$api.type~ProposalData.old2new) + +``` +ProposalData.old2new: {Engine.Entity : integer} +``` + +### ProposalData.toAddData[πŸ”—](#$api.type~ProposalData.toAddData) + +``` +ProposalData.toAddData: {ConstructionData} +``` + +### ProposalData.toAddData\_native[πŸ”—](#$api.type~ProposalData.toAddData_native) + +``` +ProposalData.toAddData_native: Vector +``` + +### ProposalData.parallelProposal[πŸ”—](#$api.type~ProposalData.parallelProposal) + +``` +ProposalData.parallelProposal: ParallelStripProposal +``` + +### ProposalData.terrainPreviewHeightModLocations[πŸ”—](#$api.type~ProposalData.terrainPreviewHeightModLocations) + +``` +ProposalData.terrainPreviewHeightModLocations: {Vec3f} +``` + +### ProposalData.terrainPreviewHeightModCutFill[πŸ”—](#$api.type~ProposalData.terrainPreviewHeightModCutFill) + +``` +ProposalData.terrainPreviewHeightModCutFill: {Vec2f} +``` + +### ProposalData.errorState[πŸ”—](#$api.type~ProposalData.errorState) + +``` +ProposalData.errorState: ErrorState +``` + +### ProposalData.entity2tn[πŸ”—](#$api.type~ProposalData.entity2tn) + +``` +ProposalData.entity2tn: {Engine.Entity : Engine.Component.TransportNetwork} +``` + +### ProposalData.tpNetLinkProposal[πŸ”—](#$api.type~ProposalData.tpNetLinkProposal) + +``` +ProposalData.tpNetLinkProposal: TpNetLinkProposal +``` + +### ProposalData.costs[πŸ”—](#$api.type~ProposalData.costs) + +``` +ProposalData.costs: integer +``` + +### ProposalEventData[πŸ”—](#$api.type~ProposalEventData) + +``` +global record ProposalEventData proposal: Proposal + data: ProposalData + result: {Engine.Entity} +end +``` + +Event data provided in builder.proposalApply event + +### ProposalEventData.proposal[πŸ”—](#$api.type~ProposalEventData.proposal) + +``` +ProposalEventData.proposal: Proposal +``` + +### ProposalEventData.data[πŸ”—](#$api.type~ProposalEventData.data) + +``` +ProposalEventData.data: ProposalData +``` + +### ProposalEventData.result[πŸ”—](#$api.type~ProposalEventData.result) + +``` +ProposalEventData.result: {Engine.Entity} +``` + +### RailroadCrossingType[πŸ”—](#$api.type~RailroadCrossingType) + +``` +[Expand All] [Collapse All] + +global record RailroadCrossingType description: ModelMetadata.Description + availability: ModelMetadata.Availability + menuCategory: ModelMetadata.MenuCategory + cost: number + speedLimit: number + new: function(): RailroadCrossingType + soundFileName: string + config: {RailroadCrossingType.ConfigEntry} + trafficDelay: number + crossingMaterial: string + categoryList: ModelMetadata.CategoryList + isAutoSelectable: boolean + record ConfigEntry modelLeft: string + modelRight: string + streetWidth: number +end +end +``` + +Specification for railroad crossings + +### RailroadCrossingType.description[πŸ”—](#$api.type~RailroadCrossingType.description) + +``` +RailroadCrossingType.description: ModelMetadata.Description +``` + +Localized strings and icons paths for user interface + +### RailroadCrossingType.availability[πŸ”—](#$api.type~RailroadCrossingType.availability) + +``` +RailroadCrossingType.availability: ModelMetadata.Availability +``` + +Era information for user interface + +### RailroadCrossingType.menuCategory[πŸ”—](#$api.type~RailroadCrossingType.menuCategory) + +``` +RailroadCrossingType.menuCategory: ModelMetadata.MenuCategory +``` + +Configure category, order and filter behaviour in the construction menu + +### RailroadCrossingType.cost[πŸ”—](#$api.type~RailroadCrossingType.cost) + +``` +RailroadCrossingType.cost: number +``` + +Cost per unit length + +### RailroadCrossingType.speedLimit[πŸ”—](#$api.type~RailroadCrossingType.speedLimit) + +``` +RailroadCrossingType.speedLimit: number +``` + +Top speed over the section type, limits top speed of road and tracks + +### RailroadCrossingType.new[πŸ”—](#$api.type~RailroadCrossingType.new) + +``` +function RailroadCrossingType.new(): RailroadCrossingType +``` + +Creates a new RailroadCrossingType object + +**Returns** + +1. `RailroadCrossingType` + +### RailroadCrossingType.soundFileName[πŸ”—](#$api.type~RailroadCrossingType.soundFileName) + +``` +RailroadCrossingType.soundFileName: string +``` + +Sound effect to play when the crossing is closing + +### RailroadCrossingType.config[πŸ”—](#$api.type~RailroadCrossingType.config) + +``` +RailroadCrossingType.config: {RailroadCrossingType.ConfigEntry} +``` + +### RailroadCrossingType.trafficDelay[πŸ”—](#$api.type~RailroadCrossingType.trafficDelay) + +``` +RailroadCrossingType.trafficDelay: number +``` + +### RailroadCrossingType.crossingMaterial[πŸ”—](#$api.type~RailroadCrossingType.crossingMaterial) + +``` +RailroadCrossingType.crossingMaterial: string +``` + +### RailroadCrossingType.categoryList[πŸ”—](#$api.type~RailroadCrossingType.categoryList) + +``` +RailroadCrossingType.categoryList: ModelMetadata.CategoryList +``` + +### RailroadCrossingType.isAutoSelectable[πŸ”—](#$api.type~RailroadCrossingType.isAutoSelectable) + +``` +RailroadCrossingType.isAutoSelectable: boolean +``` + +Allow to be used for auto railroad crossing selection while building roads and tracks, nil defaults to true + +### RailroadCrossingType.ConfigEntry[πŸ”—](#$api.type~RailroadCrossingType.ConfigEntry) + +``` +record RailroadCrossingType.ConfigEntry modelLeft: string + modelRight: string + streetWidth: number +end +``` + +Specification for railroad crossings models + +### RailroadCrossingType.ConfigEntry.modelLeft[πŸ”—](#$api.type~RailroadCrossingType.ConfigEntry.modelLeft) + +``` +RailroadCrossingType.ConfigEntry.modelLeft: string +``` + +### RailroadCrossingType.ConfigEntry.modelRight[πŸ”—](#$api.type~RailroadCrossingType.ConfigEntry.modelRight) + +``` +RailroadCrossingType.ConfigEntry.modelRight: string +``` + +### RailroadCrossingType.ConfigEntry.streetWidth[πŸ”—](#$api.type~RailroadCrossingType.ConfigEntry.streetWidth) + +``` +RailroadCrossingType.ConfigEntry.streetWidth: number +``` + +### ResName[πŸ”—](#$api.type~ResName) + +``` +global type ResName = string +``` + +### RoadType[πŸ”—](#$api.type~RoadType) + +``` +global record RoadType STREET: RoadType + TRACK: RoadType +end +``` + +Road vs Track type. + +### RoadType.STREET[πŸ”—](#$api.type~RoadType.STREET) + +``` +RoadType.STREET: RoadType +``` + +### RoadType.TRACK[πŸ”—](#$api.type~RoadType.TRACK) + +``` +RoadType.TRACK: RoadType +``` + +### Runway[πŸ”—](#$api.type~Runway) + +``` +global record Runway type: RunwayType + nodeId: NodeId + edgeIds: {EdgeId} +end +``` + +Contains runway data + +### Runway.type[πŸ”—](#$api.type~Runway.type) + +``` +Runway.type: RunwayType +``` + +Type of runway (landing or takeoff) + +### Runway.nodeId[πŸ”—](#$api.type~Runway.nodeId) + +``` +Runway.nodeId: NodeId +``` + +Node ID of the runway + +### Runway.edgeIds[πŸ”—](#$api.type~Runway.edgeIds) + +``` +Runway.edgeIds: {EdgeId} +``` + +List of edge IDs that make up the runway + +### RunwayType[πŸ”—](#$api.type~RunwayType) + +``` +global record RunwayType LANDING: RunwayType + TAKEOFF: RunwayType +end +``` + +Runway type enumeration + +### RunwayType.LANDING[πŸ”—](#$api.type~RunwayType.LANDING) + +``` +RunwayType.LANDING: RunwayType +``` + +Landing runway + +### RunwayType.TAKEOFF[πŸ”—](#$api.type~RunwayType.TAKEOFF) + +``` +RunwayType.TAKEOFF: RunwayType +``` + +Takeoff runway + +### SaveGameData[πŸ”—](#$api.type~SaveGameData) + +``` +[Expand All] [Collapse All] + +global record SaveGameData record SaveGameDetails new: function(SaveGameDetails): SaveGameDetails + metadata: GameMetadata + mods: {Mod.ModId} + configDict: {{string, string}} + modParams: {string : {string : integer}} + campaign: string + mission: string +end + new: function(SaveGameData): SaveGameData + errorMsg: string + info: SaveGameDetails +end +``` + +Savegame data with info and error message + +### SaveGameData.SaveGameDetails[πŸ”—](#$api.type~SaveGameData.SaveGameDetails) + +``` +record SaveGameData.SaveGameDetails new: function(SaveGameDetails): SaveGameDetails + metadata: GameMetadata + mods: {Mod.ModId} + configDict: {{string, string}} + modParams: {string : {string : integer}} + campaign: string + mission: string +end +``` + +Detailed information about a savegame + +### SaveGameData.SaveGameDetails.new[πŸ”—](#$api.type~SaveGameData.SaveGameDetails.new) + +``` +function SaveGameData.SaveGameDetails.new(SaveGameDetails): SaveGameDetails +``` + +**Parameters** + +* `SaveGameDetails` + +**Returns** + +1. `SaveGameDetails` + +### SaveGameData.SaveGameDetails.metadata[πŸ”—](#$api.type~SaveGameData.SaveGameDetails.metadata) + +``` +SaveGameData.SaveGameDetails.metadata: GameMetadata +``` + +### SaveGameData.SaveGameDetails.mods[πŸ”—](#$api.type~SaveGameData.SaveGameDetails.mods) + +``` +SaveGameData.SaveGameDetails.mods: {Mod.ModId} +``` + +### SaveGameData.SaveGameDetails.configDict[πŸ”—](#$api.type~SaveGameData.SaveGameDetails.configDict) + +``` +SaveGameData.SaveGameDetails.configDict: {{string, string}} +``` + +### SaveGameData.SaveGameDetails.modParams[πŸ”—](#$api.type~SaveGameData.SaveGameDetails.modParams) + +``` +SaveGameData.SaveGameDetails.modParams: {string : {string : integer}} +``` + +### SaveGameData.SaveGameDetails.campaign[πŸ”—](#$api.type~SaveGameData.SaveGameDetails.campaign) + +``` +SaveGameData.SaveGameDetails.campaign: string +``` + +### SaveGameData.SaveGameDetails.mission[πŸ”—](#$api.type~SaveGameData.SaveGameDetails.mission) + +``` +SaveGameData.SaveGameDetails.mission: string +``` + +### SaveGameData.new[πŸ”—](#$api.type~SaveGameData.new) + +``` +function SaveGameData.new(SaveGameData): SaveGameData +``` + +**Parameters** + +* `SaveGameData` + +**Returns** + +1. `SaveGameData` + +### SaveGameData.errorMsg[πŸ”—](#$api.type~SaveGameData.errorMsg) + +``` +SaveGameData.errorMsg: string +``` + +Error message if loading failed (empty string otherwise) + +### SaveGameData.info[πŸ”—](#$api.type~SaveGameData.info) + +``` +SaveGameData.info: SaveGameDetails +``` + +### SaveGameId[πŸ”—](#$api.type~SaveGameId) + +``` +global record SaveGameId new: function(): SaveGameId + path: string + saveGameName: string + saveGameNamespace: string +end +``` + +Savegame identifier with path and namespace + +### SaveGameId.new[πŸ”—](#$api.type~SaveGameId.new) + +``` +function SaveGameId.new(): SaveGameId +``` + +**Returns** + +1. `SaveGameId` + +### SaveGameId.path[πŸ”—](#$api.type~SaveGameId.path) + +``` +SaveGameId.path: string +``` + +### SaveGameId.saveGameName[πŸ”—](#$api.type~SaveGameId.saveGameName) + +``` +SaveGameId.saveGameName: string +``` + +### SaveGameId.saveGameNamespace[πŸ”—](#$api.type~SaveGameId.saveGameNamespace) + +``` +SaveGameId.saveGameNamespace: string +``` + +### SaveGameInfo[πŸ”—](#$api.type~SaveGameInfo) + +``` +global record SaveGameInfo new: function(): SaveGameInfo + equals: function(SaveGameInfo, SaveGameInfo): boolean + size: integer + timestamp: integer + path: string + modId: ModId + saveName: string +end +``` + +Information about a savegame + +### SaveGameInfo.new[πŸ”—](#$api.type~SaveGameInfo.new) + +``` +function SaveGameInfo.new(): SaveGameInfo +``` + +Creates a new SaveGameInfo. + +**Returns** + +1. `SaveGameInfo` β€” New SaveGameInfo + +### SaveGameInfo.equals[πŸ”—](#$api.type~SaveGameInfo.equals) + +``` +function SaveGameInfo.equals(SaveGameInfo, SaveGameInfo): boolean +``` + +**Parameters** + +* `SaveGameInfo` +* `SaveGameInfo` + +**Returns** + +1. `boolean` + +### SaveGameInfo.size[πŸ”—](#$api.type~SaveGameInfo.size) + +``` +SaveGameInfo.size: integer +``` + +File size in bytes + +### SaveGameInfo.timestamp[πŸ”—](#$api.type~SaveGameInfo.timestamp) + +``` +SaveGameInfo.timestamp: integer +``` + +### SaveGameInfo.path[πŸ”—](#$api.type~SaveGameInfo.path) + +``` +SaveGameInfo.path: string +``` + +### SaveGameInfo.modId[πŸ”—](#$api.type~SaveGameInfo.modId) + +``` +SaveGameInfo.modId: ModId +``` + +ModId of the mod providing this save + +### SaveGameInfo.saveName[πŸ”—](#$api.type~SaveGameInfo.saveName) + +``` +SaveGameInfo.saveName: string +``` + +### SaveGameStorageInfo[πŸ”—](#$api.type~SaveGameStorageInfo) + +``` +global record SaveGameStorageInfo totalSpace: number + usedSpace: number +end +``` + +Information about savegame storage capacity + +### SaveGameStorageInfo.totalSpace[πŸ”—](#$api.type~SaveGameStorageInfo.totalSpace) + +``` +SaveGameStorageInfo.totalSpace: number +``` + +Total storage space available, in bytes + +### SaveGameStorageInfo.usedSpace[πŸ”—](#$api.type~SaveGameStorageInfo.usedSpace) + +``` +SaveGameStorageInfo.usedSpace: number +``` + +Storage space currently used, in bytes + +### SaveGameType[πŸ”—](#$api.type~SaveGameType) + +``` +global record SaveGameType Manual: SaveGameType + Autosave: SaveGameType + Crash: SaveGameType + Exit: SaveGameType +end +``` + +### SaveGameType.Manual[πŸ”—](#$api.type~SaveGameType.Manual) + +``` +SaveGameType.Manual: SaveGameType +``` + +### SaveGameType.Autosave[πŸ”—](#$api.type~SaveGameType.Autosave) + +``` +SaveGameType.Autosave: SaveGameType +``` + +### SaveGameType.Crash[πŸ”—](#$api.type~SaveGameType.Crash) + +``` +SaveGameType.Crash: SaveGameType +``` + +### SaveGameType.Exit[πŸ”—](#$api.type~SaveGameType.Exit) + +``` +SaveGameType.Exit: SaveGameType +``` + +### SavegameScriptMetadata[πŸ”—](#$api.type~SavegameScriptMetadata) + +``` +global record SavegameScriptMetadataend +``` + +Marker for type-safe savegame metadata table + +### ScriptParam[πŸ”—](#$api.type~ScriptParam) + +``` +global record ScriptParam new: function(): ScriptParam + key: string + name: string + group: string + tooltip: string + values: {string} + numbers: {number} + tooltips: {string} + postConstructionModifiable: boolean + hideLabel: boolean + images: {string} + defaultIndex: Index + uiType: ScriptParamType + location: ScriptParamLocation + displayMode: ScriptParamDisplayMode + tags: {string} + yearFrom: integer + yearTo: integer + checkEnabledScript: ScriptRef + stepValueScript: ScriptRef + formatValueScript: ScriptRef +end +``` + +Used to configure the parameter-based UI + +### ScriptParam.new[πŸ”—](#$api.type~ScriptParam.new) + +``` +function ScriptParam.new(): ScriptParam +``` + +**Returns** + +1. `ScriptParam` + +### ScriptParam.key[πŸ”—](#$api.type~ScriptParam.key) + +``` +ScriptParam.key: string +``` + +Unique key that is passed to the construction functions + +### ScriptParam.name[πŸ”—](#$api.type~ScriptParam.name) + +``` +ScriptParam.name: string +``` + +Display name + +### ScriptParam.group[πŸ”—](#$api.type~ScriptParam.group) + +``` +ScriptParam.group: string +``` + +Display Group: +- If hideLabel is true, items will be grouped horizontally +- Else items will be separated by a divider + +### ScriptParam.tooltip[πŸ”—](#$api.type~ScriptParam.tooltip) + +``` +ScriptParam.tooltip: string +``` + +Tooltip to display over certain parameters + +### ScriptParam.values[πŸ”—](#$api.type~ScriptParam.values) + +``` +ScriptParam.values: {string} +``` + +All possible values of the params + +### ScriptParam.numbers[πŸ”—](#$api.type~ScriptParam.numbers) + +``` +ScriptParam.numbers: {number} +``` + +Allow numbers to be used as value + +### ScriptParam.tooltips[πŸ”—](#$api.type~ScriptParam.tooltips) + +``` +ScriptParam.tooltips: {string} +``` + +Allow tooltips to be used as value + +### ScriptParam.postConstructionModifiable[πŸ”—](#$api.type~ScriptParam.postConstructionModifiable) + +``` +ScriptParam.postConstructionModifiable: boolean +``` + +This param can be changed when the construction is already built + +### ScriptParam.hideLabel[πŸ”—](#$api.type~ScriptParam.hideLabel) + +``` +ScriptParam.hideLabel: boolean +``` + +Allow to hide the label + +### ScriptParam.images[πŸ”—](#$api.type~ScriptParam.images) + +``` +ScriptParam.images: {string} +``` + +Image representations of the values (for Compact Mode) + +### ScriptParam.defaultIndex[πŸ”—](#$api.type~ScriptParam.defaultIndex) + +``` +ScriptParam.defaultIndex: Index +``` + +Default index/state + +### ScriptParam.uiType[πŸ”—](#$api.type~ScriptParam.uiType) + +``` +ScriptParam.uiType: ScriptParamType +``` + +Type of ui shown in user interface selection + +### ScriptParam.location[πŸ”—](#$api.type~ScriptParam.location) + +``` +ScriptParam.location: ScriptParamLocation +``` + +construction menu has two possible locations for parameters: default or toolbar (see ScriptParamLocation) + +### ScriptParam.displayMode[πŸ”—](#$api.type~ScriptParam.displayMode) + +``` +ScriptParam.displayMode: ScriptParamDisplayMode +``` + +displayMode controls whether the parameter is displayed in default, compact, or sparse mode (see ScriptParamDisplayMode) + +### ScriptParam.tags[πŸ”—](#$api.type~ScriptParam.tags) + +``` +ScriptParam.tags: {string} +``` + +Tags associated with the script param for filtering + +### ScriptParam.yearFrom[πŸ”—](#$api.type~ScriptParam.yearFrom) + +``` +ScriptParam.yearFrom: integer +``` + +Availability from + +### ScriptParam.yearTo[πŸ”—](#$api.type~ScriptParam.yearTo) + +``` +ScriptParam.yearTo: integer +``` + +Availability to + +### ScriptParam.checkEnabledScript[πŸ”—](#$api.type~ScriptParam.checkEnabledScript) + +``` +ScriptParam.checkEnabledScript: ScriptRef +``` + +callback function to allow dynamic disabling or hiding of the paramter +function(params : {string : number}, scriptRefParams : table) : ConstructionMenuParam.CheckEnabledResult + +### ScriptParam.stepValueScript[πŸ”—](#$api.type~ScriptParam.stepValueScript) + +``` +ScriptParam.stepValueScript: ScriptRef +``` + +callback function to allow returning any value on input actions +function(value : number, direction : integer, precise : boolean) : number + +### ScriptParam.formatValueScript[πŸ”—](#$api.type~ScriptParam.formatValueScript) + +``` +ScriptParam.formatValueScript: ScriptRef +``` + +callback function to allow formatting the value display in the UI +function(value : number) : string + +### ScriptParamDisplayMode[πŸ”—](#$api.type~ScriptParamDisplayMode) + +``` +global record ScriptParamDisplayMode Default: ScriptParamDisplayMode + Compact: ScriptParamDisplayMode + Horizontal: ScriptParamDisplayMode + Vertical: ScriptParamDisplayMode + Sparse: ScriptParamDisplayMode +end +``` + +Controls how the parameter is displayed in the UI + +### ScriptParamDisplayMode.Default[πŸ”—](#$api.type~ScriptParamDisplayMode.Default) + +``` +ScriptParamDisplayMode.Default: ScriptParamDisplayMode +``` + +For BottomBar==on is Horizontal, for BottomBar==off is Sparse + +### ScriptParamDisplayMode.Compact[πŸ”—](#$api.type~ScriptParamDisplayMode.Compact) + +``` +ScriptParamDisplayMode.Compact: ScriptParamDisplayMode +``` + +Value is collapsed, full parameter is shown in a callout + +### ScriptParamDisplayMode.Horizontal[πŸ”—](#$api.type~ScriptParamDisplayMode.Horizontal) + +``` +ScriptParamDisplayMode.Horizontal: ScriptParamDisplayMode +``` + +Value is shown left of value + +### ScriptParamDisplayMode.Vertical[πŸ”—](#$api.type~ScriptParamDisplayMode.Vertical) + +``` +ScriptParamDisplayMode.Vertical: ScriptParamDisplayMode +``` + +Value is shown above value + +### ScriptParamDisplayMode.Sparse[πŸ”—](#$api.type~ScriptParamDisplayMode.Sparse) + +``` +ScriptParamDisplayMode.Sparse: ScriptParamDisplayMode +``` + +Label is shown above the value, and the value might grow to multiple lines + +### ScriptParamLocation[πŸ”—](#$api.type~ScriptParamLocation) + +``` +global record ScriptParamLocation Default: ScriptParamLocation + Toolbar: ScriptParamLocation +end +``` + +Controls bottom bar mode of the parameter + +### ScriptParamLocation.Default[πŸ”—](#$api.type~ScriptParamLocation.Default) + +``` +ScriptParamLocation.Default: ScriptParamLocation +``` + +### ScriptParamLocation.Toolbar[πŸ”—](#$api.type~ScriptParamLocation.Toolbar) + +``` +ScriptParamLocation.Toolbar: ScriptParamLocation +``` + +special location for construction menu parameters, which will be displayed in the tool bar on the left side + +### ScriptParamType[πŸ”—](#$api.type~ScriptParamType) + +``` +global record ScriptParamType Button: ScriptParamType + Slider: ScriptParamType + ComboBox: ScriptParamType + IconButton: ScriptParamType + CheckBox: ScriptParamType +end +``` + +UI Type for displaying the parameter. Used to configure the parameters used for constructions. + +### ScriptParamType.Button[πŸ”—](#$api.type~ScriptParamType.Button) + +``` +ScriptParamType.Button: ScriptParamType +``` + +### ScriptParamType.Slider[πŸ”—](#$api.type~ScriptParamType.Slider) + +``` +ScriptParamType.Slider: ScriptParamType +``` + +### ScriptParamType.ComboBox[πŸ”—](#$api.type~ScriptParamType.ComboBox) + +``` +ScriptParamType.ComboBox: ScriptParamType +``` + +### ScriptParamType.IconButton[πŸ”—](#$api.type~ScriptParamType.IconButton) + +``` +ScriptParamType.IconButton: ScriptParamType +``` + +### ScriptParamType.CheckBox[πŸ”—](#$api.type~ScriptParamType.CheckBox) + +``` +ScriptParamType.CheckBox: ScriptParamType +``` + +### ScriptRef[πŸ”—](#$api.type~ScriptRef) + +``` +global record ScriptRef new: function(): ScriptRef + fileName: string + params: { : } +end +``` + +References a function in a lua script file with ".script" extension. + +### ScriptRef.new[πŸ”—](#$api.type~ScriptRef.new) + +``` +function ScriptRef.new(): ScriptRef +``` + +**Returns** + +1. `ScriptRef` + +### ScriptRef.fileName[πŸ”—](#$api.type~ScriptRef.fileName) + +``` +ScriptRef.fileName: string +``` + +The script path, toghether with the lua path inside the function. + +For example, this is the reference for a Crane flock function: + +"models/model/animal/animal.flock.crane" + + +* the tokens separated by '/' before '.' are taken as part of the the path: "models/model/animal/animal" + +* the tokens after the second '.' represent the lua path (in this case "flock.crane") + +### ScriptRef.params[πŸ”—](#$api.type~ScriptRef.params) + +``` +ScriptRef.params: { : } +``` + +A lua table of closure parameters that will be added at the end of the parameter list when the script is called. + +### Set[πŸ”—](#$api.type~Set) + +``` +global record Set contains: function(Set, T): boolean + insert: function(Set, T): boolean + size: function(Set): integer + asTable: function(Set): {T : boolean} +end +``` + +##### Type Parameters + +* **`T`** + +### Set.contains[πŸ”—](#$api.type~Set.contains) + +``` +function Set.contains(Set, T): boolean +``` + +**Parameters** + +* `Set` +* `T` + +**Returns** + +1. `boolean` + +### Set.insert[πŸ”—](#$api.type~Set.insert) + +``` +function Set.insert(Set, T): boolean +``` + +**Parameters** + +* `Set` +* `T` + +**Returns** + +1. `boolean` + +### Set.size[πŸ”—](#$api.type~Set.size) + +``` +function Set.size(Set): integer +``` + +**Parameters** + +* `Set` + +**Returns** + +1. `integer` + +### Set.asTable[πŸ”—](#$api.type~Set.asTable) + +``` +function Set.asTable(Set): {T : boolean} +``` + +**Parameters** + +* `Set` + +**Returns** + +1. `{T : boolean}` + +### Shape[πŸ”—](#$api.type~Shape) + +``` +global record Shape subShapes: {SubShape} + generator: integer +end +``` + +Contains a procedurally generated shape. + +### Shape.subShapes[πŸ”—](#$api.type~Shape.subShapes) + +``` +Shape.subShapes: {SubShape} +``` + +List of subshapes for the shape. + +### Shape.generator[πŸ”—](#$api.type~Shape.generator) + +``` +Shape.generator: integer +``` + +Procedural generator (index) used to generate the shape. + +### ShipInfo[πŸ”—](#$api.type~ShipInfo) + +``` +global record ShipInfo topSpeed: number + maxTractiveEffort: number + availablePower: number +end +``` + +Movement information for ships + +### ShipInfo.topSpeed[πŸ”—](#$api.type~ShipInfo.topSpeed) + +``` +ShipInfo.topSpeed: number +``` + +Maximum speed (in m/s) + +### ShipInfo.maxTractiveEffort[πŸ”—](#$api.type~ShipInfo.maxTractiveEffort) + +``` +ShipInfo.maxTractiveEffort: number +``` + +### ShipInfo.availablePower[πŸ”—](#$api.type~ShipInfo.availablePower) + +``` +ShipInfo.availablePower: number +``` + +### Signal[πŸ”—](#$api.type~Signal) + +``` +[Expand All] [Collapse All] + +global record Signal record Type SIGNAL: Type + ONE_WAY_SIGNAL: Type + WAYPOINT: Type +end + edgePr: {EdgeId, boolean} + type: Type + state: integer + stateTime: integer +end +``` + +Contains information about a street/track signal + +### Signal.Type[πŸ”—](#$api.type~Signal.Type) + +``` +record Signal.Type SIGNAL: Type + ONE_WAY_SIGNAL: Type + WAYPOINT: Type +end +``` + +Enum containing the type of the signal + +### Signal.Type.SIGNAL[πŸ”—](#$api.type~Signal.Type.SIGNAL) + +``` +Signal.Type.SIGNAL: Type +``` + +Normal signal + +### Signal.Type.ONE\_WAY\_SIGNAL[πŸ”—](#$api.type~Signal.Type.ONE_WAY_SIGNAL) + +``` +Signal.Type.ONE_WAY_SIGNAL: Type +``` + +One-way signal + +### Signal.Type.WAYPOINT[πŸ”—](#$api.type~Signal.Type.WAYPOINT) + +``` +Signal.Type.WAYPOINT: Type +``` + +Waypoint + +### Signal.edgePr[πŸ”—](#$api.type~Signal.edgePr) + +``` +Signal.edgePr: {EdgeId, boolean} +``` + +EdgeId and direction pair + +### Signal.type[πŸ”—](#$api.type~Signal.type) + +``` +Signal.type: Type +``` + +The type of the signal + +### Signal.state[πŸ”—](#$api.type~Signal.state) + +``` +Signal.state: integer +``` + +Current animation playing + +### Signal.stateTime[πŸ”—](#$api.type~Signal.stateTime) + +``` +Signal.stateTime: integer +``` + +Timer for the animation + +### SignalId[πŸ”—](#$api.type~SignalId) + +``` +global record SignalId new: function(): SignalId + + entity: Engine.Entity + index: integer +end +``` + +Identifies a street/track signal + +### SignalId.new()[πŸ”—](#$api.type~SignalId.new()) + +``` +function SignalId.new()(): SignalId +``` + +**Returns** + +1. `SignalId` + +### SignalId.new(SignalId)[πŸ”—](#$api.type~SignalId.new(SignalId)) + +``` +function SignalId.new(SignalId)(SignalId): SignalId +``` + +**Parameters** + +* `SignalId` + +**Returns** + +1. `SignalId` + +### SignalId.entity[πŸ”—](#$api.type~SignalId.entity) + +``` +SignalId.entity: Engine.Entity +``` + +The entity of the SignalList + +### SignalId.index[πŸ”—](#$api.type~SignalId.index) + +``` +SignalId.index: integer +``` + +The zero-based index of the signal inside the signal list + +### SignalType[πŸ”—](#$api.type~SignalType) + +``` +global record SignalType PATH_SIGNAL: SignalType + WAYPOINT: SignalType + ONE_WAY_PATH_SIGNAL: SignalType +end +``` + +Enum containing the type of the signal + +### SignalType.PATH\_SIGNAL[πŸ”—](#$api.type~SignalType.PATH_SIGNAL) + +``` +SignalType.PATH_SIGNAL: SignalType +``` + +### SignalType.WAYPOINT[πŸ”—](#$api.type~SignalType.WAYPOINT) + +``` +SignalType.WAYPOINT: SignalType +``` + +### SignalType.ONE\_WAY\_PATH\_SIGNAL[πŸ”—](#$api.type~SignalType.ONE_WAY_PATH_SIGNAL) + +``` +SignalType.ONE_WAY_PATH_SIGNAL: SignalType +``` + +### SimpleProposal[πŸ”—](#$api.type~SimpleProposal) + +``` +[Expand All] [Collapse All] + +global record SimpleProposal new: function(): SimpleProposal + record ConstructionEntity new: function(): ConstructionEntity + fileName: string + params: { : } + transf: Mat4f + name: string + playerEntity: Engine.Entity + autoFillSlots: boolean +end + constructionsToAdd: {ConstructionEntity} + constructionsToRemove: {Engine.Entity} + old2new: {Engine.Entity : integer} + streetProposal: SimpleStreetProposal +end +``` + +A structure holding information to build/remove and update constructions and streets. +It offers much more functionality than a simple ".con" file. See also `build_street.lua` for an example. +The most important operations that can be performed with a Simple Proposal is adding/removing and modifying +the following objects: constructions (stations, depots, ), (base) edges and (base) nodes, and edgeobjects (signals, +street terminals, waypoints). + +In general, there are a few rules concerning this proposal. First, old entities are reference with the usual non-negative +id, whilst new entities are assigned a decreasing negative number starting at -1. + +The general rule is that the modification/upgrade of a construction entails removing it and adding it +anew. The same rule applies to streets and edgeobjects. + +The proposal will take care of updating lines, stop, people and cargo. + +### SimpleProposal.new[πŸ”—](#$api.type~SimpleProposal.new) + +``` +function SimpleProposal.new(): SimpleProposal +``` + +**Returns** + +1. `SimpleProposal` + +### SimpleProposal.ConstructionEntity[πŸ”—](#$api.type~SimpleProposal.ConstructionEntity) + +``` +record SimpleProposal.ConstructionEntity new: function(): ConstructionEntity + fileName: string + params: { : } + transf: Mat4f + name: string + playerEntity: Engine.Entity + autoFillSlots: boolean +end +``` + +A structure holding information to add construction entities together with a `SimpleProposal`. +It uses the data contained in a ".con" file (or added via `api.res.constructionRep`) to specify a construction. + +### SimpleProposal.ConstructionEntity.new[πŸ”—](#$api.type~SimpleProposal.ConstructionEntity.new) + +``` +function SimpleProposal.ConstructionEntity.new(): ConstructionEntity +``` + +**Returns** + +1. `ConstructionEntity` + +### SimpleProposal.ConstructionEntity.fileName[πŸ”—](#$api.type~SimpleProposal.ConstructionEntity.fileName) + +``` +SimpleProposal.ConstructionEntity.fileName: string +``` + +A fileName (or identifier in the case of dynamic constructions) + +### SimpleProposal.ConstructionEntity.params[πŸ”—](#$api.type~SimpleProposal.ConstructionEntity.params) + +``` +SimpleProposal.ConstructionEntity.params: { : } +``` + +The parameters, as received by the updateFn + +### SimpleProposal.ConstructionEntity.transf[πŸ”—](#$api.type~SimpleProposal.ConstructionEntity.transf) + +``` +SimpleProposal.ConstructionEntity.transf: Mat4f +``` + +The local transformation in the world, used also as local transformation for models and modules + +### SimpleProposal.ConstructionEntity.name[πŸ”—](#$api.type~SimpleProposal.ConstructionEntity.name) + +``` +SimpleProposal.ConstructionEntity.name: string +``` + +A name to give to the final resulting entity + +### SimpleProposal.ConstructionEntity.playerEntity[πŸ”—](#$api.type~SimpleProposal.ConstructionEntity.playerEntity) + +``` +SimpleProposal.ConstructionEntity.playerEntity: Engine.Entity +``` + +The player entity who will own the construction + +### SimpleProposal.ConstructionEntity.autoFillSlots[πŸ”—](#$api.type~SimpleProposal.ConstructionEntity.autoFillSlots) + +``` +SimpleProposal.ConstructionEntity.autoFillSlots: boolean +``` + +If true, the suitable (auto-fillable) construction slots will be automatically filled with modules + +### SimpleProposal.constructionsToAdd[πŸ”—](#$api.type~SimpleProposal.constructionsToAdd) + +``` +SimpleProposal.constructionsToAdd: {ConstructionEntity} +``` + +List of constructions to add (the entity id for constructions in this vector are an decreasing starting from -1) + +### SimpleProposal.constructionsToRemove[πŸ”—](#$api.type~SimpleProposal.constructionsToRemove) + +``` +SimpleProposal.constructionsToRemove: {Engine.Entity} +``` + +List of construction entities to remove + +### SimpleProposal.old2new[πŸ”—](#$api.type~SimpleProposal.old2new) + +``` +SimpleProposal.old2new: {Engine.Entity : integer} +``` + +Mapping from old construction entities to new construction entities (must be an index in constructionsToAdd) + +### SimpleProposal.streetProposal[πŸ”—](#$api.type~SimpleProposal.streetProposal) + +``` +SimpleProposal.streetProposal: SimpleStreetProposal +``` + +Block defining modification and addition of streets + +### SimpleStreetProposal[πŸ”—](#$api.type~SimpleStreetProposal) + +``` +[Expand All] [Collapse All] + +global record SimpleStreetProposal record EdgeObject new: function(): EdgeObject + edgeEntity: Engine.Entity + param: number + oneWay: boolean + left: boolean + model: ResName + playerEntity: Engine.Entity + name: string +end + new: function(): SimpleStreetProposal + nodesToAdd: {Proposal.NodeAndEntity} + edgesToAdd: {Proposal.SegmentAndEntity} + nodesToRemove: {Engine.Entity} + edgesToRemove: {Engine.Entity} + edgeObjectsToAdd: {EdgeObject} + edgeObjectsToRemove: {Engine.Entity} + nodeConfigsToAdd: {Proposal.BaseNodeLaneConnectionAndEntity} + nodeConfigsToRemove: {Engine.Entity} + node2rcType: {Engine.Entity : integer} +end +``` + +A structure holding information to add street and track entities together with a SimpleProposal. +A street proposal can add, remove and modify street, tracks, nodes and edge objects. To modify a street, you +need to remove all appropriate entities and add them with the correct information. + +### SimpleStreetProposal.EdgeObject[πŸ”—](#$api.type~SimpleStreetProposal.EdgeObject) + +``` +record SimpleStreetProposal.EdgeObject new: function(): EdgeObject + edgeEntity: Engine.Entity + param: number + oneWay: boolean + left: boolean + model: ResName + playerEntity: Engine.Entity + name: string +end +``` + +A structure that holds information about new edgeobjects added to the streets + +### SimpleStreetProposal.EdgeObject.new[πŸ”—](#$api.type~SimpleStreetProposal.EdgeObject.new) + +``` +function SimpleStreetProposal.EdgeObject.new(): EdgeObject +``` + +Creates a new EdgeObject object + +**Returns** + +1. `EdgeObject` + +### SimpleStreetProposal.EdgeObject.edgeEntity[πŸ”—](#$api.type~SimpleStreetProposal.EdgeObject.edgeEntity) + +``` +SimpleStreetProposal.EdgeObject.edgeEntity: Engine.Entity +``` + +Edge entity (must be a new edge in edgesToAdd, starting from -1 and decreasing) + +### SimpleStreetProposal.EdgeObject.param[πŸ”—](#$api.type~SimpleStreetProposal.EdgeObject.param) + +``` +SimpleStreetProposal.EdgeObject.param: number +``` + +Position between 0.0 and 1.0 within said edge + +### SimpleStreetProposal.EdgeObject.oneWay[πŸ”—](#$api.type~SimpleStreetProposal.EdgeObject.oneWay) + +``` +SimpleStreetProposal.EdgeObject.oneWay: boolean +``` + +Flag specifying if one way or not + +### SimpleStreetProposal.EdgeObject.left[πŸ”—](#$api.type~SimpleStreetProposal.EdgeObject.left) + +``` +SimpleStreetProposal.EdgeObject.left: boolean +``` + +Flag specifying the side of the road + +### SimpleStreetProposal.EdgeObject.model[πŸ”—](#$api.type~SimpleStreetProposal.EdgeObject.model) + +``` +SimpleStreetProposal.EdgeObject.model: ResName +``` + +Model id of the edge object + +### SimpleStreetProposal.EdgeObject.playerEntity[πŸ”—](#$api.type~SimpleStreetProposal.EdgeObject.playerEntity) + +``` +SimpleStreetProposal.EdgeObject.playerEntity: Engine.Entity +``` + +Owner of the object + +### SimpleStreetProposal.EdgeObject.name[πŸ”—](#$api.type~SimpleStreetProposal.EdgeObject.name) + +``` +SimpleStreetProposal.EdgeObject.name: string +``` + +Name to give the object + +### SimpleStreetProposal.new[πŸ”—](#$api.type~SimpleStreetProposal.new) + +``` +function SimpleStreetProposal.new(): SimpleStreetProposal +``` + +**Returns** + +1. `SimpleStreetProposal` + +### SimpleStreetProposal.nodesToAdd[πŸ”—](#$api.type~SimpleStreetProposal.nodesToAdd) + +``` +SimpleStreetProposal.nodesToAdd: {Proposal.NodeAndEntity} +``` + +List of base nodes to add (entity id will be decreasing starting from -1 for all new entities) + +### SimpleStreetProposal.edgesToAdd[πŸ”—](#$api.type~SimpleStreetProposal.edgesToAdd) + +``` +SimpleStreetProposal.edgesToAdd: {Proposal.SegmentAndEntity} +``` + +List of base edges to add (includes edge object reference which must match the content of `edgeObjectsToRemove`) + +### SimpleStreetProposal.nodesToRemove[πŸ”—](#$api.type~SimpleStreetProposal.nodesToRemove) + +``` +SimpleStreetProposal.nodesToRemove: {Engine.Entity} +``` + +List of entities with component BaseNode to remove + +### SimpleStreetProposal.edgesToRemove[πŸ”—](#$api.type~SimpleStreetProposal.edgesToRemove) + +``` +SimpleStreetProposal.edgesToRemove: {Engine.Entity} +``` + +List of entities with component BaseEdge to remove + +### SimpleStreetProposal.edgeObjectsToAdd[πŸ”—](#$api.type~SimpleStreetProposal.edgeObjectsToAdd) + +``` +SimpleStreetProposal.edgeObjectsToAdd: {EdgeObject} +``` + +List of EdgeObject to add (must be compatible with `edgesToAdd`) + +### SimpleStreetProposal.edgeObjectsToRemove[πŸ”—](#$api.type~SimpleStreetProposal.edgeObjectsToRemove) + +``` +SimpleStreetProposal.edgeObjectsToRemove: {Engine.Entity} +``` + +List of entities to be removed + +### SimpleStreetProposal.nodeConfigsToAdd[πŸ”—](#$api.type~SimpleStreetProposal.nodeConfigsToAdd) + +``` +SimpleStreetProposal.nodeConfigsToAdd: {Proposal.BaseNodeLaneConnectionAndEntity} +``` + +List of node configurations to add + +### SimpleStreetProposal.nodeConfigsToRemove[πŸ”—](#$api.type~SimpleStreetProposal.nodeConfigsToRemove) + +``` +SimpleStreetProposal.nodeConfigsToRemove: {Engine.Entity} +``` + +List of node configuration entities to remove + +### SimpleStreetProposal.node2rcType[πŸ”—](#$api.type~SimpleStreetProposal.node2rcType) + +``` +SimpleStreetProposal.node2rcType: {Engine.Entity : integer} +``` + +A map from node to railroad crossing type index + +### Slot[πŸ”—](#$api.type~Slot) + +``` +global record Slot autoFill: boolean + id: integer + type: string + transf: Mat4f + spacing: Vec4f + height: number + shape: integer + alignToTerrain: boolean + replaceable: boolean +end +``` + +Modular construction slot + +### Slot.autoFill[πŸ”—](#$api.type~Slot.autoFill) + +``` +Slot.autoFill: boolean +``` + +Autofill slots are used by field construction to add satellites automatically when the construction spawns + +### Slot.id[πŸ”—](#$api.type~Slot.id) + +``` +Slot.id: integer +``` + +Unique identifier for the slot, can also be used to reconstruct the coordinates of the slot when encoded as specific pattern + +### Slot.type[πŸ”—](#$api.type~Slot.type) + +``` +Slot.type: string +``` + +Type of the slot: only modules of the same type can be built on this slot + +### Slot.transf[πŸ”—](#$api.type~Slot.transf) + +``` +Slot.transf: Mat4f +``` + +Transformation relative to the construction origin + +### Slot.spacing[πŸ”—](#$api.type~Slot.spacing) + +``` +Slot.spacing: Vec4f +``` + +Extent of the slot relative to it's origin, (x, y) are the distances to the left, resp. right, and (z, w) are the distances +to the south and north part (when seen from above) + +### Slot.height[πŸ”—](#$api.type~Slot.height) + +``` +Slot.height: number +``` + +Height of the slot for collision purposes + +### Slot.shape[πŸ”—](#$api.type~Slot.shape) + +``` +Slot.shape: integer +``` + +Shape of the module snap point visualization, 0 = square, 1 = triangle, 2 = rectangle + +### Slot.alignToTerrain[πŸ”—](#$api.type~Slot.alignToTerrain) + +``` +Slot.alignToTerrain: boolean +``` + +Slots with this flag will be moved vertically to macht the height of the terrain (used e.g. for fields) + +### Slot.replaceable[πŸ”—](#$api.type~Slot.replaceable) + +``` +Slot.replaceable: boolean +``` + +Modules in slots with this flag can be replaced by other modules of the same type without bulldozing first + +### SlotConfig[πŸ”—](#$api.type~SlotConfig) + +``` +global record SlotConfig maxModules: integer + message: string + skipCollisionCheck: boolean +end +``` + +Slot configuration can specify additional properties for slots of a given type + +### SlotConfig.maxModules[πŸ”—](#$api.type~SlotConfig.maxModules) + +``` +SlotConfig.maxModules: integer +``` + +Max number of modules of this type that might be built + +### SlotConfig.message[πŸ”—](#$api.type~SlotConfig.message) + +``` +SlotConfig.message: string +``` + +Message for when this limit is reached + +### SlotConfig.skipCollisionCheck[πŸ”—](#$api.type~SlotConfig.skipCollisionCheck) + +``` +SlotConfig.skipCollisionCheck: boolean +``` + +Slots with this flag will not collide with other objects, but only the slot itself, the final construction +still has to pass the usual collision checks + +### SoundAttributes[πŸ”—](#$api.type~SoundAttributes) + +``` +global record SoundAttributes gain: number + refDist: number + rolloffFact: number + hasVelocity: boolean +end +``` + +SoundClip attributes + +### SoundAttributes.gain[πŸ”—](#$api.type~SoundAttributes.gain) + +``` +SoundAttributes.gain: number +``` + +### SoundAttributes.refDist[πŸ”—](#$api.type~SoundAttributes.refDist) + +``` +SoundAttributes.refDist: number +``` + +### SoundAttributes.rolloffFact[πŸ”—](#$api.type~SoundAttributes.rolloffFact) + +``` +SoundAttributes.rolloffFact: number +``` + +### SoundAttributes.hasVelocity[πŸ”—](#$api.type~SoundAttributes.hasVelocity) + +``` +SoundAttributes.hasVelocity: boolean +``` + +### SoundClip[πŸ”—](#$api.type~SoundClip) + +``` +global record SoundClip name: string + attrs: SoundAttributes +end +``` + +SoundClip for SoundSet, BuilderAudioSet, ... + +### SoundClip.name[πŸ”—](#$api.type~SoundClip.name) + +``` +SoundClip.name: string +``` + +### SoundClip.attrs[πŸ”—](#$api.type~SoundClip.attrs) + +``` +SoundClip.attrs: SoundAttributes +``` + +### SoundClipList[πŸ”—](#$api.type~SoundClipList) + +``` +global record SoundClipList names: {string} + attrs: SoundAttributes +end +``` + +SoundClipList for SoundSet + +### SoundClipList.names[πŸ”—](#$api.type~SoundClipList.names) + +``` +SoundClipList.names: {string} +``` + +### SoundClipList.attrs[πŸ”—](#$api.type~SoundClipList.attrs) + +``` +SoundClipList.attrs: SoundAttributes +``` + +### SoundSet[πŸ”—](#$api.type~SoundSet) + +``` +global record SoundSet tracks: {SoundClip} + events: {string : SoundClipList} + updateScript: ScriptRef + attrs: SoundAttributes +end +``` + +Configure sound effects for entities + +### SoundSet.tracks[πŸ”—](#$api.type~SoundSet.tracks) + +``` +SoundSet.tracks: {SoundClip} +``` + +### SoundSet.events[πŸ”—](#$api.type~SoundSet.events) + +``` +SoundSet.events: {string : SoundClipList} +``` + +### SoundSet.updateScript[πŸ”—](#$api.type~SoundSet.updateScript) + +``` +SoundSet.updateScript: ScriptRef +``` + +### SoundSet.attrs[πŸ”—](#$api.type~SoundSet.attrs) + +``` +SoundSet.attrs: SoundAttributes +``` + +### StartGameParams[πŸ”—](#$api.type~StartGameParams) + +``` +global record StartGameParams new: function(): StartGameParams + numTiles: Vec2i + climateGenerator: string + terrainGenerator: string + economy: string + mods: {string} + modParams: {string : {string : integer}} + seed: string + startDate: Date + startTimeOfDaySeconds: integer + startCloudCoverage: number + isMapEditor: boolean + generateTowns: boolean + generateIndustries: boolean + generateAssets: boolean + locationsConfig: BaseConfig.Locations +end +``` + +Parameters for starting a new game + +### StartGameParams.new[πŸ”—](#$api.type~StartGameParams.new) + +``` +function StartGameParams.new(): StartGameParams +``` + +Constructor + +**Returns** + +1. `StartGameParams` + +### StartGameParams.numTiles[πŸ”—](#$api.type~StartGameParams.numTiles) + +``` +StartGameParams.numTiles: Vec2i +``` + +Map size in tiles + +### StartGameParams.climateGenerator[πŸ”—](#$api.type~StartGameParams.climateGenerator) + +``` +StartGameParams.climateGenerator: string +``` + +Climate generator script resource name + +### StartGameParams.terrainGenerator[πŸ”—](#$api.type~StartGameParams.terrainGenerator) + +``` +StartGameParams.terrainGenerator: string +``` + +Terrain generator script resource name + +### StartGameParams.economy[πŸ”—](#$api.type~StartGameParams.economy) + +``` +StartGameParams.economy: string +``` + +Economy difficulty script resource name + +### StartGameParams.mods[πŸ”—](#$api.type~StartGameParams.mods) + +``` +StartGameParams.mods: {string} +``` + +List of mod identifiers to load + +### StartGameParams.modParams[πŸ”—](#$api.type~StartGameParams.modParams) + +``` +StartGameParams.modParams: {string : {string : integer}} +``` + +List of mod parameters + +### StartGameParams.seed[πŸ”—](#$api.type~StartGameParams.seed) + +``` +StartGameParams.seed: string +``` + +Random seed for map generation + +### StartGameParams.startDate[πŸ”—](#$api.type~StartGameParams.startDate) + +``` +StartGameParams.startDate: Date +``` + +Starting date for the game + +### StartGameParams.startTimeOfDaySeconds[πŸ”—](#$api.type~StartGameParams.startTimeOfDaySeconds) + +``` +StartGameParams.startTimeOfDaySeconds: integer +``` + +Starting time in seconds of the time + +### StartGameParams.startCloudCoverage[πŸ”—](#$api.type~StartGameParams.startCloudCoverage) + +``` +StartGameParams.startCloudCoverage: number +``` + +Starting cloud coverage + +### StartGameParams.isMapEditor[πŸ”—](#$api.type~StartGameParams.isMapEditor) + +``` +StartGameParams.isMapEditor: boolean +``` + +Whether to start the game in map editor mode + +### StartGameParams.generateTowns[πŸ”—](#$api.type~StartGameParams.generateTowns) + +``` +StartGameParams.generateTowns: boolean +``` + +Whether to generate towns + +### StartGameParams.generateIndustries[πŸ”—](#$api.type~StartGameParams.generateIndustries) + +``` +StartGameParams.generateIndustries: boolean +``` + +Whether to generate industries + +### StartGameParams.generateAssets[πŸ”—](#$api.type~StartGameParams.generateAssets) + +``` +StartGameParams.generateAssets: boolean +``` + +Whether to generate assets + +### StartGameParams.locationsConfig[πŸ”—](#$api.type~StartGameParams.locationsConfig) + +``` +StartGameParams.locationsConfig: BaseConfig.Locations +``` + +Configuration for the placement of industry and towns on max generation + +### StaticConstructionTemplate[πŸ”—](#$api.type~StaticConstructionTemplate) + +``` +global record StaticConstructionTemplate initialModules: {ResName : integer} +end +``` + +Static construction template configuration + +### StaticConstructionTemplate.initialModules[πŸ”—](#$api.type~StaticConstructionTemplate.initialModules) + +``` +StaticConstructionTemplate.initialModules: {ResName : integer} +``` + +### Station[πŸ”—](#$api.type~Station) + +``` +[Expand All] [Collapse All] + +global record Station record Pool new: function(): Pool + edges: {EdgeId} + capacity: integer +end + new: function(): Station + tag: integer + terminals: {Terminal} + catchmentAreas: {CatchmentArea} + pool: Pool +end +``` + +Data for a Station + +### Station.Pool[πŸ”—](#$api.type~Station.Pool) + +``` +record Station.Pool new: function(): Pool + edges: {EdgeId} + capacity: integer +end +``` + +Defines a common pool in a station for overflowing terminal capacities + +### Station.Pool.new[πŸ”—](#$api.type~Station.Pool.new) + +``` +function Station.Pool.new(): Pool +``` + +**Returns** + +1. `Pool` + +### Station.Pool.edges[πŸ”—](#$api.type~Station.Pool.edges) + +``` +Station.Pool.edges: {EdgeId} +``` + +the list of edges of the shared waiting area + +### Station.Pool.capacity[πŸ”—](#$api.type~Station.Pool.capacity) + +``` +Station.Pool.capacity: integer +``` + +the size of the shared pool + +### Station.new[πŸ”—](#$api.type~Station.new) + +``` +function Station.new(): Station +``` + +**Returns** + +1. `Station` + +### Station.tag[πŸ”—](#$api.type~Station.tag) + +``` +Station.tag: integer +``` + +A tag for identifying station between upgrades + +### Station.terminals[πŸ”—](#$api.type~Station.terminals) + +``` +Station.terminals: {Terminal} +``` + +### Station.catchmentAreas[πŸ”—](#$api.type~Station.catchmentAreas) + +``` +Station.catchmentAreas: {CatchmentArea} +``` + +### Station.pool[πŸ”—](#$api.type~Station.pool) + +``` +Station.pool: Pool +``` + +### StationTerminal[πŸ”—](#$api.type~StationTerminal) + +``` +global record StationTerminal new: function(): StationTerminal + + station: integer + terminal: integer +end +``` + +Identifies a Terminal inside a StationGroup + +### StationTerminal.new()[πŸ”—](#$api.type~StationTerminal.new()) + +``` +function StationTerminal.new()(): StationTerminal +``` + +Constructor: creates empty terminal reference + +**Returns** + +1. `StationTerminal` + +### StationTerminal.new(StationTerminal)[πŸ”—](#$api.type~StationTerminal.new(StationTerminal)) + +``` +function StationTerminal.new(StationTerminal)(StationTerminal): StationTerminal +``` + +Copy constructor + +**Parameters** + +* `StationTerminal` + +**Returns** + +1. `StationTerminal` + +### StationTerminal.new(integer, integer)[πŸ”—](#$api.type~StationTerminal.new(integer, integer)) + +``` +function StationTerminal.new(integer, integer)(station : integer, terminal : integer): StationTerminal +``` + +Constructor with station and terminal indices + +**Parameters** + +* `station` :`integer` β€” The zero-based station index in the StationGroup +* `terminal` :`integer` β€” The zero-based terminal index in the Station + +**Returns** + +1. `StationTerminal` + +### StationTerminal.station[πŸ”—](#$api.type~StationTerminal.station) + +``` +StationTerminal.station: integer +``` + +The zero-based station index in the StationGroup + +### StationTerminal.terminal[πŸ”—](#$api.type~StationTerminal.terminal) + +``` +StationTerminal.terminal: integer +``` + +The zero-based terminal index in the Station + +### StockId[πŸ”—](#$api.type~StockId) + +``` +global type StockId = integer +``` + +### StockListType[πŸ”—](#$api.type~StockListType) + +``` +global record StockListType InputStock: StockListType + OutputStock: StockListType + StorageStock: StockListType +end +``` + +Defines the stock list type + +### StockListType.InputStock[πŸ”—](#$api.type~StockListType.InputStock) + +``` +StockListType.InputStock: StockListType +``` + +### StockListType.OutputStock[πŸ”—](#$api.type~StockListType.OutputStock) + +``` +StockListType.OutputStock: StockListType +``` + +### StockListType.StorageStock[πŸ”—](#$api.type~StockListType.StorageStock) + +``` +StockListType.StorageStock: StockListType +``` + +### StopState[πŸ”—](#$api.type~StopState) + +``` +global record StopState empty: boolean + noPath: boolean + noPathFromAlternative: boolean + noPathToAlternative: boolean + duplicateStop: boolean + incompatibleStop: boolean + noPathLocation: boolean +end +``` + +Information about the problem state of a stop within a line. + +### StopState.empty[πŸ”—](#$api.type~StopState.empty) + +``` +StopState.empty: boolean +``` + +Stop is empty / valid + +### StopState.noPath[πŸ”—](#$api.type~StopState.noPath) + +``` +StopState.noPath: boolean +``` + +No path between stops + +### StopState.noPathFromAlternative[πŸ”—](#$api.type~StopState.noPathFromAlternative) + +``` +StopState.noPathFromAlternative: boolean +``` + +No path from an alternative stop + +### StopState.noPathToAlternative[πŸ”—](#$api.type~StopState.noPathToAlternative) + +``` +StopState.noPathToAlternative: boolean +``` + +No path to an alternative stop + +### StopState.duplicateStop[πŸ”—](#$api.type~StopState.duplicateStop) + +``` +StopState.duplicateStop: boolean +``` + +Stop is a duplicate + +### StopState.incompatibleStop[πŸ”—](#$api.type~StopState.incompatibleStop) + +``` +StopState.incompatibleStop: boolean +``` + +Stop is incompatible with the line's transport mode + +### StopState.noPathLocation[πŸ”—](#$api.type~StopState.noPathLocation) + +``` +StopState.noPathLocation: boolean +``` + +No path for a location stop + +### StreetGenerationMode[πŸ”—](#$api.type~StreetGenerationMode) + +``` +global record StreetGenerationMode new: function(): StreetGenerationMode +end +``` + +Map generation mode for street generation + +### StreetGenerationMode.new[πŸ”—](#$api.type~StreetGenerationMode.new) + +``` +function StreetGenerationMode.new(): StreetGenerationMode +``` + +**Returns** + +1. `StreetGenerationMode` + +### StreetStyle[πŸ”—](#$api.type~StreetStyle) + +``` +global record StreetStyle categoryList: ModelMetadata.CategoryList + trackStraightModel: {string, string, string, string} +end +``` + +Specifies the look and feel of streets and tracks + +### StreetStyle.categoryList[πŸ”—](#$api.type~StreetStyle.categoryList) + +``` +StreetStyle.categoryList: ModelMetadata.CategoryList +``` + +### StreetStyle.trackStraightModel[πŸ”—](#$api.type~StreetStyle.trackStraightModel) + +``` +StreetStyle.trackStraightModel: {string, string, string, string} +``` + +Models used for stright sections of tracks + +### StreetTemplate[πŸ”—](#$api.type~StreetTemplate) + +``` +[Expand All] [Collapse All] + +global record StreetTemplate new: function(string): StreetTemplate + roadType: RoadType + description: ModelMetadata.Description + availability: ModelMetadata.Availability + simBuildable: boolean + initiallyLocked: boolean + country: boolean + laneConfigs: {LaneConfig} + transportModesStreet: {TransportMode} + modifiers: Modifiers + cost: integer + maintenanceCost: integer + fillGroundTex: ResName + sidewalkFillGroundTex: ResName + borderGroundTex: ResName + streetStyle: ResName + defaultEdgeDecorations: {{ResName, boolean}} + defaultWithCrosswalk: boolean + embankmentSlopeLow: number + embankmentSlopeHigh: number + maxSlope: number + maxSlopeShape: number + priority: integer + busAndTramRight: boolean + pedestrianWalkPenalty: number + speedCoeffs: {number} + minCurveRadius: number + minCurveRadiusBuild: number + trackDistance: number + maxSlopeBuild: number + slopeBuildSteps: number + menuCategory: ModelMetadata.MenuCategory + record Emissions noise: number + pollution: number + radius: number +end + emissions: Emissions + catenaryAdd: ResName + catenaryRemove: ResName + builderAudioRes: ResName +end +``` + +Specification for street templates which define simulation relevant quantities like lanes, costs and transport modes + +### StreetTemplate.new[πŸ”—](#$api.type~StreetTemplate.new) + +``` +function StreetTemplate.new(string): StreetTemplate +``` + +Creates a new object of StreetTemplate type + +**Parameters** + +* `string` + +**Returns** + +1. `StreetTemplate` + +### StreetTemplate.roadType[πŸ”—](#$api.type~StreetTemplate.roadType) + +``` +StreetTemplate.roadType: RoadType +``` + +Localized display name + +### StreetTemplate.description[πŸ”—](#$api.type~StreetTemplate.description) + +``` +StreetTemplate.description: ModelMetadata.Description +``` + +Localized strings and icons paths for user interface + +### StreetTemplate.availability[πŸ”—](#$api.type~StreetTemplate.availability) + +``` +StreetTemplate.availability: ModelMetadata.Availability +``` + +Availability from/to year for UI and simulation + +### StreetTemplate.simBuildable[πŸ”—](#$api.type~StreetTemplate.simBuildable) + +``` +StreetTemplate.simBuildable: boolean +``` + +if this template can be used by town developer / industry connections at all. + +### StreetTemplate.initiallyLocked[πŸ”—](#$api.type~StreetTemplate.initiallyLocked) + +``` +StreetTemplate.initiallyLocked: boolean +``` + +Initial value for the locking tool when built by the player + +### StreetTemplate.country[πŸ”—](#$api.type~StreetTemplate.country) + +``` +StreetTemplate.country: boolean +``` + +Whether to consider a country or town road, this affects simulation and UI behaviour in various ways + +### StreetTemplate.laneConfigs[πŸ”—](#$api.type~StreetTemplate.laneConfigs) + +``` +StreetTemplate.laneConfigs: {LaneConfig} +``` + +List of lanes with configuration, from left to right in the build direction + +### StreetTemplate.transportModesStreet[πŸ”—](#$api.type~StreetTemplate.transportModesStreet) + +``` +StreetTemplate.transportModesStreet: {TransportMode} +``` + +Transport network types applied to vehicle lanes + +### StreetTemplate.modifiers[πŸ”—](#$api.type~StreetTemplate.modifiers) + +``` +StreetTemplate.modifiers: Modifiers +``` + +Modifiers applied to vehicles on the road + +### StreetTemplate.cost[πŸ”—](#$api.type~StreetTemplate.cost) + +``` +StreetTemplate.cost: integer +``` + +Cost in unit-length + +### StreetTemplate.maintenanceCost[πŸ”—](#$api.type~StreetTemplate.maintenanceCost) + +``` +StreetTemplate.maintenanceCost: integer +``` + +Maintenance cost in unit-length + +### StreetTemplate.fillGroundTex[πŸ”—](#$api.type~StreetTemplate.fillGroundTex) + +``` +StreetTemplate.fillGroundTex: ResName +``` + +Ground texture applied to the interior of the road + +### StreetTemplate.sidewalkFillGroundTex[πŸ”—](#$api.type~StreetTemplate.sidewalkFillGroundTex) + +``` +StreetTemplate.sidewalkFillGroundTex: ResName +``` + +Ground texture applied under sidewalks + +### StreetTemplate.borderGroundTex[πŸ”—](#$api.type~StreetTemplate.borderGroundTex) + +``` +StreetTemplate.borderGroundTex: ResName +``` + +Ground texture applied at the edges of the road + +### StreetTemplate.streetStyle[πŸ”—](#$api.type~StreetTemplate.streetStyle) + +``` +StreetTemplate.streetStyle: ResName +``` + +Default street style deciding look and feel of the road/track + +### StreetTemplate.defaultEdgeDecorations[πŸ”—](#$api.type~StreetTemplate.defaultEdgeDecorations) + +``` +StreetTemplate.defaultEdgeDecorations: {{ResName, boolean}} +``` + +Default edge decorations when newly built + +### StreetTemplate.defaultWithCrosswalk[πŸ”—](#$api.type~StreetTemplate.defaultWithCrosswalk) + +``` +StreetTemplate.defaultWithCrosswalk: boolean +``` + +Whether to create crosswalks when the street is built + +### StreetTemplate.embankmentSlopeLow[πŸ”—](#$api.type~StreetTemplate.embankmentSlopeLow) + +``` +StreetTemplate.embankmentSlopeLow: number +``` + +Terrain alignment embankment from below + +### StreetTemplate.embankmentSlopeHigh[πŸ”—](#$api.type~StreetTemplate.embankmentSlopeHigh) + +``` +StreetTemplate.embankmentSlopeHigh: number +``` + +Terrain alignment embankment from above + +### StreetTemplate.maxSlope[πŸ”—](#$api.type~StreetTemplate.maxSlope) + +``` +StreetTemplate.maxSlope: number +``` + +Max slope of the road the user can select + +### StreetTemplate.maxSlopeShape[πŸ”—](#$api.type~StreetTemplate.maxSlopeShape) + +``` +StreetTemplate.maxSlopeShape: number +``` + +Max slope for the resulting street + +### StreetTemplate.priority[πŸ”—](#$api.type~StreetTemplate.priority) + +``` +StreetTemplate.priority: integer +``` + +Priority for applying the street style at crossings + +### StreetTemplate.busAndTramRight[πŸ”—](#$api.type~StreetTemplate.busAndTramRight) + +``` +StreetTemplate.busAndTramRight: boolean +``` + +Whether bus and tram lanes are by default on the rightmost lane + +### StreetTemplate.pedestrianWalkPenalty[πŸ”—](#$api.type~StreetTemplate.pedestrianWalkPenalty) + +``` +StreetTemplate.pedestrianWalkPenalty: number +``` + +Pathfinding walk penalty when pedestran walk on sidewalk edges + +### StreetTemplate.speedCoeffs[πŸ”—](#$api.type~StreetTemplate.speedCoeffs) + +``` +StreetTemplate.speedCoeffs: {number} +``` + +Max speed based on three different curvatures of the street + +### StreetTemplate.minCurveRadius[πŸ”—](#$api.type~StreetTemplate.minCurveRadius) + +``` +StreetTemplate.minCurveRadius: number +``` + +Minimal radius of the finial proposal + +### StreetTemplate.minCurveRadiusBuild[πŸ”—](#$api.type~StreetTemplate.minCurveRadiusBuild) + +``` +StreetTemplate.minCurveRadiusBuild: number +``` + +Minimal radius buildable by the player + +### StreetTemplate.trackDistance[πŸ”—](#$api.type~StreetTemplate.trackDistance) + +``` +StreetTemplate.trackDistance: number +``` + +Distance between track centers + +### StreetTemplate.maxSlopeBuild[πŸ”—](#$api.type~StreetTemplate.maxSlopeBuild) + +``` +StreetTemplate.maxSlopeBuild: number +``` + +Max slope when built by the player + +### StreetTemplate.slopeBuildSteps[πŸ”—](#$api.type~StreetTemplate.slopeBuildSteps) + +``` +StreetTemplate.slopeBuildSteps: number +``` + +How fine grained the selection of the slope will be + +### StreetTemplate.menuCategory[πŸ”—](#$api.type~StreetTemplate.menuCategory) + +``` +StreetTemplate.menuCategory: ModelMetadata.MenuCategory +``` + +Configure category, order and filter behaviour in the construction menu + +### StreetTemplate.Emissions[πŸ”—](#$api.type~StreetTemplate.Emissions) + +``` +record StreetTemplate.Emissions noise: number + pollution: number + radius: number +end +``` + +### StreetTemplate.Emissions.noise[πŸ”—](#$api.type~StreetTemplate.Emissions.noise) + +``` +StreetTemplate.Emissions.noise: number +``` + +### StreetTemplate.Emissions.pollution[πŸ”—](#$api.type~StreetTemplate.Emissions.pollution) + +``` +StreetTemplate.Emissions.pollution: number +``` + +### StreetTemplate.Emissions.radius[πŸ”—](#$api.type~StreetTemplate.Emissions.radius) + +``` +StreetTemplate.Emissions.radius: number +``` + +### StreetTemplate.emissions[πŸ”—](#$api.type~StreetTemplate.emissions) + +``` +StreetTemplate.emissions: Emissions +``` + +Static nosie and pollution emitter for each road segment + +### StreetTemplate.catenaryAdd[πŸ”—](#$api.type~StreetTemplate.catenaryAdd) + +``` +StreetTemplate.catenaryAdd: ResName +``` + +The street template to use to replace this street template when adding catenary + +### StreetTemplate.catenaryRemove[πŸ”—](#$api.type~StreetTemplate.catenaryRemove) + +``` +StreetTemplate.catenaryRemove: ResName +``` + +The street template to use to replace this street template when removing catenary + +### StreetTemplate.builderAudioRes[πŸ”—](#$api.type~StreetTemplate.builderAudioRes) + +``` +StreetTemplate.builderAudioRes: ResName +``` + +### SubShape[πŸ”—](#$api.type~SubShape) + +``` +global record SubShape faces: {{Vec3f}} + startRule: integer + height0: number + height1: number +end +``` + +Contains a procedurally generated sub-shape. + +### SubShape.faces[πŸ”—](#$api.type~SubShape.faces) + +``` +SubShape.faces: {{Vec3f}} +``` + +### SubShape.startRule[πŸ”—](#$api.type~SubShape.startRule) + +``` +SubShape.startRule: integer +``` + +### SubShape.height0[πŸ”—](#$api.type~SubShape.height0) + +``` +SubShape.height0: number +``` + +Min height for collision purposes. + +### SubShape.height1[πŸ”—](#$api.type~SubShape.height1) + +``` +SubShape.height1: number +``` + +Max height for collision purposes. + +### SubconstructionInstanceMetadata[πŸ”—](#$api.type~SubconstructionInstanceMetadata) + +``` +global record SubconstructionInstanceMetadataend +``` + +### TargetData[πŸ”—](#$api.type~TargetData) + +``` +global record TargetData entries: {TargetDataEntry} + edges: {EdgePos} +end +``` + +Information about target destinations + +### TargetData.entries[πŸ”—](#$api.type~TargetData.entries) + +``` +TargetData.entries: {TargetDataEntry} +``` + +### TargetData.edges[πŸ”—](#$api.type~TargetData.edges) + +``` +TargetData.edges: {EdgePos} +``` + +### TargetDataEntry[πŸ”—](#$api.type~TargetDataEntry) + +``` +global record TargetDataEntry entity: Engine.Entity + freeCapacity: integer + capacity: integer + edgeWalk: {integer, integer} + edgeDrive: {integer, integer} + isIndustry: boolean +end +``` + +Target data for land use types + +### TargetDataEntry.entity[πŸ”—](#$api.type~TargetDataEntry.entity) + +``` +TargetDataEntry.entity: Engine.Entity +``` + +### TargetDataEntry.freeCapacity[πŸ”—](#$api.type~TargetDataEntry.freeCapacity) + +``` +TargetDataEntry.freeCapacity: integer +``` + +### TargetDataEntry.capacity[πŸ”—](#$api.type~TargetDataEntry.capacity) + +``` +TargetDataEntry.capacity: integer +``` + +### TargetDataEntry.edgeWalk[πŸ”—](#$api.type~TargetDataEntry.edgeWalk) + +``` +TargetDataEntry.edgeWalk: {integer, integer} +``` + +### TargetDataEntry.edgeDrive[πŸ”—](#$api.type~TargetDataEntry.edgeDrive) + +``` +TargetDataEntry.edgeDrive: {integer, integer} +``` + +### TargetDataEntry.isIndustry[πŸ”—](#$api.type~TargetDataEntry.isIndustry) + +``` +TargetDataEntry.isIndustry: boolean +``` + +### TargetsByLandUse[πŸ”—](#$api.type~TargetsByLandUse) + +``` +global record TargetsByLandUse targets: {TargetData, TargetData} +end +``` + +Target destinations organized by land use type + +### TargetsByLandUse.targets[πŸ”—](#$api.type~TargetsByLandUse.targets) + +``` +TargetsByLandUse.targets: {TargetData, TargetData} +``` + +### Terminal[πŸ”—](#$api.type~Terminal) + +``` +[Expand All] [Collapse All] + +global record Terminal vehicleNodeId: NodeId + personNodes: {NodeId} + personEdges: {EdgeId} + vehicleEdges: {EdgePos} + tag: integer + cargoLoad: boolean + passengersLoad: boolean + cargoUnload: boolean + passengersUnload: boolean + transportModes: {TransportMode : boolean} + record TerminalCargoTransferSpeed cargoTypeSet: CargoTypeSet + loadSpeedModifier: number + length: number +end + cargoTransferSpeeds: {TerminalCargoTransferSpeed} + comfortFactor: number + capacity: integer + terminalAssignmentWeight: number +end +``` + +Data for a Station terminal. + +### Terminal.vehicleNodeId[πŸ”—](#$api.type~Terminal.vehicleNodeId) + +``` +Terminal.vehicleNodeId: NodeId +``` + +The position (node) where the vehicle will attempt to stop + +### Terminal.personNodes[πŸ”—](#$api.type~Terminal.personNodes) + +``` +Terminal.personNodes: {NodeId} +``` + +List of all nodes for the person/cargo wait area + +### Terminal.personEdges[πŸ”—](#$api.type~Terminal.personEdges) + +``` +Terminal.personEdges: {EdgeId} +``` + +List of all edges for the person/cargo wait area + +### Terminal.vehicleEdges[πŸ”—](#$api.type~Terminal.vehicleEdges) + +``` +Terminal.vehicleEdges: {EdgePos} +``` + +list of all edges for the vehicle to stop + +### Terminal.tag[πŸ”—](#$api.type~Terminal.tag) + +``` +Terminal.tag: integer +``` + +Identifying tag + +### Terminal.cargoLoad[πŸ”—](#$api.type~Terminal.cargoLoad) + +``` +Terminal.cargoLoad: boolean +``` + +Whether this terminal can handle cargo + +### Terminal.passengersLoad[πŸ”—](#$api.type~Terminal.passengersLoad) + +``` +Terminal.passengersLoad: boolean +``` + +Whether this terminal can handle passengers + +### Terminal.cargoUnload[πŸ”—](#$api.type~Terminal.cargoUnload) + +``` +Terminal.cargoUnload: boolean +``` + +Whether this terminal can handle cargo + +### Terminal.passengersUnload[πŸ”—](#$api.type~Terminal.passengersUnload) + +``` +Terminal.passengersUnload: boolean +``` + +Whether this terminal can handle passengers + +### Terminal.transportModes[πŸ”—](#$api.type~Terminal.transportModes) + +``` +Terminal.transportModes: {TransportMode : boolean} +``` + +### Terminal.TerminalCargoTransferSpeed[πŸ”—](#$api.type~Terminal.TerminalCargoTransferSpeed) + +``` +record Terminal.TerminalCargoTransferSpeed cargoTypeSet: CargoTypeSet + loadSpeedModifier: number + length: number +end +``` + +Information about terminal cargo transfer speeds + +### Terminal.TerminalCargoTransferSpeed.cargoTypeSet[πŸ”—](#$api.type~Terminal.TerminalCargoTransferSpeed.cargoTypeSet) + +``` +Terminal.TerminalCargoTransferSpeed.cargoTypeSet: CargoTypeSet +``` + +Set of cargo types this setting applies to + +### Terminal.TerminalCargoTransferSpeed.loadSpeedModifier[πŸ”—](#$api.type~Terminal.TerminalCargoTransferSpeed.loadSpeedModifier) + +``` +Terminal.TerminalCargoTransferSpeed.loadSpeedModifier: number +``` + +Speed modifier for loading cargo + +### Terminal.TerminalCargoTransferSpeed.length[πŸ”—](#$api.type~Terminal.TerminalCargoTransferSpeed.length) + +``` +Terminal.TerminalCargoTransferSpeed.length: number +``` + +Length of the terminal section + +### Terminal.cargoTransferSpeeds[πŸ”—](#$api.type~Terminal.cargoTransferSpeeds) + +``` +Terminal.cargoTransferSpeeds: {TerminalCargoTransferSpeed} +``` + +List of cargo transfer speed configurations + +### Terminal.comfortFactor[πŸ”—](#$api.type~Terminal.comfortFactor) + +``` +Terminal.comfortFactor: number +``` + +Control happiness decrease speed for waiting passengers + +### Terminal.capacity[πŸ”—](#$api.type~Terminal.capacity) + +``` +Terminal.capacity: integer +``` + +How many people can fit the specific terminal + +### Terminal.terminalAssignmentWeight[πŸ”—](#$api.type~Terminal.terminalAssignmentWeight) + +``` +Terminal.terminalAssignmentWeight: number +``` + +Weighting for the automatic terminal assignment of lines, lower means less important + +### TerrainAlignment[πŸ”—](#$api.type~TerrainAlignment) + +``` +global record TerrainAlignment triangles: {{Vec3f, Vec3f, Vec3f}} + weights: {{number, number, number}} + type: TerrainAlignmentType + bbox: Box2f +end +``` + +Terrain alignment configuration + +### TerrainAlignment.triangles[πŸ”—](#$api.type~TerrainAlignment.triangles) + +``` +TerrainAlignment.triangles: {{Vec3f, Vec3f, Vec3f}} +``` + +### TerrainAlignment.weights[πŸ”—](#$api.type~TerrainAlignment.weights) + +``` +TerrainAlignment.weights: {{number, number, number}} +``` + +### TerrainAlignment.type[πŸ”—](#$api.type~TerrainAlignment.type) + +``` +TerrainAlignment.type: TerrainAlignmentType +``` + +### TerrainAlignment.bbox[πŸ”—](#$api.type~TerrainAlignment.bbox) + +``` +TerrainAlignment.bbox: Box2f +``` + +### TerrainAlignmentType[πŸ”—](#$api.type~TerrainAlignmentType) + +``` +global record TerrainAlignmentType EQUAL: TerrainAlignmentType + LESS: TerrainAlignmentType + GREATER: TerrainAlignmentType +end +``` + +Terrain alignment type enumeration + +### TerrainAlignmentType.EQUAL[πŸ”—](#$api.type~TerrainAlignmentType.EQUAL) + +``` +TerrainAlignmentType.EQUAL: TerrainAlignmentType +``` + +### TerrainAlignmentType.LESS[πŸ”—](#$api.type~TerrainAlignmentType.LESS) + +``` +TerrainAlignmentType.LESS: TerrainAlignmentType +``` + +### TerrainAlignmentType.GREATER[πŸ”—](#$api.type~TerrainAlignmentType.GREATER) + +``` +TerrainAlignmentType.GREATER: TerrainAlignmentType +``` + +### TerrainGeneratorDesc[πŸ”—](#$api.type~TerrainGeneratorDesc) + +``` +global record TerrainGeneratorDesc new: function(): TerrainGeneratorDesc + desc: ModelMetadata.Description + order: integer + editorOnly: boolean + visible: boolean + climate: string + nodeTree: string + params: {ScriptParam} +end +``` + +Contains all data relevant for the heightmap generation + +### TerrainGeneratorDesc.new[πŸ”—](#$api.type~TerrainGeneratorDesc.new) + +``` +function TerrainGeneratorDesc.new(): TerrainGeneratorDesc +``` + +**Returns** + +1. `TerrainGeneratorDesc` + +### TerrainGeneratorDesc.desc[πŸ”—](#$api.type~TerrainGeneratorDesc.desc) + +``` +TerrainGeneratorDesc.desc: ModelMetadata.Description +``` + +Localized strings and icons paths for user interface + +### TerrainGeneratorDesc.order[πŸ”—](#$api.type~TerrainGeneratorDesc.order) + +``` +TerrainGeneratorDesc.order: integer +``` + +### TerrainGeneratorDesc.editorOnly[πŸ”—](#$api.type~TerrainGeneratorDesc.editorOnly) + +``` +TerrainGeneratorDesc.editorOnly: boolean +``` + +Only selectable in editor + +### TerrainGeneratorDesc.visible[πŸ”—](#$api.type~TerrainGeneratorDesc.visible) + +``` +TerrainGeneratorDesc.visible: boolean +``` + +Invisible (will never be a choice) + +### TerrainGeneratorDesc.climate[πŸ”—](#$api.type~TerrainGeneratorDesc.climate) + +``` +TerrainGeneratorDesc.climate: string +``` + +Climate resource name to which the generator belongs to + +### TerrainGeneratorDesc.nodeTree[πŸ”—](#$api.type~TerrainGeneratorDesc.nodeTree) + +``` +TerrainGeneratorDesc.nodeTree: string +``` + +Resource name for the tree generator associated to this terrain generator + +### TerrainGeneratorDesc.params[πŸ”—](#$api.type~TerrainGeneratorDesc.params) + +``` +TerrainGeneratorDesc.params: {ScriptParam} +``` + +Script parameters (passed as input to tree node generator) + +### TerrainMaterialType[πŸ”—](#$api.type~TerrainMaterialType) + +``` +global record TerrainMaterialType new: function(): TerrainMaterialType + + name: string + desc: string + icon: ResName + previewIcon: ResName + categories: {string} + detailColorTexture: string + detailMetalGlossAoHTexture: string + detailNormalTexture: string + overlayTexture: string + detailSize: number + overlaySize: number + overlayStrength: number + hScale: number + order: integer + menuCategory: ModelMetadata.MenuCategory + priority: integer + grass: ResName + categoryList: ModelMetadata.CategoryList +end +``` + +Specification for terrain material types + +### TerrainMaterialType.new()[πŸ”—](#$api.type~TerrainMaterialType.new()) + +``` +function TerrainMaterialType.new()(): TerrainMaterialType +``` + +**Returns** + +1. `TerrainMaterialType` + +### TerrainMaterialType.new(TerrainMaterialType)[πŸ”—](#$api.type~TerrainMaterialType.new(TerrainMaterialType)) + +``` +function TerrainMaterialType.new(TerrainMaterialType)(TerrainMaterialType): TerrainMaterialType +``` + +**Parameters** + +* `TerrainMaterialType` + +**Returns** + +1. `TerrainMaterialType` + +### TerrainMaterialType.name[πŸ”—](#$api.type~TerrainMaterialType.name) + +``` +TerrainMaterialType.name: string +``` + +### TerrainMaterialType.desc[πŸ”—](#$api.type~TerrainMaterialType.desc) + +``` +TerrainMaterialType.desc: string +``` + +### TerrainMaterialType.icon[πŸ”—](#$api.type~TerrainMaterialType.icon) + +``` +TerrainMaterialType.icon: ResName +``` + +### TerrainMaterialType.previewIcon[πŸ”—](#$api.type~TerrainMaterialType.previewIcon) + +``` +TerrainMaterialType.previewIcon: ResName +``` + +### TerrainMaterialType.categories[πŸ”—](#$api.type~TerrainMaterialType.categories) + +``` +TerrainMaterialType.categories: {string} +``` + +### TerrainMaterialType.detailColorTexture[πŸ”—](#$api.type~TerrainMaterialType.detailColorTexture) + +``` +TerrainMaterialType.detailColorTexture: string +``` + +### TerrainMaterialType.detailMetalGlossAoHTexture[πŸ”—](#$api.type~TerrainMaterialType.detailMetalGlossAoHTexture) + +``` +TerrainMaterialType.detailMetalGlossAoHTexture: string +``` + +### TerrainMaterialType.detailNormalTexture[πŸ”—](#$api.type~TerrainMaterialType.detailNormalTexture) + +``` +TerrainMaterialType.detailNormalTexture: string +``` + +### TerrainMaterialType.overlayTexture[πŸ”—](#$api.type~TerrainMaterialType.overlayTexture) + +``` +TerrainMaterialType.overlayTexture: string +``` + +### TerrainMaterialType.detailSize[πŸ”—](#$api.type~TerrainMaterialType.detailSize) + +``` +TerrainMaterialType.detailSize: number +``` + +### TerrainMaterialType.overlaySize[πŸ”—](#$api.type~TerrainMaterialType.overlaySize) + +``` +TerrainMaterialType.overlaySize: number +``` + +### TerrainMaterialType.overlayStrength[πŸ”—](#$api.type~TerrainMaterialType.overlayStrength) + +``` +TerrainMaterialType.overlayStrength: number +``` + +### TerrainMaterialType.hScale[πŸ”—](#$api.type~TerrainMaterialType.hScale) + +``` +TerrainMaterialType.hScale: number +``` + +### TerrainMaterialType.order[πŸ”—](#$api.type~TerrainMaterialType.order) + +``` +TerrainMaterialType.order: integer +``` + +### TerrainMaterialType.menuCategory[πŸ”—](#$api.type~TerrainMaterialType.menuCategory) + +``` +TerrainMaterialType.menuCategory: ModelMetadata.MenuCategory +``` + +### TerrainMaterialType.priority[πŸ”—](#$api.type~TerrainMaterialType.priority) + +``` +TerrainMaterialType.priority: integer +``` + +### TerrainMaterialType.grass[πŸ”—](#$api.type~TerrainMaterialType.grass) + +``` +TerrainMaterialType.grass: ResName +``` + +### TerrainMaterialType.categoryList[πŸ”—](#$api.type~TerrainMaterialType.categoryList) + +``` +TerrainMaterialType.categoryList: ModelMetadata.CategoryList +``` + +### ThinModelInstance[πŸ”—](#$api.type~ThinModelInstance) + +``` +global record ThinModelInstance modelId: integer + pos: Vec3f + rot: number + scale: number +end +``` + +A model in the world, with very light information + +### ThinModelInstance.modelId[πŸ”—](#$api.type~ThinModelInstance.modelId) + +``` +ThinModelInstance.modelId: integer +``` + +The model id, referenced in modelRep + +### ThinModelInstance.pos[πŸ”—](#$api.type~ThinModelInstance.pos) + +``` +ThinModelInstance.pos: Vec3f +``` + +The position in the world + +### ThinModelInstance.rot[πŸ”—](#$api.type~ThinModelInstance.rot) + +``` +ThinModelInstance.rot: number +``` + +The rotation angle (in radians) + +### ThinModelInstance.scale[πŸ”—](#$api.type~ThinModelInstance.scale) + +``` +ThinModelInstance.scale: number +``` + +The scale in all directions + +### TownBuildingParams[πŸ”—](#$api.type~TownBuildingParams) + +``` +global record TownBuildingParams landUseType: LandUseType + level: integer + parcelSize: Vec2i +end +``` + +Town building parameters + +### TownBuildingParams.landUseType[πŸ”—](#$api.type~TownBuildingParams.landUseType) + +``` +TownBuildingParams.landUseType: LandUseType +``` + +One of residential, commercial or industrial + +### TownBuildingParams.level[πŸ”—](#$api.type~TownBuildingParams.level) + +``` +TownBuildingParams.level: integer +``` + +Level, which is directly related to capacity and size of the building + +### TownBuildingParams.parcelSize[πŸ”—](#$api.type~TownBuildingParams.parcelSize) + +``` +TownBuildingParams.parcelSize: Vec2i +``` + +(x, y) dimension in parcel cells for the building + +### TownIndustryGenerationMode[πŸ”—](#$api.type~TownIndustryGenerationMode) + +``` +global record TownIndustryGenerationMode new: function(): TownIndustryGenerationMode + numTownsToAdd: integer + addIndustries: boolean + showExistingTowns: boolean + showExistingIndustries: boolean + keepExistingTowns: boolean + keepExistingIndustries: boolean +end +``` + +Map generation mode for adding towns and industries + +### TownIndustryGenerationMode.new[πŸ”—](#$api.type~TownIndustryGenerationMode.new) + +``` +function TownIndustryGenerationMode.new(): TownIndustryGenerationMode +``` + +**Returns** + +1. `TownIndustryGenerationMode` + +### TownIndustryGenerationMode.numTownsToAdd[πŸ”—](#$api.type~TownIndustryGenerationMode.numTownsToAdd) + +``` +TownIndustryGenerationMode.numTownsToAdd: integer +``` + +Number of towns to add + +### TownIndustryGenerationMode.addIndustries[πŸ”—](#$api.type~TownIndustryGenerationMode.addIndustries) + +``` +TownIndustryGenerationMode.addIndustries: boolean +``` + +if industries should be added + +### TownIndustryGenerationMode.showExistingTowns[πŸ”—](#$api.type~TownIndustryGenerationMode.showExistingTowns) + +``` +TownIndustryGenerationMode.showExistingTowns: boolean +``` + +Whether to show existing towns + +### TownIndustryGenerationMode.showExistingIndustries[πŸ”—](#$api.type~TownIndustryGenerationMode.showExistingIndustries) + +``` +TownIndustryGenerationMode.showExistingIndustries: boolean +``` + +Whether to show existing industries + +### TownIndustryGenerationMode.keepExistingTowns[πŸ”—](#$api.type~TownIndustryGenerationMode.keepExistingTowns) + +``` +TownIndustryGenerationMode.keepExistingTowns: boolean +``` + +Whether to preserve existing towns when generating new towns + +### TownIndustryGenerationMode.keepExistingIndustries[πŸ”—](#$api.type~TownIndustryGenerationMode.keepExistingIndustries) + +``` +TownIndustryGenerationMode.keepExistingIndustries: boolean +``` + +Whether to preserve existing industries when generating new industries + +### TownInfo[πŸ”—](#$api.type~TownInfo) + +``` +global record TownInfo name: string + position: Vec2f + initialLandUseCapacities: {integer} + landUse2CargoNeedsCategories: {LandUseType : {string}} + majorStreetAngle: number + initialMajorStreetAngle: number + capacityScalingFactor: number +end +``` + +Extended town information for map generation + +### TownInfo.name[πŸ”—](#$api.type~TownInfo.name) + +``` +TownInfo.name: string +``` + +Name of the town + +### TownInfo.position[πŸ”—](#$api.type~TownInfo.position) + +``` +TownInfo.position: Vec2f +``` + +World position of the town + +### TownInfo.initialLandUseCapacities[πŸ”—](#$api.type~TownInfo.initialLandUseCapacities) + +``` +TownInfo.initialLandUseCapacities: {integer} +``` + +Initial size for residential, commercial, industrial zones + +### TownInfo.landUse2CargoNeedsCategories[πŸ”—](#$api.type~TownInfo.landUse2CargoNeedsCategories) + +``` +TownInfo.landUse2CargoNeedsCategories: {LandUseType : {string}} +``` + +Cargo needs for residential, commercial, industrial zones + +### TownInfo.majorStreetAngle[πŸ”—](#$api.type~TownInfo.majorStreetAngle) + +``` +TownInfo.majorStreetAngle: number +``` + +Major street angle + +### TownInfo.initialMajorStreetAngle[πŸ”—](#$api.type~TownInfo.initialMajorStreetAngle) + +``` +TownInfo.initialMajorStreetAngle: number +``` + +Initial major street angle + +### TownInfo.capacityScalingFactor[πŸ”—](#$api.type~TownInfo.capacityScalingFactor) + +``` +TownInfo.capacityScalingFactor: number +``` + +Capacity scaling factor + +### TownProblem[πŸ”—](#$api.type~TownProblem) + +``` +global record TownProblem Disconnected: TownProblem + Overlength: TownProblem +end +``` + +Town connection problem. + +### TownProblem.Disconnected[πŸ”—](#$api.type~TownProblem.Disconnected) + +``` +TownProblem.Disconnected: TownProblem +``` + +### TownProblem.Overlength[πŸ”—](#$api.type~TownProblem.Overlength) + +``` +TownProblem.Overlength: TownProblem +``` + +### TownResult[πŸ”—](#$api.type~TownResult) + +``` +global record TownResult toRemove: {Engine.Entity} + toAdd: {TownInfo} +end +``` + +Results of town generation operations + +### TownResult.toRemove[πŸ”—](#$api.type~TownResult.toRemove) + +``` +TownResult.toRemove: {Engine.Entity} +``` + +### TownResult.toAdd[πŸ”—](#$api.type~TownResult.toAdd) + +``` +TownResult.toAdd: {TownInfo} +``` + +### TpNetData[πŸ”—](#$api.type~TpNetData) + +``` +[Expand All] [Collapse All] + +global record TpNetData record NodeData record Port edgeId: EdgeId + transitions: {integer} +end + ports: {Port} +end + record EdgeData ports: {PortId, PortId} + equidistParams: {number} +end + getNodeData: function(TpNetData, NodeId): NodeData + getEdgeData: function(TpNetData, EdgeId): EdgeData +end +``` + +Contains additional data about the transport network + +### TpNetData.NodeData[πŸ”—](#$api.type~TpNetData.NodeData) + +``` +[Expand All] [Collapse All] + +record TpNetData.NodeData record Port edgeId: EdgeId + transitions: {integer} +end + ports: {Port} +end +``` + +Data attached to a transport network node. + +### TpNetData.NodeData.Port[πŸ”—](#$api.type~TpNetData.NodeData.Port) + +``` +record TpNetData.NodeData.Port edgeId: EdgeId + transitions: {integer} +end +``` + +An individual port on a NodeData + +### TpNetData.NodeData.Port.edgeId[πŸ”—](#$api.type~TpNetData.NodeData.Port.edgeId) + +``` +TpNetData.NodeData.Port.edgeId: EdgeId +``` + +The edge ID this port connects to + +### TpNetData.NodeData.Port.transitions[πŸ”—](#$api.type~TpNetData.NodeData.Port.transitions) + +``` +TpNetData.NodeData.Port.transitions: {integer} +``` + +The indices of the ports this port can transition to + +### TpNetData.NodeData.ports[πŸ”—](#$api.type~TpNetData.NodeData.ports) + +``` +TpNetData.NodeData.ports: {Port} +``` + +The list of ports on this node + +### TpNetData.EdgeData[πŸ”—](#$api.type~TpNetData.EdgeData) + +``` +record TpNetData.EdgeData ports: {PortId, PortId} + equidistParams: {number} +end +``` + +Data attached to a transport network edge. + +### TpNetData.EdgeData.ports[πŸ”—](#$api.type~TpNetData.EdgeData.ports) + +``` +TpNetData.EdgeData.ports: {PortId, PortId} +``` + +The ports at both ends of the edge + +### TpNetData.EdgeData.equidistParams[πŸ”—](#$api.type~TpNetData.EdgeData.equidistParams) + +``` +TpNetData.EdgeData.equidistParams: {number} +``` + +The equidistant parameter samples along the edge + +### TpNetData.getNodeData[πŸ”—](#$api.type~TpNetData.getNodeData) + +``` +function TpNetData.getNodeData(TpNetData, NodeId): NodeData +``` + +Get node data for a specific node + +**Parameters** + +* `TpNetData` +* `NodeId` + +**Returns** + +1. `NodeData` + +### TpNetData.getEdgeData[πŸ”—](#$api.type~TpNetData.getEdgeData) + +``` +function TpNetData.getEdgeData(TpNetData, EdgeId): EdgeData +``` + +Get edge data for a specific edge + +**Parameters** + +* `TpNetData` +* `EdgeId` + +**Returns** + +1. `EdgeData` + +### TpNetLinkProposal[πŸ”—](#$api.type~TpNetLinkProposal) + +``` +[Expand All] [Collapse All] + +global record TpNetLinkProposal record Data link: {EdgePos, EdgePos} +end + toRemove: {Data} + toAdd: {Data} +end +``` + +Contains the processed result with all edge links. + +### TpNetLinkProposal.Data[πŸ”—](#$api.type~TpNetLinkProposal.Data) + +``` +record TpNetLinkProposal.Data link: {EdgePos, EdgePos} +end +``` + +An individual link entry in a TpNetLinkProposal + +### TpNetLinkProposal.Data.link[πŸ”—](#$api.type~TpNetLinkProposal.Data.link) + +``` +TpNetLinkProposal.Data.link: {EdgePos, EdgePos} +``` + +The EdgePos pair making up the link + +### TpNetLinkProposal.toRemove[πŸ”—](#$api.type~TpNetLinkProposal.toRemove) + +``` +TpNetLinkProposal.toRemove: {Data} +``` + +Links to remove + +### TpNetLinkProposal.toAdd[πŸ”—](#$api.type~TpNetLinkProposal.toAdd) + +``` +TpNetLinkProposal.toAdd: {Data} +``` + +Links to add + +### TrafficLightData[πŸ”—](#$api.type~TrafficLightData) + +``` +global record TrafficLightData state2lockedLanes: {{integer}} + state2redLightModelIndices: {{integer}} + state2duration: {number} + animatedModels: {integer} +end +``` + +Additional traffic light data for a base node + +### TrafficLightData.state2lockedLanes[πŸ”—](#$api.type~TrafficLightData.state2lockedLanes) + +``` +TrafficLightData.state2lockedLanes: {{integer}} +``` + +### TrafficLightData.state2redLightModelIndices[πŸ”—](#$api.type~TrafficLightData.state2redLightModelIndices) + +``` +TrafficLightData.state2redLightModelIndices: {{integer}} +``` + +### TrafficLightData.state2duration[πŸ”—](#$api.type~TrafficLightData.state2duration) + +``` +TrafficLightData.state2duration: {number} +``` + +### TrafficLightData.animatedModels[πŸ”—](#$api.type~TrafficLightData.animatedModels) + +``` +TrafficLightData.animatedModels: {integer} +``` + +### TrafficLightPreference[πŸ”—](#$api.type~TrafficLightPreference) + +``` +global record TrafficLightPreference YES: TrafficLightPreference + NO: TrafficLightPreference + AUTO: TrafficLightPreference +end +``` + +TrafficLightPreference: controls whether a node/edge has a traffic light. + +### TrafficLightPreference.YES[πŸ”—](#$api.type~TrafficLightPreference.YES) + +``` +TrafficLightPreference.YES: TrafficLightPreference +``` + +### TrafficLightPreference.NO[πŸ”—](#$api.type~TrafficLightPreference.NO) + +``` +TrafficLightPreference.NO: TrafficLightPreference +``` + +### TrafficLightPreference.AUTO[πŸ”—](#$api.type~TrafficLightPreference.AUTO) + +``` +TrafficLightPreference.AUTO: TrafficLightPreference +``` + +### TrafficLightType[πŸ”—](#$api.type~TrafficLightType) + +``` +global record TrafficLightType availability: ModelMetadata.Availability + description: ModelMetadata.Description + cost: number + categoryList: ModelMetadata.CategoryList + menuCategory: ModelMetadata.MenuCategory + tryOpposite: boolean + modelScript: ScriptRef + relativePath: string +end +``` + +Specification for traffic lights + +### TrafficLightType.availability[πŸ”—](#$api.type~TrafficLightType.availability) + +``` +TrafficLightType.availability: ModelMetadata.Availability +``` + +Configures year availability of the traffic light (for AI and player building it) + +### TrafficLightType.description[πŸ”—](#$api.type~TrafficLightType.description) + +``` +TrafficLightType.description: ModelMetadata.Description +``` + +Localized strings and icons paths for user interface + +### TrafficLightType.cost[πŸ”—](#$api.type~TrafficLightType.cost) + +``` +TrafficLightType.cost: number +``` + +Cost per unit when built + +### TrafficLightType.categoryList[πŸ”—](#$api.type~TrafficLightType.categoryList) + +``` +TrafficLightType.categoryList: ModelMetadata.CategoryList +``` + +Tags for content selection and filtering + +### TrafficLightType.menuCategory[πŸ”—](#$api.type~TrafficLightType.menuCategory) + +``` +TrafficLightType.menuCategory: ModelMetadata.MenuCategory +``` + +Configure category, order and filter behaviour in the construction menu + +### TrafficLightType.tryOpposite[πŸ”—](#$api.type~TrafficLightType.tryOpposite) + +``` +TrafficLightType.tryOpposite: boolean +``` + +Whether to build North American style on the opposide side of the intersection if possible + +### TrafficLightType.modelScript[πŸ”—](#$api.type~TrafficLightType.modelScript) + +``` +TrafficLightType.modelScript: ScriptRef +``` + +A script controlling the actual placement of models on the intersection + +### TrafficLightType.relativePath[πŸ”—](#$api.type~TrafficLightType.relativePath) + +``` +TrafficLightType.relativePath: string +``` + +Deprecated + +### TramTrackType[πŸ”—](#$api.type~TramTrackType) + +``` +global record TramTrackType NO: TramTrackType + YES: TramTrackType + ELECTRIC: TramTrackType +end +``` + +Defines the type of a tram track. + +### TramTrackType.NO[πŸ”—](#$api.type~TramTrackType.NO) + +``` +TramTrackType.NO: TramTrackType +``` + +### TramTrackType.YES[πŸ”—](#$api.type~TramTrackType.YES) + +``` +TramTrackType.YES: TramTrackType +``` + +### TramTrackType.ELECTRIC[πŸ”—](#$api.type~TramTrackType.ELECTRIC) + +``` +TramTrackType.ELECTRIC: TramTrackType +``` + +### TransportMode[πŸ”—](#$api.type~TransportMode) + +``` +global record TransportMode PERSON: TransportMode + CARGO: TransportMode + CAR: TransportMode + BUS: TransportMode + TRUCK: TransportMode + TRAM: TransportMode + ELECTRIC_TRAM: TransportMode + TRAIN: TransportMode + ELECTRIC_TRAIN: TransportMode + AIRCRAFT: TransportMode + SHIP: TransportMode + SMALL_AIRCRAFT: TransportMode + SMALL_SHIP: TransportMode + HELICOPTER: TransportMode + TRAM_TRACK: TransportMode + ELECTRIC_TRAM_TRACK: TransportMode +end +``` + +Defines the transport mode (this is used to blacklist/whitelist vehicles onto transport network edges). +These values are mosly used in a bit field to influence the pathfinding for vehicles and people. + +### TransportMode.PERSON[πŸ”—](#$api.type~TransportMode.PERSON) + +``` +TransportMode.PERSON: TransportMode +``` + +### TransportMode.CARGO[πŸ”—](#$api.type~TransportMode.CARGO) + +``` +TransportMode.CARGO: TransportMode +``` + +### TransportMode.CAR[πŸ”—](#$api.type~TransportMode.CAR) + +``` +TransportMode.CAR: TransportMode +``` + +### TransportMode.BUS[πŸ”—](#$api.type~TransportMode.BUS) + +``` +TransportMode.BUS: TransportMode +``` + +### TransportMode.TRUCK[πŸ”—](#$api.type~TransportMode.TRUCK) + +``` +TransportMode.TRUCK: TransportMode +``` + +### TransportMode.TRAM[πŸ”—](#$api.type~TransportMode.TRAM) + +``` +TransportMode.TRAM: TransportMode +``` + +### TransportMode.ELECTRIC\_TRAM[πŸ”—](#$api.type~TransportMode.ELECTRIC_TRAM) + +``` +TransportMode.ELECTRIC_TRAM: TransportMode +``` + +### TransportMode.TRAIN[πŸ”—](#$api.type~TransportMode.TRAIN) + +``` +TransportMode.TRAIN: TransportMode +``` + +### TransportMode.ELECTRIC\_TRAIN[πŸ”—](#$api.type~TransportMode.ELECTRIC_TRAIN) + +``` +TransportMode.ELECTRIC_TRAIN: TransportMode +``` + +### TransportMode.AIRCRAFT[πŸ”—](#$api.type~TransportMode.AIRCRAFT) + +``` +TransportMode.AIRCRAFT: TransportMode +``` + +### TransportMode.SHIP[πŸ”—](#$api.type~TransportMode.SHIP) + +``` +TransportMode.SHIP: TransportMode +``` + +### TransportMode.SMALL\_AIRCRAFT[πŸ”—](#$api.type~TransportMode.SMALL_AIRCRAFT) + +``` +TransportMode.SMALL_AIRCRAFT: TransportMode +``` + +### TransportMode.SMALL\_SHIP[πŸ”—](#$api.type~TransportMode.SMALL_SHIP) + +``` +TransportMode.SMALL_SHIP: TransportMode +``` + +### TransportMode.HELICOPTER[πŸ”—](#$api.type~TransportMode.HELICOPTER) + +``` +TransportMode.HELICOPTER: TransportMode +``` + +### TransportMode.TRAM\_TRACK[πŸ”—](#$api.type~TransportMode.TRAM_TRACK) + +``` +TransportMode.TRAM_TRACK: TransportMode +``` + +### TransportMode.ELECTRIC\_TRAM\_TRACK[πŸ”—](#$api.type~TransportMode.ELECTRIC_TRAM_TRACK) + +``` +TransportMode.ELECTRIC_TRAM_TRACK: TransportMode +``` + +### TransportVehicleConfig[πŸ”—](#$api.type~TransportVehicleConfig) + +``` +global record TransportVehicleConfig new: function(): TransportVehicleConfig + + vehicles: {TransportVehiclePart} + vehicleGroups: {integer} + muFileNames: {string} +end +``` + +Complete configuration for a TransportVehicle (train consist, bus, etc.) + +### TransportVehicleConfig.new()[πŸ”—](#$api.type~TransportVehicleConfig.new()) + +``` +function TransportVehicleConfig.new()(): TransportVehicleConfig +``` + +**Returns** + +1. `TransportVehicleConfig` + +### TransportVehicleConfig.new(TransportVehicleConfig)[πŸ”—](#$api.type~TransportVehicleConfig.new(TransportVehicleConfig)) + +``` +function TransportVehicleConfig.new(TransportVehicleConfig)(TransportVehicleConfig): TransportVehicleConfig +``` + +**Parameters** + +* `TransportVehicleConfig` + +**Returns** + +1. `TransportVehicleConfig` + +### TransportVehicleConfig.vehicles[πŸ”—](#$api.type~TransportVehicleConfig.vehicles) + +``` +TransportVehicleConfig.vehicles: {TransportVehiclePart} +``` + +List of all vehicle parts in order + +### TransportVehicleConfig.vehicleGroups[πŸ”—](#$api.type~TransportVehicleConfig.vehicleGroups) + +``` +TransportVehicleConfig.vehicleGroups: {integer} +``` + +Vehicles can be composed into groups, each entry is the size of the group. +The sum of all entries must be the total of vehicles. +Example: + for a train made of a multiple unit with three cars and 1 extra waggon would be `{3, 1}`. + +### TransportVehicleConfig.muFileNames[πŸ”—](#$api.type~TransportVehicleConfig.muFileNames) + +``` +TransportVehicleConfig.muFileNames: {string} +``` + +for each group, if it is a multiple unit, stores the res name + +### TransportVehicleInfo[πŸ”—](#$api.type~TransportVehicleInfo) + +``` +global record TransportVehicleInfo cargoInfos: {{{VehicleCargoInfo}}} +end +``` + +Information about all cargo of a transport vehicle + +### TransportVehicleInfo.cargoInfos[πŸ”—](#$api.type~TransportVehicleInfo.cargoInfos) + +``` +TransportVehicleInfo.cargoInfos: {{{VehicleCargoInfo}}} +``` + +List of VehicleCargoInfo for vehicles, compartments and cargo types + +### TransportVehiclePart[πŸ”—](#$api.type~TransportVehiclePart) + +``` +global record TransportVehiclePart new: function(): TransportVehiclePart + part: VehiclePart + purchaseTime: integer + maintenanceChange: number + maintenanceState: number + autoLoadConfig: {boolean} +end +``` + +A subsection of a Transport Vehicle. + +### TransportVehiclePart.new[πŸ”—](#$api.type~TransportVehiclePart.new) + +``` +function TransportVehiclePart.new(): TransportVehiclePart +``` + +Creates a new TransportVehiclePart. + +**Returns** + +1. `TransportVehiclePart` β€” New TransportVehiclePart + +### TransportVehiclePart.part[πŸ”—](#$api.type~TransportVehiclePart.part) + +``` +TransportVehiclePart.part: VehiclePart +``` + +Base vehicle part configuration + +### TransportVehiclePart.purchaseTime[πŸ”—](#$api.type~TransportVehiclePart.purchaseTime) + +``` +TransportVehiclePart.purchaseTime: integer +``` + +Game time when this part was purchased + +### TransportVehiclePart.maintenanceChange[πŸ”—](#$api.type~TransportVehiclePart.maintenanceChange) + +``` +TransportVehiclePart.maintenanceChange: number +``` + +### TransportVehiclePart.maintenanceState[πŸ”—](#$api.type~TransportVehiclePart.maintenanceState) + +``` +TransportVehiclePart.maintenanceState: number +``` + +### TransportVehiclePart.autoLoadConfig[πŸ”—](#$api.type~TransportVehiclePart.autoLoadConfig) + +``` +TransportVehiclePart.autoLoadConfig: {boolean} +``` + +Automatic load configuration per compartment + +### TransportVehicleState[πŸ”—](#$api.type~TransportVehicleState) + +``` +global record TransportVehicleState IN_DEPOT: TransportVehicleState + EN_ROUTE: TransportVehicleState + AT_TERMINAL: TransportVehicleState + GOING_TO_DEPOT: TransportVehicleState +end +``` + +Current state of TransportVehicle + +### TransportVehicleState.IN\_DEPOT[πŸ”—](#$api.type~TransportVehicleState.IN_DEPOT) + +``` +TransportVehicleState.IN_DEPOT: TransportVehicleState +``` + +Vehicle is in a depot + +### TransportVehicleState.EN\_ROUTE[πŸ”—](#$api.type~TransportVehicleState.EN_ROUTE) + +``` +TransportVehicleState.EN_ROUTE: TransportVehicleState +``` + +Vehicle is traveling between terminals + +### TransportVehicleState.AT\_TERMINAL[πŸ”—](#$api.type~TransportVehicleState.AT_TERMINAL) + +``` +TransportVehicleState.AT_TERMINAL: TransportVehicleState +``` + +Vehicle is at a terminal (station/stop) + +### TransportVehicleState.GOING\_TO\_DEPOT[πŸ”—](#$api.type~TransportVehicleState.GOING_TO_DEPOT) + +``` +TransportVehicleState.GOING_TO_DEPOT: TransportVehicleState +``` + +Vehicle is traveling to a depot + +### TransportationStats[πŸ”—](#$api.type~TransportationStats) + +``` +global record TransportationStats passengersTransported: integer + cargoTransported: integer +end +``` + +A structure that holds information about the transportation data statistics. + +### TransportationStats.passengersTransported[πŸ”—](#$api.type~TransportationStats.passengersTransported) + +``` +TransportationStats.passengersTransported: integer +``` + +### TransportationStats.cargoTransported[πŸ”—](#$api.type~TransportationStats.cargoTransported) + +``` +TransportationStats.cargoTransported: integer +``` + +### UgcAccessLimitedReason[πŸ”—](#$api.type~UgcAccessLimitedReason) + +``` +global record UgcAccessLimitedReason None: UgcAccessLimitedReason + NotSignedIn: UgcAccessLimitedReason + Restricted: UgcAccessLimitedReason + Error: UgcAccessLimitedReason +end +``` + +Represent the reason why the user doesn't have access to UGC content + +### UgcAccessLimitedReason.None[πŸ”—](#$api.type~UgcAccessLimitedReason.None) + +``` +UgcAccessLimitedReason.None: UgcAccessLimitedReason +``` + +### UgcAccessLimitedReason.NotSignedIn[πŸ”—](#$api.type~UgcAccessLimitedReason.NotSignedIn) + +``` +UgcAccessLimitedReason.NotSignedIn: UgcAccessLimitedReason +``` + +### UgcAccessLimitedReason.Restricted[πŸ”—](#$api.type~UgcAccessLimitedReason.Restricted) + +``` +UgcAccessLimitedReason.Restricted: UgcAccessLimitedReason +``` + +### UgcAccessLimitedReason.Error[πŸ”—](#$api.type~UgcAccessLimitedReason.Error) + +``` +UgcAccessLimitedReason.Error: UgcAccessLimitedReason +``` + +### UserProfile[πŸ”—](#$api.type~UserProfile) + +``` +global record UserProfile getModRep: function(UserProfile): ModRep + getLanguageRep: function(UserProfile): LanguageRep + getUserName: function(UserProfile): string + changeLanguage: function(UserProfile, LangKey) + getLanguage: function(UserProfile): LangKey + subscribeMod: function(UserProfile, string) + unsubscribeMod: function(UserProfile, string) + getUnlockedAchievementIds: function(UserProfile): {string : boolean} + getAchievementRep: function(UserProfile): AchievementRep + getPlayerStatProgress: function(UserProfile, string): number + getPlayerStatsProgress: function(UserProfile): {string : number} + getLastMission: function(UserProfile, string): {string, SaveGameId} + getLastSavegameForMission: function(UserProfile, string, string): SaveGameId + getLastGame: function(UserProfile): SaveGameId | MissionCampaign + isMissionCompleted: function(UserProfile, string, string): boolean + isCurrentMissionCompleted: function(UserProfile): boolean + noteEditorsNoteShown: function(UserProfile) + isEditorsNoteShown: function(UserProfile) + noteMedalState: function(UserProfile, string, boolean) + getMedalsState: function(UserProfile, string, string): {string : boolean} + noteStarState: function(UserProfile, string, boolean) + getStarsState: function(UserProfile, string, string): {string : boolean} + hasUgcAccess: function(UserProfile): boolean + checkUgcRestrictions: function(UserProfile): boolean + hasAgeGroupForUgc: function(UserProfile): boolean + getUgcAccessLimitedReason: function(UserProfile): UgcAccessLimitedReason + openUrl: function(UserProfile, string) +end +``` + +UserProfile + +### UserProfile.getModRep[πŸ”—](#$api.type~UserProfile.getModRep) + +``` +function UserProfile.getModRep(UserProfile): ModRep +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `ModRep` + +### UserProfile.getLanguageRep[πŸ”—](#$api.type~UserProfile.getLanguageRep) + +``` +function UserProfile.getLanguageRep(UserProfile): LanguageRep +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `LanguageRep` + +### UserProfile.getUserName[πŸ”—](#$api.type~UserProfile.getUserName) + +``` +function UserProfile.getUserName(UserProfile): string +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `string` + +### UserProfile.changeLanguage[πŸ”—](#$api.type~UserProfile.changeLanguage) + +``` +function UserProfile.changeLanguage(UserProfile, LangKey) +``` + +**Parameters** + +* `UserProfile` +* `LangKey` + +### UserProfile.getLanguage[πŸ”—](#$api.type~UserProfile.getLanguage) + +``` +function UserProfile.getLanguage(UserProfile): LangKey +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `LangKey` + +### UserProfile.subscribeMod[πŸ”—](#$api.type~UserProfile.subscribeMod) + +``` +function UserProfile.subscribeMod(UserProfile, string) +``` + +**Parameters** + +* `UserProfile` +* `string` + +### UserProfile.unsubscribeMod[πŸ”—](#$api.type~UserProfile.unsubscribeMod) + +``` +function UserProfile.unsubscribeMod(UserProfile, string) +``` + +**Parameters** + +* `UserProfile` +* `string` + +### UserProfile.getUnlockedAchievementIds[πŸ”—](#$api.type~UserProfile.getUnlockedAchievementIds) + +``` +function UserProfile.getUnlockedAchievementIds(UserProfile): {string : boolean} +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `{string : boolean}` + +### UserProfile.getAchievementRep[πŸ”—](#$api.type~UserProfile.getAchievementRep) + +``` +function UserProfile.getAchievementRep(UserProfile): AchievementRep +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `AchievementRep` + +### UserProfile.getPlayerStatProgress[πŸ”—](#$api.type~UserProfile.getPlayerStatProgress) + +``` +function UserProfile.getPlayerStatProgress(UserProfile, string): number +``` + +**Parameters** + +* `UserProfile` +* `string` + +**Returns** + +1. `number` + +### UserProfile.getPlayerStatsProgress[πŸ”—](#$api.type~UserProfile.getPlayerStatsProgress) + +``` +function UserProfile.getPlayerStatsProgress(UserProfile): {string : number} +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `{string : number}` + +### UserProfile.getLastMission[πŸ”—](#$api.type~UserProfile.getLastMission) + +``` +function UserProfile.getLastMission(UserProfile, string): {string, SaveGameId} +``` + +**Parameters** + +* `UserProfile` +* `string` + +**Returns** + +1. `{string, SaveGameId}` + +### UserProfile.getLastSavegameForMission[πŸ”—](#$api.type~UserProfile.getLastSavegameForMission) + +``` +function UserProfile.getLastSavegameForMission(UserProfile, string, string): SaveGameId +``` + +**Parameters** + +* `UserProfile` +* `string` +* `string` + +**Returns** + +1. `SaveGameId` + +### UserProfile.getLastGame[πŸ”—](#$api.type~UserProfile.getLastGame) + +``` +function UserProfile.getLastGame(UserProfile): SaveGameId | MissionCampaign +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `SaveGameId | MissionCampaign` + +### UserProfile.isMissionCompleted[πŸ”—](#$api.type~UserProfile.isMissionCompleted) + +``` +function UserProfile.isMissionCompleted(UserProfile, string, string): boolean +``` + +**Parameters** + +* `UserProfile` +* `string` +* `string` + +**Returns** + +1. `boolean` + +### UserProfile.isCurrentMissionCompleted[πŸ”—](#$api.type~UserProfile.isCurrentMissionCompleted) + +``` +function UserProfile.isCurrentMissionCompleted(UserProfile): boolean +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `boolean` + +### UserProfile.noteEditorsNoteShown[πŸ”—](#$api.type~UserProfile.noteEditorsNoteShown) + +``` +function UserProfile.noteEditorsNoteShown(UserProfile) +``` + +**Parameters** + +* `UserProfile` + +### UserProfile.isEditorsNoteShown[πŸ”—](#$api.type~UserProfile.isEditorsNoteShown) + +``` +function UserProfile.isEditorsNoteShown(UserProfile) +``` + +**Parameters** + +* `UserProfile` + +### UserProfile.noteMedalState[πŸ”—](#$api.type~UserProfile.noteMedalState) + +``` +function UserProfile.noteMedalState(UserProfile, string, boolean) +``` + +**Parameters** + +* `UserProfile` +* `string` +* `boolean` + +### UserProfile.getMedalsState[πŸ”—](#$api.type~UserProfile.getMedalsState) + +``` +function UserProfile.getMedalsState(UserProfile, string, string): {string : boolean} +``` + +**Parameters** + +* `UserProfile` +* `string` +* `string` + +**Returns** + +1. `{string : boolean}` + +### UserProfile.noteStarState[πŸ”—](#$api.type~UserProfile.noteStarState) + +``` +function UserProfile.noteStarState(UserProfile, string, boolean) +``` + +**Parameters** + +* `UserProfile` +* `string` +* `boolean` + +### UserProfile.getStarsState[πŸ”—](#$api.type~UserProfile.getStarsState) + +``` +function UserProfile.getStarsState(UserProfile, string, string): {string : boolean} +``` + +**Parameters** + +* `UserProfile` +* `string` +* `string` + +**Returns** + +1. `{string : boolean}` + +### UserProfile.hasUgcAccess[πŸ”—](#$api.type~UserProfile.hasUgcAccess) + +``` +function UserProfile.hasUgcAccess(UserProfile): boolean +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `boolean` + +### UserProfile.checkUgcRestrictions[πŸ”—](#$api.type~UserProfile.checkUgcRestrictions) + +``` +function UserProfile.checkUgcRestrictions(UserProfile): boolean +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `boolean` + +### UserProfile.hasAgeGroupForUgc[πŸ”—](#$api.type~UserProfile.hasAgeGroupForUgc) + +``` +function UserProfile.hasAgeGroupForUgc(UserProfile): boolean +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `boolean` + +### UserProfile.getUgcAccessLimitedReason[πŸ”—](#$api.type~UserProfile.getUgcAccessLimitedReason) + +``` +function UserProfile.getUgcAccessLimitedReason(UserProfile): UgcAccessLimitedReason +``` + +**Parameters** + +* `UserProfile` + +**Returns** + +1. `UgcAccessLimitedReason` + +### UserProfile.openUrl[πŸ”—](#$api.type~UserProfile.openUrl) + +``` +function UserProfile.openUrl(UserProfile, string) +``` + +**Parameters** + +* `UserProfile` +* `string` + +### Vec2f[πŸ”—](#$api.type~Vec2f) + +``` +global record Vec2f new: function(): Vec2f + + equals: function(Vec2f, Vec2f): boolean + clone: function(Vec2f): Vec2f + x: number + y: number + scale: function(s : Vec2f, number): Vec2f + normalize: function(Vec2f): Vec2f + length: function(Vec2f): number + distance: function(a : Vec2f, b : Vec2f): number + distance2: function(a : Vec2f, b : Vec2f): number + lerp: function(a : Vec2f, b : Vec2f, t : number): Vec2f + angle: function(a : Vec2f, b : Vec2f): number + rotate: function(angle : Vec2f, number): Vec2f + metamethod __add: function(Vec2f, Vec2f): Vec2f + +end +``` + +A 2d vector of floats +Supports array subscript with `vec[i]` access. Supports addition `+`, subtraction `-`, multiplication `*` and division `/`. + +### Vec2f.new()[πŸ”—](#$api.type~Vec2f.new()) + +``` +function Vec2f.new()(): Vec2f +``` + +Creates a new vector. + +**Returns** + +1. `Vec2f` β€” Vec2f(0,0) + +### Vec2f.new(number)[πŸ”—](#$api.type~Vec2f.new(number)) + +``` +function Vec2f.new(number)(v : number): Vec2f +``` + +Creates a new vector. + +**Parameters** + +* `v` :`number` β€” Single value to set both x and y (optional) + +**Returns** + +1. `Vec2f` β€” Vec2f(v,v) + +### Vec2f.new(number, number)[πŸ”—](#$api.type~Vec2f.new(number, number)) + +``` +function Vec2f.new(number, number)(x : number, y : number): Vec2f +``` + +Creates a new vector. + +**Parameters** + +* `x` :`number` β€” X coordinate (optional) +* `y` :`number` β€” Y coordinate (optional) + +**Returns** + +1. `Vec2f` β€” Vec2f(x,y) + +### Vec2f.equals[πŸ”—](#$api.type~Vec2f.equals) + +``` +function Vec2f.equals(Vec2f, Vec2f): boolean +``` + +**Parameters** + +* `Vec2f` +* `Vec2f` + +**Returns** + +1. `boolean` + +### Vec2f.clone[πŸ”—](#$api.type~Vec2f.clone) + +``` +function Vec2f.clone(Vec2f): Vec2f +``` + +**Parameters** + +* `Vec2f` + +**Returns** + +1. `Vec2f` + +### Vec2f.x[πŸ”—](#$api.type~Vec2f.x) + +``` +Vec2f.x: number +``` + +x coordinate + +### Vec2f.y[πŸ”—](#$api.type~Vec2f.y) + +``` +Vec2f.y: number +``` + +y coordinate + +### Vec2f.scale[πŸ”—](#$api.type~Vec2f.scale) + +``` +function Vec2f.scale(s : Vec2f, number): Vec2f +``` + +Scale a vector by an amount + +**Parameters** + +* `s` :`Vec2f` β€” Scale amount +* `number` + +**Returns** + +1. `Vec2f` β€” Scaled vector + +### Vec2f.normalize[πŸ”—](#$api.type~Vec2f.normalize) + +``` +function Vec2f.normalize(Vec2f): Vec2f +``` + +Normalize vector to unit length + +**Parameters** + +* `Vec2f` + +**Returns** + +1. `Vec2f` β€” Normalized vector + +### Vec2f.length[πŸ”—](#$api.type~Vec2f.length) + +``` +function Vec2f.length(Vec2f): number +``` + +Calculate length of a vector + +**Parameters** + +* `Vec2f` + +**Returns** + +1. `number` β€” Length + +### Vec2f.distance[πŸ”—](#$api.type~Vec2f.distance) + +``` +function Vec2f.distance(a : Vec2f, b : Vec2f): number +``` + +Calculate distance between two vectors + +**Parameters** + +* `a` :`Vec2f` β€” First vector +* `b` :`Vec2f` β€” Second vector + +**Returns** + +1. `number` β€” Distance + +### Vec2f.distance2[πŸ”—](#$api.type~Vec2f.distance2) + +``` +function Vec2f.distance2(a : Vec2f, b : Vec2f): number +``` + +Calculate squared distance between two vectors + +**Parameters** + +* `a` :`Vec2f` β€” First vector +* `b` :`Vec2f` β€” Second vector + +**Returns** + +1. `number` β€” Squared Distance + +### Vec2f.lerp[πŸ”—](#$api.type~Vec2f.lerp) + +``` +function Vec2f.lerp(a : Vec2f, b : Vec2f, t : number): Vec2f +``` + +Linear interpolation between two vectors + +**Parameters** + +* `a` :`Vec2f` β€” First vector +* `b` :`Vec2f` β€” Second vector +* `t` :`number` β€” Interpolation parameter (0 to 1) + +**Returns** + +1. `Vec2f` β€” Interpolated vector + +### Vec2f.angle[πŸ”—](#$api.type~Vec2f.angle) + +``` +function Vec2f.angle(a : Vec2f, b : Vec2f): number +``` + +Calculate angle between two vectors + +**Parameters** + +* `a` :`Vec2f` β€” First vector +* `b` :`Vec2f` β€” Second vector + +**Returns** + +1. `number` β€” angle (in radians) + +### Vec2f.rotate[πŸ”—](#$api.type~Vec2f.rotate) + +``` +function Vec2f.rotate(angle : Vec2f, number): Vec2f +``` + +Rotate vector by angle + +**Parameters** + +* `angle` :`Vec2f` β€” Rotation angle in radians +* `number` + +**Returns** + +1. `Vec2f` β€” Rotated vector + +### Vec2f.$meta.\_\_add[πŸ”—](#$api.type~Vec2f.$meta.__add) + +``` +metamethod Vec2f.$meta.__add(Vec2f, Vec2f): Vec2f +``` + +**Parameters** + +* `Vec2f` +* `Vec2f` + +**Returns** + +1. `Vec2f` + +### Vec2f.$meta.\_\_sub[πŸ”—](#$api.type~Vec2f.$meta.__sub) + +``` +metamethod Vec2f.$meta.__sub(Vec2f, Vec2f): Vec2f +``` + +**Parameters** + +* `Vec2f` +* `Vec2f` + +**Returns** + +1. `Vec2f` + +### Vec2f.$meta.\_\_mul[πŸ”—](#$api.type~Vec2f.$meta.__mul) + +``` +metamethod Vec2f.$meta.__mul(Vec2f, number): Vec2f +``` + +**Parameters** + +* `Vec2f` +* `number` + +**Returns** + +1. `Vec2f` + +### Vec2f.$meta.\_\_div[πŸ”—](#$api.type~Vec2f.$meta.__div) + +``` +metamethod Vec2f.$meta.__div(Vec2f, number): Vec2f +``` + +**Parameters** + +* `Vec2f` +* `number` + +**Returns** + +1. `Vec2f` + +### Vec2i[πŸ”—](#$api.type~Vec2i) + +``` +global record Vec2i new: function(): Vec2i + + equals: function(Vec2i, Vec2i): boolean + x: integer + y: integer + metamethod __add: function(Vec2i, Vec2i): Vec2i + +end +``` + +A 2d vector of integers +Supports array subscript with `vec[i]` access. Supports addition `+`, subtraction `-`, multiplication `*` and division `/`. + +### Vec2i.new()[πŸ”—](#$api.type~Vec2i.new()) + +``` +function Vec2i.new()(): Vec2i +``` + +Creates a new vector. + +**Returns** + +1. `Vec2i` β€” Vec2i(0,0), + +### Vec2i.new(integer)[πŸ”—](#$api.type~Vec2i.new(integer)) + +``` +function Vec2i.new(integer)(v : integer): Vec2i +``` + +Creates a new vector. + +**Parameters** + +* `v` :`integer` β€” Single value to set both x and y (optional) + +**Returns** + +1. `Vec2i` β€” Vec2i(v,v) + +### Vec2i.new(integer, integer)[πŸ”—](#$api.type~Vec2i.new(integer, integer)) + +``` +function Vec2i.new(integer, integer)(x : integer, y : integer): Vec2i +``` + +Creates a new vector. + +**Parameters** + +* `x` :`integer` β€” X coordinate +* `y` :`integer` β€” Y coordinate + +**Returns** + +1. `Vec2i` β€” Vec2i(x,y) + +### Vec2i.equals[πŸ”—](#$api.type~Vec2i.equals) + +``` +function Vec2i.equals(Vec2i, Vec2i): boolean +``` + +**Parameters** + +* `Vec2i` +* `Vec2i` + +**Returns** + +1. `boolean` + +### Vec2i.x[πŸ”—](#$api.type~Vec2i.x) + +``` +Vec2i.x: integer +``` + +x coordinate + +### Vec2i.y[πŸ”—](#$api.type~Vec2i.y) + +``` +Vec2i.y: integer +``` + +y coordinate + +### Vec2i.$meta.\_\_add[πŸ”—](#$api.type~Vec2i.$meta.__add) + +``` +metamethod Vec2i.$meta.__add(Vec2i, Vec2i): Vec2i +``` + +**Parameters** + +* `Vec2i` +* `Vec2i` + +**Returns** + +1. `Vec2i` + +### Vec2i.$meta.\_\_sub[πŸ”—](#$api.type~Vec2i.$meta.__sub) + +``` +metamethod Vec2i.$meta.__sub(Vec2i, Vec2i): Vec2i +``` + +**Parameters** + +* `Vec2i` +* `Vec2i` + +**Returns** + +1. `Vec2i` + +### Vec2i.$meta.\_\_mul[πŸ”—](#$api.type~Vec2i.$meta.__mul) + +``` +metamethod Vec2i.$meta.__mul(Vec2i, Vec2i): Vec2i +``` + +**Parameters** + +* `Vec2i` +* `Vec2i` + +**Returns** + +1. `Vec2i` + +### Vec2i.$meta.\_\_div[πŸ”—](#$api.type~Vec2i.$meta.__div) + +``` +metamethod Vec2i.$meta.__div(Vec2i, Vec2i): Vec2i +``` + +**Parameters** + +* `Vec2i` +* `Vec2i` + +**Returns** + +1. `Vec2i` + +### Vec3f[πŸ”—](#$api.type~Vec3f) + +``` +global record Vec3f new: function(): Vec3f + + equals: function(Vec3f, Vec3f): boolean + clone: function(Vec3f): Vec3f + x: number + y: number + z: number + scale: function(s : Vec3f, number): Vec3f + normalize: function(Vec3f): Vec3f + length: function(Vec3f): number + distance: function(a : Vec3f, b : Vec3f): number + distance2: function(a : Vec3f, b : Vec3f): number + distance2_2: function(a : Vec3f, b : Vec3f): number + distance_2: function(a : Vec3f, b : Vec3f): number + lerp: function(a : Vec3f, b : Vec3f, t : number): Vec3f + angle: function(a : Vec3f, b : Vec3f): number + dot: function(a : Vec3f, b : Vec3f): number + metamethod __add: function(Vec3f, Vec3f): Vec3f + +end +``` + +A 3d vector of floats +Supports array subscript with `vec[i]` access. Supports addition `+`, subtraction `-`, multiplication `*` and division `/`. + +### Vec3f.new()[πŸ”—](#$api.type~Vec3f.new()) + +``` +function Vec3f.new()(): Vec3f +``` + +Creates a new vector. + +**Returns** + +1. `Vec3f` β€” Vec3f(0,0,0) + +### Vec3f.new(number)[πŸ”—](#$api.type~Vec3f.new(number)) + +``` +function Vec3f.new(number)(v : number): Vec3f +``` + +Creates a new vector. + +**Parameters** + +* `v` :`number` β€” Single value to set all components + +**Returns** + +1. `Vec3f` β€” Vec3f(v,v,v) + +### Vec3f.new(number, number, number)[πŸ”—](#$api.type~Vec3f.new(number, number, number)) + +``` +function Vec3f.new(number, number, number)(x : number, y : number, z : number): Vec3f +``` + +Creates a new vector. + +**Parameters** + +* `x` :`number` β€” X coordinate +* `y` :`number` β€” Y coordinate +* `z` :`number` β€” Z coordinate + +**Returns** + +1. `Vec3f` β€” Vec3f(x,y,z) + +### Vec3f.equals[πŸ”—](#$api.type~Vec3f.equals) + +``` +function Vec3f.equals(Vec3f, Vec3f): boolean +``` + +**Parameters** + +* `Vec3f` +* `Vec3f` + +**Returns** + +1. `boolean` + +### Vec3f.clone[πŸ”—](#$api.type~Vec3f.clone) + +``` +function Vec3f.clone(Vec3f): Vec3f +``` + +Create a copy of the vector + +**Parameters** + +* `Vec3f` + +**Returns** + +1. `Vec3f` β€” Cloned vector + +### Vec3f.x[πŸ”—](#$api.type~Vec3f.x) + +``` +Vec3f.x: number +``` + +x coordinate + +### Vec3f.y[πŸ”—](#$api.type~Vec3f.y) + +``` +Vec3f.y: number +``` + +y coordinate + +### Vec3f.z[πŸ”—](#$api.type~Vec3f.z) + +``` +Vec3f.z: number +``` + +z coordinate + +### Vec3f.scale[πŸ”—](#$api.type~Vec3f.scale) + +``` +function Vec3f.scale(s : Vec3f, number): Vec3f +``` + +Scale vector by a factor + +**Parameters** + +* `s` :`Vec3f` β€” Scale factor +* `number` + +**Returns** + +1. `Vec3f` β€” Scaled vector + +### Vec3f.normalize[πŸ”—](#$api.type~Vec3f.normalize) + +``` +function Vec3f.normalize(Vec3f): Vec3f +``` + +Normalize vector to unit length + +**Parameters** + +* `Vec3f` + +**Returns** + +1. `Vec3f` β€” Normalized vector + +### Vec3f.length[πŸ”—](#$api.type~Vec3f.length) + +``` +function Vec3f.length(Vec3f): number +``` + +Calculate length of the vector + +**Parameters** + +* `Vec3f` + +**Returns** + +1. `number` β€” Length + +### Vec3f.distance[πŸ”—](#$api.type~Vec3f.distance) + +``` +function Vec3f.distance(a : Vec3f, b : Vec3f): number +``` + +Calculate distance between two vectors + +**Parameters** + +* `a` :`Vec3f` β€” First vector +* `b` :`Vec3f` β€” Second vector + +**Returns** + +1. `number` β€” Distance + +### Vec3f.distance2[πŸ”—](#$api.type~Vec3f.distance2) + +``` +function Vec3f.distance2(a : Vec3f, b : Vec3f): number +``` + +Calculate squared distance between two vectors + +**Parameters** + +* `a` :`Vec3f` β€” First vector +* `b` :`Vec3f` β€” Second vector + +**Returns** + +1. `number` β€” Squared distance + +### Vec3f.distance2\_2[πŸ”—](#$api.type~Vec3f.distance2_2) + +``` +function Vec3f.distance2_2(a : Vec3f, b : Vec3f): number +``` + +Calculate squared distance between the xy components of two vectors + +**Parameters** + +* `a` :`Vec3f` β€” First vector +* `b` :`Vec3f` β€” Second vector + +**Returns** + +1. `number` β€” Squared distance + +### Vec3f.distance\_2[πŸ”—](#$api.type~Vec3f.distance_2) + +``` +function Vec3f.distance_2(a : Vec3f, b : Vec3f): number +``` + +Calculate distance between xy components of two vectors + +**Parameters** + +* `a` :`Vec3f` β€” First vector +* `b` :`Vec3f` β€” Second vector + +**Returns** + +1. `number` β€” Squared distance + +### Vec3f.lerp[πŸ”—](#$api.type~Vec3f.lerp) + +``` +function Vec3f.lerp(a : Vec3f, b : Vec3f, t : number): Vec3f +``` + +Linear interpolation between two vectors + +**Parameters** + +* `a` :`Vec3f` β€” First vector +* `b` :`Vec3f` β€” Second vector +* `t` :`number` β€” Interpolation parameter (0 to 1) + +**Returns** + +1. `Vec3f` β€” Interpolated vector + +### Vec3f.angle[πŸ”—](#$api.type~Vec3f.angle) + +``` +function Vec3f.angle(a : Vec3f, b : Vec3f): number +``` + +Calculate angle between two vectors + +**Parameters** + +* `a` :`Vec3f` β€” First vector +* `b` :`Vec3f` β€” Second vector + +**Returns** + +1. `number` β€” angle (in radians) + +### Vec3f.dot[πŸ”—](#$api.type~Vec3f.dot) + +``` +function Vec3f.dot(a : Vec3f, b : Vec3f): number +``` + +Calculate dot product of two vectors + +**Parameters** + +* `a` :`Vec3f` β€” First vector +* `b` :`Vec3f` β€” Second vector + +**Returns** + +1. `number` β€” dot product + +### Vec3f.$meta.\_\_add[πŸ”—](#$api.type~Vec3f.$meta.__add) + +``` +metamethod Vec3f.$meta.__add(Vec3f, Vec3f): Vec3f +``` + +**Parameters** + +* `Vec3f` +* `Vec3f` + +**Returns** + +1. `Vec3f` + +### Vec3f.$meta.\_\_sub[πŸ”—](#$api.type~Vec3f.$meta.__sub) + +``` +metamethod Vec3f.$meta.__sub(Vec3f, Vec3f): Vec3f +``` + +**Parameters** + +* `Vec3f` +* `Vec3f` + +**Returns** + +1. `Vec3f` + +### Vec3f.$meta.\_\_mul[πŸ”—](#$api.type~Vec3f.$meta.__mul) + +``` +metamethod Vec3f.$meta.__mul(Vec3f, number): Vec3f +``` + +**Parameters** + +* `Vec3f` +* `number` + +**Returns** + +1. `Vec3f` + +### Vec3f.$meta.\_\_div[πŸ”—](#$api.type~Vec3f.$meta.__div) + +``` +metamethod Vec3f.$meta.__div(Vec3f, number): Vec3f +``` + +**Parameters** + +* `Vec3f` +* `number` + +**Returns** + +1. `Vec3f` + +### Vec4f[πŸ”—](#$api.type~Vec4f) + +``` +global record Vec4f new: function(): Vec4f + + equals: function(Vec4f, Vec4f): boolean + x: number + y: number + z: number + w: number + lerp: function(a : Vec4f, b : Vec4f, t : number): Vec4f + metamethod __add: function(Vec4f, Vec4f): Vec4f + +end +``` + +A 4d vector of floats +Supports array subscript with `vec[i]` access. Supports addition `+`, subtraction `-`, multiplication `*` and division `/`. + +### Vec4f.new()[πŸ”—](#$api.type~Vec4f.new()) + +``` +function Vec4f.new()(): Vec4f +``` + +Creates a new vector. + +**Returns** + +1. `Vec4f` β€” Vec4f(0,0,0,0) + +### Vec4f.new(number)[πŸ”—](#$api.type~Vec4f.new(number)) + +``` +function Vec4f.new(number)(v : number): Vec4f +``` + +Creates a new vector. + +**Parameters** + +* `v` :`number` β€” Single value to set all components + +**Returns** + +1. `Vec4f` β€” Vec4f(v,v,v,v) + +### Vec4f.new(number, number, number, number)[πŸ”—](#$api.type~Vec4f.new(number, number, number, number)) + +``` +function Vec4f.new(number, number, number, number)(x : number, y : number, z : number, w : number): Vec4f +``` + +Creates a new vector. + +**Parameters** + +* `x` :`number` β€” X coordinate +* `y` :`number` β€” Y coordinate +* `z` :`number` β€” Z coordinate +* `w` :`number` β€” W coordinate + +**Returns** + +1. `Vec4f` β€” Vec4f(x, y, z, w) + +### Vec4f.new(Vec3f, number)[πŸ”—](#$api.type~Vec4f.new(Vec3f, number)) + +``` +function Vec4f.new(Vec3f, number)(v : Vec3f, w : number): Vec4f +``` + +Creates a new vector from Vec3f and w component. + +**Parameters** + +* `v` :`Vec3f` β€” Vec3f for x, y, z components +* `w` :`number` β€” W coordinate + +**Returns** + +1. `Vec4f` β€” New Vec4f + +### Vec4f.equals[πŸ”—](#$api.type~Vec4f.equals) + +``` +function Vec4f.equals(Vec4f, Vec4f): boolean +``` + +**Parameters** + +* `Vec4f` +* `Vec4f` + +**Returns** + +1. `boolean` + +### Vec4f.x[πŸ”—](#$api.type~Vec4f.x) + +``` +Vec4f.x: number +``` + +x coordinate + +### Vec4f.y[πŸ”—](#$api.type~Vec4f.y) + +``` +Vec4f.y: number +``` + +y coordinate + +### Vec4f.z[πŸ”—](#$api.type~Vec4f.z) + +``` +Vec4f.z: number +``` + +z coordinate + +### Vec4f.w[πŸ”—](#$api.type~Vec4f.w) + +``` +Vec4f.w: number +``` + +w coordinate + +### Vec4f.lerp[πŸ”—](#$api.type~Vec4f.lerp) + +``` +function Vec4f.lerp(a : Vec4f, b : Vec4f, t : number): Vec4f +``` + +Linear interpolation between two vectors + +**Parameters** + +* `a` :`Vec4f` β€” First vector +* `b` :`Vec4f` β€” Second vector +* `t` :`number` β€” Interpolation parameter (0 to 1) + +**Returns** + +1. `Vec4f` β€” Interpolated vector + +### Vec4f.$meta.\_\_add[πŸ”—](#$api.type~Vec4f.$meta.__add) + +``` +metamethod Vec4f.$meta.__add(Vec4f, Vec4f): Vec4f +``` + +**Parameters** + +* `Vec4f` +* `Vec4f` + +**Returns** + +1. `Vec4f` + +### Vec4f.$meta.\_\_sub[πŸ”—](#$api.type~Vec4f.$meta.__sub) + +``` +metamethod Vec4f.$meta.__sub(Vec4f, Vec4f): Vec4f +``` + +**Parameters** + +* `Vec4f` +* `Vec4f` + +**Returns** + +1. `Vec4f` + +### Vec4f.$meta.\_\_mul[πŸ”—](#$api.type~Vec4f.$meta.__mul) + +``` +metamethod Vec4f.$meta.__mul(Vec4f, number): Vec4f +``` + +**Parameters** + +* `Vec4f` +* `number` + +**Returns** + +1. `Vec4f` + +### Vec4f.$meta.\_\_div[πŸ”—](#$api.type~Vec4f.$meta.__div) + +``` +metamethod Vec4f.$meta.__div(Vec4f, number): Vec4f +``` + +**Parameters** + +* `Vec4f` +* `number` + +**Returns** + +1. `Vec4f` + +### Vec5f[πŸ”—](#$api.type~Vec5f) + +``` +global record Vec5f new: function(): Vec5f + + equals: function(Vec5f, Vec5f): boolean + x: number + y: number + z: number + w: number + q: number + lerp: function(a : Vec5f, b : Vec5f, t : number): Vec5f + metamethod __add: function(Vec5f, Vec5f): Vec5f + +end +``` + +A 5d vector of floats +Supports array subscript with `vec[i]` access. Supports addition `+`, subtraction `-`, multiplication `*` and division `/`. + +### Vec5f.new()[πŸ”—](#$api.type~Vec5f.new()) + +``` +function Vec5f.new()(): Vec5f +``` + +Creates a new vector. + +**Returns** + +1. `Vec5f` β€” Vec5f(0, 0, 0, 0, 0) + +### Vec5f.new(number)[πŸ”—](#$api.type~Vec5f.new(number)) + +``` +function Vec5f.new(number)(v : number): Vec5f +``` + +Creates a new vector. + +**Parameters** + +* `v` :`number` β€” Single value to set all components + +**Returns** + +1. `Vec5f` β€” Vec5f(v, v, v, v, v) + +### Vec5f.new(number, number, number, number, number)[πŸ”—](#$api.type~Vec5f.new(number, number, number, number, number)) + +``` +function Vec5f.new(number, number, number, number, number)(x : number, y : number, z : number, w : number, q : number): Vec5f +``` + +Creates a new vector. + +**Parameters** + +* `x` :`number` β€” X coordinate +* `y` :`number` β€” Y coordinate +* `z` :`number` β€” Z coordinate +* `w` :`number` β€” W coordinate +* `q` :`number` β€” Q coordinate + +**Returns** + +1. `Vec5f` β€” Vec5f(x, y, z, w, q) + +### Vec5f.equals[πŸ”—](#$api.type~Vec5f.equals) + +``` +function Vec5f.equals(Vec5f, Vec5f): boolean +``` + +**Parameters** + +* `Vec5f` +* `Vec5f` + +**Returns** + +1. `boolean` + +### Vec5f.x[πŸ”—](#$api.type~Vec5f.x) + +``` +Vec5f.x: number +``` + +x coordinate + +### Vec5f.y[πŸ”—](#$api.type~Vec5f.y) + +``` +Vec5f.y: number +``` + +y coordinate + +### Vec5f.z[πŸ”—](#$api.type~Vec5f.z) + +``` +Vec5f.z: number +``` + +z coordinate + +### Vec5f.w[πŸ”—](#$api.type~Vec5f.w) + +``` +Vec5f.w: number +``` + +w coordinate + +### Vec5f.q[πŸ”—](#$api.type~Vec5f.q) + +``` +Vec5f.q: number +``` + +q coordinate + +### Vec5f.lerp[πŸ”—](#$api.type~Vec5f.lerp) + +``` +function Vec5f.lerp(a : Vec5f, b : Vec5f, t : number): Vec5f +``` + +Linear interpolation between two vectors + +**Parameters** + +* `a` :`Vec5f` β€” First vector +* `b` :`Vec5f` β€” Second vector +* `t` :`number` β€” Interpolation parameter (0 to 1) + +**Returns** + +1. `Vec5f` β€” Interpolated vector + +### Vec5f.$meta.\_\_add[πŸ”—](#$api.type~Vec5f.$meta.__add) + +``` +metamethod Vec5f.$meta.__add(Vec5f, Vec5f): Vec5f +``` + +**Parameters** + +* `Vec5f` +* `Vec5f` + +**Returns** + +1. `Vec5f` + +### Vec5f.$meta.\_\_sub[πŸ”—](#$api.type~Vec5f.$meta.__sub) + +``` +metamethod Vec5f.$meta.__sub(Vec5f, Vec5f): Vec5f +``` + +**Parameters** + +* `Vec5f` +* `Vec5f` + +**Returns** + +1. `Vec5f` + +### Vec5f.$meta.\_\_mul[πŸ”—](#$api.type~Vec5f.$meta.__mul) + +``` +metamethod Vec5f.$meta.__mul(Vec5f, number): Vec5f +``` + +**Parameters** + +* `Vec5f` +* `number` + +**Returns** + +1. `Vec5f` + +### Vec5f.$meta.\_\_div[πŸ”—](#$api.type~Vec5f.$meta.__div) + +``` +metamethod Vec5f.$meta.__div(Vec5f, number): Vec5f +``` + +**Parameters** + +* `Vec5f` +* `number` + +**Returns** + +1. `Vec5f` + +### Vector[πŸ”—](#$api.type~Vector) + +``` +global record Vector new: function(): Vector + at: function(Vector, integer): T + pushBack: function(Vector, T) + size: function(Vector): integer + asTable: function(Vector): {T} + clone: function(Vector): Vector +end +``` + +##### Type Parameters + +* **`T`** + +### Vector.new[πŸ”—](#$api.type~Vector.new) + +``` +function Vector.new(): Vector +``` + +**Returns** + +1. `Vector` + +### Vector.at[πŸ”—](#$api.type~Vector.at) + +``` +function Vector.at(Vector, integer): T +``` + +1-base index into a standard C++ vector + +**Parameters** + +* `Vector` +* `integer` + +**Returns** + +1. `T` + +### Vector.pushBack[πŸ”—](#$api.type~Vector.pushBack) + +``` +function Vector.pushBack(Vector, T) +``` + +**Parameters** + +* `Vector` +* `T` + +### Vector.size[πŸ”—](#$api.type~Vector.size) + +``` +function Vector.size(Vector): integer +``` + +**Parameters** + +* `Vector` + +**Returns** + +1. `integer` + +### Vector.asTable[πŸ”—](#$api.type~Vector.asTable) + +``` +function Vector.asTable(Vector): {T} +``` + +**Parameters** + +* `Vector` + +**Returns** + +1. `{T}` + +### Vector.clone[πŸ”—](#$api.type~Vector.clone) + +``` +function Vector.clone(Vector): Vector +``` + +**Parameters** + +* `Vector` + +**Returns** + +1. `Vector` + +### VehicleCargoInfo[πŸ”—](#$api.type~VehicleCargoInfo) + +``` +global record VehicleCargoInfo capacity: number + offset: number +end +``` + +Information about cargo of a single compartment of a transport vehicle + +### VehicleCargoInfo.capacity[πŸ”—](#$api.type~VehicleCargoInfo.capacity) + +``` +VehicleCargoInfo.capacity: number +``` + +Capacity of this vehicle + +### VehicleCargoInfo.offset[πŸ”—](#$api.type~VehicleCargoInfo.offset) + +``` +VehicleCargoInfo.offset: number +``` + +Sum of the cargo capacities up to this vehicle + +### VehicleData[πŸ”—](#$api.type~VehicleData) + +``` +[Expand All] [Collapse All] + +global record VehicleData record CarriageData offset: number + reversed: boolean + emissions: ModelMetadata.Emissions +end + bounds: VehicleExtent + length: number + topSpeed: number + brakeDeceleration: number + carriages: {CarriageData} +end +``` + +Information about an entire vehicle (consist of carriages) + +### VehicleData.CarriageData[πŸ”—](#$api.type~VehicleData.CarriageData) + +``` +record VehicleData.CarriageData offset: number + reversed: boolean + emissions: ModelMetadata.Emissions +end +``` + +### VehicleData.CarriageData.offset[πŸ”—](#$api.type~VehicleData.CarriageData.offset) + +``` +VehicleData.CarriageData.offset: number +``` + +### VehicleData.CarriageData.reversed[πŸ”—](#$api.type~VehicleData.CarriageData.reversed) + +``` +VehicleData.CarriageData.reversed: boolean +``` + +### VehicleData.CarriageData.emissions[πŸ”—](#$api.type~VehicleData.CarriageData.emissions) + +``` +VehicleData.CarriageData.emissions: ModelMetadata.Emissions +``` + +Modified amount of emission for the carrriage + +### VehicleData.bounds[πŸ”—](#$api.type~VehicleData.bounds) + +``` +VehicleData.bounds: VehicleExtent +``` + +space in x-axis/driving direction, values for in front and behind of center + +### VehicleData.length[πŸ”—](#$api.type~VehicleData.length) + +``` +VehicleData.length: number +``` + +total length (without random spacing ahead) + +### VehicleData.topSpeed[πŸ”—](#$api.type~VehicleData.topSpeed) + +``` +VehicleData.topSpeed: number +``` + +minimum of all top speeds + +### VehicleData.brakeDeceleration[πŸ”—](#$api.type~VehicleData.brakeDeceleration) + +``` +VehicleData.brakeDeceleration: number +``` + +Acceleration when breaking (in m / s^2) + +### VehicleData.carriages[πŸ”—](#$api.type~VehicleData.carriages) + +``` +VehicleData.carriages: {CarriageData} +``` + +List of carriaces for the vehicle (applies to trams and trains) + +### VehicleEngineType[πŸ”—](#$api.type~VehicleEngineType) + +``` +global record VehicleEngineType HORSE: VehicleEngineType + STEAM: VehicleEngineType + ELECTRIC: VehicleEngineType + DIESEL: VehicleEngineType +end +``` + +### VehicleEngineType.HORSE[πŸ”—](#$api.type~VehicleEngineType.HORSE) + +``` +VehicleEngineType.HORSE: VehicleEngineType +``` + +### VehicleEngineType.STEAM[πŸ”—](#$api.type~VehicleEngineType.STEAM) + +``` +VehicleEngineType.STEAM: VehicleEngineType +``` + +### VehicleEngineType.ELECTRIC[πŸ”—](#$api.type~VehicleEngineType.ELECTRIC) + +``` +VehicleEngineType.ELECTRIC: VehicleEngineType +``` + +### VehicleEngineType.DIESEL[πŸ”—](#$api.type~VehicleEngineType.DIESEL) + +``` +VehicleEngineType.DIESEL: VehicleEngineType +``` + +### VehicleExtent[πŸ”—](#$api.type~VehicleExtent) + +``` +global record VehicleExtent back: number + front: number +end +``` + +Information about travel-direction extent of an entire vehicle (consist of carriages) + +### VehicleExtent.back[πŸ”—](#$api.type~VehicleExtent.back) + +``` +VehicleExtent.back: number +``` + +negative distance in meters from back to vehicle pin position + +### VehicleExtent.front[πŸ”—](#$api.type~VehicleExtent.front) + +``` +VehicleExtent.front: number +``` + +positive distance in meters from vehicle pin position to front plus some random spacing ahead + +### VehicleIconType[πŸ”—](#$api.type~VehicleIconType) + +``` +global record VehicleIconType Bus: VehicleIconType + Truck: VehicleIconType + TrainSteam: VehicleIconType + TrainElectric: VehicleIconType + TrainDiesel: VehicleIconType + Tram: VehicleIconType + Aircraft: VehicleIconType + Helicopter: VehicleIconType + Ship: VehicleIconType +end +``` + +Icon type used to represent a vehicle. + +### VehicleIconType.Bus[πŸ”—](#$api.type~VehicleIconType.Bus) + +``` +VehicleIconType.Bus: VehicleIconType +``` + +### VehicleIconType.Truck[πŸ”—](#$api.type~VehicleIconType.Truck) + +``` +VehicleIconType.Truck: VehicleIconType +``` + +### VehicleIconType.TrainSteam[πŸ”—](#$api.type~VehicleIconType.TrainSteam) + +``` +VehicleIconType.TrainSteam: VehicleIconType +``` + +### VehicleIconType.TrainElectric[πŸ”—](#$api.type~VehicleIconType.TrainElectric) + +``` +VehicleIconType.TrainElectric: VehicleIconType +``` + +### VehicleIconType.TrainDiesel[πŸ”—](#$api.type~VehicleIconType.TrainDiesel) + +``` +VehicleIconType.TrainDiesel: VehicleIconType +``` + +### VehicleIconType.Tram[πŸ”—](#$api.type~VehicleIconType.Tram) + +``` +VehicleIconType.Tram: VehicleIconType +``` + +### VehicleIconType.Aircraft[πŸ”—](#$api.type~VehicleIconType.Aircraft) + +``` +VehicleIconType.Aircraft: VehicleIconType +``` + +### VehicleIconType.Helicopter[πŸ”—](#$api.type~VehicleIconType.Helicopter) + +``` +VehicleIconType.Helicopter: VehicleIconType +``` + +### VehicleIconType.Ship[πŸ”—](#$api.type~VehicleIconType.Ship) + +``` +VehicleIconType.Ship: VehicleIconType +``` + +### VehiclePart[πŸ”—](#$api.type~VehiclePart) + +``` +global record VehiclePart new: function(): VehiclePart + modelId: integer + reversed: boolean + compartment2loadConfig: {LoadConfig} + color: Vec3f +end +``` + +Configuration for a single vehicle part/unit + +### VehiclePart.new[πŸ”—](#$api.type~VehiclePart.new) + +``` +function VehiclePart.new(): VehiclePart +``` + +**Returns** + +1. `VehiclePart` + +### VehiclePart.modelId[πŸ”—](#$api.type~VehiclePart.modelId) + +``` +VehiclePart.modelId: integer +``` + +### VehiclePart.reversed[πŸ”—](#$api.type~VehiclePart.reversed) + +``` +VehiclePart.reversed: boolean +``` + +Whether the vehicle part is reversed (facing backwards) + +### VehiclePart.compartment2loadConfig[πŸ”—](#$api.type~VehiclePart.compartment2loadConfig) + +``` +VehiclePart.compartment2loadConfig: {LoadConfig} +``` + +Cargo configuration for the model. One entry per compartment. -1 means automatic selection of load config. + +### VehiclePart.color[πŸ”—](#$api.type~VehiclePart.color) + +``` +VehiclePart.color: Vec3f +``` + +### VehiclePartInfo[πŸ”—](#$api.type~VehiclePartInfo) + +``` +[Expand All] [Collapse All] + +global record VehiclePartInfo record Seat occupied: Engine.Entity + animation: string + crew: boolean +end + seats: {Seat} + count: number +end +``` + +Details about a vehicle part + +### VehiclePartInfo.Seat[πŸ”—](#$api.type~VehiclePartInfo.Seat) + +``` +record VehiclePartInfo.Seat occupied: Engine.Entity + animation: string + crew: boolean +end +``` + +A single seat in a vehicle + +### VehiclePartInfo.Seat.occupied[πŸ”—](#$api.type~VehiclePartInfo.Seat.occupied) + +``` +VehiclePartInfo.Seat.occupied: Engine.Entity +``` + +Entity occupying this seat + +### VehiclePartInfo.Seat.animation[πŸ”—](#$api.type~VehiclePartInfo.Seat.animation) + +``` +VehiclePartInfo.Seat.animation: string +``` + +Animation playing for this seat + +### VehiclePartInfo.Seat.crew[πŸ”—](#$api.type~VehiclePartInfo.Seat.crew) + +``` +VehiclePartInfo.Seat.crew: boolean +``` + +### VehiclePartInfo.seats[πŸ”—](#$api.type~VehiclePartInfo.seats) + +``` +VehiclePartInfo.seats: {Seat} +``` + +List of seats in this vehicle part + +### VehiclePartInfo.count[πŸ”—](#$api.type~VehiclePartInfo.count) + +``` +VehiclePartInfo.count: number +``` + +Number of occupied seats on this vehicles + +### VehicleProblem[πŸ”—](#$api.type~VehicleProblem) + +``` +global record VehicleProblem NoPathElectric: integer + NoPathShip: integer + NoPathAircraft: integer + NoPathGeneric: integer + Blocked: integer +end +``` + +Information about the problem of a vehicle. + +### VehicleProblem.NoPathElectric[πŸ”—](#$api.type~VehicleProblem.NoPathElectric) + +``` +VehicleProblem.NoPathElectric: integer +``` + +### VehicleProblem.NoPathShip[πŸ”—](#$api.type~VehicleProblem.NoPathShip) + +``` +VehicleProblem.NoPathShip: integer +``` + +### VehicleProblem.NoPathAircraft[πŸ”—](#$api.type~VehicleProblem.NoPathAircraft) + +``` +VehicleProblem.NoPathAircraft: integer +``` + +### VehicleProblem.NoPathGeneric[πŸ”—](#$api.type~VehicleProblem.NoPathGeneric) + +``` +VehicleProblem.NoPathGeneric: integer +``` + +### VehicleProblem.Blocked[πŸ”—](#$api.type~VehicleProblem.Blocked) + +``` +VehicleProblem.Blocked: integer +``` + +### VehicleState[πŸ”—](#$api.type~VehicleState) + +``` +global record VehicleState RUNNING: VehicleState + STOPPING: VehicleState + STOPPED: VehicleState + ARRIVED: VehicleState +end +``` + +Current state of a vehicle's movement + +### VehicleState.RUNNING[πŸ”—](#$api.type~VehicleState.RUNNING) + +``` +VehicleState.RUNNING: VehicleState +``` + +Vehicle is actively moving + +### VehicleState.STOPPING[πŸ”—](#$api.type~VehicleState.STOPPING) + +``` +VehicleState.STOPPING: VehicleState +``` + +Vehicle is in the process of stopping (due to player / script interaction) + +### VehicleState.STOPPED[πŸ”—](#$api.type~VehicleState.STOPPED) + +``` +VehicleState.STOPPED: VehicleState +``` + +Vehicle is completely stopped and must be un-stopped by player / script + +### VehicleState.ARRIVED[πŸ”—](#$api.type~VehicleState.ARRIVED) + +``` +VehicleState.ARRIVED: VehicleState +``` + +Vehicle has arrived at its destination + +### Vendor[πŸ”—](#$api.type~Vendor) + +``` +global record Vendor Steam: Vendor + Gog: Vendor + Eos: Vendor + MacAppstore: Vendor + Microsoft: Vendor + Sony: Vendor + Dev: Vendor +end +``` + +Vendor represents the vendor (store) type. + +### Vendor.Steam[πŸ”—](#$api.type~Vendor.Steam) + +``` +Vendor.Steam: Vendor +``` + +### Vendor.Gog[πŸ”—](#$api.type~Vendor.Gog) + +``` +Vendor.Gog: Vendor +``` + +### Vendor.Eos[πŸ”—](#$api.type~Vendor.Eos) + +``` +Vendor.Eos: Vendor +``` + +### Vendor.MacAppstore[πŸ”—](#$api.type~Vendor.MacAppstore) + +``` +Vendor.MacAppstore: Vendor +``` + +### Vendor.Microsoft[πŸ”—](#$api.type~Vendor.Microsoft) + +``` +Vendor.Microsoft: Vendor +``` + +### Vendor.Sony[πŸ”—](#$api.type~Vendor.Sony) + +``` +Vendor.Sony: Vendor +``` + +### Vendor.Dev[πŸ”—](#$api.type~Vendor.Dev) + +``` +Vendor.Dev: Vendor +``` + +### View[πŸ”—](#$api.type~View) + +``` +global record View getEye: function(View): Vec3f + getCenter: function(View): Vec3f + getUp: function(View): Vec3f + isVisible: function(view : View, position : Vec3f, radius : number): boolean +end +``` + +Camera view information + +### View.getEye[πŸ”—](#$api.type~View.getEye) + +``` +function View.getEye(View): Vec3f +``` + +Get the camera eye position + +**Parameters** + +* `View` + +**Returns** + +1. `Vec3f` β€” Eye position + +### View.getCenter[πŸ”—](#$api.type~View.getCenter) + +``` +function View.getCenter(View): Vec3f +``` + +Get the camera center position + +**Parameters** + +* `View` + +**Returns** + +1. `Vec3f` β€” Center position + +### View.getUp[πŸ”—](#$api.type~View.getUp) + +``` +function View.getUp(View): Vec3f +``` + +Get the camera up vector + +**Parameters** + +* `View` + +**Returns** + +1. `Vec3f` β€” Up vector + +### View.isVisible[πŸ”—](#$api.type~View.isVisible) + +``` +function View.isVisible(view : View, position : Vec3f, radius : number): boolean +``` + +Check if a sphere is visible in the current view + +**Parameters** + +* `view` :`View` β€” The view +* `position` :`Vec3f` β€” Center of the sphere +* `radius` :`number` β€” Radius of the sphere + +**Returns** + +1. `boolean` β€” True if visible + +### Waypoint[πŸ”—](#$api.type~Waypoint) + +``` +global record Waypoint new: function(): Waypoint + + clone: function(Waypoint): Waypoint + equals: function(Waypoint, Waypoint) + edgePos: EdgePos + pos: Vec3f + tag: integer +end +``` + +References the position of a waypoint, which is either an EdgePos or a Vec3f + +### Waypoint.new()[πŸ”—](#$api.type~Waypoint.new()) + +``` +function Waypoint.new()(): Waypoint +``` + +**Returns** + +1. `Waypoint` + +### Waypoint.new(Waypoint)[πŸ”—](#$api.type~Waypoint.new(Waypoint)) + +``` +function Waypoint.new(Waypoint)(Waypoint): Waypoint +``` + +**Parameters** + +* `Waypoint` + +**Returns** + +1. `Waypoint` + +### Waypoint.clone[πŸ”—](#$api.type~Waypoint.clone) + +``` +function Waypoint.clone(Waypoint): Waypoint +``` + +**Parameters** + +* `Waypoint` + +**Returns** + +1. `Waypoint` + +### Waypoint.equals[πŸ”—](#$api.type~Waypoint.equals) + +``` +function Waypoint.equals(Waypoint, Waypoint) +``` + +**Parameters** + +* `Waypoint` +* `Waypoint` + +### Waypoint.edgePos[πŸ”—](#$api.type~Waypoint.edgePos) + +``` +Waypoint.edgePos: EdgePos +``` + +Edge position when using lanes + +### Waypoint.pos[πŸ”—](#$api.type~Waypoint.pos) + +``` +Waypoint.pos: Vec3f +``` + +3D position for ships and aircraft + +### Waypoint.tag[πŸ”—](#$api.type~Waypoint.tag) + +``` +Waypoint.tag: integer +``` + +tag to uniquely identify a waypoint even across addition/removal + +### WeightUnit[πŸ”—](#$api.type~WeightUnit) + +``` +global record WeightUnit T: WeightUnit + KG: WeightUnit + TN_SH: WeightUnit + LB: WeightUnit +end +``` + +WeightUnit represents the unit of measurement used for weight. + +### WeightUnit.T[πŸ”—](#$api.type~WeightUnit.T) + +``` +WeightUnit.T: WeightUnit +``` + +### WeightUnit.KG[πŸ”—](#$api.type~WeightUnit.KG) + +``` +WeightUnit.KG: WeightUnit +``` + +### WeightUnit.TN\_SH[πŸ”—](#$api.type~WeightUnit.TN_SH) + +``` +WeightUnit.TN_SH: WeightUnit +``` + +### WeightUnit.LB[πŸ”—](#$api.type~WeightUnit.LB) + +``` +WeightUnit.LB: WeightUnit +``` + +### ipairs\_native[πŸ”—](#$api.type~ipairs_native) + +``` +global record ipairs_native metamethod __call: function(ipairs_native): function() : (integer, T) +end +``` + +##### Type Parameters + +* **`T`** + +### ipairs\_native.$meta.\_\_call[πŸ”—](#$api.type~ipairs_native.$meta.__call) + +``` +metamethod ipairs_native.$meta.__call(ipairs_native): function() : (integer, T) +``` + +**Parameters** + +* `ipairs_native` + +**Returns** + +1. `function(): (integer, T)` + +### orderedPairs[πŸ”—](#$api.type~orderedPairs) + +``` +global record orderedPairs metamethod __call: function(orderedPairs, any): function() : (T, V) +end +``` + +##### Type Parameters + +* **`T`** +* **`V`** + +### orderedPairs.$meta.\_\_call[πŸ”—](#$api.type~orderedPairs.$meta.__call) + +``` +metamethod orderedPairs.$meta.__call(orderedPairs, any): function() : (T, V) +``` + +**Parameters** + +* `orderedPairs` +* `any` + +**Returns** + +1. `function(): (T, V)` + +### pairs\_native[πŸ”—](#$api.type~pairs_native) + +``` +global record pairs_native metamethod __call: function(pairs_native): function() : (T, V) +end +``` + +##### Type Parameters + +* **`T`** +* **`V`** + +### pairs\_native.$meta.\_\_call[πŸ”—](#$api.type~pairs_native.$meta.__call) + +``` +metamethod pairs_native.$meta.__call(pairs_native): function() : (T, V) +``` + +**Parameters** + +* `pairs_native` + +**Returns** + +1. `function(): (T, V)` + +### recordDef[πŸ”—](#$api.type~recordDef) + +``` +global recordDef: boolean +``` diff --git a/docs/reference/script-doc/api_type_mod.md b/docs/reference/script-doc/api_type_mod.md new file mode 100644 index 0000000..9f6986c --- /dev/null +++ b/docs/reference/script-doc/api_type_mod.md @@ -0,0 +1,479 @@ + + +[index](../../index.html) / [api](../../api.html) / [type](../type.html) / mod + +--- + +# Module api.type.mod[πŸ”—](#api.type.mod) + +Contains all type definitions for the mods. + +``` +[Expand All] [Collapse All] + +global record Mod record ModId new: function(): ModId + equals: function(ModId, ModId): boolean + name: string +end + record ModRef modId: ModId + revisionMin: integer + revisionMax: integer +end + record ModRefInfo displayName: string + url: string +end + record ModDependency mod: ModRef + optional: boolean + loadBefore: boolean + modInfo: ModRefInfo +end + record ModIncompatibility mod: ModRef +end + record GameModDesc modId: ModId + modSource: string + modhubModId: string + name: string + severityRemove: integer +end + record ModDesc severityAdd: integer + severityRemove: integer + params: {ScriptParam} + visible: boolean + cosmetic: boolean + autoActivate: boolean + url: string + dependencies: {ModDependency} + incompatibilities: {ModIncompatibility} + revision: integer +end + record ModSize numModels: integer + numTextures: integer + numMeshes: integer + totalEstimatedSizeMB: integer +end +end +global type ModId = integer +``` + +## Category: main[πŸ”—](#category-main) + +### Mod[πŸ”—](#$api.type.mod~Mod) + +``` +[Expand All] [Collapse All] + +global record Mod record ModId new: function(): ModId + equals: function(ModId, ModId): boolean + name: string +end + record ModRef modId: ModId + revisionMin: integer + revisionMax: integer +end + record ModRefInfo displayName: string + url: string +end + record ModDependency mod: ModRef + optional: boolean + loadBefore: boolean + modInfo: ModRefInfo +end + record ModIncompatibility mod: ModRef +end + record GameModDesc modId: ModId + modSource: string + modhubModId: string + name: string + severityRemove: integer +end + record ModDesc severityAdd: integer + severityRemove: integer + params: {ScriptParam} + visible: boolean + cosmetic: boolean + autoActivate: boolean + url: string + dependencies: {ModDependency} + incompatibilities: {ModIncompatibility} + revision: integer +end + record ModSize numModels: integer + numTextures: integer + numMeshes: integer + totalEstimatedSizeMB: integer +end +end +``` + +Refer to https://wiki.transportfever3.com/doku.php?id=modding:moddefinition for more details about mod and mod interface in general + +### Mod.ModId[πŸ”—](#$api.type.mod~Mod.ModId) + +``` +record Mod.ModId new: function(): ModId + equals: function(ModId, ModId): boolean + name: string +end +``` + +Mod identifier + +### Mod.ModId.new[πŸ”—](#$api.type.mod~Mod.ModId.new) + +``` +function Mod.ModId.new(): ModId +``` + +**Returns** + +1. `ModId` + +### Mod.ModId.equals[πŸ”—](#$api.type.mod~Mod.ModId.equals) + +``` +function Mod.ModId.equals(ModId, ModId): boolean +``` + +**Parameters** + +* `ModId` +* `ModId` + +**Returns** + +1. `boolean` + +### Mod.ModId.name[πŸ”—](#$api.type.mod~Mod.ModId.name) + +``` +Mod.ModId.name: string +``` + +A string that identify the mod + +### Mod.ModRef[πŸ”—](#$api.type.mod~Mod.ModRef) + +``` +record Mod.ModRef modId: ModId + revisionMin: integer + revisionMax: integer +end +``` + +A reference to a mod + +### Mod.ModRef.modId[πŸ”—](#$api.type.mod~Mod.ModRef.modId) + +``` +Mod.ModRef.modId: ModId +``` + +Mod id + +### Mod.ModRef.revisionMin[πŸ”—](#$api.type.mod~Mod.ModRef.revisionMin) + +``` +Mod.ModRef.revisionMin: integer +``` + +The minimum compatible revision + +### Mod.ModRef.revisionMax[πŸ”—](#$api.type.mod~Mod.ModRef.revisionMax) + +``` +Mod.ModRef.revisionMax: integer +``` + +The maximum compatible revision + +### Mod.ModRefInfo[πŸ”—](#$api.type.mod~Mod.ModRefInfo) + +``` +record Mod.ModRefInfo displayName: string + url: string +end +``` + +User facing mod informations + +### Mod.ModRefInfo.displayName[πŸ”—](#$api.type.mod~Mod.ModRefInfo.displayName) + +``` +Mod.ModRefInfo.displayName: string +``` + +Display name of the mod + +### Mod.ModRefInfo.url[πŸ”—](#$api.type.mod~Mod.ModRefInfo.url) + +``` +Mod.ModRefInfo.url: string +``` + +URL to the mod page + +### Mod.ModDependency[πŸ”—](#$api.type.mod~Mod.ModDependency) + +``` +record Mod.ModDependency mod: ModRef + optional: boolean + loadBefore: boolean + modInfo: ModRefInfo +end +``` + +Describes a dependency to another mod + +### Mod.ModDependency.mod[πŸ”—](#$api.type.mod~Mod.ModDependency.mod) + +``` +Mod.ModDependency.mod: ModRef +``` + +Mod Ref of the depedency + +### Mod.ModDependency.optional[πŸ”—](#$api.type.mod~Mod.ModDependency.optional) + +``` +Mod.ModDependency.optional: boolean +``` + +If the depedency is optional + +### Mod.ModDependency.loadBefore[πŸ”—](#$api.type.mod~Mod.ModDependency.loadBefore) + +``` +Mod.ModDependency.loadBefore: boolean +``` + +If this depedency needs to be loaded before the dependant + +### Mod.ModDependency.modInfo[πŸ”—](#$api.type.mod~Mod.ModDependency.modInfo) + +``` +Mod.ModDependency.modInfo: ModRefInfo +``` + +Mod info for the depedency + +### Mod.ModIncompatibility[πŸ”—](#$api.type.mod~Mod.ModIncompatibility) + +``` +record Mod.ModIncompatibility mod: ModRef +end +``` + +Describes an incompatibility with another mod + +### Mod.ModIncompatibility.mod[πŸ”—](#$api.type.mod~Mod.ModIncompatibility.mod) + +``` +Mod.ModIncompatibility.mod: ModRef +``` + +### Mod.GameModDesc[πŸ”—](#$api.type.mod~Mod.GameModDesc) + +``` +record Mod.GameModDesc modId: ModId + modSource: string + modhubModId: string + name: string + severityRemove: integer +end +``` + +Contains general information about the mod + +### Mod.GameModDesc.modId[πŸ”—](#$api.type.mod~Mod.GameModDesc.modId) + +``` +Mod.GameModDesc.modId: ModId +``` + +Mod id + +### Mod.GameModDesc.modSource[πŸ”—](#$api.type.mod~Mod.GameModDesc.modSource) + +``` +Mod.GameModDesc.modSource: string +``` + +The origin of the mod (eg. User Mod, Staging Area, DLC, mod.io, ...) + +### Mod.GameModDesc.modhubModId[πŸ”—](#$api.type.mod~Mod.GameModDesc.modhubModId) + +``` +Mod.GameModDesc.modhubModId: string +``` + +Mod id in the modhub backend + +### Mod.GameModDesc.name[πŸ”—](#$api.type.mod~Mod.GameModDesc.name) + +``` +Mod.GameModDesc.name: string +``` + +Display name of the mod (User facing) + +### Mod.GameModDesc.severityRemove[πŸ”—](#$api.type.mod~Mod.GameModDesc.severityRemove) + +``` +Mod.GameModDesc.severityRemove: integer +``` + +If removing this mod could cause instability to a savegame. +Any value above 0 will trigger a message when trying to remove the mod from a savegame +0: None, 1: Warning, 2:Critical + +### Mod.ModDesc[πŸ”—](#$api.type.mod~Mod.ModDesc) + +``` +record Mod.ModDesc severityAdd: integer + severityRemove: integer + params: {ScriptParam} + visible: boolean + cosmetic: boolean + autoActivate: boolean + url: string + dependencies: {ModDependency} + incompatibilities: {ModIncompatibility} + revision: integer +end +``` + +### Mod.ModDesc.severityAdd[πŸ”—](#$api.type.mod~Mod.ModDesc.severityAdd) + +``` +Mod.ModDesc.severityAdd: integer +``` + +If adding this mod could cause instability to a savegame. +Any value above 0 will trigger a message when trying to add the mod to a savegame +0: None, 1: Warning, 2:Critical + +### Mod.ModDesc.severityRemove[πŸ”—](#$api.type.mod~Mod.ModDesc.severityRemove) + +``` +Mod.ModDesc.severityRemove: integer +``` + +If removing this mod could cause instability to a savegame. +Any value above 0 will trigger a message when trying to remove the mod from a savegame +0: None, 1: Warning, 2:Critical + +### Mod.ModDesc.params[πŸ”—](#$api.type.mod~Mod.ModDesc.params) + +``` +Mod.ModDesc.params: {ScriptParam} +``` + +Script parameters to dynamically configure the mod + +### Mod.ModDesc.visible[πŸ”—](#$api.type.mod~Mod.ModDesc.visible) + +``` +Mod.ModDesc.visible: boolean +``` + +If if the mod is visible, hidden mod cannot auto-activate + +### Mod.ModDesc.cosmetic[πŸ”—](#$api.type.mod~Mod.ModDesc.cosmetic) + +``` +Mod.ModDesc.cosmetic: boolean +``` + +If the mod is purely cosmetic, cosmetic mods still allow achievement from being earned while playing + +### Mod.ModDesc.autoActivate[πŸ”—](#$api.type.mod~Mod.ModDesc.autoActivate) + +``` +Mod.ModDesc.autoActivate: boolean +``` + +If the mod is automatically activate by the game + +### Mod.ModDesc.url[πŸ”—](#$api.type.mod~Mod.ModDesc.url) + +``` +Mod.ModDesc.url: string +``` + +URL to the mod page + +### Mod.ModDesc.dependencies[πŸ”—](#$api.type.mod~Mod.ModDesc.dependencies) + +``` +Mod.ModDesc.dependencies: {ModDependency} +``` + +Mods this mod depends on + +### Mod.ModDesc.incompatibilities[πŸ”—](#$api.type.mod~Mod.ModDesc.incompatibilities) + +``` +Mod.ModDesc.incompatibilities: {ModIncompatibility} +``` + +Mods this mod is incompatible with + +### Mod.ModDesc.revision[πŸ”—](#$api.type.mod~Mod.ModDesc.revision) + +``` +Mod.ModDesc.revision: integer +``` + +version of the mod + +### Mod.ModSize[πŸ”—](#$api.type.mod~Mod.ModSize) + +``` +record Mod.ModSize numModels: integer + numTextures: integer + numMeshes: integer + totalEstimatedSizeMB: integer +end +``` + +Information about the size of the mod + +### Mod.ModSize.numModels[πŸ”—](#$api.type.mod~Mod.ModSize.numModels) + +``` +Mod.ModSize.numModels: integer +``` + +The number of models contained in the mod + +### Mod.ModSize.numTextures[πŸ”—](#$api.type.mod~Mod.ModSize.numTextures) + +``` +Mod.ModSize.numTextures: integer +``` + +The number of texture contained in the mod + +### Mod.ModSize.numMeshes[πŸ”—](#$api.type.mod~Mod.ModSize.numMeshes) + +``` +Mod.ModSize.numMeshes: integer +``` + +The number of meshes contained in the mod + +### Mod.ModSize.totalEstimatedSizeMB[πŸ”—](#$api.type.mod~Mod.ModSize.totalEstimatedSizeMB) + +``` +Mod.ModSize.totalEstimatedSizeMB: integer +``` + +The approximate size of the mod + +## Category: globals[πŸ”—](#category-globals) + +### ModId[πŸ”—](#$api.type.mod~ModId) + +``` +global type ModId = integer +``` diff --git a/docs/reference/script-doc/api_type_modhub.md b/docs/reference/script-doc/api_type_modhub.md new file mode 100644 index 0000000..36eabb1 --- /dev/null +++ b/docs/reference/script-doc/api_type_modhub.md @@ -0,0 +1,3767 @@ + + +[index](../../index.html) / [api](../../api.html) / [type](../type.html) / modhub + +--- + +# Module api.type.modhub[πŸ”—](#api.type.modhub) + +Contains all type definitions for the modhub. + +``` +[Expand All] [Collapse All] + +global record Modhub record ModValidatorMessage context: string + file: string + level: LogLevel + message: string + consoleOnly: boolean +end + record ModValidatorResult messages: {ModValidatorMessage} + criticalPc: boolean + criticalConsole: boolean + cookedPcPath: string + cookedConsolePath: string + levelPc: LogLevel + levelConsole: LogLevel +end + record ModHubErrorCode code: integer + message: string + fields: {string : string} +end + record SortType Trending: SortType + Rating: SortType + SubscriberCount: SortType + DateAdded: SortType + DateUpdated: SortType + Name: SortType + Source: SortType + Custom: SortType +end + record SortOrder sortType: SortType + allowAscDesc: boolean +end + record TagGroup name: string + values: {string} + allowMultipleSelection: boolean + noSortTag: boolean + visible: boolean +end + record SortAndFilterOptions tagGroups: {TagGroup} + sortOrders: {SortOrder} + statusTagGroupIndex: integer +end + record UserInfo userName: string + profileUrl: string + displayName: string +end + record ModId new: function(): ModId + isValid: function(ModId): boolean + value: string +end + record UserId new: function(integer): UserId + equals: function(UserId, UserId): boolean + isValid: function(UserId): boolean + value: integer +end + record ModManagementMode Disabled: ModManagementMode + Restricted: ModManagementMode + Full: ModManagementMode +end + record InstallState None: InstallState + Downloading: InstallState + UpdatePending: InstallState + Installed: InstallState + DownloadPending: InstallState + InstallationPending: InstallState + UninstallPending: InstallState + Extracting: InstallState + InsufficientSpace: InstallState + MiscError: InstallState +end + record ModInstallInfo installPath: string + runtimeRevision: integer +end + record ModReleaseInfo version: string + releaseNotes: string + releaseUnixTimestamp: integer +end + record ModInfo modId: ModId + modSource: string + visible: boolean + numDownloads: integer + numSubscribers: integer + title: string + url: string + summary: string + description: string + descriptionHtml: string + logoImage: string + installSize: integer + likes: integer + dislikes: integer + rating: number + tags: {string} + publishedUnixTimestamp: integer + updatedUnixTimestamp: integer + releaseInfo: ModReleaseInfo + memoryUsage: integer +end + record ModMediaType Logo: ModMediaType + GalleryThumb180p: ModMediaType + GalleryThumb720p: ModMediaType + GalleryOriginal: ModMediaType + AuthorAvatar: ModMediaType +end + record AuthenticationType Email: AuthenticationType + Steam: AuthenticationType + SteamOffline: AuthenticationType + Gog: AuthenticationType + Epic: AuthenticationType + XboxLive: AuthenticationType + PSN: AuthenticationType + Paradox: AuthenticationType +end + record RatingType Neutral: RatingType + Positive: RatingType + Negative: RatingType +end + record ReportType Generic: ReportType + DMCA: ReportType + NotWorking: ReportType + RudeContent: ReportType + IllegalContent: ReportType + StolenContent: ReportType + FalseInformation: ReportType + Other: ReportType +end + record StorageInfo usedSpace: integer + totalSpace: integer +end + record ModManagementState uploading: boolean + busy: boolean + totalPending: integer + pending: {ModId} + finished: {ModId} + progress: number + currentModId: ModId +end + record Capabilities allowForceUninstall: boolean + authenticationTypes: {AuthenticationType} + manualRefresh: boolean + specialModRefresh: boolean + allowReport: boolean + isInfoOnly: boolean + allowUnsubscribeInstalledMods: boolean + allowRestrictedMode: boolean + allowModUpload: boolean + visibleInModHub: boolean +end + record Description name: string + nameLocalized: string + url: string + icon: string +end + record EmailAuthCodeRequest new: function(string): EmailAuthCodeRequest + email: string +end + record EmailAuthCodeData record Response ValidationError: Response + NeedAuthCode: Response + Authenticated: Response +end + response: Response +end + record AuthenticateUserEmailRequest new: function(string): AuthenticateUserEmailRequest + authCode: string +end + record AuthenticateUserEmailData record Response ValidationError: Response + ExpiredAuthCode: Response + Authenticated: Response +end + response: Response +end + record TermsOfUseRequest new: function(AuthenticationType): TermsOfUseRequest + type: AuthenticationType +end + record TermsOfUseData terms: string + agreeLabel: string + disagreeLabel: string +end + record AuthenticateUserExternalRequest new: function(AuthenticationType): AuthenticateUserExternalRequest + type: AuthenticationType + email: string +end + record AuthenticateUserExternalData record Response UnkownError: Response + PortalSignInError: Response + ValidationError: Response + Authenticated: Response +end + response: Response +end + record LogoutDataend + record ListModsRequest new: function(): ListModsRequest + page: integer + preferedPageSize: integer + searchString: string + sortType: SortType + sortAscending: boolean + tags: {integer} + fetchLongDescription: boolean +end + record ListModsData modInfos: {ModInfo} + modsPerPage: integer + totalResultCount: integer +end + record GetModDetailsRequest new: function(ModId): GetModDetailsRequest + modId: ModId +end + record UserPortal XboxLive: UserPortal + PlaystationNetwork: UserPortal + Misc: UserPortal +end + record ModDetailsData new: function(): ModDetailsData + modInfo: ModInfo + author: string + userId: UserId + userPortal: UserPortal + numGalleryImages: integer + logoImage: string + galleryImages: {string} + dependencies: {{ModId, string}} + found: boolean +end + record GetModMediaRequest new: function(ModId, ModMediaType, integer): GetModMediaRequest + modId: ModId + type: ModMediaType + galleryIndex: integer +end + record ModMediaData new: function(): ModMediaData + width: integer + height: integer + channels: integer + data: {integer} + data_native: Vector +end + record GetModRatingRequest new: function(ModId): GetModRatingRequest + modId: ModId +end + record ModRatingData new: function(): ModRatingData + rating: RatingType +end + record SubscribeModRequest new: function(ModId): SubscribeModRequest + modId: ModId + includeDependencies: boolean +end + record UnsubscribeModRequest new: function(ModId): UnsubscribeModRequest + modId: ModId +end + record SubscriptionDataend + record RefreshData numRefreshed: integer +end + record ForceUninstallModRequest new: function(ModId): ForceUninstallModRequest + modId: ModId +end + record ForceUninstallModDataend + record SpecialRefreshModRequest new: function(ModId, boolean): SpecialRefreshModRequest + modId: ModId + unsubscribe: boolean +end + record SpecialRefreshModDataend + record RestartModBackendDataend + record SubmitModRatingRequest new: function(ModId, RatingType): SubmitModRatingRequest + modId: ModId + rating: RatingType +end + record SubmitModRatingData rating: RatingType +end + record SubmitModReportRequest new: function(ModId, ReportType, string, string, string): SubmitModReportRequest + modId: ModId + type: ReportType + reportDescription: string + reporterName: string + reporterContact: string +end + record SubmitModReportData record Response ValidationError: Response + Submitted: Response +end + response: Response +end + record UploadModData modId: ModId + partialErrors: {ModHubErrorCode} +end + record UniquePendingRequestId abort: function(UniquePendingRequestId) +end + record AsyncResult isSuccess: function(AsyncResult): boolean + getData: function(AsyncResult): T + getError: function(AsyncResult): ModHubErrorCode +end + type BackendId = integer + record ModBrowserDisplayData record Entry backendId: BackendId + modInfo: ModInfo + modId: Mod.ModId +end + entries: {Entry} + error: Modhub.ModHubErrorCode + currentPage: integer + numPages: integer + displayPerPage: integer + totalResults: integer + appendResults: boolean + searchString: string + sortType: Modhub.SortType + hasNoSortTag: boolean + filterTags: {string} + excludeTags: {string} +end + record ModBrowserDataProvider new: function(BackendId, integer): ModBrowserDataProvider + newForSelector: function(integer, function(Mod.ModId, Mod.ModId), {Mod.GameModDesc}): ModBrowserDataProvider + suspend: function(ModBrowserDataProvider) + resume: function(ModBrowserDataProvider) + getDisplayData: function(ModBrowserDataProvider): ModBrowserDisplayData + setLoadPage: function(ModBrowserDataProvider, integer) + setNextContinuousPage: function(ModBrowserDataProvider) + setCurrentPage: function(ModBrowserDataProvider, integer) + setSearchString: function(ModBrowserDataProvider, string) + setSearchUserId: function(ModBrowserDataProvider, UserId) + setNextPage: function(ModBrowserDataProvider) + setPreviousPage: function(ModBrowserDataProvider) + refreshCurrentPage: function(ModBrowserDataProvider, boolean) + getSortType: function(ModBrowserDataProvider): Modhub.SortType + getTagToggled: function(ModBrowserDataProvider, string): boolean + setSortType: function(ModBrowserDataProvider, SortType) + setNextSortType: function(ModBrowserDataProvider) + toggleTag: function(ModBrowserDataProvider, string) + resetFilters: function(ModBrowserDataProvider) + getSortAndFilterOptions: function(ModBrowserDataProvider): Modhub.SortAndFilterOptions +end + record StagingModData record State Sync: State + Ready: State + Publishing: State + HasResult: State +end + equals: function(StagingModData, StagingModData): boolean + localModhubDetails: Modhub.ModDetailsData + state: State + modhubId: Modhub.ModId + modhubDetails: Modhub.ModDetailsData + publishResult: AsyncResult +end + record PublishSettings new: function(): PublishSettings + + changeLog: string + updateMetadata: boolean + setPublic: boolean +end + record ModPublishHelper new: function(BackendId): ModPublishHelper + hasAnyStagingMods: function(publishHelper : ModPublishHelper): boolean + canRefresh: function(publishHelper : ModPublishHelper): boolean + refresh: function(publishHelper : ModPublishHelper): AsyncResult + hasStagingMod: function(publishHelper : ModPublishHelper, modId : Modhub.ModId): boolean + getStagingModData: function(publishHelper : ModPublishHelper, modId : Modhub.ModId): StagingModData + setModDetails: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, modDetailsData : Modhub.ModDetailsData) + setRemoteModId: function(publishHelper : ModPublishHelper, localModId : Modhub.ModId, remoteModId : Modhub.ModId) + publish: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, publishSettings : PublishSettings, validationResult : Modhub.ModValidatorResult): AsyncResult + abortPublish: function(publishHelper : ModPublishHelper, modId : Modhub.ModId): UniquePendingRequestId + addLogoImage: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, image : string) + removeLogoImage: function(publishHelper : ModPublishHelper, modId : Modhub.ModId) + addGalleryImages: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, images : {string}) + removeGalleryImage: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, index : integer) + moveGalleryImage: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, fromIndex : integer, toIndex : integer) + setPostPublishFn: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, publishFn : function(Modhub.ModId)) + openFolder: function(publishHelper : ModPublishHelper, modId : Modhub.ModId) + getSortAndFilterOptions: function(publishHelper : ModPublishHelper): Modhub.SortAndFilterOptions +end +end +``` + +## Category: main[πŸ”—](#category-main) + +### Modhub[πŸ”—](#$api.type.modhub~Modhub) + +``` +[Expand All] [Collapse All] + +global record Modhub record ModValidatorMessage context: string + file: string + level: LogLevel + message: string + consoleOnly: boolean +end + record ModValidatorResult messages: {ModValidatorMessage} + criticalPc: boolean + criticalConsole: boolean + cookedPcPath: string + cookedConsolePath: string + levelPc: LogLevel + levelConsole: LogLevel +end + record ModHubErrorCode code: integer + message: string + fields: {string : string} +end + record SortType Trending: SortType + Rating: SortType + SubscriberCount: SortType + DateAdded: SortType + DateUpdated: SortType + Name: SortType + Source: SortType + Custom: SortType +end + record SortOrder sortType: SortType + allowAscDesc: boolean +end + record TagGroup name: string + values: {string} + allowMultipleSelection: boolean + noSortTag: boolean + visible: boolean +end + record SortAndFilterOptions tagGroups: {TagGroup} + sortOrders: {SortOrder} + statusTagGroupIndex: integer +end + record UserInfo userName: string + profileUrl: string + displayName: string +end + record ModId new: function(): ModId + isValid: function(ModId): boolean + value: string +end + record UserId new: function(integer): UserId + equals: function(UserId, UserId): boolean + isValid: function(UserId): boolean + value: integer +end + record ModManagementMode Disabled: ModManagementMode + Restricted: ModManagementMode + Full: ModManagementMode +end + record InstallState None: InstallState + Downloading: InstallState + UpdatePending: InstallState + Installed: InstallState + DownloadPending: InstallState + InstallationPending: InstallState + UninstallPending: InstallState + Extracting: InstallState + InsufficientSpace: InstallState + MiscError: InstallState +end + record ModInstallInfo installPath: string + runtimeRevision: integer +end + record ModReleaseInfo version: string + releaseNotes: string + releaseUnixTimestamp: integer +end + record ModInfo modId: ModId + modSource: string + visible: boolean + numDownloads: integer + numSubscribers: integer + title: string + url: string + summary: string + description: string + descriptionHtml: string + logoImage: string + installSize: integer + likes: integer + dislikes: integer + rating: number + tags: {string} + publishedUnixTimestamp: integer + updatedUnixTimestamp: integer + releaseInfo: ModReleaseInfo + memoryUsage: integer +end + record ModMediaType Logo: ModMediaType + GalleryThumb180p: ModMediaType + GalleryThumb720p: ModMediaType + GalleryOriginal: ModMediaType + AuthorAvatar: ModMediaType +end + record AuthenticationType Email: AuthenticationType + Steam: AuthenticationType + SteamOffline: AuthenticationType + Gog: AuthenticationType + Epic: AuthenticationType + XboxLive: AuthenticationType + PSN: AuthenticationType + Paradox: AuthenticationType +end + record RatingType Neutral: RatingType + Positive: RatingType + Negative: RatingType +end + record ReportType Generic: ReportType + DMCA: ReportType + NotWorking: ReportType + RudeContent: ReportType + IllegalContent: ReportType + StolenContent: ReportType + FalseInformation: ReportType + Other: ReportType +end + record StorageInfo usedSpace: integer + totalSpace: integer +end + record ModManagementState uploading: boolean + busy: boolean + totalPending: integer + pending: {ModId} + finished: {ModId} + progress: number + currentModId: ModId +end + record Capabilities allowForceUninstall: boolean + authenticationTypes: {AuthenticationType} + manualRefresh: boolean + specialModRefresh: boolean + allowReport: boolean + isInfoOnly: boolean + allowUnsubscribeInstalledMods: boolean + allowRestrictedMode: boolean + allowModUpload: boolean + visibleInModHub: boolean +end + record Description name: string + nameLocalized: string + url: string + icon: string +end + record EmailAuthCodeRequest new: function(string): EmailAuthCodeRequest + email: string +end + record EmailAuthCodeData record Response ValidationError: Response + NeedAuthCode: Response + Authenticated: Response +end + response: Response +end + record AuthenticateUserEmailRequest new: function(string): AuthenticateUserEmailRequest + authCode: string +end + record AuthenticateUserEmailData record Response ValidationError: Response + ExpiredAuthCode: Response + Authenticated: Response +end + response: Response +end + record TermsOfUseRequest new: function(AuthenticationType): TermsOfUseRequest + type: AuthenticationType +end + record TermsOfUseData terms: string + agreeLabel: string + disagreeLabel: string +end + record AuthenticateUserExternalRequest new: function(AuthenticationType): AuthenticateUserExternalRequest + type: AuthenticationType + email: string +end + record AuthenticateUserExternalData record Response UnkownError: Response + PortalSignInError: Response + ValidationError: Response + Authenticated: Response +end + response: Response +end + record LogoutDataend + record ListModsRequest new: function(): ListModsRequest + page: integer + preferedPageSize: integer + searchString: string + sortType: SortType + sortAscending: boolean + tags: {integer} + fetchLongDescription: boolean +end + record ListModsData modInfos: {ModInfo} + modsPerPage: integer + totalResultCount: integer +end + record GetModDetailsRequest new: function(ModId): GetModDetailsRequest + modId: ModId +end + record UserPortal XboxLive: UserPortal + PlaystationNetwork: UserPortal + Misc: UserPortal +end + record ModDetailsData new: function(): ModDetailsData + modInfo: ModInfo + author: string + userId: UserId + userPortal: UserPortal + numGalleryImages: integer + logoImage: string + galleryImages: {string} + dependencies: {{ModId, string}} + found: boolean +end + record GetModMediaRequest new: function(ModId, ModMediaType, integer): GetModMediaRequest + modId: ModId + type: ModMediaType + galleryIndex: integer +end + record ModMediaData new: function(): ModMediaData + width: integer + height: integer + channels: integer + data: {integer} + data_native: Vector +end + record GetModRatingRequest new: function(ModId): GetModRatingRequest + modId: ModId +end + record ModRatingData new: function(): ModRatingData + rating: RatingType +end + record SubscribeModRequest new: function(ModId): SubscribeModRequest + modId: ModId + includeDependencies: boolean +end + record UnsubscribeModRequest new: function(ModId): UnsubscribeModRequest + modId: ModId +end + record SubscriptionDataend + record RefreshData numRefreshed: integer +end + record ForceUninstallModRequest new: function(ModId): ForceUninstallModRequest + modId: ModId +end + record ForceUninstallModDataend + record SpecialRefreshModRequest new: function(ModId, boolean): SpecialRefreshModRequest + modId: ModId + unsubscribe: boolean +end + record SpecialRefreshModDataend + record RestartModBackendDataend + record SubmitModRatingRequest new: function(ModId, RatingType): SubmitModRatingRequest + modId: ModId + rating: RatingType +end + record SubmitModRatingData rating: RatingType +end + record SubmitModReportRequest new: function(ModId, ReportType, string, string, string): SubmitModReportRequest + modId: ModId + type: ReportType + reportDescription: string + reporterName: string + reporterContact: string +end + record SubmitModReportData record Response ValidationError: Response + Submitted: Response +end + response: Response +end + record UploadModData modId: ModId + partialErrors: {ModHubErrorCode} +end + record UniquePendingRequestId abort: function(UniquePendingRequestId) +end + record AsyncResult isSuccess: function(AsyncResult): boolean + getData: function(AsyncResult): T + getError: function(AsyncResult): ModHubErrorCode +end + type BackendId = integer + record ModBrowserDisplayData record Entry backendId: BackendId + modInfo: ModInfo + modId: Mod.ModId +end + entries: {Entry} + error: Modhub.ModHubErrorCode + currentPage: integer + numPages: integer + displayPerPage: integer + totalResults: integer + appendResults: boolean + searchString: string + sortType: Modhub.SortType + hasNoSortTag: boolean + filterTags: {string} + excludeTags: {string} +end + record ModBrowserDataProvider new: function(BackendId, integer): ModBrowserDataProvider + newForSelector: function(integer, function(Mod.ModId, Mod.ModId), {Mod.GameModDesc}): ModBrowserDataProvider + suspend: function(ModBrowserDataProvider) + resume: function(ModBrowserDataProvider) + getDisplayData: function(ModBrowserDataProvider): ModBrowserDisplayData + setLoadPage: function(ModBrowserDataProvider, integer) + setNextContinuousPage: function(ModBrowserDataProvider) + setCurrentPage: function(ModBrowserDataProvider, integer) + setSearchString: function(ModBrowserDataProvider, string) + setSearchUserId: function(ModBrowserDataProvider, UserId) + setNextPage: function(ModBrowserDataProvider) + setPreviousPage: function(ModBrowserDataProvider) + refreshCurrentPage: function(ModBrowserDataProvider, boolean) + getSortType: function(ModBrowserDataProvider): Modhub.SortType + getTagToggled: function(ModBrowserDataProvider, string): boolean + setSortType: function(ModBrowserDataProvider, SortType) + setNextSortType: function(ModBrowserDataProvider) + toggleTag: function(ModBrowserDataProvider, string) + resetFilters: function(ModBrowserDataProvider) + getSortAndFilterOptions: function(ModBrowserDataProvider): Modhub.SortAndFilterOptions +end + record StagingModData record State Sync: State + Ready: State + Publishing: State + HasResult: State +end + equals: function(StagingModData, StagingModData): boolean + localModhubDetails: Modhub.ModDetailsData + state: State + modhubId: Modhub.ModId + modhubDetails: Modhub.ModDetailsData + publishResult: AsyncResult +end + record PublishSettings new: function(): PublishSettings + + changeLog: string + updateMetadata: boolean + setPublic: boolean +end + record ModPublishHelper new: function(BackendId): ModPublishHelper + hasAnyStagingMods: function(publishHelper : ModPublishHelper): boolean + canRefresh: function(publishHelper : ModPublishHelper): boolean + refresh: function(publishHelper : ModPublishHelper): AsyncResult + hasStagingMod: function(publishHelper : ModPublishHelper, modId : Modhub.ModId): boolean + getStagingModData: function(publishHelper : ModPublishHelper, modId : Modhub.ModId): StagingModData + setModDetails: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, modDetailsData : Modhub.ModDetailsData) + setRemoteModId: function(publishHelper : ModPublishHelper, localModId : Modhub.ModId, remoteModId : Modhub.ModId) + publish: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, publishSettings : PublishSettings, validationResult : Modhub.ModValidatorResult): AsyncResult + abortPublish: function(publishHelper : ModPublishHelper, modId : Modhub.ModId): UniquePendingRequestId + addLogoImage: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, image : string) + removeLogoImage: function(publishHelper : ModPublishHelper, modId : Modhub.ModId) + addGalleryImages: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, images : {string}) + removeGalleryImage: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, index : integer) + moveGalleryImage: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, fromIndex : integer, toIndex : integer) + setPostPublishFn: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, publishFn : function(Modhub.ModId)) + openFolder: function(publishHelper : ModPublishHelper, modId : Modhub.ModId) + getSortAndFilterOptions: function(publishHelper : ModPublishHelper): Modhub.SortAndFilterOptions +end +end +``` + +modhub types + +### Modhub.ModValidatorMessage[πŸ”—](#$api.type.modhub~Modhub.ModValidatorMessage) + +``` +record Modhub.ModValidatorMessage context: string + file: string + level: LogLevel + message: string + consoleOnly: boolean +end +``` + +Message from mod validator + +### Modhub.ModValidatorMessage.context[πŸ”—](#$api.type.modhub~Modhub.ModValidatorMessage.context) + +``` +Modhub.ModValidatorMessage.context: string +``` + +The context of the message, e.g. which check produced it + +### Modhub.ModValidatorMessage.file[πŸ”—](#$api.type.modhub~Modhub.ModValidatorMessage.file) + +``` +Modhub.ModValidatorMessage.file: string +``` + +The file path where the issue was found + +### Modhub.ModValidatorMessage.level[πŸ”—](#$api.type.modhub~Modhub.ModValidatorMessage.level) + +``` +Modhub.ModValidatorMessage.level: LogLevel +``` + +The severity level of the message + +### Modhub.ModValidatorMessage.message[πŸ”—](#$api.type.modhub~Modhub.ModValidatorMessage.message) + +``` +Modhub.ModValidatorMessage.message: string +``` + +The validation message + +### Modhub.ModValidatorMessage.consoleOnly[πŸ”—](#$api.type.modhub~Modhub.ModValidatorMessage.consoleOnly) + +``` +Modhub.ModValidatorMessage.consoleOnly: boolean +``` + +Whether this issue only affects console platforms + +### Modhub.ModValidatorResult[πŸ”—](#$api.type.modhub~Modhub.ModValidatorResult) + +``` +record Modhub.ModValidatorResult messages: {ModValidatorMessage} + criticalPc: boolean + criticalConsole: boolean + cookedPcPath: string + cookedConsolePath: string + levelPc: LogLevel + levelConsole: LogLevel +end +``` + +Result from mod validation + +### Modhub.ModValidatorResult.messages[πŸ”—](#$api.type.modhub~Modhub.ModValidatorResult.messages) + +``` +Modhub.ModValidatorResult.messages: {ModValidatorMessage} +``` + +List of validation messages + +### Modhub.ModValidatorResult.criticalPc[πŸ”—](#$api.type.modhub~Modhub.ModValidatorResult.criticalPc) + +``` +Modhub.ModValidatorResult.criticalPc: boolean +``` + +Whether the validation found critical issues on PC + +### Modhub.ModValidatorResult.criticalConsole[πŸ”—](#$api.type.modhub~Modhub.ModValidatorResult.criticalConsole) + +``` +Modhub.ModValidatorResult.criticalConsole: boolean +``` + +Whether the validation found critical issues on console + +### Modhub.ModValidatorResult.cookedPcPath[πŸ”—](#$api.type.modhub~Modhub.ModValidatorResult.cookedPcPath) + +``` +Modhub.ModValidatorResult.cookedPcPath: string +``` + +Cooked PC Path + +### Modhub.ModValidatorResult.cookedConsolePath[πŸ”—](#$api.type.modhub~Modhub.ModValidatorResult.cookedConsolePath) + +``` +Modhub.ModValidatorResult.cookedConsolePath: string +``` + +Cooked Console Path + +### Modhub.ModValidatorResult.levelPc[πŸ”—](#$api.type.modhub~Modhub.ModValidatorResult.levelPc) + +``` +Modhub.ModValidatorResult.levelPc: LogLevel +``` + +Minimum log level found on PC + +### Modhub.ModValidatorResult.levelConsole[πŸ”—](#$api.type.modhub~Modhub.ModValidatorResult.levelConsole) + +``` +Modhub.ModValidatorResult.levelConsole: LogLevel +``` + +Minimum log level found on console + +### Modhub.ModHubErrorCode[πŸ”—](#$api.type.modhub~Modhub.ModHubErrorCode) + +``` +record Modhub.ModHubErrorCode code: integer + message: string + fields: {string : string} +end +``` + +### Modhub.ModHubErrorCode.code[πŸ”—](#$api.type.modhub~Modhub.ModHubErrorCode.code) + +``` +Modhub.ModHubErrorCode.code: integer +``` + +Error Code Number + +### Modhub.ModHubErrorCode.message[πŸ”—](#$api.type.modhub~Modhub.ModHubErrorCode.message) + +``` +Modhub.ModHubErrorCode.message: string +``` + +Error Message (not localized, for debug purposes only) + +### Modhub.ModHubErrorCode.fields[πŸ”—](#$api.type.modhub~Modhub.ModHubErrorCode.fields) + +``` +Modhub.ModHubErrorCode.fields: {string : string} +``` + +Additional fields with more information about the error + +### Modhub.SortType[πŸ”—](#$api.type.modhub~Modhub.SortType) + +``` +record Modhub.SortType Trending: SortType + Rating: SortType + SubscriberCount: SortType + DateAdded: SortType + DateUpdated: SortType + Name: SortType + Source: SortType + Custom: SortType +end +``` + +### Modhub.SortType.Trending[πŸ”—](#$api.type.modhub~Modhub.SortType.Trending) + +``` +Modhub.SortType.Trending: SortType +``` + +### Modhub.SortType.Rating[πŸ”—](#$api.type.modhub~Modhub.SortType.Rating) + +``` +Modhub.SortType.Rating: SortType +``` + +### Modhub.SortType.SubscriberCount[πŸ”—](#$api.type.modhub~Modhub.SortType.SubscriberCount) + +``` +Modhub.SortType.SubscriberCount: SortType +``` + +### Modhub.SortType.DateAdded[πŸ”—](#$api.type.modhub~Modhub.SortType.DateAdded) + +``` +Modhub.SortType.DateAdded: SortType +``` + +### Modhub.SortType.DateUpdated[πŸ”—](#$api.type.modhub~Modhub.SortType.DateUpdated) + +``` +Modhub.SortType.DateUpdated: SortType +``` + +### Modhub.SortType.Name[πŸ”—](#$api.type.modhub~Modhub.SortType.Name) + +``` +Modhub.SortType.Name: SortType +``` + +### Modhub.SortType.Source[πŸ”—](#$api.type.modhub~Modhub.SortType.Source) + +``` +Modhub.SortType.Source: SortType +``` + +### Modhub.SortType.Custom[πŸ”—](#$api.type.modhub~Modhub.SortType.Custom) + +``` +Modhub.SortType.Custom: SortType +``` + +### Modhub.SortOrder[πŸ”—](#$api.type.modhub~Modhub.SortOrder) + +``` +record Modhub.SortOrder sortType: SortType + allowAscDesc: boolean +end +``` + +### Modhub.SortOrder.sortType[πŸ”—](#$api.type.modhub~Modhub.SortOrder.sortType) + +``` +Modhub.SortOrder.sortType: SortType +``` + +### Modhub.SortOrder.allowAscDesc[πŸ”—](#$api.type.modhub~Modhub.SortOrder.allowAscDesc) + +``` +Modhub.SortOrder.allowAscDesc: boolean +``` + +### Modhub.TagGroup[πŸ”—](#$api.type.modhub~Modhub.TagGroup) + +``` +record Modhub.TagGroup name: string + values: {string} + allowMultipleSelection: boolean + noSortTag: boolean + visible: boolean +end +``` + +### Modhub.TagGroup.name[πŸ”—](#$api.type.modhub~Modhub.TagGroup.name) + +``` +Modhub.TagGroup.name: string +``` + +### Modhub.TagGroup.values[πŸ”—](#$api.type.modhub~Modhub.TagGroup.values) + +``` +Modhub.TagGroup.values: {string} +``` + +### Modhub.TagGroup.allowMultipleSelection[πŸ”—](#$api.type.modhub~Modhub.TagGroup.allowMultipleSelection) + +``` +Modhub.TagGroup.allowMultipleSelection: boolean +``` + +### Modhub.TagGroup.noSortTag[πŸ”—](#$api.type.modhub~Modhub.TagGroup.noSortTag) + +``` +Modhub.TagGroup.noSortTag: boolean +``` + +### Modhub.TagGroup.visible[πŸ”—](#$api.type.modhub~Modhub.TagGroup.visible) + +``` +Modhub.TagGroup.visible: boolean +``` + +### Modhub.SortAndFilterOptions[πŸ”—](#$api.type.modhub~Modhub.SortAndFilterOptions) + +``` +record Modhub.SortAndFilterOptions tagGroups: {TagGroup} + sortOrders: {SortOrder} + statusTagGroupIndex: integer +end +``` + +### Modhub.SortAndFilterOptions.tagGroups[πŸ”—](#$api.type.modhub~Modhub.SortAndFilterOptions.tagGroups) + +``` +Modhub.SortAndFilterOptions.tagGroups: {TagGroup} +``` + +### Modhub.SortAndFilterOptions.sortOrders[πŸ”—](#$api.type.modhub~Modhub.SortAndFilterOptions.sortOrders) + +``` +Modhub.SortAndFilterOptions.sortOrders: {SortOrder} +``` + +### Modhub.SortAndFilterOptions.statusTagGroupIndex[πŸ”—](#$api.type.modhub~Modhub.SortAndFilterOptions.statusTagGroupIndex) + +``` +Modhub.SortAndFilterOptions.statusTagGroupIndex: integer +``` + +### Modhub.UserInfo[πŸ”—](#$api.type.modhub~Modhub.UserInfo) + +``` +record Modhub.UserInfo userName: string + profileUrl: string + displayName: string +end +``` + +### Modhub.UserInfo.userName[πŸ”—](#$api.type.modhub~Modhub.UserInfo.userName) + +``` +Modhub.UserInfo.userName: string +``` + +### Modhub.UserInfo.profileUrl[πŸ”—](#$api.type.modhub~Modhub.UserInfo.profileUrl) + +``` +Modhub.UserInfo.profileUrl: string +``` + +### Modhub.UserInfo.displayName[πŸ”—](#$api.type.modhub~Modhub.UserInfo.displayName) + +``` +Modhub.UserInfo.displayName: string +``` + +### Modhub.ModId[πŸ”—](#$api.type.modhub~Modhub.ModId) + +``` +record Modhub.ModId new: function(): ModId + isValid: function(ModId): boolean + value: string +end +``` + +### Modhub.ModId.new[πŸ”—](#$api.type.modhub~Modhub.ModId.new) + +``` +function Modhub.ModId.new(): ModId +``` + +**Returns** + +1. `ModId` + +### Modhub.ModId.isValid[πŸ”—](#$api.type.modhub~Modhub.ModId.isValid) + +``` +function Modhub.ModId.isValid(ModId): boolean +``` + +**Parameters** + +* `ModId` + +**Returns** + +1. `boolean` + +### Modhub.ModId.value[πŸ”—](#$api.type.modhub~Modhub.ModId.value) + +``` +Modhub.ModId.value: string +``` + +### Modhub.UserId[πŸ”—](#$api.type.modhub~Modhub.UserId) + +``` +record Modhub.UserId new: function(integer): UserId + equals: function(UserId, UserId): boolean + isValid: function(UserId): boolean + value: integer +end +``` + +### Modhub.UserId.new[πŸ”—](#$api.type.modhub~Modhub.UserId.new) + +``` +function Modhub.UserId.new(integer): UserId +``` + +**Parameters** + +* `integer` + +**Returns** + +1. `UserId` + +### Modhub.UserId.equals[πŸ”—](#$api.type.modhub~Modhub.UserId.equals) + +``` +function Modhub.UserId.equals(UserId, UserId): boolean +``` + +**Parameters** + +* `UserId` +* `UserId` + +**Returns** + +1. `boolean` + +### Modhub.UserId.isValid[πŸ”—](#$api.type.modhub~Modhub.UserId.isValid) + +``` +function Modhub.UserId.isValid(UserId): boolean +``` + +**Parameters** + +* `UserId` + +**Returns** + +1. `boolean` + +### Modhub.UserId.value[πŸ”—](#$api.type.modhub~Modhub.UserId.value) + +``` +Modhub.UserId.value: integer +``` + +### Modhub.ModManagementMode[πŸ”—](#$api.type.modhub~Modhub.ModManagementMode) + +``` +record Modhub.ModManagementMode Disabled: ModManagementMode + Restricted: ModManagementMode + Full: ModManagementMode +end +``` + +### Modhub.ModManagementMode.Disabled[πŸ”—](#$api.type.modhub~Modhub.ModManagementMode.Disabled) + +``` +Modhub.ModManagementMode.Disabled: ModManagementMode +``` + +### Modhub.ModManagementMode.Restricted[πŸ”—](#$api.type.modhub~Modhub.ModManagementMode.Restricted) + +``` +Modhub.ModManagementMode.Restricted: ModManagementMode +``` + +### Modhub.ModManagementMode.Full[πŸ”—](#$api.type.modhub~Modhub.ModManagementMode.Full) + +``` +Modhub.ModManagementMode.Full: ModManagementMode +``` + +### Modhub.InstallState[πŸ”—](#$api.type.modhub~Modhub.InstallState) + +``` +record Modhub.InstallState None: InstallState + Downloading: InstallState + UpdatePending: InstallState + Installed: InstallState + DownloadPending: InstallState + InstallationPending: InstallState + UninstallPending: InstallState + Extracting: InstallState + InsufficientSpace: InstallState + MiscError: InstallState +end +``` + +### Modhub.InstallState.None[πŸ”—](#$api.type.modhub~Modhub.InstallState.None) + +``` +Modhub.InstallState.None: InstallState +``` + +### Modhub.InstallState.Downloading[πŸ”—](#$api.type.modhub~Modhub.InstallState.Downloading) + +``` +Modhub.InstallState.Downloading: InstallState +``` + +### Modhub.InstallState.UpdatePending[πŸ”—](#$api.type.modhub~Modhub.InstallState.UpdatePending) + +``` +Modhub.InstallState.UpdatePending: InstallState +``` + +### Modhub.InstallState.Installed[πŸ”—](#$api.type.modhub~Modhub.InstallState.Installed) + +``` +Modhub.InstallState.Installed: InstallState +``` + +### Modhub.InstallState.DownloadPending[πŸ”—](#$api.type.modhub~Modhub.InstallState.DownloadPending) + +``` +Modhub.InstallState.DownloadPending: InstallState +``` + +### Modhub.InstallState.InstallationPending[πŸ”—](#$api.type.modhub~Modhub.InstallState.InstallationPending) + +``` +Modhub.InstallState.InstallationPending: InstallState +``` + +### Modhub.InstallState.UninstallPending[πŸ”—](#$api.type.modhub~Modhub.InstallState.UninstallPending) + +``` +Modhub.InstallState.UninstallPending: InstallState +``` + +### Modhub.InstallState.Extracting[πŸ”—](#$api.type.modhub~Modhub.InstallState.Extracting) + +``` +Modhub.InstallState.Extracting: InstallState +``` + +### Modhub.InstallState.InsufficientSpace[πŸ”—](#$api.type.modhub~Modhub.InstallState.InsufficientSpace) + +``` +Modhub.InstallState.InsufficientSpace: InstallState +``` + +### Modhub.InstallState.MiscError[πŸ”—](#$api.type.modhub~Modhub.InstallState.MiscError) + +``` +Modhub.InstallState.MiscError: InstallState +``` + +### Modhub.ModInstallInfo[πŸ”—](#$api.type.modhub~Modhub.ModInstallInfo) + +``` +record Modhub.ModInstallInfo installPath: string + runtimeRevision: integer +end +``` + +### Modhub.ModInstallInfo.installPath[πŸ”—](#$api.type.modhub~Modhub.ModInstallInfo.installPath) + +``` +Modhub.ModInstallInfo.installPath: string +``` + +### Modhub.ModInstallInfo.runtimeRevision[πŸ”—](#$api.type.modhub~Modhub.ModInstallInfo.runtimeRevision) + +``` +Modhub.ModInstallInfo.runtimeRevision: integer +``` + +### Modhub.ModReleaseInfo[πŸ”—](#$api.type.modhub~Modhub.ModReleaseInfo) + +``` +record Modhub.ModReleaseInfo version: string + releaseNotes: string + releaseUnixTimestamp: integer +end +``` + +### Modhub.ModReleaseInfo.version[πŸ”—](#$api.type.modhub~Modhub.ModReleaseInfo.version) + +``` +Modhub.ModReleaseInfo.version: string +``` + +### Modhub.ModReleaseInfo.releaseNotes[πŸ”—](#$api.type.modhub~Modhub.ModReleaseInfo.releaseNotes) + +``` +Modhub.ModReleaseInfo.releaseNotes: string +``` + +### Modhub.ModReleaseInfo.releaseUnixTimestamp[πŸ”—](#$api.type.modhub~Modhub.ModReleaseInfo.releaseUnixTimestamp) + +``` +Modhub.ModReleaseInfo.releaseUnixTimestamp: integer +``` + +### Modhub.ModInfo[πŸ”—](#$api.type.modhub~Modhub.ModInfo) + +``` +record Modhub.ModInfo modId: ModId + modSource: string + visible: boolean + numDownloads: integer + numSubscribers: integer + title: string + url: string + summary: string + description: string + descriptionHtml: string + logoImage: string + installSize: integer + likes: integer + dislikes: integer + rating: number + tags: {string} + publishedUnixTimestamp: integer + updatedUnixTimestamp: integer + releaseInfo: ModReleaseInfo + memoryUsage: integer +end +``` + +### Modhub.ModInfo.modId[πŸ”—](#$api.type.modhub~Modhub.ModInfo.modId) + +``` +Modhub.ModInfo.modId: ModId +``` + +### Modhub.ModInfo.modSource[πŸ”—](#$api.type.modhub~Modhub.ModInfo.modSource) + +``` +Modhub.ModInfo.modSource: string +``` + +### Modhub.ModInfo.visible[πŸ”—](#$api.type.modhub~Modhub.ModInfo.visible) + +``` +Modhub.ModInfo.visible: boolean +``` + +### Modhub.ModInfo.numDownloads[πŸ”—](#$api.type.modhub~Modhub.ModInfo.numDownloads) + +``` +Modhub.ModInfo.numDownloads: integer +``` + +### Modhub.ModInfo.numSubscribers[πŸ”—](#$api.type.modhub~Modhub.ModInfo.numSubscribers) + +``` +Modhub.ModInfo.numSubscribers: integer +``` + +### Modhub.ModInfo.title[πŸ”—](#$api.type.modhub~Modhub.ModInfo.title) + +``` +Modhub.ModInfo.title: string +``` + +### Modhub.ModInfo.url[πŸ”—](#$api.type.modhub~Modhub.ModInfo.url) + +``` +Modhub.ModInfo.url: string +``` + +### Modhub.ModInfo.summary[πŸ”—](#$api.type.modhub~Modhub.ModInfo.summary) + +``` +Modhub.ModInfo.summary: string +``` + +### Modhub.ModInfo.description[πŸ”—](#$api.type.modhub~Modhub.ModInfo.description) + +``` +Modhub.ModInfo.description: string +``` + +### Modhub.ModInfo.descriptionHtml[πŸ”—](#$api.type.modhub~Modhub.ModInfo.descriptionHtml) + +``` +Modhub.ModInfo.descriptionHtml: string +``` + +### Modhub.ModInfo.logoImage[πŸ”—](#$api.type.modhub~Modhub.ModInfo.logoImage) + +``` +Modhub.ModInfo.logoImage: string +``` + +### Modhub.ModInfo.installSize[πŸ”—](#$api.type.modhub~Modhub.ModInfo.installSize) + +``` +Modhub.ModInfo.installSize: integer +``` + +### Modhub.ModInfo.likes[πŸ”—](#$api.type.modhub~Modhub.ModInfo.likes) + +``` +Modhub.ModInfo.likes: integer +``` + +### Modhub.ModInfo.dislikes[πŸ”—](#$api.type.modhub~Modhub.ModInfo.dislikes) + +``` +Modhub.ModInfo.dislikes: integer +``` + +### Modhub.ModInfo.rating[πŸ”—](#$api.type.modhub~Modhub.ModInfo.rating) + +``` +Modhub.ModInfo.rating: number +``` + +### Modhub.ModInfo.tags[πŸ”—](#$api.type.modhub~Modhub.ModInfo.tags) + +``` +Modhub.ModInfo.tags: {string} +``` + +### Modhub.ModInfo.publishedUnixTimestamp[πŸ”—](#$api.type.modhub~Modhub.ModInfo.publishedUnixTimestamp) + +``` +Modhub.ModInfo.publishedUnixTimestamp: integer +``` + +### Modhub.ModInfo.updatedUnixTimestamp[πŸ”—](#$api.type.modhub~Modhub.ModInfo.updatedUnixTimestamp) + +``` +Modhub.ModInfo.updatedUnixTimestamp: integer +``` + +### Modhub.ModInfo.releaseInfo[πŸ”—](#$api.type.modhub~Modhub.ModInfo.releaseInfo) + +``` +Modhub.ModInfo.releaseInfo: ModReleaseInfo +``` + +### Modhub.ModInfo.memoryUsage[πŸ”—](#$api.type.modhub~Modhub.ModInfo.memoryUsage) + +``` +Modhub.ModInfo.memoryUsage: integer +``` + +### Modhub.ModMediaType[πŸ”—](#$api.type.modhub~Modhub.ModMediaType) + +``` +record Modhub.ModMediaType Logo: ModMediaType + GalleryThumb180p: ModMediaType + GalleryThumb720p: ModMediaType + GalleryOriginal: ModMediaType + AuthorAvatar: ModMediaType +end +``` + +### Modhub.ModMediaType.Logo[πŸ”—](#$api.type.modhub~Modhub.ModMediaType.Logo) + +``` +Modhub.ModMediaType.Logo: ModMediaType +``` + +### Modhub.ModMediaType.GalleryThumb180p[πŸ”—](#$api.type.modhub~Modhub.ModMediaType.GalleryThumb180p) + +``` +Modhub.ModMediaType.GalleryThumb180p: ModMediaType +``` + +### Modhub.ModMediaType.GalleryThumb720p[πŸ”—](#$api.type.modhub~Modhub.ModMediaType.GalleryThumb720p) + +``` +Modhub.ModMediaType.GalleryThumb720p: ModMediaType +``` + +### Modhub.ModMediaType.GalleryOriginal[πŸ”—](#$api.type.modhub~Modhub.ModMediaType.GalleryOriginal) + +``` +Modhub.ModMediaType.GalleryOriginal: ModMediaType +``` + +### Modhub.ModMediaType.AuthorAvatar[πŸ”—](#$api.type.modhub~Modhub.ModMediaType.AuthorAvatar) + +``` +Modhub.ModMediaType.AuthorAvatar: ModMediaType +``` + +### Modhub.AuthenticationType[πŸ”—](#$api.type.modhub~Modhub.AuthenticationType) + +``` +record Modhub.AuthenticationType Email: AuthenticationType + Steam: AuthenticationType + SteamOffline: AuthenticationType + Gog: AuthenticationType + Epic: AuthenticationType + XboxLive: AuthenticationType + PSN: AuthenticationType + Paradox: AuthenticationType +end +``` + +### Modhub.AuthenticationType.Email[πŸ”—](#$api.type.modhub~Modhub.AuthenticationType.Email) + +``` +Modhub.AuthenticationType.Email: AuthenticationType +``` + +### Modhub.AuthenticationType.Steam[πŸ”—](#$api.type.modhub~Modhub.AuthenticationType.Steam) + +``` +Modhub.AuthenticationType.Steam: AuthenticationType +``` + +### Modhub.AuthenticationType.SteamOffline[πŸ”—](#$api.type.modhub~Modhub.AuthenticationType.SteamOffline) + +``` +Modhub.AuthenticationType.SteamOffline: AuthenticationType +``` + +### Modhub.AuthenticationType.Gog[πŸ”—](#$api.type.modhub~Modhub.AuthenticationType.Gog) + +``` +Modhub.AuthenticationType.Gog: AuthenticationType +``` + +### Modhub.AuthenticationType.Epic[πŸ”—](#$api.type.modhub~Modhub.AuthenticationType.Epic) + +``` +Modhub.AuthenticationType.Epic: AuthenticationType +``` + +### Modhub.AuthenticationType.XboxLive[πŸ”—](#$api.type.modhub~Modhub.AuthenticationType.XboxLive) + +``` +Modhub.AuthenticationType.XboxLive: AuthenticationType +``` + +### Modhub.AuthenticationType.PSN[πŸ”—](#$api.type.modhub~Modhub.AuthenticationType.PSN) + +``` +Modhub.AuthenticationType.PSN: AuthenticationType +``` + +### Modhub.AuthenticationType.Paradox[πŸ”—](#$api.type.modhub~Modhub.AuthenticationType.Paradox) + +``` +Modhub.AuthenticationType.Paradox: AuthenticationType +``` + +### Modhub.RatingType[πŸ”—](#$api.type.modhub~Modhub.RatingType) + +``` +record Modhub.RatingType Neutral: RatingType + Positive: RatingType + Negative: RatingType +end +``` + +### Modhub.RatingType.Neutral[πŸ”—](#$api.type.modhub~Modhub.RatingType.Neutral) + +``` +Modhub.RatingType.Neutral: RatingType +``` + +### Modhub.RatingType.Positive[πŸ”—](#$api.type.modhub~Modhub.RatingType.Positive) + +``` +Modhub.RatingType.Positive: RatingType +``` + +### Modhub.RatingType.Negative[πŸ”—](#$api.type.modhub~Modhub.RatingType.Negative) + +``` +Modhub.RatingType.Negative: RatingType +``` + +### Modhub.ReportType[πŸ”—](#$api.type.modhub~Modhub.ReportType) + +``` +record Modhub.ReportType Generic: ReportType + DMCA: ReportType + NotWorking: ReportType + RudeContent: ReportType + IllegalContent: ReportType + StolenContent: ReportType + FalseInformation: ReportType + Other: ReportType +end +``` + +### Modhub.ReportType.Generic[πŸ”—](#$api.type.modhub~Modhub.ReportType.Generic) + +``` +Modhub.ReportType.Generic: ReportType +``` + +### Modhub.ReportType.DMCA[πŸ”—](#$api.type.modhub~Modhub.ReportType.DMCA) + +``` +Modhub.ReportType.DMCA: ReportType +``` + +### Modhub.ReportType.NotWorking[πŸ”—](#$api.type.modhub~Modhub.ReportType.NotWorking) + +``` +Modhub.ReportType.NotWorking: ReportType +``` + +### Modhub.ReportType.RudeContent[πŸ”—](#$api.type.modhub~Modhub.ReportType.RudeContent) + +``` +Modhub.ReportType.RudeContent: ReportType +``` + +### Modhub.ReportType.IllegalContent[πŸ”—](#$api.type.modhub~Modhub.ReportType.IllegalContent) + +``` +Modhub.ReportType.IllegalContent: ReportType +``` + +### Modhub.ReportType.StolenContent[πŸ”—](#$api.type.modhub~Modhub.ReportType.StolenContent) + +``` +Modhub.ReportType.StolenContent: ReportType +``` + +### Modhub.ReportType.FalseInformation[πŸ”—](#$api.type.modhub~Modhub.ReportType.FalseInformation) + +``` +Modhub.ReportType.FalseInformation: ReportType +``` + +### Modhub.ReportType.Other[πŸ”—](#$api.type.modhub~Modhub.ReportType.Other) + +``` +Modhub.ReportType.Other: ReportType +``` + +### Modhub.StorageInfo[πŸ”—](#$api.type.modhub~Modhub.StorageInfo) + +``` +record Modhub.StorageInfo usedSpace: integer + totalSpace: integer +end +``` + +### Modhub.StorageInfo.usedSpace[πŸ”—](#$api.type.modhub~Modhub.StorageInfo.usedSpace) + +``` +Modhub.StorageInfo.usedSpace: integer +``` + +### Modhub.StorageInfo.totalSpace[πŸ”—](#$api.type.modhub~Modhub.StorageInfo.totalSpace) + +``` +Modhub.StorageInfo.totalSpace: integer +``` + +### Modhub.ModManagementState[πŸ”—](#$api.type.modhub~Modhub.ModManagementState) + +``` +record Modhub.ModManagementState uploading: boolean + busy: boolean + totalPending: integer + pending: {ModId} + finished: {ModId} + progress: number + currentModId: ModId +end +``` + +### Modhub.ModManagementState.uploading[πŸ”—](#$api.type.modhub~Modhub.ModManagementState.uploading) + +``` +Modhub.ModManagementState.uploading: boolean +``` + +### Modhub.ModManagementState.busy[πŸ”—](#$api.type.modhub~Modhub.ModManagementState.busy) + +``` +Modhub.ModManagementState.busy: boolean +``` + +### Modhub.ModManagementState.totalPending[πŸ”—](#$api.type.modhub~Modhub.ModManagementState.totalPending) + +``` +Modhub.ModManagementState.totalPending: integer +``` + +### Modhub.ModManagementState.pending[πŸ”—](#$api.type.modhub~Modhub.ModManagementState.pending) + +``` +Modhub.ModManagementState.pending: {ModId} +``` + +### Modhub.ModManagementState.finished[πŸ”—](#$api.type.modhub~Modhub.ModManagementState.finished) + +``` +Modhub.ModManagementState.finished: {ModId} +``` + +### Modhub.ModManagementState.progress[πŸ”—](#$api.type.modhub~Modhub.ModManagementState.progress) + +``` +Modhub.ModManagementState.progress: number +``` + +### Modhub.ModManagementState.currentModId[πŸ”—](#$api.type.modhub~Modhub.ModManagementState.currentModId) + +``` +Modhub.ModManagementState.currentModId: ModId +``` + +### Modhub.Capabilities[πŸ”—](#$api.type.modhub~Modhub.Capabilities) + +``` +record Modhub.Capabilities allowForceUninstall: boolean + authenticationTypes: {AuthenticationType} + manualRefresh: boolean + specialModRefresh: boolean + allowReport: boolean + isInfoOnly: boolean + allowUnsubscribeInstalledMods: boolean + allowRestrictedMode: boolean + allowModUpload: boolean + visibleInModHub: boolean +end +``` + +### Modhub.Capabilities.allowForceUninstall[πŸ”—](#$api.type.modhub~Modhub.Capabilities.allowForceUninstall) + +``` +Modhub.Capabilities.allowForceUninstall: boolean +``` + +### Modhub.Capabilities.authenticationTypes[πŸ”—](#$api.type.modhub~Modhub.Capabilities.authenticationTypes) + +``` +Modhub.Capabilities.authenticationTypes: {AuthenticationType} +``` + +### Modhub.Capabilities.manualRefresh[πŸ”—](#$api.type.modhub~Modhub.Capabilities.manualRefresh) + +``` +Modhub.Capabilities.manualRefresh: boolean +``` + +### Modhub.Capabilities.specialModRefresh[πŸ”—](#$api.type.modhub~Modhub.Capabilities.specialModRefresh) + +``` +Modhub.Capabilities.specialModRefresh: boolean +``` + +### Modhub.Capabilities.allowReport[πŸ”—](#$api.type.modhub~Modhub.Capabilities.allowReport) + +``` +Modhub.Capabilities.allowReport: boolean +``` + +### Modhub.Capabilities.isInfoOnly[πŸ”—](#$api.type.modhub~Modhub.Capabilities.isInfoOnly) + +``` +Modhub.Capabilities.isInfoOnly: boolean +``` + +### Modhub.Capabilities.allowUnsubscribeInstalledMods[πŸ”—](#$api.type.modhub~Modhub.Capabilities.allowUnsubscribeInstalledMods) + +``` +Modhub.Capabilities.allowUnsubscribeInstalledMods: boolean +``` + +### Modhub.Capabilities.allowRestrictedMode[πŸ”—](#$api.type.modhub~Modhub.Capabilities.allowRestrictedMode) + +``` +Modhub.Capabilities.allowRestrictedMode: boolean +``` + +### Modhub.Capabilities.allowModUpload[πŸ”—](#$api.type.modhub~Modhub.Capabilities.allowModUpload) + +``` +Modhub.Capabilities.allowModUpload: boolean +``` + +### Modhub.Capabilities.visibleInModHub[πŸ”—](#$api.type.modhub~Modhub.Capabilities.visibleInModHub) + +``` +Modhub.Capabilities.visibleInModHub: boolean +``` + +### Modhub.Description[πŸ”—](#$api.type.modhub~Modhub.Description) + +``` +record Modhub.Description name: string + nameLocalized: string + url: string + icon: string +end +``` + +### Modhub.Description.name[πŸ”—](#$api.type.modhub~Modhub.Description.name) + +``` +Modhub.Description.name: string +``` + +### Modhub.Description.nameLocalized[πŸ”—](#$api.type.modhub~Modhub.Description.nameLocalized) + +``` +Modhub.Description.nameLocalized: string +``` + +### Modhub.Description.url[πŸ”—](#$api.type.modhub~Modhub.Description.url) + +``` +Modhub.Description.url: string +``` + +### Modhub.Description.icon[πŸ”—](#$api.type.modhub~Modhub.Description.icon) + +``` +Modhub.Description.icon: string +``` + +### Modhub.EmailAuthCodeRequest[πŸ”—](#$api.type.modhub~Modhub.EmailAuthCodeRequest) + +``` +record Modhub.EmailAuthCodeRequest new: function(string): EmailAuthCodeRequest + email: string +end +``` + +### Modhub.EmailAuthCodeRequest.new[πŸ”—](#$api.type.modhub~Modhub.EmailAuthCodeRequest.new) + +``` +function Modhub.EmailAuthCodeRequest.new(string): EmailAuthCodeRequest +``` + +**Parameters** + +* `string` + +**Returns** + +1. `EmailAuthCodeRequest` + +### Modhub.EmailAuthCodeRequest.email[πŸ”—](#$api.type.modhub~Modhub.EmailAuthCodeRequest.email) + +``` +Modhub.EmailAuthCodeRequest.email: string +``` + +### Modhub.EmailAuthCodeData[πŸ”—](#$api.type.modhub~Modhub.EmailAuthCodeData) + +``` +[Expand All] [Collapse All] + +record Modhub.EmailAuthCodeData record Response ValidationError: Response + NeedAuthCode: Response + Authenticated: Response +end + response: Response +end +``` + +### Modhub.EmailAuthCodeData.Response[πŸ”—](#$api.type.modhub~Modhub.EmailAuthCodeData.Response) + +``` +record Modhub.EmailAuthCodeData.Response ValidationError: Response + NeedAuthCode: Response + Authenticated: Response +end +``` + +### Modhub.EmailAuthCodeData.Response.ValidationError[πŸ”—](#$api.type.modhub~Modhub.EmailAuthCodeData.Response.ValidationError) + +``` +Modhub.EmailAuthCodeData.Response.ValidationError: Response +``` + +### Modhub.EmailAuthCodeData.Response.NeedAuthCode[πŸ”—](#$api.type.modhub~Modhub.EmailAuthCodeData.Response.NeedAuthCode) + +``` +Modhub.EmailAuthCodeData.Response.NeedAuthCode: Response +``` + +### Modhub.EmailAuthCodeData.Response.Authenticated[πŸ”—](#$api.type.modhub~Modhub.EmailAuthCodeData.Response.Authenticated) + +``` +Modhub.EmailAuthCodeData.Response.Authenticated: Response +``` + +### Modhub.EmailAuthCodeData.response[πŸ”—](#$api.type.modhub~Modhub.EmailAuthCodeData.response) + +``` +Modhub.EmailAuthCodeData.response: Response +``` + +### Modhub.AuthenticateUserEmailRequest[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserEmailRequest) + +``` +record Modhub.AuthenticateUserEmailRequest new: function(string): AuthenticateUserEmailRequest + authCode: string +end +``` + +### Modhub.AuthenticateUserEmailRequest.new[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserEmailRequest.new) + +``` +function Modhub.AuthenticateUserEmailRequest.new(string): AuthenticateUserEmailRequest +``` + +**Parameters** + +* `string` + +**Returns** + +1. `AuthenticateUserEmailRequest` + +### Modhub.AuthenticateUserEmailRequest.authCode[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserEmailRequest.authCode) + +``` +Modhub.AuthenticateUserEmailRequest.authCode: string +``` + +### Modhub.AuthenticateUserEmailData[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserEmailData) + +``` +[Expand All] [Collapse All] + +record Modhub.AuthenticateUserEmailData record Response ValidationError: Response + ExpiredAuthCode: Response + Authenticated: Response +end + response: Response +end +``` + +### Modhub.AuthenticateUserEmailData.Response[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserEmailData.Response) + +``` +record Modhub.AuthenticateUserEmailData.Response ValidationError: Response + ExpiredAuthCode: Response + Authenticated: Response +end +``` + +### Modhub.AuthenticateUserEmailData.Response.ValidationError[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserEmailData.Response.ValidationError) + +``` +Modhub.AuthenticateUserEmailData.Response.ValidationError: Response +``` + +### Modhub.AuthenticateUserEmailData.Response.ExpiredAuthCode[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserEmailData.Response.ExpiredAuthCode) + +``` +Modhub.AuthenticateUserEmailData.Response.ExpiredAuthCode: Response +``` + +### Modhub.AuthenticateUserEmailData.Response.Authenticated[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserEmailData.Response.Authenticated) + +``` +Modhub.AuthenticateUserEmailData.Response.Authenticated: Response +``` + +### Modhub.AuthenticateUserEmailData.response[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserEmailData.response) + +``` +Modhub.AuthenticateUserEmailData.response: Response +``` + +### Modhub.TermsOfUseRequest[πŸ”—](#$api.type.modhub~Modhub.TermsOfUseRequest) + +``` +record Modhub.TermsOfUseRequest new: function(AuthenticationType): TermsOfUseRequest + type: AuthenticationType +end +``` + +### Modhub.TermsOfUseRequest.new[πŸ”—](#$api.type.modhub~Modhub.TermsOfUseRequest.new) + +``` +function Modhub.TermsOfUseRequest.new(AuthenticationType): TermsOfUseRequest +``` + +**Parameters** + +* `AuthenticationType` + +**Returns** + +1. `TermsOfUseRequest` + +### Modhub.TermsOfUseRequest.type[πŸ”—](#$api.type.modhub~Modhub.TermsOfUseRequest.type) + +``` +Modhub.TermsOfUseRequest.type: AuthenticationType +``` + +### Modhub.TermsOfUseData[πŸ”—](#$api.type.modhub~Modhub.TermsOfUseData) + +``` +record Modhub.TermsOfUseData terms: string + agreeLabel: string + disagreeLabel: string +end +``` + +### Modhub.TermsOfUseData.terms[πŸ”—](#$api.type.modhub~Modhub.TermsOfUseData.terms) + +``` +Modhub.TermsOfUseData.terms: string +``` + +### Modhub.TermsOfUseData.agreeLabel[πŸ”—](#$api.type.modhub~Modhub.TermsOfUseData.agreeLabel) + +``` +Modhub.TermsOfUseData.agreeLabel: string +``` + +### Modhub.TermsOfUseData.disagreeLabel[πŸ”—](#$api.type.modhub~Modhub.TermsOfUseData.disagreeLabel) + +``` +Modhub.TermsOfUseData.disagreeLabel: string +``` + +### Modhub.AuthenticateUserExternalRequest[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserExternalRequest) + +``` +record Modhub.AuthenticateUserExternalRequest new: function(AuthenticationType): AuthenticateUserExternalRequest + type: AuthenticationType + email: string +end +``` + +### Modhub.AuthenticateUserExternalRequest.new[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserExternalRequest.new) + +``` +function Modhub.AuthenticateUserExternalRequest.new(AuthenticationType): AuthenticateUserExternalRequest +``` + +**Parameters** + +* `AuthenticationType` + +**Returns** + +1. `AuthenticateUserExternalRequest` + +### Modhub.AuthenticateUserExternalRequest.type[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserExternalRequest.type) + +``` +Modhub.AuthenticateUserExternalRequest.type: AuthenticationType +``` + +### Modhub.AuthenticateUserExternalRequest.email[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserExternalRequest.email) + +``` +Modhub.AuthenticateUserExternalRequest.email: string +``` + +### Modhub.AuthenticateUserExternalData[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserExternalData) + +``` +[Expand All] [Collapse All] + +record Modhub.AuthenticateUserExternalData record Response UnkownError: Response + PortalSignInError: Response + ValidationError: Response + Authenticated: Response +end + response: Response +end +``` + +### Modhub.AuthenticateUserExternalData.Response[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserExternalData.Response) + +``` +record Modhub.AuthenticateUserExternalData.Response UnkownError: Response + PortalSignInError: Response + ValidationError: Response + Authenticated: Response +end +``` + +### Modhub.AuthenticateUserExternalData.Response.UnkownError[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserExternalData.Response.UnkownError) + +``` +Modhub.AuthenticateUserExternalData.Response.UnkownError: Response +``` + +### Modhub.AuthenticateUserExternalData.Response.PortalSignInError[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserExternalData.Response.PortalSignInError) + +``` +Modhub.AuthenticateUserExternalData.Response.PortalSignInError: Response +``` + +### Modhub.AuthenticateUserExternalData.Response.ValidationError[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserExternalData.Response.ValidationError) + +``` +Modhub.AuthenticateUserExternalData.Response.ValidationError: Response +``` + +### Modhub.AuthenticateUserExternalData.Response.Authenticated[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserExternalData.Response.Authenticated) + +``` +Modhub.AuthenticateUserExternalData.Response.Authenticated: Response +``` + +### Modhub.AuthenticateUserExternalData.response[πŸ”—](#$api.type.modhub~Modhub.AuthenticateUserExternalData.response) + +``` +Modhub.AuthenticateUserExternalData.response: Response +``` + +### Modhub.LogoutData[πŸ”—](#$api.type.modhub~Modhub.LogoutData) + +``` +record Modhub.LogoutDataend +``` + +### Modhub.ListModsRequest[πŸ”—](#$api.type.modhub~Modhub.ListModsRequest) + +``` +record Modhub.ListModsRequest new: function(): ListModsRequest + page: integer + preferedPageSize: integer + searchString: string + sortType: SortType + sortAscending: boolean + tags: {integer} + fetchLongDescription: boolean +end +``` + +### Modhub.ListModsRequest.new[πŸ”—](#$api.type.modhub~Modhub.ListModsRequest.new) + +``` +function Modhub.ListModsRequest.new(): ListModsRequest +``` + +**Returns** + +1. `ListModsRequest` + +### Modhub.ListModsRequest.page[πŸ”—](#$api.type.modhub~Modhub.ListModsRequest.page) + +``` +Modhub.ListModsRequest.page: integer +``` + +### Modhub.ListModsRequest.preferedPageSize[πŸ”—](#$api.type.modhub~Modhub.ListModsRequest.preferedPageSize) + +``` +Modhub.ListModsRequest.preferedPageSize: integer +``` + +### Modhub.ListModsRequest.searchString[πŸ”—](#$api.type.modhub~Modhub.ListModsRequest.searchString) + +``` +Modhub.ListModsRequest.searchString: string +``` + +### Modhub.ListModsRequest.sortType[πŸ”—](#$api.type.modhub~Modhub.ListModsRequest.sortType) + +``` +Modhub.ListModsRequest.sortType: SortType +``` + +### Modhub.ListModsRequest.sortAscending[πŸ”—](#$api.type.modhub~Modhub.ListModsRequest.sortAscending) + +``` +Modhub.ListModsRequest.sortAscending: boolean +``` + +### Modhub.ListModsRequest.tags[πŸ”—](#$api.type.modhub~Modhub.ListModsRequest.tags) + +``` +Modhub.ListModsRequest.tags: {integer} +``` + +### Modhub.ListModsRequest.fetchLongDescription[πŸ”—](#$api.type.modhub~Modhub.ListModsRequest.fetchLongDescription) + +``` +Modhub.ListModsRequest.fetchLongDescription: boolean +``` + +### Modhub.ListModsData[πŸ”—](#$api.type.modhub~Modhub.ListModsData) + +``` +record Modhub.ListModsData modInfos: {ModInfo} + modsPerPage: integer + totalResultCount: integer +end +``` + +### Modhub.ListModsData.modInfos[πŸ”—](#$api.type.modhub~Modhub.ListModsData.modInfos) + +``` +Modhub.ListModsData.modInfos: {ModInfo} +``` + +### Modhub.ListModsData.modsPerPage[πŸ”—](#$api.type.modhub~Modhub.ListModsData.modsPerPage) + +``` +Modhub.ListModsData.modsPerPage: integer +``` + +### Modhub.ListModsData.totalResultCount[πŸ”—](#$api.type.modhub~Modhub.ListModsData.totalResultCount) + +``` +Modhub.ListModsData.totalResultCount: integer +``` + +### Modhub.GetModDetailsRequest[πŸ”—](#$api.type.modhub~Modhub.GetModDetailsRequest) + +``` +record Modhub.GetModDetailsRequest new: function(ModId): GetModDetailsRequest + modId: ModId +end +``` + +### Modhub.GetModDetailsRequest.new[πŸ”—](#$api.type.modhub~Modhub.GetModDetailsRequest.new) + +``` +function Modhub.GetModDetailsRequest.new(ModId): GetModDetailsRequest +``` + +**Parameters** + +* `ModId` + +**Returns** + +1. `GetModDetailsRequest` + +### Modhub.GetModDetailsRequest.modId[πŸ”—](#$api.type.modhub~Modhub.GetModDetailsRequest.modId) + +``` +Modhub.GetModDetailsRequest.modId: ModId +``` + +### Modhub.UserPortal[πŸ”—](#$api.type.modhub~Modhub.UserPortal) + +``` +record Modhub.UserPortal XboxLive: UserPortal + PlaystationNetwork: UserPortal + Misc: UserPortal +end +``` + +### Modhub.UserPortal.XboxLive[πŸ”—](#$api.type.modhub~Modhub.UserPortal.XboxLive) + +``` +Modhub.UserPortal.XboxLive: UserPortal +``` + +### Modhub.UserPortal.PlaystationNetwork[πŸ”—](#$api.type.modhub~Modhub.UserPortal.PlaystationNetwork) + +``` +Modhub.UserPortal.PlaystationNetwork: UserPortal +``` + +### Modhub.UserPortal.Misc[πŸ”—](#$api.type.modhub~Modhub.UserPortal.Misc) + +``` +Modhub.UserPortal.Misc: UserPortal +``` + +### Modhub.ModDetailsData[πŸ”—](#$api.type.modhub~Modhub.ModDetailsData) + +``` +record Modhub.ModDetailsData new: function(): ModDetailsData + modInfo: ModInfo + author: string + userId: UserId + userPortal: UserPortal + numGalleryImages: integer + logoImage: string + galleryImages: {string} + dependencies: {{ModId, string}} + found: boolean +end +``` + +### Modhub.ModDetailsData.new[πŸ”—](#$api.type.modhub~Modhub.ModDetailsData.new) + +``` +function Modhub.ModDetailsData.new(): ModDetailsData +``` + +**Returns** + +1. `ModDetailsData` + +### Modhub.ModDetailsData.modInfo[πŸ”—](#$api.type.modhub~Modhub.ModDetailsData.modInfo) + +``` +Modhub.ModDetailsData.modInfo: ModInfo +``` + +### Modhub.ModDetailsData.author[πŸ”—](#$api.type.modhub~Modhub.ModDetailsData.author) + +``` +Modhub.ModDetailsData.author: string +``` + +### Modhub.ModDetailsData.userId[πŸ”—](#$api.type.modhub~Modhub.ModDetailsData.userId) + +``` +Modhub.ModDetailsData.userId: UserId +``` + +### Modhub.ModDetailsData.userPortal[πŸ”—](#$api.type.modhub~Modhub.ModDetailsData.userPortal) + +``` +Modhub.ModDetailsData.userPortal: UserPortal +``` + +### Modhub.ModDetailsData.numGalleryImages[πŸ”—](#$api.type.modhub~Modhub.ModDetailsData.numGalleryImages) + +``` +Modhub.ModDetailsData.numGalleryImages: integer +``` + +### Modhub.ModDetailsData.logoImage[πŸ”—](#$api.type.modhub~Modhub.ModDetailsData.logoImage) + +``` +Modhub.ModDetailsData.logoImage: string +``` + +### Modhub.ModDetailsData.galleryImages[πŸ”—](#$api.type.modhub~Modhub.ModDetailsData.galleryImages) + +``` +Modhub.ModDetailsData.galleryImages: {string} +``` + +### Modhub.ModDetailsData.dependencies[πŸ”—](#$api.type.modhub~Modhub.ModDetailsData.dependencies) + +``` +Modhub.ModDetailsData.dependencies: {{ModId, string}} +``` + +### Modhub.ModDetailsData.found[πŸ”—](#$api.type.modhub~Modhub.ModDetailsData.found) + +``` +Modhub.ModDetailsData.found: boolean +``` + +### Modhub.GetModMediaRequest[πŸ”—](#$api.type.modhub~Modhub.GetModMediaRequest) + +``` +record Modhub.GetModMediaRequest new: function(ModId, ModMediaType, integer): GetModMediaRequest + modId: ModId + type: ModMediaType + galleryIndex: integer +end +``` + +### Modhub.GetModMediaRequest.new[πŸ”—](#$api.type.modhub~Modhub.GetModMediaRequest.new) + +``` +function Modhub.GetModMediaRequest.new(ModId, ModMediaType, integer): GetModMediaRequest +``` + +**Parameters** + +* `ModId` +* `ModMediaType` +* `integer` + +**Returns** + +1. `GetModMediaRequest` + +### Modhub.GetModMediaRequest.modId[πŸ”—](#$api.type.modhub~Modhub.GetModMediaRequest.modId) + +``` +Modhub.GetModMediaRequest.modId: ModId +``` + +### Modhub.GetModMediaRequest.type[πŸ”—](#$api.type.modhub~Modhub.GetModMediaRequest.type) + +``` +Modhub.GetModMediaRequest.type: ModMediaType +``` + +### Modhub.GetModMediaRequest.galleryIndex[πŸ”—](#$api.type.modhub~Modhub.GetModMediaRequest.galleryIndex) + +``` +Modhub.GetModMediaRequest.galleryIndex: integer +``` + +### Modhub.ModMediaData[πŸ”—](#$api.type.modhub~Modhub.ModMediaData) + +``` +record Modhub.ModMediaData new: function(): ModMediaData + width: integer + height: integer + channels: integer + data: {integer} + data_native: Vector +end +``` + +### Modhub.ModMediaData.new[πŸ”—](#$api.type.modhub~Modhub.ModMediaData.new) + +``` +function Modhub.ModMediaData.new(): ModMediaData +``` + +**Returns** + +1. `ModMediaData` + +### Modhub.ModMediaData.width[πŸ”—](#$api.type.modhub~Modhub.ModMediaData.width) + +``` +Modhub.ModMediaData.width: integer +``` + +### Modhub.ModMediaData.height[πŸ”—](#$api.type.modhub~Modhub.ModMediaData.height) + +``` +Modhub.ModMediaData.height: integer +``` + +### Modhub.ModMediaData.channels[πŸ”—](#$api.type.modhub~Modhub.ModMediaData.channels) + +``` +Modhub.ModMediaData.channels: integer +``` + +### Modhub.ModMediaData.data[πŸ”—](#$api.type.modhub~Modhub.ModMediaData.data) + +``` +Modhub.ModMediaData.data: {integer} +``` + +### Modhub.ModMediaData.data\_native[πŸ”—](#$api.type.modhub~Modhub.ModMediaData.data_native) + +``` +Modhub.ModMediaData.data_native: Vector +``` + +### Modhub.GetModRatingRequest[πŸ”—](#$api.type.modhub~Modhub.GetModRatingRequest) + +``` +record Modhub.GetModRatingRequest new: function(ModId): GetModRatingRequest + modId: ModId +end +``` + +### Modhub.GetModRatingRequest.new[πŸ”—](#$api.type.modhub~Modhub.GetModRatingRequest.new) + +``` +function Modhub.GetModRatingRequest.new(ModId): GetModRatingRequest +``` + +**Parameters** + +* `ModId` + +**Returns** + +1. `GetModRatingRequest` + +### Modhub.GetModRatingRequest.modId[πŸ”—](#$api.type.modhub~Modhub.GetModRatingRequest.modId) + +``` +Modhub.GetModRatingRequest.modId: ModId +``` + +### Modhub.ModRatingData[πŸ”—](#$api.type.modhub~Modhub.ModRatingData) + +``` +record Modhub.ModRatingData new: function(): ModRatingData + rating: RatingType +end +``` + +### Modhub.ModRatingData.new[πŸ”—](#$api.type.modhub~Modhub.ModRatingData.new) + +``` +function Modhub.ModRatingData.new(): ModRatingData +``` + +**Returns** + +1. `ModRatingData` + +### Modhub.ModRatingData.rating[πŸ”—](#$api.type.modhub~Modhub.ModRatingData.rating) + +``` +Modhub.ModRatingData.rating: RatingType +``` + +### Modhub.SubscribeModRequest[πŸ”—](#$api.type.modhub~Modhub.SubscribeModRequest) + +``` +record Modhub.SubscribeModRequest new: function(ModId): SubscribeModRequest + modId: ModId + includeDependencies: boolean +end +``` + +### Modhub.SubscribeModRequest.new[πŸ”—](#$api.type.modhub~Modhub.SubscribeModRequest.new) + +``` +function Modhub.SubscribeModRequest.new(ModId): SubscribeModRequest +``` + +**Parameters** + +* `ModId` + +**Returns** + +1. `SubscribeModRequest` + +### Modhub.SubscribeModRequest.modId[πŸ”—](#$api.type.modhub~Modhub.SubscribeModRequest.modId) + +``` +Modhub.SubscribeModRequest.modId: ModId +``` + +### Modhub.SubscribeModRequest.includeDependencies[πŸ”—](#$api.type.modhub~Modhub.SubscribeModRequest.includeDependencies) + +``` +Modhub.SubscribeModRequest.includeDependencies: boolean +``` + +### Modhub.UnsubscribeModRequest[πŸ”—](#$api.type.modhub~Modhub.UnsubscribeModRequest) + +``` +record Modhub.UnsubscribeModRequest new: function(ModId): UnsubscribeModRequest + modId: ModId +end +``` + +### Modhub.UnsubscribeModRequest.new[πŸ”—](#$api.type.modhub~Modhub.UnsubscribeModRequest.new) + +``` +function Modhub.UnsubscribeModRequest.new(ModId): UnsubscribeModRequest +``` + +**Parameters** + +* `ModId` + +**Returns** + +1. `UnsubscribeModRequest` + +### Modhub.UnsubscribeModRequest.modId[πŸ”—](#$api.type.modhub~Modhub.UnsubscribeModRequest.modId) + +``` +Modhub.UnsubscribeModRequest.modId: ModId +``` + +### Modhub.SubscriptionData[πŸ”—](#$api.type.modhub~Modhub.SubscriptionData) + +``` +record Modhub.SubscriptionDataend +``` + +### Modhub.RefreshData[πŸ”—](#$api.type.modhub~Modhub.RefreshData) + +``` +record Modhub.RefreshData numRefreshed: integer +end +``` + +### Modhub.RefreshData.numRefreshed[πŸ”—](#$api.type.modhub~Modhub.RefreshData.numRefreshed) + +``` +Modhub.RefreshData.numRefreshed: integer +``` + +### Modhub.ForceUninstallModRequest[πŸ”—](#$api.type.modhub~Modhub.ForceUninstallModRequest) + +``` +record Modhub.ForceUninstallModRequest new: function(ModId): ForceUninstallModRequest + modId: ModId +end +``` + +### Modhub.ForceUninstallModRequest.new[πŸ”—](#$api.type.modhub~Modhub.ForceUninstallModRequest.new) + +``` +function Modhub.ForceUninstallModRequest.new(ModId): ForceUninstallModRequest +``` + +**Parameters** + +* `ModId` + +**Returns** + +1. `ForceUninstallModRequest` + +### Modhub.ForceUninstallModRequest.modId[πŸ”—](#$api.type.modhub~Modhub.ForceUninstallModRequest.modId) + +``` +Modhub.ForceUninstallModRequest.modId: ModId +``` + +### Modhub.ForceUninstallModData[πŸ”—](#$api.type.modhub~Modhub.ForceUninstallModData) + +``` +record Modhub.ForceUninstallModDataend +``` + +### Modhub.SpecialRefreshModRequest[πŸ”—](#$api.type.modhub~Modhub.SpecialRefreshModRequest) + +``` +record Modhub.SpecialRefreshModRequest new: function(ModId, boolean): SpecialRefreshModRequest + modId: ModId + unsubscribe: boolean +end +``` + +### Modhub.SpecialRefreshModRequest.new[πŸ”—](#$api.type.modhub~Modhub.SpecialRefreshModRequest.new) + +``` +function Modhub.SpecialRefreshModRequest.new(ModId, boolean): SpecialRefreshModRequest +``` + +**Parameters** + +* `ModId` +* `boolean` + +**Returns** + +1. `SpecialRefreshModRequest` + +### Modhub.SpecialRefreshModRequest.modId[πŸ”—](#$api.type.modhub~Modhub.SpecialRefreshModRequest.modId) + +``` +Modhub.SpecialRefreshModRequest.modId: ModId +``` + +### Modhub.SpecialRefreshModRequest.unsubscribe[πŸ”—](#$api.type.modhub~Modhub.SpecialRefreshModRequest.unsubscribe) + +``` +Modhub.SpecialRefreshModRequest.unsubscribe: boolean +``` + +### Modhub.SpecialRefreshModData[πŸ”—](#$api.type.modhub~Modhub.SpecialRefreshModData) + +``` +record Modhub.SpecialRefreshModDataend +``` + +### Modhub.RestartModBackendData[πŸ”—](#$api.type.modhub~Modhub.RestartModBackendData) + +``` +record Modhub.RestartModBackendDataend +``` + +### Modhub.SubmitModRatingRequest[πŸ”—](#$api.type.modhub~Modhub.SubmitModRatingRequest) + +``` +record Modhub.SubmitModRatingRequest new: function(ModId, RatingType): SubmitModRatingRequest + modId: ModId + rating: RatingType +end +``` + +### Modhub.SubmitModRatingRequest.new[πŸ”—](#$api.type.modhub~Modhub.SubmitModRatingRequest.new) + +``` +function Modhub.SubmitModRatingRequest.new(ModId, RatingType): SubmitModRatingRequest +``` + +**Parameters** + +* `ModId` +* `RatingType` + +**Returns** + +1. `SubmitModRatingRequest` + +### Modhub.SubmitModRatingRequest.modId[πŸ”—](#$api.type.modhub~Modhub.SubmitModRatingRequest.modId) + +``` +Modhub.SubmitModRatingRequest.modId: ModId +``` + +### Modhub.SubmitModRatingRequest.rating[πŸ”—](#$api.type.modhub~Modhub.SubmitModRatingRequest.rating) + +``` +Modhub.SubmitModRatingRequest.rating: RatingType +``` + +### Modhub.SubmitModRatingData[πŸ”—](#$api.type.modhub~Modhub.SubmitModRatingData) + +``` +record Modhub.SubmitModRatingData rating: RatingType +end +``` + +### Modhub.SubmitModRatingData.rating[πŸ”—](#$api.type.modhub~Modhub.SubmitModRatingData.rating) + +``` +Modhub.SubmitModRatingData.rating: RatingType +``` + +### Modhub.SubmitModReportRequest[πŸ”—](#$api.type.modhub~Modhub.SubmitModReportRequest) + +``` +record Modhub.SubmitModReportRequest new: function(ModId, ReportType, string, string, string): SubmitModReportRequest + modId: ModId + type: ReportType + reportDescription: string + reporterName: string + reporterContact: string +end +``` + +### Modhub.SubmitModReportRequest.new[πŸ”—](#$api.type.modhub~Modhub.SubmitModReportRequest.new) + +``` +function Modhub.SubmitModReportRequest.new(ModId, ReportType, string, string, string): SubmitModReportRequest +``` + +**Parameters** + +* `ModId` +* `ReportType` +* `string` +* `string` +* `string` + +**Returns** + +1. `SubmitModReportRequest` + +### Modhub.SubmitModReportRequest.modId[πŸ”—](#$api.type.modhub~Modhub.SubmitModReportRequest.modId) + +``` +Modhub.SubmitModReportRequest.modId: ModId +``` + +### Modhub.SubmitModReportRequest.type[πŸ”—](#$api.type.modhub~Modhub.SubmitModReportRequest.type) + +``` +Modhub.SubmitModReportRequest.type: ReportType +``` + +### Modhub.SubmitModReportRequest.reportDescription[πŸ”—](#$api.type.modhub~Modhub.SubmitModReportRequest.reportDescription) + +``` +Modhub.SubmitModReportRequest.reportDescription: string +``` + +### Modhub.SubmitModReportRequest.reporterName[πŸ”—](#$api.type.modhub~Modhub.SubmitModReportRequest.reporterName) + +``` +Modhub.SubmitModReportRequest.reporterName: string +``` + +### Modhub.SubmitModReportRequest.reporterContact[πŸ”—](#$api.type.modhub~Modhub.SubmitModReportRequest.reporterContact) + +``` +Modhub.SubmitModReportRequest.reporterContact: string +``` + +### Modhub.SubmitModReportData[πŸ”—](#$api.type.modhub~Modhub.SubmitModReportData) + +``` +[Expand All] [Collapse All] + +record Modhub.SubmitModReportData record Response ValidationError: Response + Submitted: Response +end + response: Response +end +``` + +### Modhub.SubmitModReportData.Response[πŸ”—](#$api.type.modhub~Modhub.SubmitModReportData.Response) + +``` +record Modhub.SubmitModReportData.Response ValidationError: Response + Submitted: Response +end +``` + +### Modhub.SubmitModReportData.Response.ValidationError[πŸ”—](#$api.type.modhub~Modhub.SubmitModReportData.Response.ValidationError) + +``` +Modhub.SubmitModReportData.Response.ValidationError: Response +``` + +### Modhub.SubmitModReportData.Response.Submitted[πŸ”—](#$api.type.modhub~Modhub.SubmitModReportData.Response.Submitted) + +``` +Modhub.SubmitModReportData.Response.Submitted: Response +``` + +### Modhub.SubmitModReportData.response[πŸ”—](#$api.type.modhub~Modhub.SubmitModReportData.response) + +``` +Modhub.SubmitModReportData.response: Response +``` + +### Modhub.UploadModData[πŸ”—](#$api.type.modhub~Modhub.UploadModData) + +``` +record Modhub.UploadModData modId: ModId + partialErrors: {ModHubErrorCode} +end +``` + +### Modhub.UploadModData.modId[πŸ”—](#$api.type.modhub~Modhub.UploadModData.modId) + +``` +Modhub.UploadModData.modId: ModId +``` + +### Modhub.UploadModData.partialErrors[πŸ”—](#$api.type.modhub~Modhub.UploadModData.partialErrors) + +``` +Modhub.UploadModData.partialErrors: {ModHubErrorCode} +``` + +### Modhub.UniquePendingRequestId[πŸ”—](#$api.type.modhub~Modhub.UniquePendingRequestId) + +``` +record Modhub.UniquePendingRequestId abort: function(UniquePendingRequestId) +end +``` + +### Modhub.UniquePendingRequestId.abort[πŸ”—](#$api.type.modhub~Modhub.UniquePendingRequestId.abort) + +``` +function Modhub.UniquePendingRequestId.abort(UniquePendingRequestId) +``` + +**Parameters** + +* `UniquePendingRequestId` + +### Modhub.AsyncResult[πŸ”—](#$api.type.modhub~Modhub.AsyncResult) + +``` +record Modhub.AsyncResult isSuccess: function(AsyncResult): boolean + getData: function(AsyncResult): T + getError: function(AsyncResult): ModHubErrorCode +end +``` + +##### Type Parameters + +* **`T`** + +### Modhub.AsyncResult.isSuccess[πŸ”—](#$api.type.modhub~Modhub.AsyncResult.isSuccess) + +``` +function Modhub.AsyncResult.isSuccess(AsyncResult): boolean +``` + +**Parameters** + +* `AsyncResult` + +**Returns** + +1. `boolean` + +### Modhub.AsyncResult.getData[πŸ”—](#$api.type.modhub~Modhub.AsyncResult.getData) + +``` +function Modhub.AsyncResult.getData(AsyncResult): T +``` + +**Parameters** + +* `AsyncResult` + +**Returns** + +1. `T` + +### Modhub.AsyncResult.getError[πŸ”—](#$api.type.modhub~Modhub.AsyncResult.getError) + +``` +function Modhub.AsyncResult.getError(AsyncResult): ModHubErrorCode +``` + +**Parameters** + +* `AsyncResult` + +**Returns** + +1. `ModHubErrorCode` + +### Modhub.BackendId[πŸ”—](#$api.type.modhub~Modhub.BackendId) + +``` +type Modhub.BackendId = integer +``` + +### Modhub.ModBrowserDisplayData[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData) + +``` +[Expand All] [Collapse All] + +record Modhub.ModBrowserDisplayData record Entry backendId: BackendId + modInfo: ModInfo + modId: Mod.ModId +end + entries: {Entry} + error: Modhub.ModHubErrorCode + currentPage: integer + numPages: integer + displayPerPage: integer + totalResults: integer + appendResults: boolean + searchString: string + sortType: Modhub.SortType + hasNoSortTag: boolean + filterTags: {string} + excludeTags: {string} +end +``` + +### Modhub.ModBrowserDisplayData.Entry[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.Entry) + +``` +record Modhub.ModBrowserDisplayData.Entry backendId: BackendId + modInfo: ModInfo + modId: Mod.ModId +end +``` + +### Modhub.ModBrowserDisplayData.Entry.backendId[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.Entry.backendId) + +``` +Modhub.ModBrowserDisplayData.Entry.backendId: BackendId +``` + +### Modhub.ModBrowserDisplayData.Entry.modInfo[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.Entry.modInfo) + +``` +Modhub.ModBrowserDisplayData.Entry.modInfo: ModInfo +``` + +### Modhub.ModBrowserDisplayData.Entry.modId[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.Entry.modId) + +``` +Modhub.ModBrowserDisplayData.Entry.modId: Mod.ModId +``` + +### Modhub.ModBrowserDisplayData.entries[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.entries) + +``` +Modhub.ModBrowserDisplayData.entries: {Entry} +``` + +### Modhub.ModBrowserDisplayData.error[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.error) + +``` +Modhub.ModBrowserDisplayData.error: Modhub.ModHubErrorCode +``` + +### Modhub.ModBrowserDisplayData.currentPage[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.currentPage) + +``` +Modhub.ModBrowserDisplayData.currentPage: integer +``` + +### Modhub.ModBrowserDisplayData.numPages[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.numPages) + +``` +Modhub.ModBrowserDisplayData.numPages: integer +``` + +### Modhub.ModBrowserDisplayData.displayPerPage[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.displayPerPage) + +``` +Modhub.ModBrowserDisplayData.displayPerPage: integer +``` + +### Modhub.ModBrowserDisplayData.totalResults[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.totalResults) + +``` +Modhub.ModBrowserDisplayData.totalResults: integer +``` + +### Modhub.ModBrowserDisplayData.appendResults[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.appendResults) + +``` +Modhub.ModBrowserDisplayData.appendResults: boolean +``` + +### Modhub.ModBrowserDisplayData.searchString[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.searchString) + +``` +Modhub.ModBrowserDisplayData.searchString: string +``` + +### Modhub.ModBrowserDisplayData.sortType[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.sortType) + +``` +Modhub.ModBrowserDisplayData.sortType: Modhub.SortType +``` + +### Modhub.ModBrowserDisplayData.hasNoSortTag[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.hasNoSortTag) + +``` +Modhub.ModBrowserDisplayData.hasNoSortTag: boolean +``` + +### Modhub.ModBrowserDisplayData.filterTags[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.filterTags) + +``` +Modhub.ModBrowserDisplayData.filterTags: {string} +``` + +### Modhub.ModBrowserDisplayData.excludeTags[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDisplayData.excludeTags) + +``` +Modhub.ModBrowserDisplayData.excludeTags: {string} +``` + +### Modhub.ModBrowserDataProvider[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider) + +``` +record Modhub.ModBrowserDataProvider new: function(BackendId, integer): ModBrowserDataProvider + newForSelector: function(integer, function(Mod.ModId, Mod.ModId), {Mod.GameModDesc}): ModBrowserDataProvider + suspend: function(ModBrowserDataProvider) + resume: function(ModBrowserDataProvider) + getDisplayData: function(ModBrowserDataProvider): ModBrowserDisplayData + setLoadPage: function(ModBrowserDataProvider, integer) + setNextContinuousPage: function(ModBrowserDataProvider) + setCurrentPage: function(ModBrowserDataProvider, integer) + setSearchString: function(ModBrowserDataProvider, string) + setSearchUserId: function(ModBrowserDataProvider, UserId) + setNextPage: function(ModBrowserDataProvider) + setPreviousPage: function(ModBrowserDataProvider) + refreshCurrentPage: function(ModBrowserDataProvider, boolean) + getSortType: function(ModBrowserDataProvider): Modhub.SortType + getTagToggled: function(ModBrowserDataProvider, string): boolean + setSortType: function(ModBrowserDataProvider, SortType) + setNextSortType: function(ModBrowserDataProvider) + toggleTag: function(ModBrowserDataProvider, string) + resetFilters: function(ModBrowserDataProvider) + getSortAndFilterOptions: function(ModBrowserDataProvider): Modhub.SortAndFilterOptions +end +``` + +### Modhub.ModBrowserDataProvider.new[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.new) + +``` +function Modhub.ModBrowserDataProvider.new(BackendId, integer): ModBrowserDataProvider +``` + +**Parameters** + +* `BackendId` +* `integer` + +**Returns** + +1. `ModBrowserDataProvider` + +### Modhub.ModBrowserDataProvider.newForSelector[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.newForSelector) + +``` +function Modhub.ModBrowserDataProvider.newForSelector(integer, function(Mod.ModId, Mod.ModId), {Mod.GameModDesc}): ModBrowserDataProvider +``` + +**Parameters** + +* `integer` +* `function(Mod.ModId, Mod.ModId)` +* `{Mod.GameModDesc}` + +**Returns** + +1. `ModBrowserDataProvider` + +### Modhub.ModBrowserDataProvider.suspend[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.suspend) + +``` +function Modhub.ModBrowserDataProvider.suspend(ModBrowserDataProvider) +``` + +**Parameters** + +* `ModBrowserDataProvider` + +### Modhub.ModBrowserDataProvider.resume[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.resume) + +``` +function Modhub.ModBrowserDataProvider.resume(ModBrowserDataProvider) +``` + +**Parameters** + +* `ModBrowserDataProvider` + +### Modhub.ModBrowserDataProvider.getDisplayData[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.getDisplayData) + +``` +function Modhub.ModBrowserDataProvider.getDisplayData(ModBrowserDataProvider): ModBrowserDisplayData +``` + +**Parameters** + +* `ModBrowserDataProvider` + +**Returns** + +1. `ModBrowserDisplayData` + +### Modhub.ModBrowserDataProvider.setLoadPage[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.setLoadPage) + +``` +function Modhub.ModBrowserDataProvider.setLoadPage(ModBrowserDataProvider, integer) +``` + +**Parameters** + +* `ModBrowserDataProvider` +* `integer` + +### Modhub.ModBrowserDataProvider.setNextContinuousPage[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.setNextContinuousPage) + +``` +function Modhub.ModBrowserDataProvider.setNextContinuousPage(ModBrowserDataProvider) +``` + +**Parameters** + +* `ModBrowserDataProvider` + +### Modhub.ModBrowserDataProvider.setCurrentPage[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.setCurrentPage) + +``` +function Modhub.ModBrowserDataProvider.setCurrentPage(ModBrowserDataProvider, integer) +``` + +**Parameters** + +* `ModBrowserDataProvider` +* `integer` + +### Modhub.ModBrowserDataProvider.setSearchString[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.setSearchString) + +``` +function Modhub.ModBrowserDataProvider.setSearchString(ModBrowserDataProvider, string) +``` + +**Parameters** + +* `ModBrowserDataProvider` +* `string` + +### Modhub.ModBrowserDataProvider.setSearchUserId[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.setSearchUserId) + +``` +function Modhub.ModBrowserDataProvider.setSearchUserId(ModBrowserDataProvider, UserId) +``` + +**Parameters** + +* `ModBrowserDataProvider` +* `UserId` + +### Modhub.ModBrowserDataProvider.setNextPage[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.setNextPage) + +``` +function Modhub.ModBrowserDataProvider.setNextPage(ModBrowserDataProvider) +``` + +**Parameters** + +* `ModBrowserDataProvider` + +### Modhub.ModBrowserDataProvider.setPreviousPage[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.setPreviousPage) + +``` +function Modhub.ModBrowserDataProvider.setPreviousPage(ModBrowserDataProvider) +``` + +**Parameters** + +* `ModBrowserDataProvider` + +### Modhub.ModBrowserDataProvider.refreshCurrentPage[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.refreshCurrentPage) + +``` +function Modhub.ModBrowserDataProvider.refreshCurrentPage(ModBrowserDataProvider, boolean) +``` + +**Parameters** + +* `ModBrowserDataProvider` +* `boolean` + +### Modhub.ModBrowserDataProvider.getSortType[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.getSortType) + +``` +function Modhub.ModBrowserDataProvider.getSortType(ModBrowserDataProvider): Modhub.SortType +``` + +**Parameters** + +* `ModBrowserDataProvider` + +**Returns** + +1. `Modhub.SortType` + +### Modhub.ModBrowserDataProvider.getTagToggled[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.getTagToggled) + +``` +function Modhub.ModBrowserDataProvider.getTagToggled(ModBrowserDataProvider, string): boolean +``` + +**Parameters** + +* `ModBrowserDataProvider` +* `string` + +**Returns** + +1. `boolean` + +### Modhub.ModBrowserDataProvider.setSortType[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.setSortType) + +``` +function Modhub.ModBrowserDataProvider.setSortType(ModBrowserDataProvider, SortType) +``` + +**Parameters** + +* `ModBrowserDataProvider` +* `SortType` + +### Modhub.ModBrowserDataProvider.setNextSortType[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.setNextSortType) + +``` +function Modhub.ModBrowserDataProvider.setNextSortType(ModBrowserDataProvider) +``` + +**Parameters** + +* `ModBrowserDataProvider` + +### Modhub.ModBrowserDataProvider.toggleTag[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.toggleTag) + +``` +function Modhub.ModBrowserDataProvider.toggleTag(ModBrowserDataProvider, string) +``` + +**Parameters** + +* `ModBrowserDataProvider` +* `string` + +### Modhub.ModBrowserDataProvider.resetFilters[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.resetFilters) + +``` +function Modhub.ModBrowserDataProvider.resetFilters(ModBrowserDataProvider) +``` + +**Parameters** + +* `ModBrowserDataProvider` + +### Modhub.ModBrowserDataProvider.getSortAndFilterOptions[πŸ”—](#$api.type.modhub~Modhub.ModBrowserDataProvider.getSortAndFilterOptions) + +``` +function Modhub.ModBrowserDataProvider.getSortAndFilterOptions(ModBrowserDataProvider): Modhub.SortAndFilterOptions +``` + +**Parameters** + +* `ModBrowserDataProvider` + +**Returns** + +1. `Modhub.SortAndFilterOptions` + +### Modhub.StagingModData[πŸ”—](#$api.type.modhub~Modhub.StagingModData) + +``` +[Expand All] [Collapse All] + +record Modhub.StagingModData record State Sync: State + Ready: State + Publishing: State + HasResult: State +end + equals: function(StagingModData, StagingModData): boolean + localModhubDetails: Modhub.ModDetailsData + state: State + modhubId: Modhub.ModId + modhubDetails: Modhub.ModDetailsData + publishResult: AsyncResult +end +``` + +### Modhub.StagingModData.State[πŸ”—](#$api.type.modhub~Modhub.StagingModData.State) + +``` +record Modhub.StagingModData.State Sync: State + Ready: State + Publishing: State + HasResult: State +end +``` + +### Modhub.StagingModData.State.Sync[πŸ”—](#$api.type.modhub~Modhub.StagingModData.State.Sync) + +``` +Modhub.StagingModData.State.Sync: State +``` + +### Modhub.StagingModData.State.Ready[πŸ”—](#$api.type.modhub~Modhub.StagingModData.State.Ready) + +``` +Modhub.StagingModData.State.Ready: State +``` + +### Modhub.StagingModData.State.Publishing[πŸ”—](#$api.type.modhub~Modhub.StagingModData.State.Publishing) + +``` +Modhub.StagingModData.State.Publishing: State +``` + +### Modhub.StagingModData.State.HasResult[πŸ”—](#$api.type.modhub~Modhub.StagingModData.State.HasResult) + +``` +Modhub.StagingModData.State.HasResult: State +``` + +### Modhub.StagingModData.equals[πŸ”—](#$api.type.modhub~Modhub.StagingModData.equals) + +``` +function Modhub.StagingModData.equals(StagingModData, StagingModData): boolean +``` + +**Parameters** + +* `StagingModData` +* `StagingModData` + +**Returns** + +1. `boolean` + +### Modhub.StagingModData.localModhubDetails[πŸ”—](#$api.type.modhub~Modhub.StagingModData.localModhubDetails) + +``` +Modhub.StagingModData.localModhubDetails: Modhub.ModDetailsData +``` + +### Modhub.StagingModData.state[πŸ”—](#$api.type.modhub~Modhub.StagingModData.state) + +``` +Modhub.StagingModData.state: State +``` + +### Modhub.StagingModData.modhubId[πŸ”—](#$api.type.modhub~Modhub.StagingModData.modhubId) + +``` +Modhub.StagingModData.modhubId: Modhub.ModId +``` + +### Modhub.StagingModData.modhubDetails[πŸ”—](#$api.type.modhub~Modhub.StagingModData.modhubDetails) + +``` +Modhub.StagingModData.modhubDetails: Modhub.ModDetailsData +``` + +### Modhub.StagingModData.publishResult[πŸ”—](#$api.type.modhub~Modhub.StagingModData.publishResult) + +``` +Modhub.StagingModData.publishResult: AsyncResult +``` + +### Modhub.PublishSettings[πŸ”—](#$api.type.modhub~Modhub.PublishSettings) + +``` +record Modhub.PublishSettings new: function(): PublishSettings + + changeLog: string + updateMetadata: boolean + setPublic: boolean +end +``` + +### Modhub.PublishSettings.new()[πŸ”—](#$api.type.modhub~Modhub.PublishSettings.new()) + +``` +function Modhub.PublishSettings.new()(): PublishSettings +``` + +**Returns** + +1. `PublishSettings` + +### Modhub.PublishSettings.new(PublishSettings)[πŸ”—](#$api.type.modhub~Modhub.PublishSettings.new(PublishSettings)) + +``` +function Modhub.PublishSettings.new(PublishSettings)(PublishSettings): PublishSettings +``` + +**Parameters** + +* `PublishSettings` + +**Returns** + +1. `PublishSettings` + +### Modhub.PublishSettings.changeLog[πŸ”—](#$api.type.modhub~Modhub.PublishSettings.changeLog) + +``` +Modhub.PublishSettings.changeLog: string +``` + +### Modhub.PublishSettings.updateMetadata[πŸ”—](#$api.type.modhub~Modhub.PublishSettings.updateMetadata) + +``` +Modhub.PublishSettings.updateMetadata: boolean +``` + +### Modhub.PublishSettings.setPublic[πŸ”—](#$api.type.modhub~Modhub.PublishSettings.setPublic) + +``` +Modhub.PublishSettings.setPublic: boolean +``` + +### Modhub.ModPublishHelper[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper) + +``` +record Modhub.ModPublishHelper new: function(BackendId): ModPublishHelper + hasAnyStagingMods: function(publishHelper : ModPublishHelper): boolean + canRefresh: function(publishHelper : ModPublishHelper): boolean + refresh: function(publishHelper : ModPublishHelper): AsyncResult + hasStagingMod: function(publishHelper : ModPublishHelper, modId : Modhub.ModId): boolean + getStagingModData: function(publishHelper : ModPublishHelper, modId : Modhub.ModId): StagingModData + setModDetails: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, modDetailsData : Modhub.ModDetailsData) + setRemoteModId: function(publishHelper : ModPublishHelper, localModId : Modhub.ModId, remoteModId : Modhub.ModId) + publish: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, publishSettings : PublishSettings, validationResult : Modhub.ModValidatorResult): AsyncResult + abortPublish: function(publishHelper : ModPublishHelper, modId : Modhub.ModId): UniquePendingRequestId + addLogoImage: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, image : string) + removeLogoImage: function(publishHelper : ModPublishHelper, modId : Modhub.ModId) + addGalleryImages: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, images : {string}) + removeGalleryImage: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, index : integer) + moveGalleryImage: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, fromIndex : integer, toIndex : integer) + setPostPublishFn: function(publishHelper : ModPublishHelper, modId : Modhub.ModId, publishFn : function(Modhub.ModId)) + openFolder: function(publishHelper : ModPublishHelper, modId : Modhub.ModId) + getSortAndFilterOptions: function(publishHelper : ModPublishHelper): Modhub.SortAndFilterOptions +end +``` + +### Modhub.ModPublishHelper.new[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.new) + +``` +function Modhub.ModPublishHelper.new(BackendId): ModPublishHelper +``` + +**Parameters** + +* `BackendId` + +**Returns** + +1. `ModPublishHelper` + +### Modhub.ModPublishHelper.hasAnyStagingMods[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.hasAnyStagingMods) + +``` +function Modhub.ModPublishHelper.hasAnyStagingMods(publishHelper : ModPublishHelper): boolean +``` + +Checks if there are any mods in the staging area + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper + +**Returns** + +1. `boolean` + +### Modhub.ModPublishHelper.canRefresh[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.canRefresh) + +``` +function Modhub.ModPublishHelper.canRefresh(publishHelper : ModPublishHelper): boolean +``` + +Checks if the publish helper can be refreshed + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper + +**Returns** + +1. `boolean` + +### Modhub.ModPublishHelper.refresh[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.refresh) + +``` +function Modhub.ModPublishHelper.refresh(publishHelper : ModPublishHelper): AsyncResult +``` + +Refreshes the mod helper, this is an async operation + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper + +**Returns** + +1. `AsyncResult` β€” the result of the async operation, including the number of mods that were refreshed + +### Modhub.ModPublishHelper.hasStagingMod[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.hasStagingMod) + +``` +function Modhub.ModPublishHelper.hasStagingMod(publishHelper : ModPublishHelper, modId : Modhub.ModId): boolean +``` + +Checks if a specific mod is in the staging area + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `modId` :`Modhub.ModId` β€” the mod id + +**Returns** + +1. `boolean` + +### Modhub.ModPublishHelper.getStagingModData[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.getStagingModData) + +``` +function Modhub.ModPublishHelper.getStagingModData(publishHelper : ModPublishHelper, modId : Modhub.ModId): StagingModData +``` + +Returns the staging mod data for a specific mod + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `modId` :`Modhub.ModId` β€” the mod id + +**Returns** + +1. `StagingModData` + +### Modhub.ModPublishHelper.setModDetails[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.setModDetails) + +``` +function Modhub.ModPublishHelper.setModDetails(publishHelper : ModPublishHelper, modId : Modhub.ModId, modDetailsData : Modhub.ModDetailsData) +``` + +Sets the mod details data + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `modId` :`Modhub.ModId` β€” the local mod id of the mod to update +* `modDetailsData` :`Modhub.ModDetailsData` β€” the mod details data + +### Modhub.ModPublishHelper.setRemoteModId[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.setRemoteModId) + +``` +function Modhub.ModPublishHelper.setRemoteModId(publishHelper : ModPublishHelper, localModId : Modhub.ModId, remoteModId : Modhub.ModId) +``` + +Update the local modId of a mod to the remote (eg. mod.io) mod.io of the mod when publishing + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `localModId` :`Modhub.ModId` β€” the local mod id of the mod to update +* `remoteModId` :`Modhub.ModId` β€” the remote mod id to set + +### Modhub.ModPublishHelper.publish[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.publish) + +``` +function Modhub.ModPublishHelper.publish(publishHelper : ModPublishHelper, modId : Modhub.ModId, publishSettings : PublishSettings, validationResult : Modhub.ModValidatorResult): AsyncResult +``` + +Publishes a mod (eg. on mod.io), this is an async call + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `modId` :`Modhub.ModId` β€” the mod id +* `publishSettings` :`PublishSettings` β€” the publish settings +* `validationResult` :`Modhub.ModValidatorResult` β€” the validation result + +**Returns** + +1. `AsyncResult` β€” the result of the async call, also contains the remote mod id + +### Modhub.ModPublishHelper.abortPublish[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.abortPublish) + +``` +function Modhub.ModPublishHelper.abortPublish(publishHelper : ModPublishHelper, modId : Modhub.ModId): UniquePendingRequestId +``` + +Aborts the publication of a mod + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `modId` :`Modhub.ModId` β€” the mod id + +**Returns** + +1. `UniquePendingRequestId` + +### Modhub.ModPublishHelper.addLogoImage[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.addLogoImage) + +``` +function Modhub.ModPublishHelper.addLogoImage(publishHelper : ModPublishHelper, modId : Modhub.ModId, image : string) +``` + +Adds a list of image to the mod gallery + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `modId` :`Modhub.ModId` β€” the mod id +* `image` :`string` β€” image file to add to the gallery + +### Modhub.ModPublishHelper.removeLogoImage[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.removeLogoImage) + +``` +function Modhub.ModPublishHelper.removeLogoImage(publishHelper : ModPublishHelper, modId : Modhub.ModId) +``` + +Removes the logo image + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `modId` :`Modhub.ModId` β€” the mod id + +### Modhub.ModPublishHelper.addGalleryImages[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.addGalleryImages) + +``` +function Modhub.ModPublishHelper.addGalleryImages(publishHelper : ModPublishHelper, modId : Modhub.ModId, images : {string}) +``` + +Adds a list of image to the mod gallery + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `modId` :`Modhub.ModId` β€” the mod id +* `images` :`{string}` β€” the list of image file to add to the gallery + +### Modhub.ModPublishHelper.removeGalleryImage[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.removeGalleryImage) + +``` +function Modhub.ModPublishHelper.removeGalleryImage(publishHelper : ModPublishHelper, modId : Modhub.ModId, index : integer) +``` + +Removes an image from the mod gallery + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `modId` :`Modhub.ModId` β€” the mod id +* `index` :`integer` β€” the index of the image in the gallery to remove + +### Modhub.ModPublishHelper.moveGalleryImage[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.moveGalleryImage) + +``` +function Modhub.ModPublishHelper.moveGalleryImage(publishHelper : ModPublishHelper, modId : Modhub.ModId, fromIndex : integer, toIndex : integer) +``` + +Moves an image position in the mod gallery + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `modId` :`Modhub.ModId` β€” the mod id +* `fromIndex` :`integer` β€” the index in the mod gallery of the image to move +* `toIndex` :`integer` β€” the new position of the image in the mod gallery + +### Modhub.ModPublishHelper.setPostPublishFn[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.setPostPublishFn) + +``` +function Modhub.ModPublishHelper.setPostPublishFn(publishHelper : ModPublishHelper, modId : Modhub.ModId, publishFn : function(Modhub.ModId)) +``` + +Set a function called after a mod has been successfuly published + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `modId` :`Modhub.ModId` β€” the mod id +* `publishFn` :`function(Modhub.ModId)` β€” a function called after the mod has been published, the function gives the remote mod id as parameter + +### Modhub.ModPublishHelper.openFolder[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.openFolder) + +``` +function Modhub.ModPublishHelper.openFolder(publishHelper : ModPublishHelper, modId : Modhub.ModId) +``` + +Opens the mod folder + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper +* `modId` :`Modhub.ModId` β€” the modId + +### Modhub.ModPublishHelper.getSortAndFilterOptions[πŸ”—](#$api.type.modhub~Modhub.ModPublishHelper.getSortAndFilterOptions) + +``` +function Modhub.ModPublishHelper.getSortAndFilterOptions(publishHelper : ModPublishHelper): Modhub.SortAndFilterOptions +``` + +Gets the list of sorting and filtering options (eg. tags) + +**Parameters** + +* `publishHelper` :`ModPublishHelper` β€” the publish helper + +**Returns** + +1. `Modhub.SortAndFilterOptions` β€” an object containing the list of sort and filter options diff --git a/docs/reference/script-doc/app.md b/docs/reference/script-doc/app.md new file mode 100644 index 0000000..b6f3b4d --- /dev/null +++ b/docs/reference/script-doc/app.md @@ -0,0 +1,788 @@ + + +[index](index.html) / app + +--- + +# Module app[πŸ”—](#app) + +Module controlling high level functions for the application, can be used to manipulate save games. + +``` +[Expand All] [Collapse All] + +global record App record ProgressMonitor getProgress: function(ProgressMonitor): number + getTask: function(ProgressMonitor): string +end + quit: function(instant : boolean) + restart: function() + printMemoryStats: function() + startGame: function(startGameParams : StartGameParams) + startGame2: function(map : GameMap, seed : string, startDate : Date, startTimeOfDaySeconds : integer, startCloudCoverage : number, isMapEditor : boolean, mods : {Mod.ModId}, configDict : {{string, string}}, modParams : {string : {string : integer}}) + stopGame: function() + findAllSavegames: function(namespace : string): {SaveGameInfo} + loadGame: function(saveId : SaveGameId, isMapEditor : boolean, info : SaveGameData.SaveGameDetails) + loadMission: function(saveId : SaveGameId, campaign : string, mission : string) + saveGame: function(name : string, callBack : function(), isMapEditor : boolean, skipSetName : boolean) + parseSavegameName: function(savegameName : string): ParsedSavegameName + getSavegameComplexity: function(saveGameDetails : SaveGameData.SaveGameDetails): integer + getSavegameComplexityLimit: function(): integer + getSavegameInfo: function(saveId : SaveGameId): Async + getSavegameImage: function(saveId : SaveGameId): GameScreenshot | nil + deleteSavegame: function(saveId : SaveGameId): boolean + getUserProfile: function(): UserProfile + findBuiltinSavegames: function(isMapSave : boolean): {SaveGameInfo} + getSaveGameStorageInfo: function(): SaveGameStorageInfo + getSupportedMSAASampleCounts: function(): {integer} + loadUserdata: function(directory : string, fileName : string): { : } + saveUserdata: function(directory : string, fileName : string, table : { : }) + removeUserdata: function(directory : string, fileName : string) + getAllUserdata: function(directory : string): {string} + playVoiceOverOrStop: function(resName : string) + makeEmptyMap: function(climate : string, numTiles : Vec2i, waterLevel : number): GameMap + getInputActionRep: function(): InputActionRep + refreshMods: function() + setWaitForStartReadyGame: function() + isWaitForStartReadyGame: function(): boolean + startReadyGame: function() + getRandomTips: function(): {string} + getModTagTranslation: function(tag : string): string + getProgressMonitor: function(): ProgressMonitor + openUserDataFolder: function() + openUserDataSubFolder: function(directory : string) + getUserDataFolder: function(): string + getAllHeightmaps: function(): {string} + getGPUCapabilities: function(): GPUCapabilities + writeHeightmap: function(map : GameMap, path : string, writeStl : boolean, sixteenBits : boolean): boolean + showNodeEditor: function() + record SaveGameNamespace getUserdata: function(): string + getSavegame: function(): string + getSavemap: function(): string +end + record Debug setForcedGamepadDynamicScrollRepeatSpeed: function(speed : integer) + pushGamepadButtonKeyInputEvent: function(gamepadButtonName : string, press : boolean) +end + debug: Debug +end +``` + +## Category: globals[πŸ”—](#category-globals) + +### App[πŸ”—](#$app~App) + +``` +[Expand All] [Collapse All] + +global record App record ProgressMonitor getProgress: function(ProgressMonitor): number + getTask: function(ProgressMonitor): string +end + quit: function(instant : boolean) + restart: function() + printMemoryStats: function() + startGame: function(startGameParams : StartGameParams) + startGame2: function(map : GameMap, seed : string, startDate : Date, startTimeOfDaySeconds : integer, startCloudCoverage : number, isMapEditor : boolean, mods : {Mod.ModId}, configDict : {{string, string}}, modParams : {string : {string : integer}}) + stopGame: function() + findAllSavegames: function(namespace : string): {SaveGameInfo} + loadGame: function(saveId : SaveGameId, isMapEditor : boolean, info : SaveGameData.SaveGameDetails) + loadMission: function(saveId : SaveGameId, campaign : string, mission : string) + saveGame: function(name : string, callBack : function(), isMapEditor : boolean, skipSetName : boolean) + parseSavegameName: function(savegameName : string): ParsedSavegameName + getSavegameComplexity: function(saveGameDetails : SaveGameData.SaveGameDetails): integer + getSavegameComplexityLimit: function(): integer + getSavegameInfo: function(saveId : SaveGameId): Async + getSavegameImage: function(saveId : SaveGameId): GameScreenshot | nil + deleteSavegame: function(saveId : SaveGameId): boolean + getUserProfile: function(): UserProfile + findBuiltinSavegames: function(isMapSave : boolean): {SaveGameInfo} + getSaveGameStorageInfo: function(): SaveGameStorageInfo + getSupportedMSAASampleCounts: function(): {integer} + loadUserdata: function(directory : string, fileName : string): { : } + saveUserdata: function(directory : string, fileName : string, table : { : }) + removeUserdata: function(directory : string, fileName : string) + getAllUserdata: function(directory : string): {string} + playVoiceOverOrStop: function(resName : string) + makeEmptyMap: function(climate : string, numTiles : Vec2i, waterLevel : number): GameMap + getInputActionRep: function(): InputActionRep + refreshMods: function() + setWaitForStartReadyGame: function() + isWaitForStartReadyGame: function(): boolean + startReadyGame: function() + getRandomTips: function(): {string} + getModTagTranslation: function(tag : string): string + getProgressMonitor: function(): ProgressMonitor + openUserDataFolder: function() + openUserDataSubFolder: function(directory : string) + getUserDataFolder: function(): string + getAllHeightmaps: function(): {string} + getGPUCapabilities: function(): GPUCapabilities + writeHeightmap: function(map : GameMap, path : string, writeStl : boolean, sixteenBits : boolean): boolean + showNodeEditor: function() + record SaveGameNamespace getUserdata: function(): string + getSavegame: function(): string + getSavemap: function(): string +end + record Debug setForcedGamepadDynamicScrollRepeatSpeed: function(speed : integer) + pushGamepadButtonKeyInputEvent: function(gamepadButtonName : string, press : boolean) +end + debug: Debug +end +``` + +### App.ProgressMonitor[πŸ”—](#$app~App.ProgressMonitor) + +``` +record App.ProgressMonitor getProgress: function(ProgressMonitor): number + getTask: function(ProgressMonitor): string +end +``` + +### App.ProgressMonitor.getProgress[πŸ”—](#$app~App.ProgressMonitor.getProgress) + +``` +function App.ProgressMonitor.getProgress(ProgressMonitor): number +``` + +Returns the current progress as a value from 0 to 1 + +**Parameters** + +* `ProgressMonitor` + +**Returns** + +1. `number` + +### App.ProgressMonitor.getTask[πŸ”—](#$app~App.ProgressMonitor.getTask) + +``` +function App.ProgressMonitor.getTask(ProgressMonitor): string +``` + +Returns the current task being executed + +**Parameters** + +* `ProgressMonitor` + +**Returns** + +1. `string` + +### App.quit[πŸ”—](#$app~App.quit) + +``` +function App.quit(instant : boolean) +``` + +Quit the application. + +**Parameters** + +* `instant` :`boolean` β€” immediately quit one exit + +### App.restart[πŸ”—](#$app~App.restart) + +``` +function App.restart() +``` + +Restart the application + +### App.printMemoryStats[πŸ”—](#$app~App.printMemoryStats) + +``` +function App.printMemoryStats() +``` + +Prints memory statistics to the log output. + +### App.startGame[πŸ”—](#$app~App.startGame) + +``` +function App.startGame(startGameParams : StartGameParams) +``` + +Starts a new test game by specifying some basic parameters + +**Parameters** + +* `startGameParams` :`StartGameParams` β€” start game parameters (optional) - if not set, the game will start with default values + +### App.startGame2[πŸ”—](#$app~App.startGame2) + +``` +function App.startGame2(map : GameMap, seed : string, startDate : Date, startTimeOfDaySeconds : integer, startCloudCoverage : number, isMapEditor : boolean, mods : {Mod.ModId}, configDict : {{string, string}}, modParams : {string : {string : integer}}) +``` + +Starts a new game + +**Parameters** + +* `map` :`GameMap` β€” the map to use +* `seed` :`string` β€” the seed use for the map generation +* `startDate` :`Date` β€” the start date +* `startTimeOfDaySeconds` :`integer` β€” is the start time of the day in seconds +* `startCloudCoverage` :`number` β€” is the start cloud coverage +* `isMapEditor` :`boolean` β€” starting from map editor +* `mods` :`{Mod.ModId}` β€” list of mods to start the game with +* `configDict` :`{{string, string}}` β€” list of game settings +* `modParams` :`{string : {string : integer}}` β€” list of mod params + +### App.stopGame[πŸ”—](#$app~App.stopGame) + +``` +function App.stopGame() +``` + +Stops the current game. + +### App.findAllSavegames[πŸ”—](#$app~App.findAllSavegames) + +``` +function App.findAllSavegames(namespace : string): {SaveGameInfo} +``` + +Obtain list of all savegames. + +**Parameters** + +* `namespace` :`string` β€” from which to obtain information (see app.SaveGameNamespace.getSavemap() or app.SaveGameNamespace.getSavegame() for the namespaces) + +**Returns** + +1. `{SaveGameInfo}` β€” a list of all savegame + +### App.loadGame[πŸ”—](#$app~App.loadGame) + +``` +function App.loadGame(saveId : SaveGameId, isMapEditor : boolean, info : SaveGameData.SaveGameDetails) +``` + +Loads a savegame + +**Parameters** + +* `saveId` :`SaveGameId` β€” the savegame id +* `isMapEditor` :`boolean` β€” if the savegame is loaded in the map editor +* `info` :`SaveGameData.SaveGameDetails` β€” savegame info (optional) + +### App.loadMission[πŸ”—](#$app~App.loadMission) + +``` +function App.loadMission(saveId : SaveGameId, campaign : string, mission : string) +``` + +Loads a mission + +**Parameters** + +* `saveId` :`SaveGameId` β€” the savegame id +* `campaign` :`string` β€” campaign name +* `mission` :`string` β€” mission name + +### App.saveGame[πŸ”—](#$app~App.saveGame) + +``` +function App.saveGame(name : string, callBack : function(), isMapEditor : boolean, skipSetName : boolean) +``` + +Saves the current game. + +**Parameters** + +* `name` :`string` β€” the name of the savegame +* `callBack` :`function()` β€” callback when the savegame is finished +* `isMapEditor` :`boolean` β€” is saving from the map editor +* `skipSetName` :`boolean` β€” skips setting the savegame name as the current default savegame name (optional) + +### App.parseSavegameName[πŸ”—](#$app~App.parseSavegameName) + +``` +function App.parseSavegameName(savegameName : string): ParsedSavegameName +``` + +Parse savegame info from its file name + +**Parameters** + +* `savegameName` :`string` β€” the name of the savegame + +**Returns** + +1. `ParsedSavegameName` β€” The info (most notably, savegame type and group name) + +### App.getSavegameComplexity[πŸ”—](#$app~App.getSavegameComplexity) + +``` +function App.getSavegameComplexity(saveGameDetails : SaveGameData.SaveGameDetails): integer +``` + +Get an estimated value of the savegame complexity + +**Parameters** + +* `saveGameDetails` :`SaveGameData.SaveGameDetails` β€” the savegame data of the savegame + +**Returns** + +1. `integer` β€” a value that represents the estimate size of the savegame + +### App.getSavegameComplexityLimit[πŸ”—](#$app~App.getSavegameComplexityLimit) + +``` +function App.getSavegameComplexityLimit(): integer +``` + +Get an limit for the savegame complexity for the current platform + +**Returns** + +1. `integer` β€” the complexity limit for the current platform + +### App.getSavegameInfo[πŸ”—](#$app~App.getSavegameInfo) + +``` +function App.getSavegameInfo(saveId : SaveGameId): Async +``` + +Loads savegame metadata asynchronously. + +**Parameters** + +* `saveId` :`SaveGameId` β€” the savegame id + +**Returns** + +1. `Async` β€” an async object with the savegame data + +### App.getSavegameImage[πŸ”—](#$app~App.getSavegameImage) + +``` +function App.getSavegameImage(saveId : SaveGameId): GameScreenshot | nil +``` + +Obtains the savegame preview image +Note: This is - usually, if not explicitly changed in userdata - the same image as GameMetadata.screenshot but with the full available resolution + +**Parameters** + +* `saveId` :`SaveGameId` β€” the savegame id + +**Returns** + +1. `GameScreenshot | nil` β€” the image, or nil if no preview image is available + +### App.deleteSavegame[πŸ”—](#$app~App.deleteSavegame) + +``` +function App.deleteSavegame(saveId : SaveGameId): boolean +``` + +Deletes a savegame + +**Parameters** + +* `saveId` :`SaveGameId` β€” the savegame to delete + +**Returns** + +1. `boolean` β€” if the savegame was successfully deleted + +### App.getUserProfile[πŸ”—](#$app~App.getUserProfile) + +``` +function App.getUserProfile(): UserProfile +``` + +Obtain the user profile. + +**Returns** + +1. `UserProfile` β€” the user profile + +### App.findBuiltinSavegames[πŸ”—](#$app~App.findBuiltinSavegames) + +``` +function App.findBuiltinSavegames(isMapSave : boolean): {SaveGameInfo} +``` + +Obtains a list of built-in savegames. + +**Parameters** + +* `isMapSave` :`boolean` β€” true to list built-in maps, false to list built-in savegames + +**Returns** + +1. `{SaveGameInfo}` β€” list of savegames + +### App.getSaveGameStorageInfo[πŸ”—](#$app~App.getSaveGameStorageInfo) + +``` +function App.getSaveGameStorageInfo(): SaveGameStorageInfo +``` + +Returns the savegame storage infos + +**Returns** + +1. `SaveGameStorageInfo` β€” savegame storage info + +### App.getSupportedMSAASampleCounts[πŸ”—](#$app~App.getSupportedMSAASampleCounts) + +``` +function App.getSupportedMSAASampleCounts(): {integer} +``` + +Returns the supported MSAA sample counts + +**Returns** + +1. `{integer}` β€” list of supported sample counts + +### App.loadUserdata[πŸ”—](#$app~App.loadUserdata) + +``` +function App.loadUserdata(directory : string, fileName : string): { : } +``` + +Load a custom userdata file + +**Parameters** + +* `directory` :`string` β€” a folder in the userdata directory +* `fileName` :`string` β€” a lua filename (without .lua extension) + +**Returns** + +1. `{ : }` β€” the deserialized lua data + +### App.saveUserdata[πŸ”—](#$app~App.saveUserdata) + +``` +function App.saveUserdata(directory : string, fileName : string, table : { : }) +``` + +Saves a custom table as lua file. + +**Parameters** + +* `directory` :`string` β€” a folder in the userdata directory +* `fileName` :`string` β€” the filename to save to (without .lua extension) +* `table` :`{ : }` β€” the table to serialize + +### App.removeUserdata[πŸ”—](#$app~App.removeUserdata) + +``` +function App.removeUserdata(directory : string, fileName : string) +``` + +Removes a userdata. + +**Parameters** + +* `directory` :`string` β€” a folder in the userdata directory +* `fileName` :`string` β€” the filename to remove (without .lua extension) + +### App.getAllUserdata[πŸ”—](#$app~App.getAllUserdata) + +``` +function App.getAllUserdata(directory : string): {string} +``` + +Returns a list of all saved mod preset names. + +**Parameters** + +* `directory` :`string` β€” a folder in the userdata directory + +**Returns** + +1. `{string}` β€” a list of mod preset names + +### App.playVoiceOverOrStop[πŸ”—](#$app~App.playVoiceOverOrStop) + +``` +function App.playVoiceOverOrStop(resName : string) +``` + +Plays a voice over if not currently playing, otherwise stops it. + +**Parameters** + +* `resName` :`string` β€” the file to play + +### App.makeEmptyMap[πŸ”—](#$app~App.makeEmptyMap) + +``` +function App.makeEmptyMap(climate : string, numTiles : Vec2i, waterLevel : number): GameMap +``` + +Creates an empty map (for tooling / map generation workflows). + +**Parameters** + +* `climate` :`string` β€” climate resource name +* `numTiles` :`Vec2i` β€” map dimension in tiles +* `waterLevel` :`number` β€” water level height + +**Returns** + +1. `GameMap` β€” the map + +### App.getInputActionRep[πŸ”—](#$app~App.getInputActionRep) + +``` +function App.getInputActionRep(): InputActionRep +``` + +Returns the global input action repository. + +**Returns** + +1. `InputActionRep` β€” input action repository + +### App.refreshMods[πŸ”—](#$app~App.refreshMods) + +``` +function App.refreshMods() +``` + +Refreshes the installed mods + +### App.setWaitForStartReadyGame[πŸ”—](#$app~App.setWaitForStartReadyGame) + +``` +function App.setWaitForStartReadyGame() +``` + +Wait for the game to be ready to start. This is called when loading a game to prevent the game from starting automatically + +### App.isWaitForStartReadyGame[πŸ”—](#$app~App.isWaitForStartReadyGame) + +``` +function App.isWaitForStartReadyGame(): boolean +``` + +Return if the `setWaitForStartReadyGame` had been called for this game. + +**Returns** + +1. `boolean` + +### App.startReadyGame[πŸ”—](#$app~App.startReadyGame) + +``` +function App.startReadyGame() +``` + +Start Game that is fully loaded and ready to play. This is called after the progress page has finished loading the game. + +### App.getRandomTips[πŸ”—](#$app~App.getRandomTips) + +``` +function App.getRandomTips(): {string} +``` + +Gets the list of random tips + +**Returns** + +1. `{string}` β€” a list of tips as string + +### App.getModTagTranslation[πŸ”—](#$app~App.getModTagTranslation) + +``` +function App.getModTagTranslation(tag : string): string +``` + +Returns a translated name for a mod tag. + +**Parameters** + +* `tag` :`string` β€” tag to translate + +**Returns** + +1. `string` β€” the translated tag + +### App.getProgressMonitor[πŸ”—](#$app~App.getProgressMonitor) + +``` +function App.getProgressMonitor(): ProgressMonitor +``` + +Gets the load progress monitor + +**Returns** + +1. `ProgressMonitor` + +### App.openUserDataFolder[πŸ”—](#$app~App.openUserDataFolder) + +``` +function App.openUserDataFolder() +``` + +Opens the user data folder in the OS file manager + +### App.openUserDataSubFolder[πŸ”—](#$app~App.openUserDataSubFolder) + +``` +function App.openUserDataSubFolder(directory : string) +``` + +Opens the heightmaps folder in the OS file manager + +**Parameters** + +* `directory` :`string` β€” subfolder + +### App.getUserDataFolder[πŸ”—](#$app~App.getUserDataFolder) + +``` +function App.getUserDataFolder(): string +``` + +Gets the directory containing userdata + +**Returns** + +1. `string` + +### App.getAllHeightmaps[πŸ”—](#$app~App.getAllHeightmaps) + +``` +function App.getAllHeightmaps(): {string} +``` + +Gets a list of all heightmaps in the userdata directory + +**Returns** + +1. `{string}` β€” list of heightmaps files + +### App.getGPUCapabilities[πŸ”—](#$app~App.getGPUCapabilities) + +``` +function App.getGPUCapabilities(): GPUCapabilities +``` + +Get information about the GPU + +**Returns** + +1. `GPUCapabilities` + +### App.writeHeightmap[πŸ”—](#$app~App.writeHeightmap) + +``` +function App.writeHeightmap(map : GameMap, path : string, writeStl : boolean, sixteenBits : boolean): boolean +``` + +Writes a heightmap image (and optionally an STL) for a map. + +**Parameters** + +* `map` :`GameMap` β€” the map to write +* `path` :`string` β€” the relative path (extension will be added if missing) +* `writeStl` :`boolean` β€” write as an STL file as well +* `sixteenBits` :`boolean` β€” use 16 bits depth for the heightmap (default 8 bits depth) + +**Returns** + +1. `boolean` β€” if the heightmap was successfully written + +### App.showNodeEditor[πŸ”—](#$app~App.showNodeEditor) + +``` +function App.showNodeEditor() +``` + +Shows the node editor. + +### App.SaveGameNamespace[πŸ”—](#$app~App.SaveGameNamespace) + +``` +record App.SaveGameNamespace getUserdata: function(): string + getSavegame: function(): string + getSavemap: function(): string +end +``` + +Savegame namespace constants. + +### App.SaveGameNamespace.getUserdata[πŸ”—](#$app~App.SaveGameNamespace.getUserdata) + +``` +function App.SaveGameNamespace.getUserdata(): string +``` + +Returns the userdata savegame namespace. + +**Returns** + +1. `string` + +### App.SaveGameNamespace.getSavegame[πŸ”—](#$app~App.SaveGameNamespace.getSavegame) + +``` +function App.SaveGameNamespace.getSavegame(): string +``` + +Returns the savegame namespace. + +**Returns** + +1. `string` + +### App.SaveGameNamespace.getSavemap[πŸ”—](#$app~App.SaveGameNamespace.getSavemap) + +``` +function App.SaveGameNamespace.getSavemap(): string +``` + +Returns the savemap namespace. + +**Returns** + +1. `string` + +### App.Debug[πŸ”—](#$app~App.Debug) + +``` +record App.Debug setForcedGamepadDynamicScrollRepeatSpeed: function(speed : integer) + pushGamepadButtonKeyInputEvent: function(gamepadButtonName : string, press : boolean) +end +``` + +### App.Debug.setForcedGamepadDynamicScrollRepeatSpeed[πŸ”—](#$app~App.Debug.setForcedGamepadDynamicScrollRepeatSpeed) + +``` +function App.Debug.setForcedGamepadDynamicScrollRepeatSpeed(speed : integer) +``` + +Overrides gamepad dynamic scroll repeat speed. + +**Parameters** + +* `speed` :`integer` β€” the scroll speed (0: 1/sec, 3: max speed), or nil to clear the override + +### App.Debug.pushGamepadButtonKeyInputEvent[πŸ”—](#$app~App.Debug.pushGamepadButtonKeyInputEvent) + +``` +function App.Debug.pushGamepadButtonKeyInputEvent(gamepadButtonName : string, press : boolean) +``` + +Pushes a gamepad button event into the input queue. + +**Parameters** + +* `gamepadButtonName` :`string` β€” the button to push +* `press` :`boolean` β€” if pressed + +### App.debug[πŸ”—](#$app~App.debug) + +``` +App.debug: Debug +``` diff --git a/docs/reference/script-doc/content_base_difficulty_util.md b/docs/reference/script-doc/content_base_difficulty_util.md new file mode 100644 index 0000000..d7be718 --- /dev/null +++ b/docs/reference/script-doc/content_base_difficulty_util.md @@ -0,0 +1,123 @@ + + +[index](../../index.html) / content / base / difficulty\_util + +--- + +# Module content.base.difficulty\_util[πŸ”—](#content.base.difficulty_util) + +``` +global record DifficultyUtil calculateDifficulty: function({string : integer}): GameDifficulty + getModParamPreset: function(GameDifficulty): {string : integer} + getLabel: function(GameDifficulty): string + getScale: function(string, integer): number + getAllValues: function(string): {number} +end +global enum GameDifficulty "Easy" + "Hard" + "Medium" + "VeryHard" +end +``` + +## Category: globals[πŸ”—](#category-globals) + +### DifficultyUtil[πŸ”—](#$content.base.difficulty_util~DifficultyUtil) + +``` +global record DifficultyUtil calculateDifficulty: function({string : integer}): GameDifficulty + getModParamPreset: function(GameDifficulty): {string : integer} + getLabel: function(GameDifficulty): string + getScale: function(string, integer): number + getAllValues: function(string): {number} +end +``` + +### DifficultyUtil.calculateDifficulty[πŸ”—](#$content.base.difficulty_util~DifficultyUtil.calculateDifficulty) + +``` +function DifficultyUtil.calculateDifficulty({string : integer}): GameDifficulty +``` + +**Parameters** + +* `{string : integer}` + +**Returns** + +1. `GameDifficulty` + +### DifficultyUtil.getModParamPreset[πŸ”—](#$content.base.difficulty_util~DifficultyUtil.getModParamPreset) + +``` +function DifficultyUtil.getModParamPreset(GameDifficulty): {string : integer} +``` + +**Parameters** + +* `GameDifficulty` + +**Returns** + +1. `{string : integer}` + +### DifficultyUtil.getLabel[πŸ”—](#$content.base.difficulty_util~DifficultyUtil.getLabel) + +``` +function DifficultyUtil.getLabel(GameDifficulty): string +``` + +**Parameters** + +* `GameDifficulty` + +**Returns** + +1. `string` + +### DifficultyUtil.getScale[πŸ”—](#$content.base.difficulty_util~DifficultyUtil.getScale) + +``` +function DifficultyUtil.getScale(string, integer): number +``` + +**Parameters** + +* `string` +* `integer` + +**Returns** + +1. `number` + +### DifficultyUtil.getAllValues[πŸ”—](#$content.base.difficulty_util~DifficultyUtil.getAllValues) + +``` +function DifficultyUtil.getAllValues(string): {number} +``` + +**Parameters** + +* `string` + +**Returns** + +1. `{number}` + +### GameDifficulty[πŸ”—](#$content.base.difficulty_util~GameDifficulty) + +``` +global enum GameDifficulty "Easy" + "Hard" + "Medium" + "VeryHard" +end +``` + +### GameDifficulty."Easy"[πŸ”—](#$content.base.difficulty_util~GameDifficulty.) + +### GameDifficulty."Hard"[πŸ”—](#$content.base.difficulty_util~GameDifficulty.) + +### GameDifficulty."Medium"[πŸ”—](#$content.base.difficulty_util~GameDifficulty.) + +### GameDifficulty."VeryHard"[πŸ”—](#$content.base.difficulty_util~GameDifficulty.) diff --git a/docs/reference/script-doc/content_base_model_metadata_util.md b/docs/reference/script-doc/content_base_model_metadata_util.md new file mode 100644 index 0000000..d41be00 --- /dev/null +++ b/docs/reference/script-doc/content_base_model_metadata_util.md @@ -0,0 +1,427 @@ + + +[index](../../index.html) / content / base / model\_metadata\_util + +--- + +# Module content.base.model\_metadata\_util[πŸ”—](#content.base.model_metadata_util) + +``` +global record ModelMetadataUtil convertEmissionData: function(string, { : }): { : } + addEmissionMetadata: function(string, { : }): { : } + addCostMetadata: function(string, { : }): { : } + addTransportVehicleTransportModes: function(string, { : }): { : } + addFilterTags: function(string, { : }): { : } + newLoadSpeedsAndMaintenanceFactor: function(string, { : }): { : } + turnRoadAndRailToLandVehicle: function(string, { : }): { : } + addVehicleExtent: function(string, { : }): { : } + addTransformatorConfig: function(string, { : }): { : } + toCompartmentList: function(string, { : }): { : } + replaceMeshIdWithNodeName: function(string, { : }): { : } + squeezeConfigsToOneConfigForVehicles: function(string, { : }): { : } + sortLods: function(string, { : }): { : } + addTextureLods: function(string, { : }): { : } + addTreeReputationFactor: function(string, { : }): { : } + makeLoadIndicators: function(string, { : }): { : } + makeLoadIndicatorFormats: function(string, { : }): { : } + makeCargoEntry: function(string, { : }): { : } + makeCargoTypeSet: function(string, { : }): { : } + convertCargoType: function(string, string): string + convertCargoTypeSet: function({ : }, string): { : } + convertCargoTypes: function(string, { : }): { : } + addIconMetadata: function(string, { : }): { : } + convertParticleSystem: function(string, { : }): { : } +end +``` + +## Category: globals[πŸ”—](#category-globals) + +### ModelMetadataUtil[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil) + +``` +global record ModelMetadataUtil convertEmissionData: function(string, { : }): { : } + addEmissionMetadata: function(string, { : }): { : } + addCostMetadata: function(string, { : }): { : } + addTransportVehicleTransportModes: function(string, { : }): { : } + addFilterTags: function(string, { : }): { : } + newLoadSpeedsAndMaintenanceFactor: function(string, { : }): { : } + turnRoadAndRailToLandVehicle: function(string, { : }): { : } + addVehicleExtent: function(string, { : }): { : } + addTransformatorConfig: function(string, { : }): { : } + toCompartmentList: function(string, { : }): { : } + replaceMeshIdWithNodeName: function(string, { : }): { : } + squeezeConfigsToOneConfigForVehicles: function(string, { : }): { : } + sortLods: function(string, { : }): { : } + addTextureLods: function(string, { : }): { : } + addTreeReputationFactor: function(string, { : }): { : } + makeLoadIndicators: function(string, { : }): { : } + makeLoadIndicatorFormats: function(string, { : }): { : } + makeCargoEntry: function(string, { : }): { : } + makeCargoTypeSet: function(string, { : }): { : } + convertCargoType: function(string, string): string + convertCargoTypeSet: function({ : }, string): { : } + convertCargoTypes: function(string, { : }): { : } + addIconMetadata: function(string, { : }): { : } + convertParticleSystem: function(string, { : }): { : } +end +``` + +### ModelMetadataUtil.convertEmissionData[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.convertEmissionData) + +``` +function ModelMetadataUtil.convertEmissionData(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.addEmissionMetadata[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.addEmissionMetadata) + +``` +function ModelMetadataUtil.addEmissionMetadata(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.addCostMetadata[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.addCostMetadata) + +``` +function ModelMetadataUtil.addCostMetadata(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.addTransportVehicleTransportModes[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.addTransportVehicleTransportModes) + +``` +function ModelMetadataUtil.addTransportVehicleTransportModes(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.addFilterTags[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.addFilterTags) + +``` +function ModelMetadataUtil.addFilterTags(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.newLoadSpeedsAndMaintenanceFactor[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.newLoadSpeedsAndMaintenanceFactor) + +``` +function ModelMetadataUtil.newLoadSpeedsAndMaintenanceFactor(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.turnRoadAndRailToLandVehicle[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.turnRoadAndRailToLandVehicle) + +``` +function ModelMetadataUtil.turnRoadAndRailToLandVehicle(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.addVehicleExtent[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.addVehicleExtent) + +``` +function ModelMetadataUtil.addVehicleExtent(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.addTransformatorConfig[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.addTransformatorConfig) + +``` +function ModelMetadataUtil.addTransformatorConfig(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.toCompartmentList[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.toCompartmentList) + +``` +function ModelMetadataUtil.toCompartmentList(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.replaceMeshIdWithNodeName[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.replaceMeshIdWithNodeName) + +``` +function ModelMetadataUtil.replaceMeshIdWithNodeName(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.squeezeConfigsToOneConfigForVehicles[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.squeezeConfigsToOneConfigForVehicles) + +``` +function ModelMetadataUtil.squeezeConfigsToOneConfigForVehicles(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.sortLods[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.sortLods) + +``` +function ModelMetadataUtil.sortLods(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.addTextureLods[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.addTextureLods) + +``` +function ModelMetadataUtil.addTextureLods(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.addTreeReputationFactor[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.addTreeReputationFactor) + +``` +function ModelMetadataUtil.addTreeReputationFactor(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.makeLoadIndicators[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.makeLoadIndicators) + +``` +function ModelMetadataUtil.makeLoadIndicators(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.makeLoadIndicatorFormats[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.makeLoadIndicatorFormats) + +``` +function ModelMetadataUtil.makeLoadIndicatorFormats(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.makeCargoEntry[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.makeCargoEntry) + +``` +function ModelMetadataUtil.makeCargoEntry(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.makeCargoTypeSet[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.makeCargoTypeSet) + +``` +function ModelMetadataUtil.makeCargoTypeSet(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.convertCargoType[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.convertCargoType) + +``` +function ModelMetadataUtil.convertCargoType(string, string): string +``` + +**Parameters** + +* `string` +* `string` + +**Returns** + +1. `string` + +### ModelMetadataUtil.convertCargoTypeSet[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.convertCargoTypeSet) + +``` +function ModelMetadataUtil.convertCargoTypeSet({ : }, string): { : } +``` + +**Parameters** + +* `{ : }` +* `string` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.convertCargoTypes[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.convertCargoTypes) + +``` +function ModelMetadataUtil.convertCargoTypes(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.addIconMetadata[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.addIconMetadata) + +``` +function ModelMetadataUtil.addIconMetadata(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` + +### ModelMetadataUtil.convertParticleSystem[πŸ”—](#$content.base.model_metadata_util~ModelMetadataUtil.convertParticleSystem) + +``` +function ModelMetadataUtil.convertParticleSystem(string, { : }): { : } +``` + +**Parameters** + +* `string` +* `{ : }` + +**Returns** + +1. `{ : }` diff --git a/docs/reference/script-doc/content_base_post_run_util.md b/docs/reference/script-doc/content_base_post_run_util.md new file mode 100644 index 0000000..df0a310 --- /dev/null +++ b/docs/reference/script-doc/content_base_post_run_util.md @@ -0,0 +1,41 @@ + + +[index](../../index.html) / content / base / post\_run\_util + +--- + +# Module content.base.post\_run\_util[πŸ”—](#content.base.post_run_util) + +``` +global record PostRunUtil applyCostScale: function() + updateDesc: function(ModelMetadata.Description, number, number) +end +``` + +## Category: globals[πŸ”—](#category-globals) + +### PostRunUtil[πŸ”—](#$content.base.post_run_util~PostRunUtil) + +``` +global record PostRunUtil applyCostScale: function() + updateDesc: function(ModelMetadata.Description, number, number) +end +``` + +### PostRunUtil.applyCostScale[πŸ”—](#$content.base.post_run_util~PostRunUtil.applyCostScale) + +``` +function PostRunUtil.applyCostScale() +``` + +### PostRunUtil.updateDesc[πŸ”—](#$content.base.post_run_util~PostRunUtil.updateDesc) + +``` +function PostRunUtil.updateDesc(ModelMetadata.Description, number, number) +``` + +**Parameters** + +* `ModelMetadata.Description` +* `number` +* `number` diff --git a/docs/reference/script-doc/content_gui_main_mod_entry_point.md b/docs/reference/script-doc/content_gui_main_mod_entry_point.md new file mode 100644 index 0000000..5609d8b --- /dev/null +++ b/docs/reference/script-doc/content_gui_main_mod_entry_point.md @@ -0,0 +1,27 @@ + + +[index](../../../index.html) / content / gui / main / mod\_entry\_point + +--- + +# Module content.gui.main.mod\_entry\_point[πŸ”—](#content.gui.main.mod_entry_point) + +``` +global record ModEntryPoint ModEntryPointExtension: ExtensionPoint0 +end +``` + +## Category: globals[πŸ”—](#category-globals) + +### ModEntryPoint[πŸ”—](#$content.gui.main.mod_entry_point~ModEntryPoint) + +``` +global record ModEntryPoint ModEntryPointExtension: ExtensionPoint0 +end +``` + +### ModEntryPoint.ModEntryPointExtension[πŸ”—](#$content.gui.main.mod_entry_point~ModEntryPoint.ModEntryPointExtension) + +``` +ModEntryPoint.ModEntryPointExtension: ExtensionPoint0 +``` diff --git a/docs/reference/script-doc/content_gui_main_script_param_util.md b/docs/reference/script-doc/content_gui_main_script_param_util.md new file mode 100644 index 0000000..46a85c2 --- /dev/null +++ b/docs/reference/script-doc/content_gui_main_script_param_util.md @@ -0,0 +1,505 @@ + + +[index](../../../index.html) / content / gui / main / script\_param\_util + +--- + +# Module content.gui.main.script\_param\_util[πŸ”—](#content.gui.main.script_param_util) + +``` +[Expand All] [Collapse All] + +global record ScriptParamUtil record ParamForUi enum IconStyle "Colored" + "Default" +end + uiType: ScriptParamType + iconStyle: IconStyle + name: string + values: {string} + numbers: {number} + tooltips: {string} + defaultIndex: integer + hideLabel: boolean + allowCoalesce: boolean + makeCompactButtonFn: function(number): TreeNodeId + formatValueFn: function(number): string + stepValueFn: function(number, integer, boolean): number +end + record CompSimpleParam scriptParam: ParamForUi + currentValue: number + onValueChange: function(number) + toggleButtonsFlowLayout: boolean + vertical: boolean + compact: boolean + addSpacer: boolean + disableGamepadNavigation: boolean + onHover: function(boolean) + gameCtx: GameContext + updateCurrentValue: boolean +end + buildScriptParamCompSimple: function(CompSimpleParam): TreeNodeId + buildScriptParamComp: function(ScriptParam, integer, function(integer), boolean, boolean, function(boolean), boolean): TreeNodeId + searchAndBuildScriptParamComp: function(string, function(string) : number, function(string, number), boolean, function(boolean), {string}, boolean): MenuIconReactUtil.HintWidgetParam.Data, TreeNodeId + wrap: function(string, boolean, TreeNodeId, boolean, function(boolean), string): TreeNodeId + getScriptParam: function(string, {string}): ScriptParam + clampScriptParamToDiscreteValue: function(number, ScriptParam): number + clampScriptParamValueIndex: function(number, ScriptParam): integer + getScriptParamDefaultValue: function({number}, integer): number + getScriptParamDefaultValueIndex: function({number}, integer): integer + getScriptParamLabel: function(string, number, {string}): string + getScriptParamLabelUnfiltered: function(string, number): string +end +``` + +## Category: globals[πŸ”—](#category-globals) + +### ScriptParamUtil[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil) + +``` +[Expand All] [Collapse All] + +global record ScriptParamUtil record ParamForUi enum IconStyle "Colored" + "Default" +end + uiType: ScriptParamType + iconStyle: IconStyle + name: string + values: {string} + numbers: {number} + tooltips: {string} + defaultIndex: integer + hideLabel: boolean + allowCoalesce: boolean + makeCompactButtonFn: function(number): TreeNodeId + formatValueFn: function(number): string + stepValueFn: function(number, integer, boolean): number +end + record CompSimpleParam scriptParam: ParamForUi + currentValue: number + onValueChange: function(number) + toggleButtonsFlowLayout: boolean + vertical: boolean + compact: boolean + addSpacer: boolean + disableGamepadNavigation: boolean + onHover: function(boolean) + gameCtx: GameContext + updateCurrentValue: boolean +end + buildScriptParamCompSimple: function(CompSimpleParam): TreeNodeId + buildScriptParamComp: function(ScriptParam, integer, function(integer), boolean, boolean, function(boolean), boolean): TreeNodeId + searchAndBuildScriptParamComp: function(string, function(string) : number, function(string, number), boolean, function(boolean), {string}, boolean): MenuIconReactUtil.HintWidgetParam.Data, TreeNodeId + wrap: function(string, boolean, TreeNodeId, boolean, function(boolean), string): TreeNodeId + getScriptParam: function(string, {string}): ScriptParam + clampScriptParamToDiscreteValue: function(number, ScriptParam): number + clampScriptParamValueIndex: function(number, ScriptParam): integer + getScriptParamDefaultValue: function({number}, integer): number + getScriptParamDefaultValueIndex: function({number}, integer): integer + getScriptParamLabel: function(string, number, {string}): string + getScriptParamLabelUnfiltered: function(string, number): string +end +``` + +### ScriptParamUtil.ParamForUi[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi) + +``` +[Expand All] [Collapse All] + +record ScriptParamUtil.ParamForUi enum IconStyle "Colored" + "Default" +end + uiType: ScriptParamType + iconStyle: IconStyle + name: string + values: {string} + numbers: {number} + tooltips: {string} + defaultIndex: integer + hideLabel: boolean + allowCoalesce: boolean + makeCompactButtonFn: function(number): TreeNodeId + formatValueFn: function(number): string + stepValueFn: function(number, integer, boolean): number +end +``` + +### ScriptParamUtil.ParamForUi.IconStyle[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.IconStyle) + +``` +enum ScriptParamUtil.ParamForUi.IconStyle "Colored" + "Default" +end +``` + +### ScriptParamUtil.ParamForUi.IconStyle."Colored"[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.IconStyle.) + +### ScriptParamUtil.ParamForUi.IconStyle."Default"[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.IconStyle.) + +### ScriptParamUtil.ParamForUi.uiType[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.uiType) + +``` +ScriptParamUtil.ParamForUi.uiType: ScriptParamType +``` + +### ScriptParamUtil.ParamForUi.iconStyle[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.iconStyle) + +``` +ScriptParamUtil.ParamForUi.iconStyle: IconStyle +``` + +### ScriptParamUtil.ParamForUi.name[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.name) + +``` +ScriptParamUtil.ParamForUi.name: string +``` + +### ScriptParamUtil.ParamForUi.values[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.values) + +``` +ScriptParamUtil.ParamForUi.values: {string} +``` + +### ScriptParamUtil.ParamForUi.numbers[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.numbers) + +``` +ScriptParamUtil.ParamForUi.numbers: {number} +``` + +### ScriptParamUtil.ParamForUi.tooltips[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.tooltips) + +``` +ScriptParamUtil.ParamForUi.tooltips: {string} +``` + +### ScriptParamUtil.ParamForUi.defaultIndex[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.defaultIndex) + +``` +ScriptParamUtil.ParamForUi.defaultIndex: integer +``` + +### ScriptParamUtil.ParamForUi.hideLabel[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.hideLabel) + +``` +ScriptParamUtil.ParamForUi.hideLabel: boolean +``` + +### ScriptParamUtil.ParamForUi.allowCoalesce[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.allowCoalesce) + +``` +ScriptParamUtil.ParamForUi.allowCoalesce: boolean +``` + +### ScriptParamUtil.ParamForUi.makeCompactButtonFn[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.makeCompactButtonFn) + +``` +function ScriptParamUtil.ParamForUi.makeCompactButtonFn(number): TreeNodeId +``` + +**Parameters** + +* `number` + +**Returns** + +1. `TreeNodeId` + +### ScriptParamUtil.ParamForUi.formatValueFn[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.formatValueFn) + +``` +function ScriptParamUtil.ParamForUi.formatValueFn(number): string +``` + +**Parameters** + +* `number` + +**Returns** + +1. `string` + +### ScriptParamUtil.ParamForUi.stepValueFn[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.ParamForUi.stepValueFn) + +``` +function ScriptParamUtil.ParamForUi.stepValueFn(number, integer, boolean): number +``` + +**Parameters** + +* `number` +* `integer` +* `boolean` + +**Returns** + +1. `number` + +### ScriptParamUtil.CompSimpleParam[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam) + +``` +record ScriptParamUtil.CompSimpleParam scriptParam: ParamForUi + currentValue: number + onValueChange: function(number) + toggleButtonsFlowLayout: boolean + vertical: boolean + compact: boolean + addSpacer: boolean + disableGamepadNavigation: boolean + onHover: function(boolean) + gameCtx: GameContext + updateCurrentValue: boolean +end +``` + +### ScriptParamUtil.CompSimpleParam.scriptParam[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.scriptParam) + +``` +ScriptParamUtil.CompSimpleParam.scriptParam: ParamForUi +``` + +### ScriptParamUtil.CompSimpleParam.currentValue[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.currentValue) + +``` +ScriptParamUtil.CompSimpleParam.currentValue: number +``` + +### ScriptParamUtil.CompSimpleParam.onValueChange[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.onValueChange) + +``` +function ScriptParamUtil.CompSimpleParam.onValueChange(number) +``` + +**Parameters** + +* `number` + +### ScriptParamUtil.CompSimpleParam.toggleButtonsFlowLayout[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.toggleButtonsFlowLayout) + +``` +ScriptParamUtil.CompSimpleParam.toggleButtonsFlowLayout: boolean +``` + +### ScriptParamUtil.CompSimpleParam.vertical[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.vertical) + +``` +ScriptParamUtil.CompSimpleParam.vertical: boolean +``` + +### ScriptParamUtil.CompSimpleParam.compact[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.compact) + +``` +ScriptParamUtil.CompSimpleParam.compact: boolean +``` + +### ScriptParamUtil.CompSimpleParam.addSpacer[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.addSpacer) + +``` +ScriptParamUtil.CompSimpleParam.addSpacer: boolean +``` + +### ScriptParamUtil.CompSimpleParam.disableGamepadNavigation[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.disableGamepadNavigation) + +``` +ScriptParamUtil.CompSimpleParam.disableGamepadNavigation: boolean +``` + +### ScriptParamUtil.CompSimpleParam.onHover[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.onHover) + +``` +function ScriptParamUtil.CompSimpleParam.onHover(boolean) +``` + +**Parameters** + +* `boolean` + +### ScriptParamUtil.CompSimpleParam.gameCtx[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.gameCtx) + +``` +ScriptParamUtil.CompSimpleParam.gameCtx: GameContext +``` + +### ScriptParamUtil.CompSimpleParam.updateCurrentValue[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.CompSimpleParam.updateCurrentValue) + +``` +ScriptParamUtil.CompSimpleParam.updateCurrentValue: boolean +``` + +### ScriptParamUtil.buildScriptParamCompSimple[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.buildScriptParamCompSimple) + +``` +function ScriptParamUtil.buildScriptParamCompSimple(CompSimpleParam): TreeNodeId +``` + +**Parameters** + +* `CompSimpleParam` + +**Returns** + +1. `TreeNodeId` + +### ScriptParamUtil.buildScriptParamComp[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.buildScriptParamComp) + +``` +function ScriptParamUtil.buildScriptParamComp(ScriptParam, integer, function(integer), boolean, boolean, function(boolean), boolean): TreeNodeId +``` + +**Parameters** + +* `ScriptParam` +* `integer` +* `function(integer)` +* `boolean` +* `boolean` +* `function(boolean)` +* `boolean` + +**Returns** + +1. `TreeNodeId` + +### ScriptParamUtil.searchAndBuildScriptParamComp[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.searchAndBuildScriptParamComp) + +``` +function ScriptParamUtil.searchAndBuildScriptParamComp(string, function(string) : number, function(string, number), boolean, function(boolean), {string}, boolean): MenuIconReactUtil.HintWidgetParam.Data, TreeNodeId +``` + +**Parameters** + +* `string` +* `function(string): number` +* `function(string, number)` +* `boolean` +* `function(boolean)` +* `{string}` +* `boolean` + +**Returns** + +1. `MenuIconReactUtil.HintWidgetParam.Data` +2. `TreeNodeId` + +### ScriptParamUtil.wrap[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.wrap) + +``` +function ScriptParamUtil.wrap(string, boolean, TreeNodeId, boolean, function(boolean), string): TreeNodeId +``` + +**Parameters** + +* `string` +* `boolean` +* `TreeNodeId` +* `boolean` +* `function(boolean)` +* `string` + +**Returns** + +1. `TreeNodeId` + +### ScriptParamUtil.getScriptParam[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.getScriptParam) + +``` +function ScriptParamUtil.getScriptParam(string, {string}): ScriptParam +``` + +**Parameters** + +* `string` +* `{string}` + +**Returns** + +1. `ScriptParam` + +### ScriptParamUtil.clampScriptParamToDiscreteValue[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.clampScriptParamToDiscreteValue) + +``` +function ScriptParamUtil.clampScriptParamToDiscreteValue(number, ScriptParam): number +``` + +**Parameters** + +* `number` +* `ScriptParam` + +**Returns** + +1. `number` + +### ScriptParamUtil.clampScriptParamValueIndex[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.clampScriptParamValueIndex) + +``` +function ScriptParamUtil.clampScriptParamValueIndex(number, ScriptParam): integer +``` + +**Parameters** + +* `number` +* `ScriptParam` + +**Returns** + +1. `integer` + +### ScriptParamUtil.getScriptParamDefaultValue[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.getScriptParamDefaultValue) + +``` +function ScriptParamUtil.getScriptParamDefaultValue({number}, integer): number +``` + +**Parameters** + +* `{number}` +* `integer` + +**Returns** + +1. `number` + +### ScriptParamUtil.getScriptParamDefaultValueIndex[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.getScriptParamDefaultValueIndex) + +``` +function ScriptParamUtil.getScriptParamDefaultValueIndex({number}, integer): integer +``` + +**Parameters** + +* `{number}` +* `integer` + +**Returns** + +1. `integer` + +### ScriptParamUtil.getScriptParamLabel[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.getScriptParamLabel) + +``` +function ScriptParamUtil.getScriptParamLabel(string, number, {string}): string +``` + +**Parameters** + +* `string` +* `number` +* `{string}` + +**Returns** + +1. `string` + +### ScriptParamUtil.getScriptParamLabelUnfiltered[πŸ”—](#$content.gui.main.script_param_util~ScriptParamUtil.getScriptParamLabelUnfiltered) + +``` +function ScriptParamUtil.getScriptParamLabelUnfiltered(string, number): string +``` + +**Parameters** + +* `string` +* `number` + +**Returns** + +1. `string` diff --git a/docs/reference/wiki/modding_general_bestpractice.md b/docs/reference/wiki/modding_general_bestpractice.md new file mode 100644 index 0000000..2f877f1 --- /dev/null +++ b/docs/reference/wiki/modding_general_bestpractice.md @@ -0,0 +1,172 @@ + + +### Table of Contents + +* [Common pitfalls](#common_pitfalls) + + + [Draw Calls and Lods](#draw_calls_and_lods) + + [Polycount and Lods](#polycount_and_lods) + + [Icons](#icons) +* [Best practices](#best_practices) + + + [Content Creation](#content_creation) + + - [Materials, Textures & UVs](#materials_textures_uvs) + - [Modeling](#modeling) + + [Model Editor](#model_editor) + + - [Lights](#lights) +* [Some Final Tips](#some_final_tips) + +# Common Pitfalls and Best Practices + +An overview of good workflows to prevent bad performance, cleanup work and errors later on. Its intended to increase understanding of some technical topics related to content creation. + +## Common pitfalls + +Some concepts of game engines can be difficult to grasp if you're not working directly in the games industry. To give some insight on what's happening behind the scenes and why its important, this section will list some of the bottlenecks of modern rendering, as well as specifics to Transport Fever 3. + +### Draw Calls and Lods + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=51c33d&media=modding:general:drawcalls.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:drawcalls.png "modding:general:drawcalls.png")**Draw Calls are a major source of performance impact in TF3.** When working on a model, you can see your materials and meshes as unique instructions getting sent by the CPU to the GPU. **Unique combinations of materials and meshes** adds to the total number of instructions that are needed to render the full model. The amount of draw calls displayed for a model is roughly(!) the sum of these instructions. **The more individual meshes and materials, the higher the draw call number**. Some rules of thumb: + +* New meshes start new draw calls, new materials as well +* Using **Mesh Instances that have the same material doesn't create new draw calls** for the instances +* Skinned meshes always generate new draw calls, even on instances ( = same mesh/material) . +* Sorted Materials also always generate new draw calls per instance +* Vehicle materials should be split into an exterior and interior material. This makes the later lods as optimized as possible, since interior can just be deleted and the exterior can still use the full texture. Same for small detail meshes with additional textures that can be disabled in later lods. +* A higher amount of draw calls for lod0 is generally reasonable, but should serve a purpose. For example glass windows can be split into separate local groups to improve sorting. Generally splitting every object is not recommended, since it increases draw calls quite fast. + +--- + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=7ad7ad&media=modding:general:draw_calls_lod0.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:draw_calls_lod0.png "modding:general:draw_calls_lod0.png") In terms of re-usability and Texel Size, sometimes there are not really good alternatives to using separate materials; at least for lod0. This in general is fine and common standard in Transport Fever 3 as well as other current-gen games. The focus is more on **reducing the number of draw calls for later lods** by merging objects, **removing small detail materials like glasses** and also **combining textures onto a single texture set** (explained down below), saving the need for separate materials in the process. + +* For most gameplay scenarios, total number of Draw Calls is probably bottlenecking earlier than the total polycount. +* Thus its required to reduce not only the polycount per lod but also the amount of Draw Calls. +* This can be achieved by removing small detail materials and merging meshes, especially individual glasses from lod1 onwards +* For lod0 in general its fine to have a higher number of draw calls as long as it can reasonably be explained and it switches to an optimized lod1 at distance 50-100. +* Its smart to plan your materials a bit beforehand in terms of Draw Calls, to have an easier time optimizing them later down the road. + +--- + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=06bfe5&media=modding:general:draw_calls_last_lod.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:draw_calls_last_lod.png "modding:general:draw_calls_last_lod.png") As mentioned (generally speaking) a higher number of Draw Calls in lod0 is not the biggest issue, it becomes more of a problem if later lods still retain a high number of Draw Calls and cannot fallback to a low single digit number. The more we zoom out, the more they add up. Especially for the last lod, just a single draw call is the optimal target. + +For vehicles its often easy to just keep the chassis/shell of the vehicle as the last remaining mesh and material, but it can be a bit of a challenge for buildings. They often use separate trim sheets or tileable textures for ceiling, walls and ground and still have a noticable color contrast from a far distance that cannot be discarded easily without some really visible plopping between lod levels. + +That's where the process of [Material Baking](https://wiki.transportfever3.com/doku.php?id=modding:tools:external:blender#material_baking "modding:tools:external:blender") can come in handy. + +### Polycount and Lods + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=cdadd0&media=modding:general:polycount_lods.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:polycount_lods.png "modding:general:polycount_lods.png")Polycount is measured as the total number of triangles that make up a mesh. A reasonable polycount in lod0 is strongly recommended to keep the game running smoothly even with dozens of the same vehicle spawned. Even more important than the lod0 polycount is proper fallback in later lods. When the camera zooms out, **the camera will need to render more objects, thus each individual object needs to have fewer triangles; proportionally to its size on the screen**. + +* lod0 polycount should be in the range defined in the guidelines +* each lod should be a meaningful reduction to its predecessor. Internally, we aim for 1/4th reduction +* **The last lod needs to be as simple as possible** and can be aggressively reduced. Getting down to 1000 triangles is realistic for most models +* Automatic polygon reduction can help, but some options provide better results than others. For most models, un-subdividing models should be preferred over random polyreduce. +* Generally, **two lods in addition to the base lod should be sufficient** for most models. **More lods dont necessarily improve performance.** +* For a model, every lod always resides in the RAM. More lods mean more RAM usage. Its good practice to prevent redundant lods. +* If you feel like you cannot reduce the draw calls anymore for the last lod due to plopping, you could try increasing the distance if this enables you to go lower. This is generally the better tradeoff since the draw call count on the last lod quickly adds up. +* Also, getting rid of the transparent materials from lod1 onwards has performance advantages since they are more expensive to render compared to opaque + +### Icons + +Icons can be generated using the model editor. Its important to have all relevant icons shipped with the mod to support all of the menu items, including cblend masks. + +We strongly encourage using cblend for some models in your mod since most players like tinting their vehicles. + +## Best practices + +### Content Creation + +#### Materials, Textures & UVs + +##### Trim sheets for multiple different materials on a single texture + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=ebc429&media=modding:general:trim_sheets.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:trim_sheets.png "modding:general:trim_sheets.png")Trim sheets are basically strips of different materials packed onto a single texture. In most cases they are tileable horizontally and stacked vertically. + +This way you can get a lot out of a single material/texture by overlapping the uvs in the areas where you need them. And the final model will only have a single draw call. + +**Different materials still make sense if you need different shaders like Physical or Transparent.** + +##### Tileable textures for layouting of complex patterns (and optimizing texel density) + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=d6ec4a&media=modding:general:tileable_textures.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:tileable_textures.png "modding:general:tileable_textures.png")Similarly, single tileable textures can be salvaged in the same way to create complex patterns from differently layouted uvs onto the same texture. This way you won't run into texel density issues, no matter how many variations you need. As you can see, different patterns can even be aligned along each other. + +**Keep in mind you will get baking issues if you intend to bake additional maps like AO since the UVs overlap.** + +#### Modeling + +##### Spirals / Tubes / Pipes + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=384d8f&media=modding:general:polycount_spirals.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:polycount_spirals.png "modding:general:polycount_spirals.png")Pipes, Tubes and spiraling wires are common elements of vehicles. They tend to increase the polycount quite a bit and should be used with caution. Especially when being constructed procedurally by spiral objects or spline curves in your content creation tool, they can have more polygons than necessary. Often a way lower polycount is enough while still looking good from a reasonable distance. Keep in mind even LOD0 should be game-ready, which means small wires don't need to have so much resolution that they still look smooth when zoomed in full-screen. Most of the time they will be seen from a humanly reasonable distance and that's the distance where the resolution should suffice. + +**Especially the number of segments for the curve profile (the "base circle" of such spirals) increase the polycount quite a bit since it scales wih the length of the whole curve. Often, shading these curve smoothly is a better tradeoff compared to more polygons for the curve profile.** + +##### Bevels and Smooth Shading + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=f9f244&media=modding:general:polycount_bevels.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:polycount_bevels.png "modding:general:polycount_bevels.png")In reality, perfectly sharp edges are almost non-existent and smoothing edges a bit can be an important tool to convey a realistic feeling of surfaces. Especially for modern technical objects like vehicles, they are quite common. Unfortunately, if we just subdivide surfaces for perfect smoothness, this blows up the polycount quite fast. Luckily, there are some tricks to prevent this. + +**Smooth shaded edges can convincingly make surfaces look more detailed than they actually are.** In many cases, a rounded edge with only two subdividion loops will provide the same visual quality as a comparably much more subdivided edge. + +**It's best practice to start with lower subdivisions** and keep track of the polycount, since it can increase very fast with just a couple more subdivisions, depending on the complexity of the model. Even for this simple cube, you can see how fast the polycount increased, with just a tiny bit more accentuated smoothing gained from it. + +**If you still want to sharpen the edge a bit more, you can use Blenders Bevel Node and bake a normal map without having to increase the polycount further.** + +##### Glass Sorting + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=8e43be&media=modding:general:glass_sorting.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:glass_sorting.png "modding:general:glass_sorting.png")Correctly sorting overlapping transparencies can be a challenge even for modern game engines. In general, **transparencies are not sorted per pixel like conventional opaque geometry, but per object.** And triangles inside a single geometry are sorted by their index, if no other factor (for example a setting in the submaterial) sorts them differently. **This will become a problem if we can see one transparent objects from different sides and transparent surfaces overlap each other in different ways.** Then it will look like some parts are drawn above others, even if spacially the overlap differently. + +Knowing this, we can help the game engine sort our transparencies correctly by **providing additional pivot points for sorting**. This can simply be done by splitting one object into separate ones and centering the pivot. The game engine will then calculate the distance from these objects to the camera based on the current view and sort our objects accordingly. **This way, it will look correct from all angles.** + +**Keep in mind: Splitting objects creates additional Draw Calls!** It's often not necessary to split every single glass, but rather keep all those glass triangles in a single object that can't overlap each other anyway. + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=282c37&media=modding:general:glass_vehicles.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:glass_vehicles.png "modding:general:glass_vehicles.png")A good rule of thumb would be for vehicles: left windows, right windows, front windows, back windows. + +There are some setups that can break this approach, like doors which are movable/animated as well as overlapping glass windows due to the design of a vehicle. For example some trains have a pretty curved front where multiple parts of the cabin can intersect perspectively. In this case, it should be split into multiple objects that are coplanar to each other, meaning they form a single flat plane. + +**β†’ roughly 9 Draw Calls in total for all the glass on the vehicle.** + +##### Map Baking and UV Transfer + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=23ea35&media=modding:general:uv_projection_baking.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:uv_projection_baking.png "modding:general:uv_projection_baking.png")Sometimes you'll want to repeat patterns along a surface and triplanar projection or regular uvs are not an option. In these cases you can use additional uv sets to layout your texture and project the result back to your regular UVs. It's very easy to do in Substance Painter: + +1. Create your additional UV in your content creation software +2. Set the projection method in SP to "UV set to UV set projection". +3. Select the uv you want to project from. It can be anything except uv0. +4. This way you can also use multiple different UV sets for different parts of your model, or even different material layers on the same polygons. + +### Model Editor + +#### Lights + +Rendering lights tends to be among the more costy processes of rendering in games. Both the light count and the light range are the two parameters that can drastically impact light performance. To keep performance impact of an asset low, there shouldn't be too many individual light sources per asset, and overall lights shouldn't be too large. + +##### Vehicles + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=2563b2&media=modding:general:light_sources_vehicles.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:light_sources_vehicles.png "modding:general:light_sources_vehicles.png")Vehicles tend to have quite a lot of lights that increase their bounding box quite a bit. A larger bounding box means the vehicle will be rendered longer, even if its already out of screen. + +Some good rules of thumb for vehicles (especially trains): + +* the max light range should be no larger than 2x the length of a regular train, which is around 32 units +* Longer trains don't necessarily need longer-ranged lights +* Lights should be parented to their visual light-emitting objects so they are properly disabled via animations +* Often a reason for longer ranged lights is to increase brightness or get a smoother falloff. Try to experiment with the light strength, it should still give good results sticking to these guidelines. +* Tilting the cone a bit more to the floor or sky can influence brightness and falloff in positive way +* Lights should be disabled at some distance for lower lods. + +##### Buildings + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=500&tok=b405eb&media=modding:general:light_sources_buildings.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Abestpractice&media=modding:general:light_sources_buildings.png "modding:general:light_sources_buildings.png")Buildings can be more difficult to light compared to vehicles since its a very individual process. The guideline constraints remain the same though: try to minimize light count and range. It can get quite cumbersome to represent every light-emitting object in your building with its own light source. Approximations might make the setup cleaner, better performing and provide the same visual fidelity. + +* The game has many different light types, use the shapes appropriate for your case +* Try to find a good balance between enough lights for contrast/atmosphere and not too many that make the setup noisy and performance-heavy +* Mode:ABSORBER lights can be used to darken areas and enhance contrast / atmosphere +* If you just need surfaces to be brighter and don't need to illuminate other objects, you can also use emissive materials with a mask + +## Some Final Tips + +* Actively use the draw call / polycount stats panel in the Model Editor +* Test cBlend where applicable, generate all icons and check ingame +* Use the validator actively in the process +* Base Level of Weathering is highly encouraged to fit with other ingame assets +* Files and node names should use lower case letters diff --git a/docs/reference/wiki/modding_general_guidelines.md b/docs/reference/wiki/modding_general_guidelines.md new file mode 100644 index 0000000..cc0fb96 --- /dev/null +++ b/docs/reference/wiki/modding_general_guidelines.md @@ -0,0 +1,212 @@ + + +### Table of Contents + +* [Content Guidelines](#content_guidelines) +* [Technical Requirements](#technical_requirements) +* [Mod Metadata](#mod_metadata) + + + [Template](#template) + +# Guidelines & Requirements + +This page outlines the guidelines and technical requirements for mods. The primary goals are a consistent user experience as well as stability, performance and compatibility. + +## Content Guidelines + +These guidelines aim to provide a consistent and familiar experience for players worldwide, ensuring that mods feel like an official part of the game. + +**Basic Principles** + +* Mod content should integrate in a seamless way, feeling like a natural extension of the original game. +* This includes adhering to technical requirements as well as respecting the game's visual style. +* Content should be available in English (with optional localizations) to appeal to a global audience. +* In general, follow the original game content as a reference for design and implementation. +* That said, if your goal is to introduce something entirely new or experimental, that is of course also possible! + +**Visual Style** + +* Ensure that the proportions are correct, with specific details potentially slightly exaggerated. As a rule of thumb, imagine a scale model world rather than the real world. +* The elements that define the silhouette are particularly important and should be modeled, while minor details can be left on normal maps. +* Make use of the full range of materials (metal, plastic, paint, wood, stone etc.) offered by the PBR metallic approach. Be generous with details and avoid repetitions to achieve authentic and believable surfaces. +* Always add some signs of weathering (light dirt, edge damage, diesel traces etc.) to avoid an unnaturally clean look. Cargo vehicles and industrial items should be more weathered than their passenger counterparts. + +**Modeling/Texturing** + +* Geometry + + + Find a good compromise for highly detailed elements so that you don't end up with too many triangles. Spend more triangles for important/characteristic elements than for minor details. + + Avoid having many different meshes/objects, but keep in mind that functional (movable) parts need to be separate meshes. Each unique (sub)mesh/material combination requires a "draw call", which can negatively affect performance. + + In general, maintain a vertex and triangle count consistent with original game assets. For example, typical vehicles range from 20.000 to 50.000 triangles depending on size and complexity. Some of the largest vehicles have up to 100.000 triangles. +* Texturing + + + Texel density: Aim for a density between 128 and 170 pixels/meter and keep it consistent for all UV islands. If necessary, you can allocate a smaller density for less important elements like interior or hidden surfaces. + + Make sure that the UV space is well used (not too much empty space), but have some padding (32 px) between different regions. When creating variants of the same model (such as the cars in a multiple-unit train), try to minimize duplicate texture space. + + Avoid having too many texture sets. For example, typical vehicles have between 1 and 3 sets (depending on size/complexity). +* LOD (Level of Detail) + + + Provide an adequate number of lower-detail versions of the model. A typical asset has 1 to 3 LODs (in addition to the base version) depending on complexity and how far the asset is visible. + + LODs should reduce both triangle count and number of meshes/materials (to reduce the number of draw calls). Typically, the triangle count is reduced by a factor of 4 per level. + + Pay particular attention to the lowest-detail version as it usually has the largest impact on performance. Reduce the geometry to the bare minimum and make sure only a single mesh/material is used. + +**Folder Structure** + +* While resources don't *have* to be organized in a specific way, it is considered good practice to follow the game's conventions. +* The general recommendation is to have one subfolder per asset and all its dependencies. +* If some resources are shared by multiple assets, place them in a "shared" folder (next to the asset folders). +* For models, there is typically a subfolder per resource type ("msh", "mat" and "ani") with textures placed in "mat/tex". +* Try to avoid extra long names, deeply nested folders, name repetitions, empty folders etc. + +**Vehicle-Specific Topics** + +* Bounding Box & Extent + + + Make sure that the bounding box contains the model and all light sources. In contrast, the "extent" should only contain the physical model. + + Tip: Use the Model Editor to calculate these properties. +* Aging & Coloring + + + Include the necessary masks (cblend/dirt/rust) to make these features work. + + There should be enough visual contrast between a brand-new vehicle and one in a bad state. +* Windows & Interior + + + Provide an interior mesh (with reduced detail level) so that it's possible to see through the windows. + + Keep in mind that when the doors are open, it may be possible to see through the windows from the inside. + + Use "sorted" meshes/materials to make transparency work from all angles. +* Animations + + + Create animations for doors, blinkers, wheels etc. (if applicable). +* Axles & Fake Bogies + + + These properties are needed for a vehicle to be correctly positioned on the rails (or on the road). +* Seats & Cargo Bays + + + Use a "Seat provider" to define seats for passengers and the driver. + + Load indicators allow to define how cargo (loaded in a vehicle) is displayed. +* Particle Systems + + + Define emitters so that smoke and steam is generated in a realistic way. + + Refer to the base game vehicles to configure strength and appearance. + + Make sure that each particle system is attached to the correct node (via the "child" property). +* Lights + + + Configure light sources (such as headlights) so that vehicles work with night mode. + + Avoid making light volumes too large (as a guideline, not more than twice the length of the vehicle). +* Display Panels + + + In order for a vehicle to have functioning display panels, "labels" should be defined. + +## Technical Requirements + +To ensure stability, performance, and compatibility across all platforms (PC and Console), all mods must adhere to the following requirements. + +Note: All mods undergo an automatic validation process for both PC and console versions, which includes structural & file acceptance tests as well as syntax, metadata and resource integrity checks. Validation is mandatory to pass for a mod to be released on all platforms. + +**Basics** + +* Integrity: All resources must be syntactically correct and load without errors or warnings. +* Security: Batch files, shell scripts or other executable files are not allowed. +* Encoding: Text-based files (e.g. .lua, .json, .mdl, .msh) must be encoded in UTF-8 without BOM. + +**Files & Folders** + +* Size limit: The maximum unpacked size for a single mod must not exceed 500 MB. Avoid using more space than comparable assets in the base game. +* Naming conventions: Use lowercase only for all files and folders. Avoid whitespaces and special characters. +* No ballast: Include only essential files. Remove source assets (like .psd or .fbx) and temporary files before uploading. + +**Models & Textures** + +* The lowest-detail LOD meshes (blob files) must not exceed 256 KB. +* Texture format: Use the DDS format *with mipmaps*. Dimensions must be power-of-two (e.g. 512, 1024, 2048). + +**Scripting** + +* API usage: Only use the official Transport Fever 3 scripting API. +* Robustness: Scripts should be written to handle edge cases in a graceful way. + +**Misc** + +* Audio: All .wav files must be exported with a sample width of 16-bit (sampwidth: 2) and a frame rate of 48.000 Hz. +* Stability: The severityRemove parameter in mod.json must be correctly defined to indicate the impact of removing the mod from a save game. + +For consoles, there are a few additional requirements: + +**Console-Specific Constraints** + +* No shaders: Custom shader files are not permitted on consoles due to platform-specific constraints. +* Stable gameplay: Mods may not alter fundamental gameplay features that could compromise performance. + +## Mod Metadata + +The metadata needs to be set up according to the description in [Mod Definition](https://wiki.transportfever3.com/doku.php?id=modding:general:moddefinition "modding:general:moddefinition"). This covers the mod name, description and images which are the most relevant elements to gather attention by the users. Hence it is important to have a consistent and appealing quality. + +The **name** of your mod is the first thing users will see, making it crucial for their decision to explore further. It should be clear, memorable, and in title case for consistency. Use Title Case (e.g., β€œAwesome Mod Name”) to ensure uniformity across all mods. This name should not be longer than 32 characters and may not contain line breaks. + +The **cover** (sometimes called "mod listing image" or "thumbnail") and the other gallery images should show the main subject of the mod and contain only English texts, if necessary at all. + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=400&tok=bc6908&media=modding:general:bestpractice:mods_screenshot.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Aguidelines&media=modding:general:bestpractice:mods_screenshot.png "modding:general:bestpractice:mods_screenshot.png") +Cover based on ingame screenshot +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=400&tok=dd68e2&media=modding:general:bestpractice:mods_screenshot_with_overlay.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Aguidelines&media=modding:general:bestpractice:mods_screenshot_with_overlay.png "modding:general:bestpractice:mods_screenshot_with_overlay.png") +Cover based on ingame screenshot with icons +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=400&tok=71579e&media=modding:general:bestpractice:mods_ui.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Aguidelines&media=modding:general:bestpractice:mods_ui.png "modding:general:bestpractice:mods_ui.png") +Cover based on ui screenshot with tilt-shift effect +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=400&tok=04b2f2&media=modding:general:bestpractice:mods_icons_example.png)](https://wiki.transportfever3.com/lib/exe/detail.php?id=modding%3Ageneral%3Aguidelines&media=modding:general:bestpractice:mods_icons_example.png "modding:general:bestpractice:mods_icons_example.png") +Cover with stylized icon and colored accent + +Refer to these **guidelines for creating a high-quality cover image**: + +* Highlight the main subject: The image should showcase the primary element of your mod in an attractive and clear way. +* Use in-game screenshots: Using a screenshot from the game is the recommended approach for authenticity. +* Avoid extra elements: Do not add text, logos, or graphical overlays; let the image speak for itself. Keep in mind that the mod title is always displayed directly below the image. If desired, a small branding logo may be added (see below). +* Frame the subject appropriately: Ensure the main subject occupies a significant portion of the total image area. Use the "Advanced Camera" to find the best perspective (e.g. telephoto view for planes). +* Balance contrast and detail: Ensure the subject stands out from the background without making the environment look too plain or boring. +* Seek inspiration: Review other popular mods to see how they compose their images for effective presentation. + +If the mod is difficult to represent visually (e.g. **script mods**), use one of the following alternatives: + +* Add graphical overlays: Place simple icons or other visual elements over an in-game screenshot (using a 3D perspective if appropriate). Avoid using text. +* Show the GUI: Use a direct screenshot of an in-game menu, settings screen, or other relevant user interface. Frame the image so that the most important element is clearly highlighted (e.g. with a tilt-shift effect). +* Use a schematic representation: Create a clean, minimalist 2D icon that illustrates the mod's function. Use the provided background or, where available, the full category template as visual inspiration. + +In technical terms, the image should be: + +* 1920 x 1080 px +* 16:9 aspect ratio +* At most 8MB in size + +If you (as an individual or group) plan to release multiple mods, you may want to add a small **logo** to the cover image. This so-called branding helps other players recognize your content immediately. Note that the logo should represent you as the creator, not the content of a specific mod. When designing the logo, keep in mind that the cover image is usually displayed in thumbnail size. Therefore, avoid including small details or too many graphical elements. Please also follow these technical guidelines for a consistent appearance: + +* (Assuming the cover image is 1920 x 1080 px) +* Size: 270 x 270 px (or similar area if non-square) +* Position: Bottom left corner +* Margin: 54 px (from the left and bottom) + +### Template + +The templates for mod thumbnails are available here: + +* [png](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:templates:background_png.zip "modding:templates:background_png.zip (1Β MB)") +* [psd (for Photoshop)](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:templates:script_mod_template_psd.zip "modding:templates:script_mod_template_psd.zip (21.4Β MB)") +* [xcf (for Gimp)](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:templates:script_mod_template_xcf.zip "modding:templates:script_mod_template_xcf.zip (32.3Β MB)") + +The **description** will be shown in the ingame browser and on the website. It is mandatory that the description is provided in English. Not all formatting types are supported ingame, hence we recommend to use the following ones: + +* Paragraph, Header 1, Header 2 and Header 3 +* Bold text +* Unordered and ordered lists +* Horizontal lines + +It is not recommended to use tables and embedded images or videos in the description. Both images and videos can be added to the gallery at the top instead. + +Make sure you have included some **tags** describing your mod. They are used to offer filter categories to the players. See the [list of supported tags](https://wiki.transportfever3.com/doku.php?id=modding:general:modtags "modding:general:modtags"). This example shows how to add tags in the `modinfo.json`: + +```lua +{ + "name": "MOD_NAME", + ... + "tags": [ + "Town Building", + "Depot" + ], + ... +} +``` diff --git a/docs/reference/wiki/modding_general_moddefinition.md b/docs/reference/wiki/modding_general_moddefinition.md new file mode 100644 index 0000000..4619af0 --- /dev/null +++ b/docs/reference/wiki/modding_general_moddefinition.md @@ -0,0 +1,214 @@ + + +### Table of Contents + +* [mod.json](#modjson) + + + [Dependencies & Incompatibilities](#dependencies_incompatibilities) + + [Mod Parameters & Scripts](#mod_parameters_scripts) +* [modinfo.json](#modinfojson) +* [strings.json](#stringsjson) + +# Mod Definition + +Mods are folders containing resource files similar to the base game and some additional metadata files to describe and define the mod: + +```lua + mods/ + urbangames_example_mod (1) + _metadata/ (2) + modinfo.json (3) + description.html (4) (optional) + 0.png (5) (optional) + ... + content (6) + mod.script.tl (7) (optional) + mod.json (8) + strings.json (9) (optional) +``` + +1. The directory name has no functional relevance. Best practice is to name the mod in the form `_`. It may not contain characters other than `A-Z`, `a-z`, `0-9`, `_` and . +2. The `_metadata` folder contains the metadata used to describe the mod in the Mod Browser. It contains: +3. The `modinfo.json` file contains all descriptive metadata (like name, description, tags, …). See below for more information. +4. The `description.html` is an optional file for the description which is shown in the ingame mod browser and on mod.io. +5. PNG files with `.png` are used for the Mod Browser and preview. The `0.png` will be used in the grid, the others in the detail view. The images should have 1920x1080 pixels. +6. All the game resources of the mod like vehicles, scripts, … are located in the `content` folder. It is best practice to use a structure similar to the base game. +7. The `mod.script.tl` contains the executable script functions referenced from mod.json. See [here](https://wiki.transportfever3.com/doku.php?id=modding:general:modscripts "modding:general:modscripts") for further information. +8. The `mod.json` contains the technical definition of the mod, most important its id. See below for further information. +9. The `strings.json` file contains translations of the mod’s texts. See below for further information. + +## mod.json + +The `mod.json` file contains the most important technical properties to define the mod. It is written in [JSON snytax](https://en.wikipedia.org/wiki/JSON "https://en.wikipedia.org/wiki/JSON") and its basic structure is as follows: + +```lua +{ + "modId": "urbangames_example_mod", + "revision": 1, + "severityAdd" : "Critical", + "severityRemove" : "Critical", + "visible" : true, + "cosmetic" : false +} +``` + +The `modId` property is a string that is used to identify the mod. It may not contain characters other than `a-z`, `0-9` and `_`. It is best practice to name the mod in the form `_`. The mods are identified based on this id and independent of its location of installation, e.g. a mod in the staging area and in the directory for manually installed mods is considered as the same if the `modId` is the same. If more than one installed mod has the same ID, the game prefers them in following order: +Staging Area > Manual Installation Directory > Subscribed Mods. + +While the folder name has no functional meaning in Transport Fever 3, it is recommended to keep it in sync with the `modId`. In comparison to previous games of the Transport Fever series, there is no major version like `_3` at the end of the `modId`. + +The `revision` integer is used to indicate updated versions of the mod. It is also shown in the ingame mod detail pages. Whenever a new update of the mod is published, this number should be increased. In case of an update that is not compatible with the previous version of the mod, it is recommended to change the mod id and publish the new version as an independent mod to not break user savegames with the update of the mod. + +To inform players of expected behavior when adding mods to or removing mods from existing savegames, the `severityAdd` and `severityRemove` properties are used. There are three possible values: + +* `None` may be used when adding or removing may not harm the savegame in any way, e.g. when only doing cosmetic adjustments. +* `Warning` shall be used when some impacts, e.g. missing vehicle models, are expected, but the savegame will not get into an unstable state. +* `Critical` is used for anything that might result in broken savegames, e.g. missing cargo types. + +If the properties are unset, they behave like `severityAdd` is set to `None` and `severityRemove` is set to `Warning`. + +To hide mods from appearing in the list of mods, it is possible to set `visible` to `false`. The default value if emitted is `true`. This might be relevant for mods that provide content for a campaign savegame and should not be used in other free games. + +Purely cosmetic mods can set the `cosmetic` property to `true` to ensure that achievements can still be earned if only cosmetic mods are used. It is up to the modder to judge if a mod can be considered as cosmetic. Anything that has an impact on the simulation, e.g. faster vehicles, higher capacities or different production output should not be considered as cosmetic. + +### Dependencies & Incompatibilities + +Beyond the two properties above, it is possible to define dependencies and incompatibilities to other mods. Dependencies are used to reference mods that are required to use this mod properly, e.g. a base mod containing a vehicle that you provide a repaint skin for. If a mod is not compatible, due to conflicting behavior, it is possible to warn the player by referencing it as an incompatibility. + +The user will be informed in both cases while activating mods. Dependency mods will be activated before the dependent mod if needed and dependencies that are not yet installed will be offered to be downloaded. There will be a warning if a user tries to start a game with missing dependencies or active incompatible mods. + +```lua +{ + ... + "dependencies": [ + { + "mod": { + "modId": "testing_mod_params", + "revisionMin": 1, + "revisionMax": 1 + }, + "modInfo": { + "displayName": "Testing Mod Params", + "url": "http://www.urbangames.com" + }, + "loadBefore": false, + "optional": false + } + ], + ... +} +``` + +Each dependency has four properties: + +* `mod` is used to identify the other mod. It consists of three values: + + + `modId` is the modId as defined in the mod.json of the other mod. + + `revisionMin` is an optional lower revision limit, if earlier version of the other mod are not yet providing what is needed. Omitting this parameter or setting it to `-1` results in no lower limit. + + `revisionMax` is an optional upper revision limit, if only older versions of other mods are compatible. If omitted or set to `-1`, any (newer) version is considered as compatible. Usually this is not required as mod updates should be backward compatible anyway. +* `modInfo` contains info that is displayed when the dependency mod is not installed, so players can see what they need to install: + + + `displayName` is shown in the Mod Browser. + + `url` is an optional url to reference a location where the mod can be downloaded manually, e.g. from 3rd-party sites. +* `loadBefore` is an optional bool that needs to be set to `true`, if it is necessary that the dependency mod is loaded before this mod. If unset, it is considered as `true`. +* `optional` is an optional bool that can be set to `true` to specify that the dependency is not a must have, but is recommended to be used to have the full functionality available. If unset, it is considered as `false`. + +```lua +{ + ... + "incompatibilities": [ + { + "mod": { + "modId": "urbangames_sandbox", + "revisionMax": 1, + "revisionMin": 1 + } + } + ], + ... +} +``` + +For incompatibilities, the `mod` property is defined as above with the dependencies. + +### Mod Parameters & Scripts + +Mods may have parameters to customize the user experience depending on the user preferences. The selected parameters can be used in the scripts that each mod can provide. See the page about these [parameters and scrips](https://wiki.transportfever3.com/doku.php?id=modding:general:modscripts "modding:general:modscripts") for more details. + +## modinfo.json + +The display name and description for the mod browser are configured in the `modinfo.json` file in the `_metadata` folder: + +```lua +{ + "name": "MOD_NAME", + "summary": "MOD_SUMMARY", + "description": "MOD_DESCRIPTION", + "localization" : { + "en": { + "name": "Wiki Example Config Change", + "summary": "Vehicle brake intensity change", + "description": "Vehicles brake stronger or weaker based on the configured parameter." + }, + "de": { + "name": "Wiki-Beispiel KonfigurationsΓ€nderung", + "summary": "Fahrzeug-BremsintensitΓ€tsΓ€nderung.", + "description": "Fahrzeuge bremsen stΓ€rker oder schwΓ€cher, abhΓ€ngig vom eingestellten Wert." + } + }, + "authors": [ + { + "name": "Urban Games", + "role": "CREATOR" + } + ], + "tags": [ + "Script Mod" + ], + "dependencies": [ + "5499706" + ], + "url": "" +} +``` + +The three important attributes are: + +* `name`: The display name of the mod. This name should not be longer than 32 characters and may not contain line breaks. +* `summary`: This brief summary of the mod content is shown as a tooltip when hovering over a mod in the mod browser. It may not be longer than 100 characters and may not contain line breaks. +* `description`: This may be a longer description text and supports line breaks. It is ignored if a seperate description.html is available. + +To localize these texts, it is possible to provide a set for some language in the `localization` attribute. The default ones are used for all other languages. For a list of possible language codes, have a look at the information on the [localization](https://wiki.transportfever3.com/doku.php?id=modding:misc:localizations "modding:misc:localizations") page. + +As mod.io currently does not support multiple languages, the different languages are concatenated to a longer description which is uploaded for the mod browser. Only the english title is uploaded. The support of multiple languages is planned to arrive until Q2/2027. + +The `authors` list contains a list of authors with their roles. + +The `tags` list may contain one or more of the officially supported tags. See the [list of supported tags](https://wiki.transportfever3.com/doku.php?id=modding:general:modtags "modding:general:modtags") for more details. + +To automatically link to the correct dependencies on mod.io, the `dependencies` list contains the mod.io internal modIds. They can be found in the info boxes on the right side of a mod detail page on mod.io. + +When a dependency shall be removed, removing from the list above alone is not sufficient. This has to be manually updated on mod.io. + +The optional `url` attribute may contain a link to a place where more info about this mod can be found, e.g. a github repository or website. Please be aware that it is not possible to access this url from ingame when playing on console. Hence the description should already contain every relevant info for using the mod. + +Currently, the URL is not shown ingame, but it is accessible for players on mod.io. + +## strings.json + +To provide support for multiple languages, a `strings.json` can be provided in the mod: + +```lua +{ + "en" : { + "brake_intensity_name" : "Brake Intensity", + "brake_intensity_tooltip" : "Adjust the global brake intensity." + }, + "de" : { + "brake_intensity_name" : "BremsintensitΓ€t", + "brake_intensity_tooltip" : "Passen Sie die globale BremsintensitΓ€t an." + } +} +``` + +This file contains translations for strings, specified as a list of key/value pairs for each language. If a key does not exist for a given language, the English text is used. If this isn’t defined neither, the key itself is displayed. For a list of possible language codes, have a look at the information on the [localization](https://wiki.transportfever3.com/doku.php?id=modding:misc:localizations "modding:misc:localizations") page. diff --git a/docs/reference/wiki/modding_general_modscripts.md b/docs/reference/wiki/modding_general_modscripts.md new file mode 100644 index 0000000..4bf0bb8 --- /dev/null +++ b/docs/reference/wiki/modding_general_modscripts.md @@ -0,0 +1,276 @@ + + +### Table of Contents + +* [Mod Params](#mod_params) +* [Script Functions](#script_functions) + + + [preRunScript](#prerunscript) + + [runScript](#runscript) + + [postRunScript](#postrunscript) + + - [Resource Filtering](#resource_filtering) + - [Resource Modification](#resource_modification) + - [Resource Addition](#resource_addition) + +# Mod Parameters and Scripts + +Mods may have parameters to customize the user experience depending on the user preferences. The selected parameters can be used in the scripts that each mod can provide. + +## Mod Params + +Mods can provide individual parameters in the `params` property. These use the parameter types that are available for [constructions](https://wiki.transportfever3.com/doku.php?id=modding:constructions:basics#parameters "modding:constructions:basics") too. The user can select his preferences in the mod selection when creating a new game or loading an existing savegame. Parameters of all mods are available in the script functions described below. + +```lua +{ + ... + "params": [ + { + "key": "param_key", + "name": "Parametername", + "tooltip": "Parameter-Tooltip", + "uiType": "ComboBox", + "values": [ + "Era A", + "Era B", + "Era C" + ], + "numbers": [1, 2, 3], + "defaultIndex": 2 + }, + ... + ], + ... +} +``` + +Each parameter has several properties: + +* `key` is a string that is used to reference this parameter in functions. +* `name` is the string that is shown in the ui. +* `tooltip` is an optional string that is displayed when the user moves to mouse over the name of the parameter. +* `uiType` is used to select the type of parameter. It is either `Button`, `Slider`, `ComboBox`, `IconButton` or `CheckBox`. +* `values` is either a list of filepaths in case of `IconButton` parameters or a list of strings for all other types. +* `numbers` is an optional list of doubles that are returned when referencing the parameters in script functions. If unset, the default values are 1, 2, 3, … +* `defaultIndex` is an optional integer to specify the default option of the parameter. If unset, the first one is used. + +While indices in lua and Teal files are 1-based, the `defaultIndex` in the mod.json needs to be set 0-based. + +## Script Functions + +The static `mod.json` does not contain executable functions itself, but it may reference a `.script.lua` file for these functions: + +```lua +{ + ... + "preRunScript": { + "fileName": "ug_wiki_example_mod::mod.script@preRunFn" + }, + "runScript": { + "fileName": "ug_wiki_example_mod::mod.script@runFn" + }, + "postRunScript": { + "fileName": "ug_wiki_example_mod::mod.script@postRunFn" + }, + ... +} +``` + +The functions can be referenced with `::@`. There are three different functions that can be specified for each mod. The base game functions are executed first, then in the order of mod activation: + +[![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:general:scriptfn.png)](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:general:scriptfn.png "modding:general:scriptfn.png") + +### preRunScript + +The `preRunScript` function is called before the game and mod resources are loaded. It receives three parameters: + +* `configDict` containing the selected climate, economy and name list. +* `allModParams` containing a list of all mod parameters with the mod id as key of the list items. To retrieve the list of parameters for the current mod, `allModParams[getCurrentModId()]` can be used. +* `baseConfig` a list of all properties that are relevant for the simulation and gameplay aspects. + +The preRunFn allows the adjustment of this `baseConfig` by overriding the individual values. See [game configs](https://wiki.transportfever3.com/doku.php?id=modding:scripting:baseconfig "modding:scripting:baseconfig") for a detailed list of all existing configuration properties in the base config. + +### runScript + +The main function that is called when a mod is loaded is the `runScript` function. It receives two parameters: + +* `configDict` containing the selected climate, economy and name list. +* `allModParams` containing a list of all mod parameters with the mod id as key of the list items. To retrieve the list of parameters for the current mod, `allModParams[getCurrentModId()]` can be used. + +It is possible to register file filters and resource modifiers that are considered when loading the game resources after all the `runFn` are executed. However it is recommended to filter and alter resources in the `postRunFn` whenever that is possible. See [resource modifiers](https://wiki.transportfever3.com/doku.php?id=modding:scripting:modifiersfilters#resource_modifiers "modding:scripting:modifiersfilters") and [file filters](https://wiki.transportfever3.com/doku.php?id=modding:scripting:modifiersfilters#file_filters "modding:scripting:modifiersfilters") for the filters and modifiers and below for the `postRunFn`. + +### postRunScript + +The `postRunScript` function is called once after all resources are loaded. It receives two parameters: + +* `configDict` containing the selected climate, economy and name list. +* `allModParams` containing a list of all mod parameters with the mod id as key of the list items. To retrieve the list of parameters for the current mod, `allModParams[getCurrentModId()]` can be used. + +It is possible to use the `api.res.*` script functions provided by the [Scripting API](https://wiki.transportfever3.com/doku.php?id=modding:scripting:api "modding:scripting:api"), e.g. to add additional multiple unit configurations or construction modules based on the loaded resources. + +#### Resource Filtering + +This example has a mod parameter that allows optional filtering of models. It is available for [download](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:templates:wiki_example_mod_param_filter.zip "modding:templates:wiki_example_mod_param_filter.zip (136.1Β MB)"). + +Explanation + +The parameter is defined in the `mod.json`: + +```lua +... + "params": [ + { + "key": "paramVehicleFilter", + "name": "Available Designs", + "tooltip": "Enables the liveries", + "uiType": "Combobox", + "values": [ + "TGV PSE", + "TGV Atlantique", + "TGV PSE & Atlantique" + ], + "defaultIndex": 2 + } + ], +... +``` + +The result of the defined mod parameter can be retrieved in the `postRunFn` in the `mod.script.tl` to be used for filtering the models and multiple units in the repository. + +```lua +local modelsToHide: {{string}} = { + [1] = { -- Param Option 1 + "wiki_example_mod_param_filter::/vehicle/train/tgv/tgv_atlantique_front.mdl", + "wiki_example_mod_param_filter::/vehicle/train/tgv/tgv_atlantique_middle1.mdl", + ... + }, + [2] = { -- Param Option 2 + "wiki_example_mod_param_filter::/vehicle/train/tgv/tgv_front.mdl", + "wiki_example_mod_param_filter::/vehicle/train/tgv/tgv_middle1.mdl", + ... + }, + [3] = {} -- Param Option 3 +} +Β  +local multipleUnitsToHide: {{string}} = { + [1] = { + "wiki_example_mod_param_filter::/vehicle/train/tgv/tgv_atlantique.mu", + }, + [2] = { + "wiki_example_mod_param_filter::/vehicle/train/tgv/tgv.mu", + }, + [3] = { } +} +``` + +These two arrays of arrays contain the list of models/multiple units that will be hidden depending on the value of the script param. + +```lua +local selectedFilterSet: integer = allModParams[getCurrentModId()].paramVehicleFilter +``` + +The value of the parameter is fetched based on its key. + +```lua +for _, v in ipairs(modelsToHide[selectedFilterSet]) do + local modelId : number = api.res.modelRep.find(v) + if modelId ~= -1 then + api.res.modelRep.setVisible(modelId, false) + end +end +for _, v in ipairs(multipleUnitsToHide[selectedFilterSet]) do + local muId : number = api.res.multipleUnitRep.find(v) + if muId ~= -1 then + api.res.multipleUnitRep.setVisible(muId, false) + end +end +``` + +Depending on the parameter value, one of the lists is looped to hide the models/multiple units. This is done by finding the id of the resource in the appropriate [repository](https://wiki.transportfever3.com/script-doc/api/res.html#$api.res~Res "https://wiki.transportfever3.com/script-doc/api/res.html#$api.res~Res") with the function `find` and then setting it's visibility to false with `setVisible`. This hinders it from appearing in vehicle stores at all. + +#### Resource Modification + +This example has a mod parameter that allows optional modification of vehicle capacities. It is available for [download](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:templates:wiki_example_mod_param_modifier.zip "modding:templates:wiki_example_mod_param_modifier.zip (2.9Β KB)"). + +Explanation + +The parameter is defined in the `mod.json`: + +```lua +... + "params": [ + { + "key": "paramVehicleModifier", + "name": "Capacity", + "tooltip": "Scales the vehicle capacity", + "uiType": "Slider", + "values": [ + "1x", + "2x", + "3x", + "4x" + ], + "defaultIndex": 1 + } + ], +... +``` + +The result of the defined mod parameter can be retrieved in the `postRunFn` in the `mod.script.tl` to be used for modifying the models in the repository. + +```lua +local capacityMultiplier: integer = allModParams[getCurrentModId()].paramVehicleModifier +``` + +The value of the parameter is fetched based on its key. + +```lua +api.res.modelRep.forEachModelWithMetadata("transportVehicle", function(name : string) + local model = api.res.modelRep.getAsTable(api.res.modelRep.find(name)) + local tv = model.metadata["transportVehicle"] as ModelMetadata.TransportVehicle + if tv then + for i = 1, #tv.compartments do + for j = 1, #tv.compartments[i].loadConfigs do + if tv.compartments[i].loadConfigs[j].cargoEntry ~= nil then + local cargoEntry = tv.compartments[i].loadConfigs[j].cargoEntry + if cargoEntry and cargoEntry.capacity then + tv.compartments[i].loadConfigs[j].cargoEntry.capacity = cargoEntry.capacity * capacityMultiplier + end + end + end + end + api.res.modelRep.setAsTable(api.res.modelRep.find(name), model) + end +end) +``` + +A loop over all models with metadata `transportVehicle` is started. The model is fetched from the `api.res.modelRep` by using the `getAsTable(index)` function. This function provides a lua table representation of the model that can be edited freely. After finishing the editing, the result needs to be pushed back to the repository by using the `setAsTable(index, data)` function. + +#### Resource Addition + +This example adds a second version of all vehicle models that have no purchase cost but increased maintenance price, mimicking a "leasing" option. It is available for [download](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:templates:wiki_example_mod_param_adder.zip "modding:templates:wiki_example_mod_param_adder.zip (2.1Β KB)"). + +Explanation + +The `postRunFn` in the `mod.script.tl` is used to loop over all models with `transportVehicle` metadata: + +```lua +api.res.modelRep.forEachModelWithMetadata("transportVehicle", function(name : string) + local model = api.res.modelRep.getAsTable(api.res.modelRep.find(name)) + local mc = model.metadata["maintenance"] as ModelMetadata.Maintenance + local cost = model.metadata["cost"] as ModelMetadata.Cost + local tv = model.metadata["transportVehicle"] as ModelMetadata.TransportVehicle + if cost and mc then + local costPrice = cost.price + local lifespan = mc.lifespan + mc.runningCosts = mc.runningCosts + (3 * costPrice) / (2 * lifespan / 1460) + cost.price = 0 + tv.groupFileName = name + api.res.modelRep.addAsTable(name .. "_leasing", model) + end +end) +``` + +A loop over all models with metadata `transportVehicle` is started. The model is fetched from the `api.res.modelRep` by using the `getAsTable(index)` function. This function provides a lua table representation of the model that can be edited freely. After finishing the editing, the result is pushed back to a new entry in the model repository by using the `addAsTable(name, data)` function. + +Be aware that it's not possible to add new 3d resources with the scripts, it is only possible to reference existing `.mdl` data for the visual models by adjusting the `modelPath` reference in the `model` struct. diff --git a/docs/reference/wiki/modding_general_modtags.md b/docs/reference/wiki/modding_general_modtags.md new file mode 100644 index 0000000..9303cf3 --- /dev/null +++ b/docs/reference/wiki/modding_general_modtags.md @@ -0,0 +1,90 @@ + + +### Table of Contents + +* [Map/Savegame](#map_savegame) +* [Climate](#climate) +* [Vehicle](#vehicle) +* [Station](#station) +* [Track/Road](#track_road) +* [Building](#building) +* [Asset](#asset) +* [Misc](#misc) + +# Mod Tags + +The mod hub is divided in several categories. Each of the categories has some distinct tags that are used for subcategories. + +Transport Fever 3 supports the following tags: + +#### Map/Savegame + +* `Map` +* `Savegame` + +#### Climate + +* `Temperate` +* `Subarctic` +* `Dry` +* `Tropical` +* `Custom` + +#### Vehicle + +* `Locomotive` +* `Wagon` +* `Multiple Unit` +* `Bus` +* `Truck` +* `Tram` +* `Ship` +* `Plane` +* `Helicopter` + +#### Station + +* `Rail Station` +* `Road Station` +* `Airport/Heliport` +* `Port` + +#### Track/Road + +* `Track` +* `Road` +* `Bridge` +* `Tunnel` +* `Signal` +* `Rail Crossing` +* `Road Construction` +* `Track Construction` + +#### Building + +* `Industry` +* `Town Building` +* `Warehouse` +* `Landmark` +* `Depot` +* `Maintenance Building` + +#### Asset + +* `Vegetation` +* `Rock` +* `Other Asset` + +#### Misc + +* `Script Mod` +* `Car` +* `Resident` +* `Animal` +* `Sound` +* `Shader` +* `Campaign` +* `Localization` +* `Misc` + +To keep the categories clean, it is recommended to choose at most up to three major tags that support what users would use to find a mod. A combined industry with embedded station would primarily count as `Industry`. A combined airport with underground train station would likely equally fit in both `Rail Station` and `Airport/Heliport`. A script mod that adjusts metadata of locomotives is still a `Script Mod` and not a `Locomotive`. diff --git a/docs/reference/wiki/modding_general_publishing.md b/docs/reference/wiki/modding_general_publishing.md new file mode 100644 index 0000000..88df2a2 --- /dev/null +++ b/docs/reference/wiki/modding_general_publishing.md @@ -0,0 +1,108 @@ + + +### Table of Contents + +* [Compensation and Monetization of Mods](#compensation_and_monetization_of_mods) +* [Publish](#publish) + + + [Customizing](#customizing) +* [Update](#update) +* [Publish on other Platforms](#publish_on_other_platforms) + +# Publish a Mod + +Once a mod is finished, you may consider to upload the mod to a place where other users may download it to use. The official mod browser is hosted by our partner [mod.io](https://mod.io/ "https://mod.io/"). It allows players on all platforms (Win/Mac/Linux as well as PS5 and Xbox Series) to access mods directly within the game. + +To ensure fair play for everyone, there are a few mandatory rules to follow: + +* Do not upload content for which you do not have copyright or permission to distribute yourself! +* Mods must be non-commercial and accessible in full for free to all users. (see below) +* Mods must not contain offensive or inappropriate content. +* Mods (aka User Generated Content) must comply with the End User License Agreement and the Terms of Use by mod.io. +* Mods must follow the instructions from our [modding manual](https://wiki.transportfever3.com/doku.php?id=modding:start "modding:start"). + +Urban Games allows the use of game files from the base game of Transport Fever, Transport Fever 2 and Transport Fever 3 to create mods for Transport Fever 3. When using game files, it is mandatory to state the source of the files. You are not permitted to use the game files for games or projects other than the Transport Fever series without explicit permission from Urban Games. + +## Compensation and Monetization of Mods + +We recognize that creating and maintaining mods can require a significant investment of time and, in some cases, money. As with the previous titles of the Transport Fever series, modders should therefore have reasonable ways to receive compensation and support for their work. As a fair and consistent rule direct **support of modders is permitted**, the **sale of content is not**. + +Allowed forms of modder support include: + +* **Donations:** Users may voluntarily provide financial support to modders without any expectation to receive something in return. +* **Direct commissions:** Users may commission modders to create or modify content according to their individual requests, providing that the resulting content is provided to all players free of charge. +* **Patreon and similar support programs:** Modders may use membership or donation platforms to receive financial support from their community. Supporter programs may provide additional benefits, such as: + + + Early beta access to mods, for a period of **up to 31 days before public release** + + Participation in polls or voting on future mod development + + Exclusive development blogs, posts, videos, or behind-the-scenes content + + Similar benefits that provide additional interaction or insight into the modding process + +Not permitted selling of content: + +* **Permanent paywalls:** A mod may not be permanently restricted to paying supporters or made available only through a Patreon membership or similar paid subscription for greater than the 31 day early beta method. +* **Selling individual mods:** Mods may not be sold through online shops, marketplaces, or other commercial storefronts as products. +* **Advertising with incomplete mods:** Feature reduced or other dummy mods may not be published to advertise exclusive feature-complete beta mods that are only accessible with the support programs. + +Accordingly, a modder may use Patreon or similar platforms to generate income and offer supporters additional benefits, but the full mod itself must ultimately be made available to the general community without requiring payment. Additional means of support may be provided by Urban Games as part of the [Curated Mods Program](https://www.transportfever3.com/curated-mods-program/ "https://www.transportfever3.com/curated-mods-program/") (application and approval is required). + +## Publish + +Start the game and select the Mod Hub in the main menu. There is a My Mods tab, if there is at least one mod in your staging area. If not yet done, copy your mod to the `staging_area` subdirectory in the userdata directory. Usually it's located here: +`C:\Program Files (x86)\Steam\userdata\\3493540\local\staging_area\` + +Select the mod that you would like to publish in order to see the mod details and add your final adjustments. + +It is possible to adjust: + +* 1 the name of the mod +* 2 the tags of the mod +* 3 the cover and additional images for the gallery +* 4 the visibility +* 5 the changelog message + +Once you are ready publish your mod by clicking Upload at the bottomn left. Before upload, the game performs a validation pass to ensure the mod fulfills the requirements for Transport Fever 3. If it fits to the stricter console requirements, a version with adapted textures is prepared and automatically approved for PS5 and Xbox Series as well. + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:publishing:mod_upload.png) + +### Customizing + +Once the upload of the mod is complete, the entry will be opened on mod.io. Several edit functions are available by pressing the edit button in the top right corner. + +In the General settings tab, there are four sub pages: + +* Mod Profile name, summary, description, URL, listing image (cover/thumbnail), visibility setting and the selection of tags. +* Media Additional screenshots for the gallery section on the detail page of the mod. +* Files The history of uploaded files and the approval status for the different platforms. +* Dependencies References to other mods that are required and a list of mods that require your mod. + +The Preview tab offers the possibility to give preview access to other players so they can beta test your mod. It is also possible to give preview access via url instead of manual approval of seperate user accounts. + +It is possible to add other users as Team members of a mod. There are three roles to choose from: + +* Administrator - Full access (includes editing the mod details themselves, as well as the team) +* Manager - Ability to manage mod details. Cannot edit team or delete files +* Moderator - Ability to moderate comments + +All reports by players are listed in the Reports tab. It is possible to respond to the reporter to discuss additional details. + +Download numbers, regional distribution of players and other statistics are collected in the Stats tab. + +## Update + +To update an existing mod, simply open the Mod Hub in the main menu and go to My Mods again. Then select the mod to update. If you can read `The existing mod on mod.io will be updated` in the bottom left box next to an Update button, the mod.io item that should be updated is properly recognized. Otherwise, the reference might be missing. + +Once a mod is uploaded to mod.io, a `mod.io_fileid.txt` file is generated in the \_metadata folder of the mod. This file is required to find the right existing mod.io entry to update. If you lost the file, you may add it manually. The content is just the entry id that you may find in the info box on the right side of a mod detail page on mod.io. + +Please increase the revision number in the `mod.json` before upload and provide a useful changelog message to inform the other players what changed. + +If you modified title or description texts directly on mod.io, these changes will be overridden by the content from the mods name and description that is used in the `modinfo.json`! Thus you're advised to manually backup them elsewhere to restore them after the update. + +## Publish on other Platforms + +In difference to mod.io, the upload to other mod hosters works manually and not through the game. +Thus, the workflow may vary depending on the hoster. In most cases, the hosters have some terms of service which have to be accepted before uploading content. + +For example, the mostly german community website has a download section. The [filebase on transportfever.net](https://www.transportfever.net/filebase/ "https://www.transportfever.net/filebase/") can be accessed by everyone, so Win, MacOS and Linux users may install mods from there as well. + +It is recommended to include the url in the [modinfo.json](https://wiki.transportfever3.com/doku.php?id=modding:general:moddefinition#modinfojson "modding:general:moddefinition") to point to the download possibility. This helps other users to locate the source of missing mods. diff --git a/docs/reference/wiki/modding_general_resourcetypes.md b/docs/reference/wiki/modding_general_resourcetypes.md new file mode 100644 index 0000000..a80721c --- /dev/null +++ b/docs/reference/wiki/modding_general_resourcetypes.md @@ -0,0 +1,284 @@ + + +### Table of Contents + +* [File Endings](#file_endings) +* [File Names & References](#file_names_references) +* [Static Resources & Scripts](#static_resources_scripts) +* [3D Files](#d_files) + + + [.mdl for Model Definitions](#mdl_for_model_definitions) + + [.msh / .msh.blob for Mesh Data](#msh_mshblob_for_mesh_data) + + [.mtl for Material Definition](#mtl_for_material_definition) + + [.ani for Extracted Animations](#ani_for_extracted_animations) +* [Texture Files](#texture_files) + + + [DDS (DirectDraw Surface)](#dds_directdraw_surface) + + [TGA (TARGA)](#tga_targa) +* [Directory Structure](#directory_structure) + +# Resource Types & Structure + +In Transport Fever 3, the game resources are not distinguished by their folder, but by their individual file endings. + +## File Endings + +The game resources as well as the mod resources consist of code files (scripts, configurations, …), 3D files, texture files and soundfiles. The following table contains an overview over all used file endings in Transport Fever 3. Below are additional infos for the most common ones. + +| Category | Resource | File Endings | +| --- | --- | --- | +| General | Models | `.mdl` | +| | Meshes | `.msh`, `.msh.blob` | +| | Materials | `.mtl` | +| | Animations | `.ani` | +| | Textures | `.dds`, `.tga`, `.hdr` | +| | Icons | `.tga` | +| | Transformators | `.trf.lua` | +| | Sound Sets | `.snd.lua` | +| | [Sound Effects](https://wiki.transportfever3.com/doku.php?id=modding:misc:soundeffects "modding:misc:soundeffects") | `.wav` | +| Configurations | Climates | `.clima.lua` | +| | Terrain Generators | `.gen.lua` | +| | Economies | `.eco.lua` | +| | Environments | `.env.lua` | +| | Terrain Materials | `.tmat.lua` | +| | Grass | `.grass.lua` | +| Scripts | Generic Scripts/Utils | `.lua`, `.tl` | +| Scripts | Script Resources | `.script.lua`, `.script.tl` | +| | Teal Definitions | `.d.tl` | +| | Game Scripts | `.gs.lua` | +| | Campaigns | `.campaign.lua` | +| | Missions | `.mission.lua` | +| Content | Constructions | `.con.lua` | +| | Modules | `.module.lua` | +| | Ground Textures | `.gtex.lua` | +| | Auto Ground Textures | `.agt.lua` | +| | Track/Street Templates | `.street_template.lua` | +| | Track/Street Styles | `.street.lua` | +| | Bridges | `.bridge.lua` | +| | Tunnels | `.tunnel.lua` | +| | Railroad Crossings | `.rcr.lua` | +| | Traffic Lights | `.trl.lua` | +| | Cargo Types | `.cargo.lua` | +| | Cargo Formats | `cmf.lua` | +| | Cargo Classes | `.cargoclass.lua` | +| | Multiple Units | `.mu.lua` | +| Rendering | [Shaders](https://wiki.transportfever3.com/doku.php?id=modding:misc:shaders "modding:misc:shaders") | `.fs`, `.tesc`, `.tese`, `.vs`, `.gs`, `.glsl` | +| | Render Descriptors | `desc` | +| | Render Programs | `.prog` | +| | Techniques | `.tec` | +| | Material Properties | `.prop` | +| | Material Types | `.mat` | +| Misc | Stylesheets | `.css.lua` | +| | Playlists | `.plist.lua` | +| | Songs | `.ogg` | +| | Layer Nodes | `.node.lua` | +| | Names | `.names.lua` | +| | [Locale](https://wiki.transportfever3.com/doku.php?id=modding:misc:localizations "modding:misc:localizations") | `.lang.lua` | +| | Generic Resources | `.res.lua` | + +## File Names & References + +All text files (models, meshes, scripts etc.) should be encoded in **UTF-8 without BOM**. For file and folder names the following conditions apply: + +* Only use lower case letters `a-z`, underscore `_`, dash `-` and numbers `0-9`. +* Do **not** use upper case letters and blank spaces. +* Keep folder and file names short + +To reference another file, it is possible to either reference relative to the current file or absolute from the base game `content` directory or the root of a mod: + +```lua +"/assets/<...>/filename.mdl" -- absolute path +"tex/logo_mga.dds" -- path relative to current file +``` + +To reference files in another mod than the current one or from the base game, the whole path is prefixed: + +```lua +"/assets/<...>/filename.mdl" -- absolute path in the current mod +"::/assets/<...>/filename.mdl" -- absolute path in the base game +"mod_id::/assets/<...>/filename.mdl" -- absolute path in mod ''mod_id'' +Β  +"tex/logo_mga.dds" -- path relative to current file in the current mod +"::tex/logo_mga.dds" -- path relative to current file but in the folders of the base game +"mod_id::tex/logo_mga.dds" -- path relative to current file but in the folders of the mod ''mod_id'' +``` + +It is not possible to use `../` to reference to the parent directory. + +## Static Resources & Scripts + +In general, the lua and Teal based static resources consist at least of the `data()` function that is executed once when the game loads all the resources at the start of a savegame: + +```lua +function data() +return { + -- content of data struct depending on type of configuration +} +end +``` + +Beside the static metadata file, many of the resources like constructions have a dynamic script part. The static resource file has a reference to the script file like in the following example: + +```lua +... +updateScript = { + fileName = "underground_station.script@updateFn", + params = { + key = value, + } +}, +``` + +The `fileName` follows the pattern: `resourceRef@functionKey` where `resourceRef` may be a full path as described above. The `functionKey` refers to a key in the result of the `data()` function in that script file. + +The `params` struct is injected as the first parameter into these referenced functions and is commonly called `captureParams`: + +```lua +function data() +return { + updateFn = function(captureParams, params) + ... + end, + ... +} +end +``` + +## 3D Files + +The model resources consist of the following file types: + +* `.mdl` for model definitions +* `.msh` for mesh index files +* `.msh.blob` for mesh 3D data +* `.mtl` for material definitions +* `.ani` for extracted animations + +### .mdl for Model Definitions + +Model files are a special kind of configuration file as well, thus their structure is similar with a `data()`-function. + +```lua +function data() +return { + boundingInfo = { ... }, -- optional bounding box used e.g. for render borders + collider = { ... }, -- optional collider for collision calculation + lods = { ... }, -- geometric information for 3D data and textures + metadata = { ... }, -- metadata depending on model type + version = 2, -- required to distinguish from the old Transport Fever 2 model format +} +end +``` + +Detailed information about bounding boxes, colliders and the lod tree can be found in the [model documentation](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl "modding:general:resourcetypes:mdl"). + +### .msh / .msh.blob for Mesh Data + +The mesh files contain the threedimensional mesh information known as the actual 3D model. A mesh can consist of more than one submesh. This data is stored in a binary blob file that contains all the positions, orientations etc. of every vertex, edge and face. To tell the engine where the right information is stored in the binary blob file, there is a second file with indices. This text based file can be edited with any text editor. + +```lua +function data() +return { + subMeshes = { ... }, + vertexAttr = { ... }, +} +end +``` + +Both files share the same name, but the blob file has `.blob` as a suffix. For example, if the index file is called `cube_lod_0.msh`, then the blob file is called `cube_lod_0.msh.blob`. Read more about meshes and the internal structure of these files in the [mesh documentation](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:msh "modding:general:resourcetypes:msh"). + +### .mtl for Material Definition + +Materials contain the reference to texture files. The basic structure is a `data()` function as well. + +```lua +function data() +return { + order = 0, -- used to determine rendering order between materials of same type + params = { ... }, -- parameters vary depending on type + type = "PHYSICAL_NRML_MAP", +} +end +``` + +There are many different material types available. For a full overview of available types, see the [material documentation](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mtl "modding:general:resourcetypes:mtl"). + +### .ani for Extracted Animations + +If animations are extracted from `.mdl` files to external files, they are located in `.ani` files. + +These files contain a `data()` function as most of the other resources: + +```lua +function data() +return { + times = { 0, ... }, -- timestamps in milliseconds from 0 as begin of animation + transfs = { + { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, }, -- transformation matrix for each timestamp + ... + }, +} +end +``` + +The number of timestamps must equal the number of matrices! + +## Texture Files + +The preferred texture format for Transport Fever 3 is `.dds` with compression and mip maps. In some rare cases and for ui elements the `.tga` format is files and compressed `.dds` files. + +### DDS (DirectDraw Surface) + +The `.dds` textures are compressed and have a smaller filesize, reducing the memory usage. + +The common compression types supported by Transport Fever 3 are: + +* BC1/DXT1 with binary alpha information +* BC2/DXT3 with 4bit alpha +* BC3/DXT5 with interpolated alpha +* BC7/DX11 with interpolated alpha +* BC5/3Dc for normal maps +* BC4/R8/L8 for m8 bit greyscale masks + +While DXT1 has the smallest file size, it is only suitable where no transparency or full transparency (either 100% opaque or 100% transparent) is needed. + +For normalmaps, the `3Dc ATI2A2XY` standard is required. See [external tools documentation](https://wiki.transportfever3.com/doku.php?id=modding:tools:external "modding:tools:external") for more information on tools supporting these compressions. + +To ensure compatibility with ATI and Intel graphic cards, it is important that the texture resolutions use multiples of 2 for the sizes: 16, 32, 64, 128, 256, 512, 1024, 2048, 4096. + +Keep in mind that larger textures occupy a lot more memory space. Therefore only use large textures when absolutely necessary. + +### TGA (TARGA) + +`.tga` files usually are used for UI elements and smaller graphics. To provide graphics with high resolution for 4k-monitors, the ui icons usually are provided in double scale, meaning a 24 px large icon is actually 48 px large in the file. The file name ends with `@2x.tga` in that case. + +As `.tga` filesize is greater than the file size of a similar image with compressed `.dds`-format, it is not recommended to use `.tga` for model textures. + +## Directory Structure + +While in most cases there is no mandatory directory structure for mods, it is recommended to use a similar directory structure as used in the base game of Transport Fever 3. Below is a description of all relevant folders inside of the `content` directory of Transport Fever 3. Only those which are relevant for a specific mod need to be included in a mod. + +The directories in Transport Fever 3 are grouped by game element, not by filetype. Thus the folders contain 3D models, sounds and additional script files all in one place: + +| Folder | Description | +| --- | --- | +| assets | 3D models without special functionality. Used to decorate other game elements, e.g. town buildings and industries | +| base | Important files for the basic functionality of the game | +| buildings | 3D models and construction files for town buildings | +| cargos | 3D models, icons and definitions for cargo types | +| characters | 3D models for sim people and drivers | +| climates | metadata and generator files for climate zones | +| depots | 3D models and construction files for [depots](https://wiki.transportfever3.com/doku.php?id=modding:constructions:types#depots "modding:constructions:types") and maintenance buildings | +| economy | economy definition files | +| gui | scripts and icons for the user interface | +| industries | 3D models and construction files for [industries](https://wiki.transportfever3.com/doku.php?id=modding:constructions:types#industries "modding:constructions:types") | +| infrastructure | 3D models and definition files for [tracks](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:tracksstreets#tracks "modding:infrastructure:tracksstreets"), [streets](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:tracksstreets#streets "modding:infrastructure:tracksstreets"), [bridges](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:bridgestunnels#bridges "modding:infrastructure:bridgestunnels"), [tunnels](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:bridgestunnels#tunnels "modding:infrastructure:bridgestunnels"), [signals](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:signals#signals "modding:infrastructure:signals"), [railroad crossings](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:railroadcrossings "modding:infrastructure:railroadcrossings"), [traffic lights](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:trafficlights "modding:infrastructure:trafficlights") and [edge addons](https://wiki.transportfever3.com/doku.php?id=modding:edgeaddons "modding:edgeaddons") | +| landmarks | 3D models and construction files for [landmarks](https://wiki.transportfever3.com/doku.php?id=modding:constructions:types#landmarks "modding:constructions:types") | +| mission | scripts for campaign mechanics | +| music | music tracks for the background music | +| names | lists of [people, street and town names](https://wiki.transportfever3.com/doku.php?id=modding:misc:names "modding:misc:names") | +| scripts | generic scripts used in various places | +| stations | 3D models and construction files for [stations](https://wiki.transportfever3.com/doku.php?id=modding:constructions:types#stations "modding:constructions:types") of all types of transport | +| terrain | textures and configurations of [terrain materials](https://wiki.transportfever3.com/doku.php?id=modding:environment:terrainmaterials "modding:environment:terrainmaterials") used by terrain generation as well as brush tools | +| vehicle | 3D models for all types of [vehicles](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:basics "modding:vehicles:basics") and configurations of [multiple units](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:types#multiple_units "modding:vehicles:types") | +| warehouses | 3D models and construction files for [warehouses](https://wiki.transportfever3.com/doku.php?id=modding:constructions:types#warehouses "modding:constructions:types") | diff --git a/docs/reference/wiki/modding_general_syntax.md b/docs/reference/wiki/modding_general_syntax.md new file mode 100644 index 0000000..fc2b5f2 --- /dev/null +++ b/docs/reference/wiki/modding_general_syntax.md @@ -0,0 +1,254 @@ + + +### Table of Contents + +* [JSON](#json) +* [LUA & Teal](#lua_teal) + + + [Functions](#functions) + + [Types](#types) + + [Variables](#variables) + + [Data Structs / Arrays](#data_structs_arrays) + + - [Structs with Keys](#structs_with_keys) + - [Structs without Keys](#structs_without_keys) + + [Loops](#loops) + + - [while](#while) + - [for](#for) + + [Conditionals](#conditionals) + + [Operators](#operators) + + - [Mathematical Operators](#mathematical_operators) + - [Comparators](#comparators) + - [Logic](#logic) + - [String Concatenation](#string_concatenation) + + [Imports](#imports) + +# Syntax + +This page gives a brief introduction into the used scripting language. +See the documentation of [resource types](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes "modding:general:resourcetypes") for the internal structures of files. + +## JSON + +The static [JavaScript Object Notation](https://en.wikipedia.org/wiki/JSON "https://en.wikipedia.org/wiki/JSON") is used for the header files of mods to ensure a broken mod definition does not prevent the game from starting. + +More details on the syntax rules for JSON can be found at [W3 Schools](https://www.w3schools.com/js/js_json.asp "https://www.w3schools.com/js/js_json.asp"). + +## LUA & Teal + +For all scripts and the other external resources which are not hard coded into the game binary, the [LUA](https://en.wikipedia.org/wiki/Lua "https://en.wikipedia.org/wiki/Lua") language is used. LUA is a script language which is used by many programs to offer extendability and customization. To assist coding and reduce potential for errors, scripts usually use the [Teal](https://teal-language.org/ "https://teal-language.org/") dialect for lua. It provides static typing annotations to better specify the data types of function parameters and arrays. + +The most common syntax structures used for Transport Fever 3 are described briefly below. A full reference of the LUA syntax is available at the [website of LUA](https://www.lua.org/manual/5.2/ "https://www.lua.org/manual/5.2/"). + +Files with LUA content are plain textfiles and can be edited with any text editor. Common used editors are [Notepad++](https://notepad-plus-plus.org "https://notepad-plus-plus.org") and [Visual Studio Code](https://code.visualstudio.com/ "https://code.visualstudio.com/") which both support syntax highlighting of LUA code. The later also supports syntax highlighting for Teal. + +### Functions + +Functions can be called by their name from other functions or the game engine. + +```lua +local function functionname(parametername1, parametername2) + -- code + return resultname +end +``` + +Functions are defined by the keyword `function` followed by a name for the function. +In brackets, some `parameters` may be required too. Then they can be called inside the function code below. If no parameters are needed, the brackets are left empty. If the function should return a result, the `return` keyword is used. The `end` marks the end of the function. All code between `function` and `end` belongs to the function. + +An exemplaric function call looks like this: + +```lua +multiply(5, 21) +``` + +When working with Teal, the parameter and return value types are assigned with `: `. + +```lua +local function functionname(parametername1: number, parametername2: number): number + -- code + return resultname +end +``` + +### Types + +The basic types used in Teal are: + +* `any` undefined type similar to lua default behavior +* `nil` +* `boolean` +* `integer` positive and negative full numbers +* `number` any decimal number. +* `string` + +### Variables + +Variables can be used to temporarily store some values or data structs in code. + +```lua +--define variable +local variablename +Β  +--define and write variable +local variablename = -- content +Β  +--override variable +variablename = -- new content +``` + +To define a variable, the keyword `local` followed by an identifier is used. Transport Fever 3 does not support global variables, thus `local` is mandatory! +A variable can be filled with content by using the keyword `=` followed by the content. +To read content from a variable, simply call the variable by its name. + +As with the functions, variables are typed in Teal: + +```lua +--define variable +local variablename: number +``` + +### Data Structs / Arrays + +In many places of Transport Fever 3, data structs are used to store more than single values or key-value paired contents. They are called **arrays** or **tables** too. + +#### Structs with Keys + +Most of the configurational data in Transport Fever uses keys for the different properties. + +```lua +local structname = { + key1 = value1, + key2 = value2, + key3 = value3, + -- ... +} +``` + +These values later can be called by using `structname.keyname`, e.g. `structname.key2`. +To add a new key at a later point, use `structname[key] = value`. + +In Teal, these structs are defined as a `record`: + +```lua +local record ExampleParams + record ExampleChildRecord + exampleChildValue : number + end +Β  + exampleFunction : function(paramName: number) : number + exampleValue : string +end +``` + +These records may then be referenced as types for parameters, return types or other data structs. + +#### Structs without Keys + +In many cases, the storage of a list of similar contents is needed. + +```lua +local array = { value1, value2, value3 } +``` + +These values later can be called by using an index number. These structs are one-indexed, meaning the first index is 1. The total number of values can be gathered by using `#variablename`. In the above example, `#array` would return 3 and the indices 1,2 or 3 could be used. + +### Loops + +There are several solutions for looping code. The two common ones are while- and for-loops. + +#### while + +A while loop checks a condition and loops as long as the condition returns true + +```lua +while condition do --condition could be something like #result < 10 + -- looped code +end +``` + +#### for + +A for loop has an index that counts the number of loop runs. It's exit condition is determined by comparing the index to an end value + +```lua +for i = startvalue, endvalue, stepwidth do + -- looped code +end +``` + +The index starts with the startvalue and is modified by stepwidth every time it finishes a loop run. if stepwidth is omitted, the step is 1. As soon as the index is greater or equal to the endvalue, no new loop runs are started. + +To iterate over all key-value pairs in a struct, it is possible to use the `pairs` function: + +```lua +for k,v in pairs(t) do + -- looped code +end +``` + +In the looped code, the key can be used with `k` and the value can be used with `v`. + +### Conditionals + +To skip some code under certain circumstances, conditionals are used. + +```lua +if condition then + -- some code +elseif othercondition then + -- some other code +else + -- some default code +end +``` + +If the condition applies, some code is executed. Otherwise optional other conditions are checked. If no condition applies, optionally the default code applies. Otherwise the execution jumps below the `end`. + +### Operators + +In conditions as well as in some codes, operators are used for mathematical operations or compares. There are several other operators as well. + +#### Mathematical Operators + +* `+` for addition +* `-` for subtraction +* `*` for multiplication +* `/` for division +* `%` for modulo +* `^` for exponentiation + +#### Comparators + +* `==` equal +* `!=` not equal +* `~=` not equal +* `<` less +* `>` greater +* `⇐` less or equal +* `>=` greator or equal + +#### Logic + +* `and` +* `or` + +#### String Concatenation + +* `..` to combine strings: `"string a " .. "string b"` results in `"string a string b"` + +### Imports + +Some files use functions from other script files. These can be imported: + +```lua +-- import +local scriptvariablename = ug_require "::/scripts/scriptname.lua" +Β  +-- use +scriptvariablename.functionname(parameter) +``` + +The file path for the imported script follows the pattern described on the page about [resource types](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes#file_names_references "modding:general:resourcetypes"). diff --git a/docs/reference/wiki/modding_introduction.md b/docs/reference/wiki/modding_introduction.md new file mode 100644 index 0000000..bf7a380 --- /dev/null +++ b/docs/reference/wiki/modding_introduction.md @@ -0,0 +1,76 @@ + + +### Table of Contents + +* [Typical Use Cases](#typical_use_cases) + + + [Repaints of existing vehicle models](#repaints_of_existing_vehicle_models) + + [New vehicle or asset models](#new_vehicle_or_asset_models) + + [Add new constructions with parameters](#add_new_constructions_with_parameters) + + [Change config values by mod](#change_config_values_by_mod) + + [Rebalance existing models](#rebalance_existing_models) +* [Hello Modding-World](#hello_modding-world) + + + [Demo Asset](#demo_asset) + + [Demo Config Change](#demo_config_change) + +# Introduction + +While the vanilla game of Transport Fever 3 provides the player with a great number of models and content from different regions of the world, some people prefer to extend the variety further by adding more content. Others like to tweak some game mechanics or to alter some configurations to better suite their style of gameplay. The modding support of Transport Fever 3 reaches from the addition of new model content over the altering of existing contents to the scripting possibilities which reach deep into the game mechanics. + +It is not recommended to adjust the files in the installation directory of Transport Fever 3! Instead, a mod should be created. From a file system perspective, a mod is simply a directory containing all the necessary data and script files. If you like to setup your own mod, look at the two examples at the bottom of this page or the [mod definition](https://wiki.transportfever3.com/doku.php?id=modding:general:moddefinition "modding:general:moddefinition") description. Read more for the [syntax](https://wiki.transportfever3.com/doku.php?id=modding:general:syntax "modding:general:syntax") and the [common resource types](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes "modding:general:resourcetypes"). + +Working mods can be [shared](https://wiki.transportfever3.com/doku.php?id=modding:general:publishing "modding:general:publishing") to other users. + +## Typical Use Cases + +Below are some typical use cases for mods with varying degrees of difficulty. Please note, that mods are not restricted to one of these possibilities, but can be a combination of more than one or go beyond them in many ways. + +### Repaints of existing vehicle models + +For many vehicles there are lots of color variations out there in the real world. As somebody who is not familiar with 3D modelling, this kind of mod might be a way to get into vehicle modding. Further information on this topic can be found in the [manual for vehicle repaints](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:repaints "modding:vehicles:repaints"). + +### New vehicle or asset models + +Both vehicles as well as static models like decorative assets mainly focus on 3D modelling and texturing. The amount of coding needed to get those contents into the game are very limited, thus it's a good entry point for interested people with less coding affinity. People interested in vehicle modding can find some details in the [vehicle modding section](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:basics "modding:vehicles:basics"). For assets, a simple example can be found below. + +### Add new constructions with parameters + +As single static models might not cover every needs for decoration, the possibility to add parameters is one step further into scripting. Models might get rotated or scaled, different models get added depending on the users choice, … the possibilities are almost endless, but the needed information can be found in the [construction section](https://wiki.transportfever3.com/doku.php?id=modding:constructions:basics "modding:constructions:basics"). + +### Change config values by mod + +A lot of basic configurations can be altered by simple mods. The amount of script code needed is very limited and the 3D models and textures do not need to be touched. An example for this type of mod can be found below. + +### Rebalance existing models + +If desired, certain or all vehicles can be adapted in the same way, e.g. to increase the capacity equally without manually modifying the source files. The details for resource modifiers are located in the [scripting section](https://wiki.transportfever3.com/doku.php?id=modding:scripting:modifiersfilters "modding:scripting:modifiersfilters"). + +## Hello Modding-World + +Here are two exemplaric demo mods which show small examples of what can be modded for Transport Fever 3. + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=300&tok=ba8b95&media=modding:introduction:demo_asset.png) + +### Demo Asset + +This demo adds the Transport Fever logo as an asset to the game. It can be placed ingame. +The minimal setup for a static 3D model in Transport Fever consist of three parts: + +* [''mod.json''](https://wiki.transportfever3.com/doku.php?id=modding:general:moddefinition#modjson "modding:general:moddefinition") and [''\_metadata/modinfo.json''](https://wiki.transportfever3.com/doku.php?id=modding:general:moddefinition#modinfojson "modding:general:moddefinition") for the setup of the mod itself +* a 3D model with [''.msh''](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:msh "modding:general:resourcetypes:msh"), [''.mdl''](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl "modding:general:resourcetypes:mdl") and [textures](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes#texture_files "modding:general:resourcetypes") for the content +* [''.con.lua''](https://wiki.transportfever3.com/doku.php?id=modding:constructions:basics "modding:constructions:basics") and [''.script.lua''](https://wiki.transportfever3.com/doku.php?id=modding:constructions:basics#update_script "modding:constructions:basics") for the scripting as a placeable asset. + +You can [download](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:introduction:ug_tf3_example_asset.zip "modding:introduction:ug_tf3_example_asset.zip (2Β MB)") the mod for further investigation. This mod includes a simplified asset construction based on the `assetbuilderutil`, too. + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=300&tok=a4e9c3&media=modding:introduction:demo_config_change.png) + +### Demo Config Change + +This demo overrides a config value from the [base config](https://wiki.transportfever3.com/doku.php?id=modding:scripting:baseconfig "modding:scripting:baseconfig") to force trains to start breaking earlier. +The minimal setup for a mod that changes a base config value consists just of the first part: + +* [''mod.json''](https://wiki.transportfever3.com/doku.php?id=modding:general:moddefinition#modjson "modding:general:moddefinition") and [''\_metadata/modinfo.json''](https://wiki.transportfever3.com/doku.php?id=modding:general:moddefinition#modinfojson "modding:general:moddefinition") for the setup of the mod itself +* `mod.script.tl` for the script function that changes the config + +You can [download](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:introduction:wiki_example_config_change.zip "modding:introduction:wiki_example_config_change.zip (1.8Β KB)") the mod for further investigation. diff --git a/docs/reference/wiki/modding_scripting_api.md b/docs/reference/wiki/modding_scripting_api.md new file mode 100644 index 0000000..1923b46 --- /dev/null +++ b/docs/reference/wiki/modding_scripting_api.md @@ -0,0 +1,9 @@ + + +# API Reference + +The `api` resources that can be accessed in game scripts and other areas of scripting are documented in the **API Reference**. This reference is not yet complete but will be expanded in the near future. + +It is recommended to use the [console](https://wiki.transportfever3.com/doku.php?id=modding:tools:ingame#console "modding:tools:ingame") to test commands. To get debug output of table structures, you may use `debugPrint()`. + +[Scripting Reference](https://wiki.transportfever3.com/script-doc/ "https://wiki.transportfever3.com/script-doc/") diff --git a/docs/reference/wiki/modding_scripting_baseconfig.md b/docs/reference/wiki/modding_scripting_baseconfig.md new file mode 100644 index 0000000..87e55c7 --- /dev/null +++ b/docs/reference/wiki/modding_scripting_baseconfig.md @@ -0,0 +1,192 @@ + + +### Table of Contents + +* [Config variables](#config_variables) + +This page is not yet adapted for Transport Fever 3. The content may be outdated. + +# Base Config + +Global properties that are relevant for the simulation and gameplay aspects are defined in the `config` struct. It's initial values are loaded from the `base_config.lua` file in the `res/config/` folder. + +To set new values for the properties, call: + +* `game.config. = ` in the `runFn` function. +* `api.res.getBaseConfig(). = ` in the `postRunFn` function. + +To read values from the properties, call: + +* `game.config.` in the `runFn` function. +* `api.res.getBaseConfig().` in `postRunFn` or game scripts. + +Calling `game.config.` outside of the `runFn` will respond with outdated data and should not be used. + +## Config variables + +| Property | Default Value | Description | +| --- | --- | --- | +| Costs (not available with getBaseConfig()) | | | +| cost.terrainRaise | 0.75 \* 6.0 | Cost per mΒ³ to raise the land | +| cost.terrainLower | 0.75 \* 7.0 | Cost per mΒ³ to lower the land | +| cost.railroadCatenary | 0.3 | Fraction of track building cost for catenary construction | +| cost.roadBusLane | 0.1 | Fraction of street building cost for bus lane construction | +| cost.roadTramLane | 0.2 | Fraction of street building cost for tram lane construction | +| cost.roadElectricTramLane | 0.4 | Fraction of street building cost for electric tram lane construction | +| cost.bulldozeRefundTimeOut | 60 | Time after construction, in which a certain fraction of the building costs is refunded | +| cost.bulldozeRefundFactor | 0.75 | Fraction of construction cost that is refunded while still in time | +| cost.removeField | 200000 | Bulldozing cost for removal of farm fields. | +| Construction Function (not available with getBaseConfig()) | | | +| ConstructWithModules | | Function that is called for every construction during placement. See the [explanation of constructions](https://wiki.transportfever3.com/doku.php?id=modding:constructions:modular#method_cycle "modding:constructions:modular") for more information. | +| Scaffolding (not available with getBaseConfig()) | | | +| scaffold..scaffold | | List with two model references relative to `res/models/`. The first references the normal scaffolding element, the second is a reference to an element with a ladder. | +| scaffold..crane | | List with five models that are used to construct the crane that is displayed during town building construction. | +| Terrain Tools | | | +| terrainToolMinStrength | 5 | Minimum limit of the strength slider | +| terrainToolMaxStrength | 100 | Maximum limit of the strength slider | +| terrainToolMaxSize | 16 | Maximum terrain tool size in game (large values may result in performance issues!) | +| terrainPainterMaxSize | 256 | Maximum paint tool size in game | +| terrainToolMaxSizeEditor | 256 | Maximum terrain tool size in map editor | +| terrainPainterMaxSizeEditor | 256 | Maximum paint tool size in map editor | +| assetBrushMaxSize | 256 | Maximum asset brush tool size | +| GUI | | | +| gui.layers.defaultColors.baseTerrainColor | { 0.82, 0.82, 0.82, 1.0 } | The default terrain color used in most data layers. | +| gui.layers.defaultColors.baseWaterColorFactors | { 0.5, 0.5, 0.5, 0.25 } | A vector of four factors that alter the default water color relative to the baseTerrainColor property. | +| gui.layers.defaultColors.entityColorFactor | 0.33 | Factor that darkens streets, tracks & bridges. | +| gui.layers.contourLines.numLevels | 6 | Number of color levels of the contour lines data layer. | +| gui.layers.contourLines.baseTerrainColor | { 0.82, 0.82, 0.82, 1.0 } | Base color that is used for the contour lines layer. | +| gui.layers.contourLines.baseEntityColor | { 1.0, 1.0, 1.0, 1.0 } | Color that is used for buildings, vehicles, rocks and trees. | +| gui.layers.contourLines.terrainMinColor | {.82,.82,.82,1 } | Color that is used for the lowest terrain level. | +| gui.layers.contourLines.terrainMaxColor | {.235,.54,.25,1 } | Color that is used for the highest terrain level. | +| gui.layers.contourLines.waterColor | {.47, .64, .76, 1.0 } | Color that is used for the water. | +| gui.layers.contourLines.contours | | A list of 4 contour line definitions with different names, colors, levels, widths and fade out distances. | +| gui.layers.navigableWaters.baseEntityColor | { 1.0, 1.0, 1.0, 1.0 } | Color that is used for buildings, vehicles, rocks and trees. | +| gui.layers.navigableWaters.navigableWaterColor | { 0.435, 0.827, 0.380, 1.0} | Color that is used for navigable waters. | +| gui.layers.navigableWaters.baseWaterColor | { 0.318, 0.494, 0.600, -0.85} | Color that is used for non-navigable waters. The negative alpha value indicates that the color is drawn underneath the navigable water color. | +| gui.layers.landUse.baseEntityColor | { 1.0, 1.0, 1.0, 1.0 } | Color that is used for buildings, vehicles, rocks and trees. | +| gui.layers.landUse.residentialColors | | A list of 2 colors that are used for the residential buildings. The first is the minimum color, used for level 1 buildings, the second is the maximum color, used for level 4 buildings. | +| gui.layers.landUse.commercialColors | | Like above but for commerical buildings. | +| gui.layers.landUse.industrialColors | | Like above but for industrial buildings. | +| gui.layers.trackSpeedLimits.baseEntityColor | { 1.0, 1.0, 1.0, 1.0 } | Color that is used for buildings, vehicles, rocks and trees. | +| gui.layers.trackSpeedLimits.numLevels | 5 | Number of color levels of the speed limits data layer. | +| gui.layers.trackSpeedLimits.tunnelOutlineSize | 2.0 | Size of the tunnel outline. | +| gui.layers.trackSpeedLimits.tunnelOutlineColor | { 0.0, 0.0, 0.0, 0.3 } | Color that is used for the tunnel outline. | +| gui.layers.trackSpeedLimits.speedLimitColors | | A list of 3 colors that are used for the track speed limits. The first color is used for very bad speeds, the second for neutral speeds and the third for very good speeds. | +| gui.layers.destinations.baseEntityColor | { 1.0, 1.0, 1.0, 1.0 } | Color that is used for buildings, vehicles, rocks and trees. | +| gui.layers.destinations.residentialColor | { 0.4, 0.4, 0.4, 1.0 } | Color that is used for residential buildings. | +| gui.layers.destinations.destinationColor | { 1.0, 1.0, 1.0, 1.0 } | Color that is used for destinations. | +| gui.layers.destinations.publicTransportColors | | A list of 2 colors that are used for public transport. The first is the minimum color, the second is the maximum color. | +| gui.layers.destinations.privateTransportColors | | Like above but for private transport. | +| gui.layers.destinations.numTransportLevels | 5 | Number of color levels of the destinations data layer. | +| gui.layers.cargo.baseEntityColor | { 1.0, 1.0, 1.0, 1.0 } | Color that is used for buildings, vehicles, rocks and trees. | +| gui.layers.cargo.transportColors | | A list of 2 colors that are used for transport routes. The first is the minimum color, the second is the maximum color. | +| gui.layers.cargo.residentialColors | | A list of 2 colors that are used for residential buildings. The first is the minimum color, the second is the maximum color. This property does not have an effect unless there are residential buildings that accept cargo. | +| gui.layers.cargo.commercialColors | | A list of 2 colors that are used for commercial buildings. The first is the minimum color, the second is the maximum color. | +| gui.layers.cargo.industrialColors | | Like above but for industrial buildings. | +| gui.layers.cargo.numTransportLevels | 5 | Number of color levels for transport routes. | +| gui.layers.cargo.numBuildingLevels | 3 | Number of color levels for the buildings. | +| gui.layers.stations.baseEntityColor | { 1.0, 1.0, 1.0, 1.0 } | Color that is used for buildings, vehicles, rocks and trees. | +| gui.layers.stations.stationColors | | A list of 3 colors that are used for the stations. The first color is used for very overloaded stations, the second for neutral stations and the third for very good stations. | +| gui.layers.stations.numLevels | 5 | Number of color levels of the stations data layer. | +| gui.layers.streetTraffic.baseEntityColor | { 1.0, 1.0, 1.0, 1.0 } | Color that is used for buildings, vehicles, rocks and trees. | +| gui.layers.streetTraffic.trafficColors | | A list of 3 colors that are used for the streets. The first color is used for very congested streets, the second for neutral streets and the third for very good streets. | +| gui.layers.streetTraffic.numLevels | 5 | Number of color levels of the street traffic data layer. | +| gui.layers.emissions.baseTerrainColor | { 0.82, 0.82, 0.82, 1.0 } | The terrain color used in the emissions data layer. | +| gui.layers.emissions.baseEntityColor | { 1.0, 1.0, 1.0, -1.0 } | Color that is used for buildings, vehicles, rocks and trees. The negative alpha value indicates that the color is drawn underneath the emissions color. | +| gui.layers.emissions.residentialColor | { 0.4, 0.4, 0.4, 1.0 } | Color that is used for residential buildings. | +| gui.layers.emissions.emissionColors | | A list of 2 colors that are used for emissions. The first is the minimum color, the second is the maximum color. | +| gui.layers.emissions.numLevels | 17 | Number of color levels of the emissions data layer. | +| gui.signConfig.signRenderDistance | 1500 | The distance from which number signs, used in speed limits, destinations and cargo data layers, are shown. | +| gui.signConfig.signBackgroundTintColor | { 1.0, 1.0, 1.0, 1.0 } | Color that is used to tint the background of these number signs. The color is multiplied with the texture color of res/textures/ui/traffic\_sign\_min.tga. Only has an effect, if the background texture has a non-black color. | +| gui.signConfig.signTextColor | { 0.9, 0.9, 0.9, 1.0 } | Color that is used for the text in these number signs. | +| gui.iconRenderDistances | | Far limit scale for rendering of specific HUD icon types. | +| gui.defaultChartColors | | A list of base colors that are used for the statistical charts. | +| gui.incomeCostsChartColors | | A list of 2 colors that are used for the income and cost chart. | +| gui.loadedUnloadedChartColors | | A list of 2 colors that are used for the chart with transported items. | +| gui.landUseChartColors | | A list of 3 colors that are used for the land use chart. | +| gui.lineColors | | A list of colors that is used for the transport lines. | +| gui.modifierColors | | A list of 8 colors that are used for the track and street modifiers. There are 4 values each for enabled and disabled state in certain situations. | +| Audio | | | +| audio.environment.lake | | Name of the sound file that should be used for lake areas and reference distance in which the sound can be heard at full volume. | +| audio.environment.birds | | Like above for area with birds. | +| audio.environment.forest | | Like above for forest areas. | +| audio.environment.meadow | | Like above for meadow areas. | +| audio.environment.mountain | | Like above for mountain areas. | +| audio.environment.commercial1850 | | Like above for commercial buildings in era a. | +| audio.environment.commercial1920 | | Like above for commercial buildings in era b. | +| audio.environment.commercial1990 | | Like above for commercial buildings in era c. | +| audio.environment.industrial1850 | | Like above for industrial buildings in era a. | +| audio.environment.industrial1920 | | Like above for industrial buildings in era b. | +| audio.environment.industrial1990 | | Like above for industrial buildings in era c. | +| audio.environment.residential1850 | | Like above for residential buildings in era a. | +| audio.environment.residential1920 | | Like above for residential buildings in era b. | +| audio.environment.residential1990 | | Like above for residential buildings in era c. | +| audio.environment.crowd | | Like above for areas with many people. | +| audio.environment.traffic1850 | | Name of the sound file that should be used for traffic in era a and reference distance and height in which the sound can be at full volume. | +| audio.environment.traffic1920 | | Like above for traffic in era b. | +| audio.environment.traffic1990 | | Like above for traffic in era c. | +| audio.environment.atmosphere | | Name of the sound file that should be used when the camera is far away from ground and reference distance in which the sound can be at full volume. | +| Locations | | | +| locations.town.maxNumberPerArea | 0.2 | Number of towns per kmΒ² (by default overridden based on map settings) | +| locations.town.allowInRoughTerrain | false | Allows towns in steeper regions of the map | +| locations.industry.absoluteMinimum | 5 | Minimum number of industries on the map | +| locations.industry.maxNumberPerArea | 0.8 | Number of industries per kmΒ² on map creation (by default overridden based on map settings) | +| locations.industry.targetMaxNumberPerArea | 0.8 | Target number of industries per kmΒ² over time (by default overridden based on map settings) | +| locations.makeInitialStreets | true | Builds the initial street network on map creation | +| Animals | | | +| animal.populationDensityMultiplier | 1 | All population densities (in kmΒ²) are multiplied by this value | +| animal.useLocalSpawning | true | If set to `true`, spawning is done in subgrids of size 'localTileSize'. This results in a distribution that is closer to the chosen density but less uniform | +| animal.localTileSize | 1000 | Size of local spawning grid | +| animal.notifyAnimalDespawn | true | Play a notification when animal despawns | +| Geometry Quality | | | +| settings.geometryQualityOptions | | This list contains 5 elements which each represent one distance level from the camera (Low, Medium, High, Camera Tool, Cockpit View). Each of the levels has 3 properties. Keep in mind that extending the ranges may have a heavy impact on the rendering performance! | +| `viewNearFar` for the render limits in the area near the camera and far away. | +| `fogStartEndFarPerc` for the start and end factors of the fog that appears in distance. | +| `lodDistanceScaling` for the scaling of the distance influence on LOD choosing for models. | +| Particles | | | +| particles.textures | | Texture references for smoke particles | +| water.textures | | Texture references for water foam particles | +| Economy | | | +| economy.industryDevelopment.spawnTargetTimeSpan | 50 \* 365.25 \* 2000 | Time span on which the industry spawning is projected | +| economy.industryDevelopment.spawnProbabilityExponent | 3.0 | Probability exponent for industry spawning | +| economy.industryDevelopment.spawnIndustries | false | Enables/Disables industry spawning (by default overridden based on map settings) | +| economy.industryDevelopment.closureCountdownTimeSpan | 730.5 \* 2000 | Time span between notification and actual closure | +| economy.industryDevelopment.closureProbability | 1 | Probability exponent for industry closure (by default overridden based on map settings) | +| economy.townDevelopment.cargoNeedsPerTown | 2 | Probability exponent for industry closure (by default overridden based on map settings) | +| Advanced options | | | +| advancedOptions.maximumLoanScale | 1.0 | Scales the maximum amount of money that can be borrowed from the bank. (by default overridden based on map settings) | +| advancedOptions.loanInterestScale | 1.0 | Scales the height of the interest rate for a loan. (by default overridden based on map settings) | +| advancedOptions.publicTransportDestinationsSensitivityScale | 1.0 | Scales the influence of reachable destinations by public transport on town growth. (by default overridden based on map settings) | +| advancedOptions.privateTransportDestinationsSensitivityScale | 1.0 | Scales the influence of reachable destinations by private transport on town growth. (by default overridden based on map settings) | +| advancedOptions.cargoSupplySensitivityScale | 1.0 | Scales the influence of the cargo supply rating on town growth. (by default overridden based on map settings) | +| advancedOptions.emissionSensitivityScale | 1.0 | Scales the influence of emissions around town buildings on town growth. (by default overridden based on map settings) | +| advancedOptions.trafficSpeedSensitivityScale | 1.0 | Scales the influence of traffic slowdowns on town growth. (by default overridden based on map settings) | +| advancedOptions.stationOverflowSensitivityScale | 1.0 | Scales the influence of overcrowded passenger stations on town growth. (by default overridden based on map settings) | +| Misc | | | +| environment | "temperate.lua" | Default environment | +| climate | "temperate.clima.lua" | Default climate | +| terrain.lodErrorMultiplier | 1 | Factor influencing the terrain simplification threshold | +| nameList.folder | "" | Names list folder reference | +| loadspeedPenaltyForTrainOverlength | true | Enables load speed penalty for trains which are longer than the platform | +| earnAchievementsWithMods | false | Enables achievements even with mods | +| industryButton | false | Enables the industry button in free game | +| sandboxButton | false | Enables the sandbox button (to build towns) in free game | +| difficulty | "EASY" | Default difficulty level | +| noCosts | false | disables all costs | +| enforceMainConnections | true | checks if main connections are interrupted and throws warnings | +| townDevelopInterval | 60 | Number of half days after which the town will be adjusted (grow or shrink) | +| chargeMaintenanceInterval | 60 | Length of interval in half days after which the maintenance fees will be charged | +| simulateCargoWeight | true | Simulates the weight of loaded cargo | +| simPersonDestinationRecomputationProbability | 1.0 | The probability that a person will look for a new job or shopping facility. Smaller values reduce performance load. Larger values will adapt to changes in the offered public transport faster. | +| townMajorStreetAngleRange | 0 | Angle of default town crossings. 0 results in parallel streets without curves in town. | +| townInitialMajorStreetAngleRange | 0 | The same, but only during first creation of a town. | +| tramCatenaryYearFrom | 1875 | Start date of tram catenaries | +| trackCatenaryYearFrom | 1910 | Start date of rail catenaries | +| busLaneYearFrom | 1925 | Start date of bus lanes | +| maxVehicleCloneAmount | 50 | Maximum number of vehicles that can be cloned at once. Only used for console edition. | +| trainAccelerationFactor | 1.0 | Global acceleration factor | +| trainBrakeDeceleration | 2.5 | Global deceleration factor. Lower values will result in slower deceleration. | + +[Scripting Basics](https://wiki.transportfever3.com/doku.php?id=modding:scripting:basics "modding:scripting:basics") + +[Modifiers & Filters](https://wiki.transportfever3.com/doku.php?id=modding:scripting:modifiersfilters "modding:scripting:modifiersfilters") diff --git a/docs/reference/wiki/modding_scripting_missions.md b/docs/reference/wiki/modding_scripting_missions.md new file mode 100644 index 0000000..7a4cdeb --- /dev/null +++ b/docs/reference/wiki/modding_scripting_missions.md @@ -0,0 +1,344 @@ + + +### Table of Contents + +* [Campaign File](#campaign_file) +* [Mission Folder](#mission_folder) + + + [info.mission.lua](#infomissionlua) + + [savegame.sav](#savegamesav) + + [mission.tl](#missiontl) +* [Mission Scripting](#mission_scripting) +* [Mission Tasks](#mission_tasks) + + + [Task Scripts](#task_scripts) + +# Missions + +Transport Fever 3 ships with one [campaign](https://wiki.transportfever3.com/doku.php?id=gamemanual:gamemodes:campaign "gamemanual:gamemodes:campaign"). For modders, it is possible to provide additional campaigns or single missions. These are then available over CAMPAIGN in the main menu. + +Each campaign consists of several missions. + +### Campaign File + +The campaign file is must carry the suffix `.campaign.lua`. The file can be placed either in a mission mod file or within a separate mod. +It should have the following content specified: + +```lua +function data() +return { + name = _("CAMPAIGN_NAME"), + icon = "campaign.tga", + description = _("CAMPAIGN_DESC"), + order = 1, + unlockingProgression = true, +} +end +``` + +The properties are: + +* `name` for the title of the campaign that is displayed in the campaign selection menu. +* `icon` for the image button that is used to select the campaign. The double sized `@2x.tga` image should have a resolution of 675 Γ— 1080 pixels. +* `description` for the descriptive text in the campaign selection menu. +* `order` for the sort order in the campaign selection menu. The vanilla campaigns have place 1. +* `unlockingProgression` whether all missions are unlocked or if the next mission must be unlocked by achieving at least one star. + +### Mission Folder + +Inside each mission folder should consist of the following files, which we will explain one after the other: + +* `info.mission.lua` specified the metadata of the mission +* `savegame.sav` the actual savegame +* `mission.res.lua` entry point for the overall mission simulation script in the base game +* `mission.script.lua` entry point for the specific mission script +* `mission.tl` actual implementation of the mission +* `mission_story.tl` task logic of the mission + +#### info.mission.lua + +```lua +function data() + return { + name = _("MISSION_01_NAME"), + description = _("MISSION_01_DESC"), + image = "/gui/mission/m01_preview.tga", + imagePreview = "/gui/mission/m01_preview2.tga", + imageSuccess = "/gui/mission/m01_suc.tga", + imageFailure = "/gui/mission/m01_fail.tga", + languageScript = "urbangames_campaign_mission_01::/mission/keyframes/languages.script@get", + loadscreen = "/gui/mission/m01_loadscreen.tga", + loadscreenDescription = _("MISSION_01_LOADSCREEN"), + loadscreenVoiceOver = "/audio/voice_over/MISSION_01_LOADSCREEN.wav", + savegame = "/savegames/savegame.sav", + starsDescription = _("MISSION_01_STARS_INFO"), + stars = { + { + id = "MISSION_01_STAR_1", + name = _("MISSION_01_STAR_1"), + iconLocked = "::/gui/menu/icons/star_1.tga", + iconCompleted = "::/gui/menu/icons/star_1.tga", + }, + { + id = "MISSION_01_STAR_2", + name = _("MISSION_01_STAR_2"), + iconLocked = "::/gui/menu/icons/star_2.tga", + iconCompleted = "::/gui/menu/icons/star_2.tga", + }, + { + id = "MISSION_01_STAR_3", + name = _("MISSION_01_STAR_3"), + iconLocked = "::/gui/menu/icons/star_3.tga", + iconCompleted = "::/gui/menu/icons/star_3.tga", + }, + }, + medals = { + { + id = "MISSION_01_MEDAL_1", + name = _("MISSION_01_MEDAL"), + nameLocked = _("MISSION_01_MEDAL_LOCKED"), + iconLocked = "::/gui/menu/icons/star_1.tga", + iconCompleted = "::/gui/menu/icons/star_1.tga", + }, + }, + characters = { + { + name = _("MISSION_01_CHARACTER_1_NAME"), + info = _("MISSION_01_CHARACTER_1_INFO"), + portrait = "urbangames_campaign_mission_01::/mission/dialogue/major_neutral.tga", + }, + { + name = _("MISSION_01_CHARACTER_2_NAME"), + info = _("MISSION_01_CHARACTER_2_INFO"), + portrait = "urbangames_campaign_mission_01::/mission/dialogue/katie_baker_neutral.tga", + }, + { + name = _("MISSION_01_CHARACTER_3_NAME"), + info = _("MISSION_01_CHARACTER_3_INFO"), + portrait = "urbangames_campaign_mission_01::/mission/dialogue/andrew_neutral.tga", + }, + }, + location = _("MISSION_01_LOCATION"), + year = 1906, + campaign = "urbangames_campaign::/info.campaign", + order = 1, + musicTracks = { + { "urbangames_campaign_mission_01::/audio/music/m1_intro.ogg", false }, + { "urbangames_campaign_mission_01::/audio/music/m1_theme_chapter_1.ogg", true }, + }, + } +end +``` + +Notable properties are: + +* `campaign` each mission must belong to a campaign +* `stars` required if you want to have a progress in your campaign +* `languageScript` required for dialogue tasks. At least one language should be supported + +#### savegame.sav + +You can either create a new game or use an existing savegame. Important is that the mission mod is active, when creating/loading the game so that the game scripts for the mission are loaded. Then you can save the game and copy the savegame to your mission folder. + +#### mission.tl + +This is the entry point for your mission. The mission interface is highly flexible, but as a starting point, we recommend this pattern here: + +```lua +local mission_boot_util = ug_require "::/mission/mission_boot_util.tl" as MissionBootUtil +local taskDataFactory = ug_require "mission_story.tl" as function(taskKey : string) : MissionTaskUtil.StaticTaskInfo +Β  +return mission_boot_util.makeMission({ + scriptKey = "urbangames_campaign_mission_01::/mission/mission.script", + taskDataFactory = taskDataFactory, + bootTasks = { + { taskKey = "your_first_task" }, + }, +}) +``` + +The `mission_story.tl` contains the entire logic of the mission and it contains a function that takes a key as an input and returns a mission task. +The bootTasks select all tasks that are triggered at the start of the mission. +These will be retrieved from the `mission_story.tl` file. + +## Mission Scripting + +Basically a mission is the combination of an orchestrating [game script](https://wiki.transportfever3.com/doku.php?id=modding:scripting:gamescripts "modding:scripting:gamescripts") and a savegame that is played on. + +### Mission Tasks + +Missions are just a sequence of tasks. These tasks can either be tasks that have to be completed by the player, or they can be executed in the background and can be completed by themselves when their internal logic is completed. + +#### Task Scripts + +Task scripts are the base of all tasks. These tasks have parameters that need to be specified in the `mission_story.tl` file and they are triggered sequentially. +Task scripts can define various methods in them. We show here only the most essential methods, and we refer to the source code for a complete definition. + +```lua + interface TaskScript + taskScriptName : string +Β  + -- prepare the initial state when attempting to spawn (return nil to prevent spawning) + onSpawn : function(TaskParams, guiTimeSeconds : number) : TaskSpecificState | nil +Β  + isComplete : function(state: TaskContext) : boolean +Β  + onUpdate : function(ctx : TaskContext, readOnlyApi : MissionTaskReadOnlyApi) + handleEvent : function(src : string, id : string, name : string, param : any, ctx : TaskContext, missionTaskApi : MissionTaskApi) : any + guiHandleEvent : function(src : string, id : string, name : string, param : any, ctx : TaskContext, taskApi : DeferredTaskApi) : any + guiUpdate : function(ctx : TaskContext, taskApi : DeferredTaskApi) + end +``` + +Here, we will focus on the most important ones: + +* Usually, each task has a completeness check: `isComplete`. If it returns true, the follow-up task is triggered and the task is completed. +* `onSpawn` initializes the task state, usually given the parameters specified in the story file. +* `onUpdate` is executed every simulation step. Here lies usually the main logic of the task. +* `guiUpdate` is executed in every frame +* `handleEvent` receives all game script events +* `guiHandleEvent` receives all gui events + +The `mission_story.tl` file registers each task with a unique key within the file. + +The base game already provides a variety of pre-defiend tasks in `::/mission/tasks/`. For example, there is the `buy_vehicle` task: + +```lua +global record MissionTaskBuyVehicle is MissionInterface.TaskScript + record Params + carrier : Carrier + cargoTypeRes : string + minCount : integer + allowBuyVehicles : {string: integer} + end + record State + result : {Engine.Entity} + purchasedVehicles : {string: integer} + end +end +``` + +This task takes as parameters: + +* `carrier` which carrier type the player is supposed to buy, e.g., road, rail, etc. +* `cargoTypeRes` the path to the cargo resource which the vehicle is supposed to be able to transport +* `minCount` the number of vehicles the player is supposed to buy +* `allowBuyVehicles` a map of resource paths to integer, which specified which vehicles are allowed to be bought in the vehicle store during this tasks lifetime + +The state is used by the task internally. + +For tasks that are to be completed by the player's action, usually some UI is wanted. In this case, the task info must be specified. Here, we display the essential fields. See the source code for the complete definition. + +```lua + record TaskInfo + record Paragraph + text : string + end + record Option + text : string + key : any + end +Β  + name : string + paragraphs : { Paragraph } + options : { Option } +Β  + instructionData : MissionDialogueData.InstructionData + end +``` + +The fields are: + +* `name` of the task +* `paragraphs` description of the task. First entry is the task description, follow up components are *hints*. +* `options` represent buttons the player can select in the mission UI +* `instructionData` a record that holds voice over/subtitle/portrait images + +In the `mission_story.tl` file, the task might be defined as follows: + +```lua + if taskKey == "buy_truck" then + return { + taskScript = buy_vehicle as MissionInterface.TaskScript, + taskParams : MissionTaskBuyVehicle.Params = { + carrier = api.type["enum"].Carrier.ROAD, + cargoTypeRes = "::/cargos/logs/logs.cargo", + }, + taskInfo = { + name = _("Buy a Truck"), + paragraphs = { + { text = _("Buy a truck that can transport logs.") }, + }, +Β  + }, + followup = { + { taskKey = "" }, + }, + } + end +``` + +We present one more example, that shows a branching point. The flow of the mission can be imagined as a directed graph. In this graph, branching points are allowed. The conditions can be given in the follow up definition. We present here the example where the player can choose between two different options `A` and `B`: + +```lua + if taskKey == "branching_point" then + return { + taskScript = page as MissionInterface.TaskScript, + showInHistory = true, + taskInfo = { + name = _("Branching point"), + paragraphs = { + { text = _("Make your decision") }, + }, + options = { + { text = _("Choose A"), key = "finish-a" }, + { text = _("Choose B"), key = "finish-b" }, + }, + }, + followup = { +Β  + { + taskKey = "a", + condition = function(ctx : MissionInterface.TaskContext) : boolean + if ctx.genericState.optionDecision == "finish-a" then + return true + end + end, + }, + { + taskKey = "b", + condition = function(ctx : MissionInterface.TaskContext) : boolean + if ctx.genericState.optionDecision == "finish-b" then + return true + end + end, + }, + } + } + end +``` + +Here we used the `page` task. This is an empty task that completes once the player selects a button in the mission window. + +To conclude this section, we explain how to end the mission. There are two possible endings: success and failure, defined by the `finish` task. + +```lua + if taskKey == "failure" then + return { + taskScript = finish as MissionInterface.TaskScript, + taskParams = { + success = false, + }, + } + end + if taskKey == "success" then + return { + taskScript = finish as MissionInterface.TaskScript, + } + end +``` + +**Takeaway** + +1. Functions in handlers operate on engine thread (api.gui unavailable, engine functions available) +2. Functions in guiHandlers operate on ui thread (api.gui available, engine functions unavailable) diff --git a/docs/reference/wiki/modding_scripting_modifiersfilters.md b/docs/reference/wiki/modding_scripting_modifiersfilters.md new file mode 100644 index 0000000..d0f2366 --- /dev/null +++ b/docs/reference/wiki/modding_scripting_modifiersfilters.md @@ -0,0 +1,156 @@ + + +### Table of Contents + +* [Resource Modifiers](#resource_modifiers) + + + [Example](#example) +* [File Filters](#file_filters) + + + [File Filter Util](#file_filter_util) + + [Example](#example1) + +This page is not yet adapted for Transport Fever 3. The content may be outdated. + +# Modifiers and Filters + +It is possible to modify and filter game resources from vanilla and mods by using resource modifiers and filters in the runFn function in mod.lua file. + +## Resource Modifiers + +Modifier functions allow to modify resources on the fly at the time they’re loaded. This is useful to edit the same value in multiple files. in fact, it’s much more convenient than copying and editing all affected files by hand. Furthermore, multiple modifiers can be added by different mods without one mod overriding the files of the other. + +A modifier is a function that receives two parameters: + +* `fileName` is the name of the resource file that might get modified. +* `data` is the content of the `data()` function in this file. + +The function should return the `data` unchanged or adjusted. + +To register a resource modifier, call `addModifier(category, fn)` where: + +* `category` is the category of resource file that this modifier should be applied to. +* `fn` is the modifier function explained above. + +Resource modifiers can be specified for the following categories: + +* `loadModel` +* `loadModule` +* `loadStreet` +* `loadTrack` +* `loadBridge` +* `loadTunnel` + +* `loadMultipleUnit` +* `loadRailroadCrossing` +* `loadTrafficLight` +* `loadConstruction` +* `loadConstructionCategory` +* `loadConstructionMenu` + +* `loadClimate` +* `loadEnvironment` +* `loadTerrainMaterial` +* `loadTerrainGenerator` +* `loadGrass` +* `loadGroundTex` + +* `loadCargoType` +* `loadSoundSet` +* `loadScript` +* `loadGameScript` + +### Example + +As an exemplaric use case, the following modifier function sets the speed limit of all bridges to 200%: + +```lua +local function bridgeModifier (fileName, data) + if data.speedLimit then + data.speedLimit = 2.0 * data.speedLimit + end +Β  + return data +end +Β  +addModifier( "loadBridge", bridgeModifier ) +``` + +## File Filters + +File filters filter the content of a directory, i.e. they define which files are visible to the game. Mods can install as many file filters as needed, and multiple file filters per category can be specified (to form a filter chain). + +A filter is a function that receives two parameters: + +* `fileName` is the name of the resource file that might get filtered. +* `data` is the content of the `data()` function in this file. + +The function should return `false` if the resource should be deactivated and `true` if the resource should not be deactivated. + +To register a file filter, call `addFileFilter(category, fn)` where: + +* `category` is the category of resource file that this filter should be applied to. +* `fn` is the filter function explained above. + +File filters can be specified for the following categories: + +* `model/vehicle` +* `model/person` +* `model/car` +* `model/rock` +* `model/tree` +* `model/other` + +* `multipleUnit` +* `street` +* `track` +* `bridge` +* `tunnel` +* `railroadCrossing` + +* `trafficLight` +* `environment` +* `construction` +* `module` +* `autoGroundTex` +* `groundTex` + +* `terrainGenerator` +* `terrainMaterial` +* `cargoType` +* `grass` +* `gameScript` +* `climate` + +### File Filter Util + +The `filefilterutil.lua` in `res/scripts/` provides various functions to help with file filtering: + +* `util.always` is a pass through filter that does not deactivate anything. +* `util.combineOr` is a function to combine the results of several file filters with an `or` condition. If any of the file filters returns `true`, the function returns `true`. +* `util.combineAnd` is a function to combine the results of several file filters with an `and` condition. If any of the file filters returns `false`, the function returns `false`. +* `package.base` is a file filter that tests if the resource is not part of a DLC or mod. +* `package.mod` is a file filter that tests if the resource is part of a mod. +* `package.baseOrMod` is a file filter that tests if the resource is part of the base game or a mod. +* `package.dlcOrMod` is a file filter that tests if the resource is part of a DLC or mod. +* `model` contains several additional file filters that test if the resource is a model of a certain type. + +### Example + +The following code installs a filter for vehicles which removes all non-steam-locomotives from the game. + +```lua +local function myFilter(fileName, data) + if data.metadata.railVehicle and data.metadata.railVehicle.engines and + #data.metadata.railVehicle.engines == 1 and data.metadata.railVehicle.engines[1].type ~= "STEAM" then + return false + end + return true +end +Β  +addFileFilter("model/vehicle", myFilter) +``` + +[Base Config](https://wiki.transportfever3.com/doku.php?id=modding:scripting:baseconfig "modding:scripting:baseconfig") + +[Game Scripts](https://wiki.transportfever3.com/doku.php?id=modding:scripting:gamescripts "modding:scripting:gamescripts") diff --git a/docs/reference/wiki/modding_start.md b/docs/reference/wiki/modding_start.md new file mode 100644 index 0000000..273ddf3 --- /dev/null +++ b/docs/reference/wiki/modding_start.md @@ -0,0 +1,98 @@ + + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:menubox_title_modding_manual.png) + +New here? Start with a brief [introduction](https://wiki.transportfever3.com/doku.php?id=modding:introduction "modding:introduction") into modding Transport Fever 3. + +Transport Fever 3 features full modding support, empowering the community to create, customize, and expand the experience in countless ways. Mods can be easily [shared](https://wiki.transportfever3.com/doku.php?id=modding:general:publishing "modding:general:publishing") and discovered through [mod.io](https://mod.io/g/transportfever3 "https://mod.io/g/transportfever3"), making it simple to connect creators and players across platforms. + +We're proud to run a Curated Mods Program, highlighting high-quality creations and supporting standout modders within the community. To help you bring your ideas to life, we provide dedicated modding tools and extensive documentation covering everything from getting started to advanced topics. + +Mods are a vital part of Transport Fever 3's ecosystem. They inspire innovation, extend longevity, and strengthen the community. We're incredibly grateful to every creator who contributes their time, talent, and passion. + +## General + +This chapter introduces the general concepts and fundamentals of Transport Fever 3 modding. It explains mod structure, loading behavior and the used resource types. + +* [Syntax](https://wiki.transportfever3.com/doku.php?id=modding:general:syntax "modding:general:syntax") +* [Mod Definition](https://wiki.transportfever3.com/doku.php?id=modding:general:moddefinition "modding:general:moddefinition") +* [Mod Parameters & Scripts](https://wiki.transportfever3.com/doku.php?id=modding:general:modscripts "modding:general:modscripts") +* [Resource Types & Structure](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes "modding:general:resourcetypes") +* [Models (.mdl)](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl "modding:general:resourcetypes:mdl") +* [Meshes (.msh)](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:msh "modding:general:resourcetypes:msh") +* [Materials (.mtl)](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mtl "modding:general:resourcetypes:mtl") +* [Guidelines & Requirements](https://wiki.transportfever3.com/doku.php?id=modding:general:guidelines "modding:general:guidelines") +* [Best Practices](https://wiki.transportfever3.com/doku.php?id=modding:general:bestpractice "modding:general:bestpractice") +* [Publish a mod](https://wiki.transportfever3.com/doku.php?id=modding:general:publishing "modding:general:publishing") + +## Tools + +Documentation of official and third-party tools relevant to the modding workflow. Covers their purpose and typical use cases. + +* [Model Editor](https://wiki.transportfever3.com/doku.php?id=modding:tools:modeleditor "modding:tools:modeleditor") +* Ingame Tools (Coming Soon) +* [Terrain Generator Editor](https://wiki.transportfever3.com/doku.php?id=modding:tools:terraingeneratoreditor "modding:tools:terraingeneratoreditor") +* [External Tools](https://wiki.transportfever3.com/doku.php?id=modding:tools:external "modding:tools:external") + +## Vehicles + +This chapter describes how vehicles are defined. It covers configuration files, models, animations, and gameplay-relevant parameters for all supported transport types. + +* [Vehicle Basics](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:basics "modding:vehicles:basics") +* [Vehicle Types](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:types "modding:vehicles:types") +* [Vehicle Advanced Topics](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:advancedtopics "modding:vehicles:advancedtopics") +* [Repaint Mods](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:repaints "modding:vehicles:repaints") + +## Constructions + +This chapter describes how constructions such as buildings and stations are defined. It covers configuration options, models, and in-game behavior. + +* [Construction Basics](https://wiki.transportfever3.com/doku.php?id=modding:constructions:basics "modding:constructions:basics") +* [Construction Menu](https://wiki.transportfever3.com/doku.php?id=modding:constructions:menu "modding:constructions:menu") +* [Construction Types](https://wiki.transportfever3.com/doku.php?id=modding:constructions:types "modding:constructions:types") +* [Modular Constructions](https://wiki.transportfever3.com/doku.php?id=modding:constructions:modular "modding:constructions:modular") +* [Construction Templates](https://wiki.transportfever3.com/doku.php?id=modding:constructions:templates "modding:constructions:templates") +* [Ground Textures](https://wiki.transportfever3.com/doku.php?id=modding:constructions:groundtextures "modding:constructions:groundtextures") + +## Infrastructure + +This chapter describes how streets, tracks, and other transport network elements are defined. It covers geometry, parameters, and gameplay behavior. + +* [Tracks and Streets](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:tracksstreets "modding:infrastructure:tracksstreets") +* [Bridges and Tunnels](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:bridgestunnels "modding:infrastructure:bridgestunnels") +* [Signals](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:signals "modding:infrastructure:signals") +* [Railroad Crossings](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:railroadcrossings "modding:infrastructure:railroadcrossings") +* [Traffic Lights](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:trafficlights "modding:infrastructure:trafficlights") +* [Edge Addons](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:edgeaddons "modding:infrastructure:edgeaddons") + +## Environment + +This chapter covers environment-related modding topics such as map generation, terrain materials, vegetation, and other world elements. + +* [Climate Zones](https://wiki.transportfever3.com/doku.php?id=modding:environment:climates "modding:environment:climates") +* [Environments](https://wiki.transportfever3.com/doku.php?id=modding:environment:environments "modding:environment:environments") +* [Terrain Generators](https://wiki.transportfever3.com/doku.php?id=modding:environment:terraingenerators "modding:environment:terraingenerators") +* [Terrain Materials](https://wiki.transportfever3.com/doku.php?id=modding:environment:terrainmaterials "modding:environment:terrainmaterials") +* [Animals](https://wiki.transportfever3.com/doku.php?id=modding:environment:animals "modding:environment:animals") +* [Landscape Assets](https://wiki.transportfever3.com/doku.php?id=modding:environment:landscapeassets "modding:environment:landscapeassets") + +## Misc + +Collection of miscellaneous reference material relevant to Transport Fever 3 modding. Covers features referenced across multiple chapters. + +* [Cargo Types](https://wiki.transportfever3.com/doku.php?id=modding:misc:cargo "modding:misc:cargo") +* [People](https://wiki.transportfever3.com/doku.php?id=modding:misc:people "modding:misc:people") +* [Shaders](https://wiki.transportfever3.com/doku.php?id=modding:misc:shaders "modding:misc:shaders") +* [Sound Sets](https://wiki.transportfever3.com/doku.php?id=modding:misc:soundsets "modding:misc:soundsets") +* [Playlists](https://wiki.transportfever3.com/doku.php?id=modding:misc:playlists "modding:misc:playlists") +* [Names](https://wiki.transportfever3.com/doku.php?id=modding:misc:names "modding:misc:names") +* [Localizations](https://wiki.transportfever3.com/doku.php?id=modding:misc:localizations "modding:misc:localizations") + +## Scripting + +Reference for scripting interfaces available to mods. Covers APIs, execution flow, and interaction with game systems. + +* [API Reference](https://wiki.transportfever3.com/doku.php?id=modding:scripting:api "modding:scripting:api") +* [Missions](https://wiki.transportfever3.com/doku.php?id=modding:scripting:missions "modding:scripting:missions") +* Game Scripts (Coming Soon) +* User Interface (Coming Soon) diff --git a/docs/reference/wiki/modding_tools_external.md b/docs/reference/wiki/modding_tools_external.md new file mode 100644 index 0000000..0edd395 --- /dev/null +++ b/docs/reference/wiki/modding_tools_external.md @@ -0,0 +1,127 @@ + + +### Table of Contents + +* [Scripting](#scripting) + + + [VS Code Setup](#vs_code_setup) + + - [Install Teal & Extensions](#install_teal_extensions) + - [Preparing Development Workspace](#preparing_development_workspace) + - [Adding your own Teal definitions](#adding_your_own_teal_definitions) +* [3D Modelling](#d_modelling) +* [Texturing](#texturing) + + + [DDS Export](#dds_export) +* [Custom Tools for Transport Fever 3](#custom_tools_for_transport_fever_3) + +# External Tools + +Every modder has individual preferences which programs he likes to use for modding. Here are some recommendations and hints on tools that are often used in the community. The list below is not exclusive, there are many other compatible programs. + +## Scripting + +The various [text based](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes#code_files "modding:general:resourcetypes") resouce types can be edited with almost any text editor. This reaches from *Microsoft Editor* to integrated development environments like *Eclipse*. Two commonly used text editors are: + +* **Visual Studio Code** is afree text editor that runs under Microsoft Windows, MacOS and Linux. It can be downloaded for free at [code.visualstudio.com](https://code.visualstudio.com/ "https://code.visualstudio.com/"). +* **Notepad++** is another free text editor for Microsoft Windows. It can open multiple tabs in several windows and has builtin Lua syntax highlighting. It can be downloaded for free at [notepad-plus-plus.org](https://notepad-plus-plus.org/ "https://notepad-plus-plus.org/"). + +### VS Code Setup + +To ease development of mods with VS Code, it is recommended to follow this setup guide. + +#### Install Teal & Extensions + +TEAL is an augmentation for LUA that provides additional features. When using TEAL, autocompletion and compile time type checking is possible also in LUA. Download it from the [official repository](https://github.com/teal-language/tl "https://github.com/teal-language/tl"). + +There are several helpful extensions for autocompletion and syntax highlighting: + +* [Lua by sumneko](https://marketplace.visualstudio.com/items?itemName=sumneko.lua "https://marketplace.visualstudio.com/items?itemName=sumneko.lua") +* [Teal by Patrick Desaulniers](https://marketplace.visualstudio.com/items?itemName=pdesaulniers.vscode-teal "https://marketplace.visualstudio.com/items?itemName=pdesaulniers.vscode-teal") + +After installing the Teal extension, go to the settings of the extension and configure the path to the Teal executable. + +#### Preparing Development Workspace + +To create the development workspace, start the [Model Editor](https://wiki.transportfever3.com/doku.php?id=modding:tools:modeleditor "modding:tools:modeleditor") once. It creates the following files in the Staging Area: + +* `tlconfig.lua` +* `workspace_def.lua` +* `.vscode/extensions.json` + +If this did not work, you can manually copy them from `/dev-workspace` and adjust `tlconfig.lua` to have proper folders set. + +To test the workspace setup, create an example script in your mod called `example.tl` and paste + +```lua +local function myFirstTealFunction() + log.warning("Hello World!") +end +``` + +You should be able to navigate to the definition of the `warning` function via CTRL and click or F12 or right click β†’ Go To Definition. + +#### Adding your own Teal definitions + +To add your own definitions, create `*.d.tl` files in your mod and add the folder of your mod in the `tlconfig.lua` and `workspace_def.tl`. + +As a trial run, you may + +1. uncomment `– "example_mod_1"` from both: `tlconfig.lua` and `workspace_def.tl` +2. add a file called `example_mod_1/example_mod_1.d.tl` with the following content: + +```lua +global record MyFirstRecord + myFirstField : string +end +``` + +Now you should be able to use it in the `example.tl`: + +```lua +local function myFirstTealFunction(aRecord : MyFirstRecord) + log.warning("Hello World : " .. aRecord.myFirstField) +end +``` + +## 3D Modelling + +Like with the text editors, there are plenty of available software solutions for 3D modelling. + +* **Blender** is a free allround software for 3D modelling, animation, … It supports bone animations too and bake texture maps like for ambient occlusion. Models exported as FBX may be imported with the [model editor](https://wiki.transportfever3.com/doku.php?id=modding:tools:modeleditor "modding:tools:modeleditor"). Blender can be downloaded at [www.blender.org](https://www.blender.org/ "https://www.blender.org/"). +* **Modo** is a payware 3D modelling software by Foundry. It's the software used by Urban Games to develop the content for Transport Fever 3. The FBX import into the model editor is suited for FBX files exported by Modo. As Foundry stopped the support for Modo, it is not recommended to use it for new mod projects anymore. +* **3ds Max** is a payware 3D modelling software by Autodesk. See [www.autodesk.de/products/3ds-max/overview](https://www.autodesk.de/products/3ds-max/overview "https://www.autodesk.de/products/3ds-max/overview") for more information. +* **Maya** is the other payware 3D modelling software by Autodesk. See [www.autodesk.de/products/maya/overview](https://www.autodesk.de/products/maya/overview "https://www.autodesk.de/products/maya/overview") for more information. +* **Cinema4D** is a payware 3D modelling software by Maxon. See [www.maxon.net/de/produkte/cinema-4d/](https://www.maxon.net/de/produkte/cinema-4d/ "https://www.maxon.net/de/produkte/cinema-4d/") for more information. + +As the payware tools have very expensive licenses, it's not recommended to invest in them if you are not an advanced user. Students may get a discount or free license though as long as they do not use the software for professional and commercial projects. + +There are other tools that are used regularily. These have some problems regarding the compatibility to Transport Fever 3 that are described below: + +* **Sketchup** is a 3D modelling software that many prefer because of its ease of use. However, it does not offer the possibility to map the 3D model itself, so it is not possible to import it directly into Transport Fever 3. The models must first be mapped in another program. In addition, cylindrical objects are often exported very finely, so that the models have high tris numbers. +* **Solidworks** and similar parametrized CAD modelling tools are especially popular with people in the CAD field. They offer the possibility to create systematic models. However, they have the same problems as Sketchup, i.e. it is usually not possible to map the model and curves are implemented very finely. + +## Texturing + +Beside the modelling tools, there are various texturing tools. These have different advantages and disadvantages and many artists stick to tools they are familiar with. + +* **GIMP** is a freeware image editing software that is commonly used. It is capable of loading some Photoshop files too. You can find it on [www.gimp.org](https://www.gimp.org/ "https://www.gimp.org/"). +* **Paint.NET** is a freeware image editing software that originally started as an alternative to the classical Microsoft Paint. It can be downloaded at [www.getpaint.net](https://www.getpaint.net/ "https://www.getpaint.net/"). +* **Photoshop** is a payware software for professional 2D artists by Adobe. It is available as part of the Adobe Creative Cloud or separate but not with a perpetual license. Find more information about Photoshop at [www.adobe.com/products/photoshop.html](https://www.adobe.com/products/photoshop.html "https://www.adobe.com/products/photoshop.html"). +* **Paint Shop Pro** is a payware software by Corel. It can be bought with a perpetual license at [www.paintshoppro.com](https://www.paintshoppro.com/ "https://www.paintshoppro.com/"). +* **Substance Painter** is a payware software for professional 3D artists originally developed by Allegorithmic and now maintained and developed further by Adobe. It is used for texturing at Urban Games. In contrast to the software above, the textures can be painted directly on the 3D model. Interactive texture materials can be used with lots of modifiers to accommodate various needs. Get more information at [www.adobe.com/products/substance3d-painter.html](https://www.adobe.com/products/substance3d-painter.html "https://www.adobe.com/products/substance3d-painter.html"). A perpetual lifetime license can be bought on [Steam](https://store.steampowered.com/app/4329260/Substance_3D_Painter_2026/ "https://store.steampowered.com/app/4329260/Substance_3D_Painter_2026/"). + +### DDS Export + +To export DDS files, a plugin or standalone program might be needed. Here is a list of common ones. Be aware that their internal compression algorithms may differ resulting in slightly different output. + +* Both **Gimp** and **Paint.net** have included support for exporting DDS textures. +* **NVIDIA Texture Tools** require a NVIDIA CUDA capable GPU. They are available standalone as well as plugin for Adobe Photoshop. Find more information at [developer.nvidia.com/nvidia-texture-tools-exporter](https://developer.nvidia.com/nvidia-texture-tools-exporter "https://developer.nvidia.com/nvidia-texture-tools-exporter"). +* **Intel Texture Works** is a Photoshop plugin made by Intel. You can find more information at [software.intel.com/.../intel-texture-works-plugin.html](https://software.intel.com/content/www/us/en/develop/articles/intel-texture-works-plugin.html "https://software.intel.com/content/www/us/en/develop/articles/intel-texture-works-plugin.html"). +* **Compressonator** is an AMD based GUI and command line tool that is now hosted on GitHub. See [github.com/GPUOpen-Tools/compressonator](https://github.com/GPUOpen-Tools/compressonator "https://github.com/GPUOpen-Tools/compressonator") for more information. + +## Custom Tools for Transport Fever 3 + +There are fanmade tools available that support the development of mods for Transport Fever 3. Some common ones are: + +* An interactive transformation matrix calculator by Xanos can be found at [transportfever.net](https://www.transportfever.net/lexicon/index.php?entry/77-transformationsmatrix/ "https://www.transportfever.net/lexicon/index.php?entry/77-transformationsmatrix/"). diff --git a/docs/reference/wiki/modding_tools_ingame.md b/docs/reference/wiki/modding_tools_ingame.md new file mode 100644 index 0000000..d14a48c --- /dev/null +++ b/docs/reference/wiki/modding_tools_ingame.md @@ -0,0 +1,189 @@ + + +### Table of Contents + +* [Hotkeys](#hotkeys) +* [Debug Tool Window](#debug_tool_window) + + + [Main](#main) + + [Framebuffers](#framebuffers) + + [Textures](#textures) + + [Draw Calls](#draw_calls) + + [Animals](#animals) + + [Environment](#environment) + + [Dump](#dump) + + [Crash](#crash) +* [Console](#console) +* [Construction Development Tools](#construction_development_tools) + + + [Set Dressing Assets & Ground Textures](#set_dressing_assets_ground_textures) + +This page is not yet adapted for Transport Fever 3. The content may be outdated. + +# Ingame Tools + +There are several tools available ingame to test and debug content. To activate these features, the debug mode has to be enabled. To do this, change the according `debugMode` value in the settings.lua to `true` or toggle the option in the [game settings](https://wiki.transportfever3.com/doku.php?id=gamemanual:ui:settings#advanced "gamemanual:ui:settings") advanced options. + +Once enabled, you have: + +* enabled debugging hotkeys to help debugging or testing modifications +* additional debug views and windows +* unlocked access to all campaigns and missions +* several filetypes are automatically refreshed when they changed (this e.g. covers updateFn definitions) + +## Hotkeys + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=350&tok=03090b&media=modding:tools:boundingbox.png) + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=350&tok=9db53d&media=modding:tools:lanes.png) + +The following hotkeys are available with activated debug mode: +(In the US keyboard layout, the AltGr key is the right Alt) + +| Hotkey | Function | +| --- | --- | +| AltGr + A | Reload [sound sets](https://wiki.transportfever3.com/doku.php?id=modding:misc:soundsets "modding:misc:soundsets") | +| AltGr + B | Show bounding boxes | +| AltGr + D | Open Debug Tool Window (see below) | +| AltGr + E | Show chunk refresh | +| AltGr + G | Hide user interface | +| AltGr + I | Show GPU workload statistics and simulation diagrams | +| AltGr + L | Show lanes | +| AltGr + R | Recompile shaders (keep existing when compilation fails) | +| AltGr + Z | Open [camera tool](https://wiki.transportfever3.com/doku.php?id=gamemanual:ui:cameratool "gamemanual:ui:cameratool") | + +In general, most of these modes can be switched on and off by repeating the keyboard combination. + +## Debug Tool Window + +The debug tool window has several tabs with different functions that are described below. It can be opened with AltGr + D. + +### Main + +The MAIN tab has several options regarding rendering and miscellaneous other tools. + +In the **General** section, the current cursor position is shown with all three coordinates. + +The **Rendering options** cover several modes that are available as Hotkeys as well as some others: + +* **Show Bounding Boxes** is the same as AltGr + B +* **Freeze Render** is the same as AltGr + F +* **Show Lanes** is the same as AltGr + L +* **Grass Prepass** is a rendering technique used to fasten the grass rendering. It is enabled by default. +* **Terrain Prepass** is a rendering technique used to fasten the terrain rendering. It is enabled by default. +* **Terrain Disable Filter** disables the dithering between different textures. The dominationg materials are displayed alone in a grid of 1Γ—1 mΒ². +* **LOD Scale** is a slider to simulate different LOD distances. +* **Terrain Memory Usage** is a slider to adjust the ratio between performance and memory consumption of terrain data. +* **Terrain LOD error multiplier** is a parameter for the terrain LOD generation tolerance. +* **Terrain LOD radius multiplier** is a parameter for the terrain LOD generation radius. The average in this radius is used for the simpler LOD geometry. + +The **Simulation options** provide buttons to increase the simulation speed up to 32 compared to the regular maximum of 4. + +Finally the **UI Debug tools** have two tools: + +* With **Show UI Element (Console)** it is possible to get the type and identifier of the current ui element the cursor is pointing on. The output can be read in the console. +* **Toggle Ruler** enables or disables a small ruler tool that can be used to measure distances on the map. + +### Framebuffers + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=350&tok=996d32&media=modding:tools:framebuffer.png) + +Some rendering intermediate frames can be reached in the FRAMEBUFFERS tab. These are: + +* **Fb color** with color information. +* **Fb normalmap** with the overall normal information. +* **Fb depth** with depth information. As the depth information is stored exponential, zoom in to see some differences. +* **Hdr lum** with light emission and reflecion information. +* **Hdr blur final** and **Hdr small** with light blurring information. +* **Shadow map** is some depth information but from the origin of the sunlight. +* **Ssao** with ssao information. +* **Ssao final** with the blurred ssao information. +* **Reflection** with reflection information. + +The views depend on the current main viewport and can be scaled to various sizes. + +### Textures + +To get an overview over the currently loaded textures, the TEXTURES tab can be used. It shows a complete folder tree with all loaded textures or only the subset with file sizes larger than the **Threshold** that can be set in the text box at the bottom edge. + +### Draw Calls + +The DRAW CALLS tab lists all current draw calls proceeded by the engine. There are several different properties listed in the top section: + +* **Draw calls** is the total number of current draw calls. +* **Tec binds** is the number of different material techniques / shaders used for the objects. +* **Mat binds** is the number of loaded materials. +* **Total instances** is the number of all objects rendered. +* **Total vertices** is the total number of vertices of all these objects. + +Below is a sortable table with different columns: + +* **#** is an ID in the order of rendering. +* **Type** is `either` opaque for non transparent materials or `transp` for transparent materials. +* **Material** is the reference to the used material. +* **Mesh** is the name of the displayed mesh. +* **Grp** is the number of the submesh of this mesh. +* **Inst** is the number of instances of this mesh. +* **Mode** is usually `tris` for triangle based objects. `points` are very rare. +* **Vert** is the number of vertices of one instance. +* **Inst\*Vert** is the product of the vertices and the number of instances. +* **%** is the percentage of the total workload. + +### Animals + +There is a dropdown where the [score maps](https://wiki.transportfever3.com/doku.php?id=modding:environment:animals#suitable_areas "modding:environment:animals") for animals can be selected. They are visualized with red and blue colors. The current animal movements and distribution can be shown with the two buttons at **Debug rendering** below. + +### Environment + +The settings of [environments](https://wiki.transportfever3.com/doku.php?id=modding:environment:environments "modding:environment:environments") can be tested live in the ENVIRONMENT tab. It provides several input fields to test the different properties. See the documentation of environments for more information on their meaning. + +At the bottom is a Load From Camera Tool and a Save to Camera Tool button. These can be used to temporarily store an environment setting for the use in the camera tool. + +### Dump + +A list of component types of an entity can be gathered from the **Entity information dump**. By entering an entity id, confirming it with REFRESH and pressing GOTO, it is possible to jump to the entity on the map. + +### Crash + +The last tab CRASH provides several buttons that can be used to force a crash of the game. Usually this is not needed for modders, but if you like you can test various ways of forced crashes there. + +## Console + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=350&tok=a679bb&media=modding:tools:console.png) + +The ingame console can be used to see the output that is written in the stdout.txt as well as to test and execute lua commands. The console can be opened and closed by default with the key below the ESC key. Depending on your keyboard layout it could be either `, Β§ or ^. + +You can execute lua commands in the command line by typing them and pressing ENTER. To enter complex statements with several lines of code, simply press ENTER inbetween. The console will execute the commands once syntactically complete, even if they span over many lines. + +There are some assisting commands available: + +* `\help` shows this list of available shortcuts and assisting commands. +* `\clear` clears the console. +* `\stdout ` regulates the output in `stdout.txt`. Default is `on`. If set to `off` there will be no output in the `stdout.txt`. +* `\timestamp ` shows timestamp in front of output if set to `on`. Default is `off`. +* `\scrlk ` does not jump to the bottom if new output appears if set to `on`. Default is `off`. +* `\history` prints a history of recent sent commands. + +You may use the Up and Down keys to recall and cycle through the recent sent commands from the history. + +To see a list of available functions, press CTRL + SPACE. This opens the autocomplete menu. You may use the Up and Down keys or the scroll wheel to navigate in the autocomplete menu. Press ENTER or click on a command to add the selected command to the console command line. + +If you press TAB in the command line, the command will be completed if it can be completed unambiguously. Pressing TAB twice prints the available commands from the current autocomplete menu view to the console. + +## Construction Development Tools + +To ease the creation of constructions, there are several assistance tools available. + +### Set Dressing Assets & Ground Textures + +To decorate constructions, it is recommended to use the available asset models of the base game. The [Asset Placer mod](https://mod.io/g/transportfever3/m/asset-placer "https://mod.io/g/transportfever3/m/asset-placer") provides most of them in the landscaping menu. As they have the `allowSnapToMesh` flag set to true in the `snapPoint` struct, it is possible to snap them directly to a surface of a model, e.g. to a building wall after pressing Alt. + +To move around some assets after placing them, the Toggle asset manipulator in the Main tab of the debug tools window can be used. Click on a model after activating it and it will be highlighted in turqoise. The shown axis handles can be used to move it around in 3D space. The menu on the left side of the screen allows manually tuning positions, size and rotation as well as to delete and clone the model. + +The terrain can be painted with the brushes in the landscaping menu as well. To define areas that shall not be painted by the construction but what is already there, use a [terrain material](https://wiki.transportfever3.com/doku.php?id=modding:environment:terrainmaterials "modding:environment:terrainmaterials") that has a file name containing `"chroma_key"`. A mod containing such a material is provided below. + +After decorating and painting the terrain, both can be exported. For that to work, the construction needs to have a configured [ground texture](https://wiki.transportfever3.com/doku.php?id=modding:constructions:groundtextures "modding:constructions:groundtextures"). Go to the Dump tab of the debug tools window and click on the construction. On the right side, the Print button allows to update the referenced `.gtex.lua` and its referenced index texture of the construction. Additionally, a `_assets.tl` file containing a list of all model instances is generated. Its content can be copied over elsewhere or the file can be required by a `.script.lua`. The `constructionutil.addModels` function can insert such a list to a subconstruction model result. + +**Chroma Key Mod** + +This mod contains a pink terrain material that will be skipped when exporting the ground texture mask as described above. The mod can be downloaded [here](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:ingame:ug_tf3_chroma_key.zip "modding:tools:ingame:ug_tf3_chroma_key.zip (423.3Β KB)"). diff --git a/docs/reference/wiki/modding_tools_modeleditor.md b/docs/reference/wiki/modding_tools_modeleditor.md new file mode 100644 index 0000000..ed2bbe3 --- /dev/null +++ b/docs/reference/wiki/modding_tools_modeleditor.md @@ -0,0 +1,670 @@ + + +### Table of Contents + +* [Setup](#setup) +* [User Interface](#user_interface) + + + [Model Loading and Saving](#model_loading_and_saving) + + [Model Rendering](#model_rendering) + + [Animation Preview](#animation_preview) + + [Model Properties](#model_properties) + + - [Model Tree](#model_tree) + - [Metadata Editor](#metadata_editor) + - [Material Editor](#material_editor) + - [Metadata Validation](#metadata_validation) + + [Options](#options) + + - [Rendering](#rendering) + - [Config](#config) + - [Graphics](#graphics) + - [Environment](#environment) + - [Icons](#icons) + - [Im-/ Export](#im-_export) + - [Tools](#tools) +* [Importing Models & Data](#importing_models_data) + + + [Material/Metadata Templates](#material_metadata_templates) + + [FBX Model Import](#fbx_model_import) + + - [File & Folder Names](#file_folder_names) + - [Nodes / Meshes](#nodes_meshes) + - [Materials](#materials) + - [Textures](#textures) + - [Animations](#animations) + - [Metadata](#metadata) + + [Bulk Import](#bulk_import) + + [FBX Construction Data Import](#fbx_construction_data_import) + + - [Target Construction](#target_construction) + - [Hierarchy](#hierarchy) + - [Collider & Terrain Alignment](#collider_terrain_alignment) + - [Set Dressing](#set_dressing) + +# Model Editor + +The Model Editor is the main tool to be used when importing and editing models for Transport Fever 3. It features various import and conversion tools as well as editing functionality for the model metadata. Testing of different things like particles, aging, labels and animations is possible too. For presentation in the vehicle store, the Model Editor also includes an option to create screenshots and GUI icons. + +## Setup + +To start the Model Editor, execute the `ModelEditor.bat` in the installation directory of Transport Fever 2 on Windows, `ModelEditor.sh` in the installation directory of Linux or `ModelEditor.command` in the installation directory of MacOS. This will open two windows, a console window with debug output and the actual user interface window. + +On first startup, the Model Editor creates a configuration file in + +* `%APPDATA%/Transport Fever 3/` for Windows +* `~/.local/share/Transport Fever 2` for Linux +* `/Users//Library/Application Support/Transport Fever 3/` for MacOS + +and asks the user to fill in the userdata location in this file. The configuration file contains several references to directories. The `userDataPath` is the directory where the userData is located. It is used to find the staging area and screenshot folders. You can find your userdata folder over the game's main menu > SETTINGS > ADVANCED > OPEN USER DATA FOLDER. + +Only use forward slashes / in the path, otherwise the model editor may not start properly. + +After saving the file, the Model Editor may be started again. + +## User Interface + +Once the Model Editor has started, the main window is visible with the toolbar at the top and the viewport where the models are rendered below. + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:model_editor_toolbar.png) + +The toolbar is split into 5 different groups of interactive elements: + +1 dropdowns and buttons to select mods and models and save them +2 model rendering options +3 animation trigger +4 detail windows +5 validation, screenshots and options + +As long as no model is loaded, most buttons are deactivated. + +The viewport camera is controlled with the mouse: + +* Hold the left mouse button and move the mouse to rotate the camera around. +* Hold the right mouse button and move the mouse to move the camera around. +* Scroll the mouse wheel to zoom in and out. +* Hold CTRL and the left mouse button to rotate the skybox around the model. + +### Model Loading and Saving + +To open a model, click on the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:open.png) button. The open dialog allows browsing through the content of the base game as well as all mods in the staging area. It is possible to search for models with the search field. It covers all subfolders of the currently selected folder. The ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:open_folder.png) button opens the currently selected folder in the file explorer. + +A list of previously opened models can be accessed by clicking the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:recent.png) button. It is sorted by date. To close the currently loaded model, use the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:close.png) button. + +If you want to save a model, use the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:save.png) button. It will save the currently loaded model to the mod that is selected in the dropdown next to it. Please be aware that there is no extra confirmation in case you overwrite existing files. To only save certain parts of the model, you may deselect the options provided in the dropdown next to the save button: + +* MODEL will save the .mdl file +* MESH will save the .msh and .msh.blob files if they were just imported from fbx. +* MATERIAL will save the .mtl files +* ANIMATION will save the .ani files if they were just imported from fbx. + +### Model Rendering + +The model rendering in the viewport can be influenced by the second group of buttons in the toolbar 2. The three icon buttons are: + +* ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:model_material.png) for the model with the materials as it looks in the game. +* ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:model_solid.png) for the model in plain white. +* ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:model_wireframe.png) for the model as a wire mesh. + +The level of detail can be selected further to the right. With Auto the used level of detail depends on the zoom level like in the game. 0 and above select specific levels of detail independent of the zoom level. + +### Animation Preview + +The third button group 3 allows direct playing of one animation. If the model has any animation, it can be selected in the dropdown. Then it can be started with the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:resume.png) button. To loop the animation, activate the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:refresh.png) toggle next to it. + +### Model Properties + +The fourth group 4 allows accessing detailed windows for the model tree, metadata, materials and animations. + +#### Model Tree + +A click on the Model button opens the model window. + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:model_editor_model_dialogue.png) + +At the top of the window, the full path of the model resource is shown. To the right 1, there are three action buttons: + +1. Recalculation of the [bounding box](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#bounding_box "modding:general:resourcetypes:mdl"). +2. Recalculation of the [simulation extent](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#extent "modding:general:resourcetypes:mdl"). +3. Open the model folder in the file explorer. + +In the section below 2, the bounding box of the model can be manually adjusted. + +The bottom section of the window is a tab widget 3 that has a tab for each level of detail. For each level of detail, it is possible to adjust the `visibleFrom` and `visibleTo` distances and lods can be marked as [texture lod base](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#level_of_detail "modding:general:resourcetypes:mdl") 4. + +Below is a tree 5 that shows the node hierarchy of the model with the node names and mesh file references. If you activate checkboxes on the left or hover over lines, the mesh will be displayed alone in the viewport. This helps with identifying model parts. If you want to manually transform a mesh, e.g. to correct its position, you can open a popup with transformation parameters by clicking on the right button. The columns at the very right tell how many materials and animations are assigned to the node. They are listed in a tooltip when hovering the numbers or by clicking the checkbox Extended View further above. + +#### Metadata Editor + +To access the metadata editor, press the Metadata button. It presents all the data that is set in the `metadata` struct of a model. + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:model_editor_metadata_dialogue.png) + +To add new properties, you can press on the + button in the top right corner 1. There you can select new property types and add them to the metadata of the currently loaded model. To delete all metadata, use the gear button next to it and select Delete all. If you want to reset to the initial loaded values, press Reset. + +The properties are collapsed by default 2 . Press the arrow markers on the left to unfold the hierarchy levels of properties. To unfold the complete hierarchy inside of a property, you can hold SHIFT while you click on the arrow marker. + +To reset a single property or only a value of the property, you can use the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:recent.png) arrow on the right side 3. To completely remove it, press the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=20&tok=2f215a&media=gamemanual:interface:buttons:bin.png) button instead. Some properties contain lists, e.g. the labels. You can add a new entry by clicking on ![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=20&tok=e4446a&media=gamemanual:interface:buttons:plus.png) button. If you want to add a duplicate of an existing list element, use the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=20&tok=433e43&media=gamemanual:interface:buttons:duplicate.png) button next to it. Both are added to the end of the list. + +Depending on the property there are one or more attributes to configure 4. Some require numeric or text input, others are checkboxes or sliders. For some attributes or even whole metadata properties, there are templates. They can be selected with the gear button on the left 5. + +#### Material Editor + +The MATERIALS button leads you to the materials editor. It provides access to all material files that are used in the model. + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:model_editor_material_dialogue.png) + +The top section 1 lists all materials used in this model. The ones referenced with relative path are more emphasized than the ones referenced with absolute path to differentiate between materials that are local and materials that are likely shared and should only be edited with caution. On the right side, the short tag of the individual material type is shown. Hovering over a line will hide all other geometry in the viewport. + +For the currently selected material, the full material type is shown below the list 2. Its order can be changed on the right side and the material can be converted to another [material type](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mtl#types "modding:general:resourcetypes:mtl") by pressing the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=20&tok=6bd44f&media=gamemanual:interface:buttons:settings.png). There you can reset a material file to the initially loaded values too by clicking the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:recent.png) button. + +Below is a list of all material properties depending on the material type 3. To unfold properties, you can press the arrow button and to reset a single property, you can click on the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:recent.png) arrow on the right side. + +You can edit the properties in a similar way as the properties in the metadata editor. Texture references can either be written by hand or selected with a file picker that can be opened with the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:open.png) button on the right side 4. + +Some material properties offer templates, they can be accessed as in the metadata editor by clicking on the gear button on the left side 5. + +#### Metadata Validation + +To check if there are major issues with the configured metadata, you can use the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:validate.png) button in the top bar. It will run a check and informs you as soon as it finds an issue. Run it again after you fixed the issue to check if there are further issues. + +Currently the following metadata issues are covered by the validation tool: + +| | | | +| --- | --- | --- | +| `loadIndicator` | `Referenced mesh node 'XYZ' not found (key: 'cargoBay.childId' in '')` | The `cargoBay` is not assigned to an existing node in the model. | +| `loadIndicator` | `Area too small for 'loadIndicator.configs[1].cargoBay.bbox' at ` | The `cargoBay` bounding box is too small. | +| `loadIndicator` | `The configuration 'loadIndicator.configurations[1][2][3]' references invalid slot 1 at ` | The referenced slot in the config does not exist in the model. | +| `roadVehicle` | `roadVehicle/configs/fakeBogies: size (= 2) must match number of lods (= 3) or be empty` | There needs to be a list of `fakeBogies` per LOD. It might be an empty list `{}`. | +| `railVehicle` | `railVehicle/configs/fakeBogies: size (= 2) must match number of lods (= 3) or be empty` | There needs to be a list of `fakeBogies` per LOD. It might be an empty list `{}`. | +| `waterVehicle` | `waterVehicle/availPower: ship will never reach top speed, increase power or reduce area` | The `waterVehicle.area` value is too large in relation to the `availPower`. | +| `airVehicle` | `airVehicle/configs/axles: missing entry (but wheels specified)` | If `wheels` are configured, `axles` need to be configured as well. | +| `airVehicle` | `airVehicle/configs/wheels: missing entry (but axles specified)` | If `axles` are configured, `wheels` need to be configured as well. | +| `airVehicle` | `airVehicle/configs: invalid landing gear configuration; wheels defined but not axles` | If `wheels` are configured, `axles` need to be configured as well. | +| `airVehicle` | `airVehicle/configs: invalid landing gear configuration; axles defined but not wheels` | If `axles` are configured, `wheels` need to be configured as well. | +| `airVehicle` | `airVehicle/configs: invalid landing gear configuration; zero distance between main and front/back gear` | The configured wheels and axles may not be in the same spot. | +| `airVehicle` | `airVehicle/configs: invalid landing gear configuration; aircraft's initial pitch on ground is below deg` | The plane gear results in a too negative pitch on the ground. | +| `airVehicle` | `airVehicle/configs: invalid landing gear configuration; aircraft's initial pitch on ground is above deg` | The plane gear results in a too high pitch on the ground. | +| `seatProvider` | `Referenced mesh node 'XYZ' not found (key: 'seatProvider.seats[10]' in '')` | The `seat` is not assigned to an existing node in the model. | +| `transportVehicle` | `transportVehicle/loadConfigs: list of load configs must not be empty` | The compartment needs at least one load config. | +| `transportVehicle` | `Model has a cargo entry specifying a load indicator '1' but no load indicator metadata` | The cargo configuration is referencing a `loadIndicator` but none are configured. | +| `transportVehicle` | `Model does not have load indicator '2`' | The cargo configuration is referencing a non-existent `loadIndicator`. | +| `transportVehicle` | `Wrong seat index in transportVehicle, seat 3 is invalid, should between 0 and 2 (compartment = 1, loadConfig = 2)` | The cargo configuration is referencing a non-existent `seat`. | +| `transportVehicle` | `transportVehicle/capacities: capacity '-1' not valid` | The capacity may not be negative. | +| `transportVehicle` | `transportVehicle/capacities: 'excluded' cargo type 'cargos/coal/coal.cargo' not found` | The cargo configuration is referencing a non-existent cargo type. | +| `transportVehicle` | `transportVehicle/capacities: cargo class 'BULK' not found` | The cargo configuration is referencing a non-existent cargo class. | +| `categoryList` | `Referenced cargo type not found: cargos/coal/coal.cargo, referenced by ` | The model is referencing a non-existent cargo type. | +| `categoryList` | `Referenced cargo format not found: RECT_40x10, referenced by ` | The model is referencing a non-existent cargo format. | + +The following error messages might appear when there are misconfigured meshes, materials or animations: + +| | | | +| --- | --- | --- | +| `Mesh` | `'body' with '' (SKINNING_PHYS_NRML_MAP): Used technique '' requires missing mesh attribute 'XYZ' in mesh {}. Usually this means a model is missing UV1 vertex attributes or a skinned material is used with a unskinned mesh.` | The mesh is not compatible with the material type. | +| `Material` | `'body' with '' (PHYS_TRANSPARENT): map_albedo has missing texture .` | A material is referencing a non-existent texture file. | +| `Material` | `Group 'body' has 2 materials but mesh has 3 groups (they must be equal). The group has been patched but this might lead to unexpected results.` | The number of submeshes needs to match the number of assigned materials. | +| `Material` | `Group 'body' has no materials but mesh has 2 groups` | Materials need to be assigned to the meshes. | +| `Material` | `Group body has 2 skin materials but mesh has 3 groups (they must be equal). The group has been patched but this might lead to unexpected results.` | The number of subgroups needs to match the number of assigned skin materials. | +| `Material` | `Group 'body' has no skin materials but mesh has 2 groups` | Materials need to be assigned to the meshes. | +| `Material` | `Model Group 'body' uses skinned mesh '' with an unskinned material ''. This might lead to unexpected crashes or glitches.` | Meshes with vertex groups should be used with skinned materials. | +| `Animation` | `Animation at body named has incorrent number of times 12 and transforms 10.` | Number of time stamps and transformations need to match. | +| `Animation` | `Animation at body named has no keyframes.` | Animations need to have at least one time stamp. | +| `Animation` | `Animation at body named has keyframes starting after 0: 1200.` | The first time stamp needs to be at time 0. | + +### Options + +The options window can be opened by a click on the OPTIONS button in the top right. It contains several tabs with different settings. All settings are persisted and loaded when the model editor is opened. Most of the tabs have a RESET TO DEFAULT button to revert them to their default values. + +#### Rendering + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=300&tok=ebfe05&media=modding:tools:modeleditor:options_rendering.png) + +The Rendering tab provides several general options to show and hide annotations. The **Render Settings** cover general annotations: + +* **Axes** renders the three orientation axis that meet at the origin in the 3D space. These mark the global positive directions of the x (red), y (green) and z (blue) dimension. +* **Nodes** renders the hierarchy of nodes in the model node tree as well as their individual orientation. +* **Node Names** renders the assigned names for each node. +* **Bounding Box** renders the [bounding box](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#bounding_box "modding:general:resourcetypes:mdl") used for rendering as it is specified in the `.mdl` file. +* **Extent Box** renders the [extent box](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#extent "modding:general:resourcetypes:mdl") used for simulation as it is specified in the `.mdl` file. +* **Collider** renders the [collider shape](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#collider "modding:general:resourcetypes:mdl") as it is specified in the `.mdl` file. + +The **Locator Settings** cover annotations for individual features: + +* **Seat Locators** renders small indicators at the positions of defined [passenger seats](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:basics#seats1 "modding:vehicles:basics"). +* **Light Source Locators** renders origins and shapes of defined [light sources](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#lightsourcelist "modding:general:resourcetypes:mdl"). +* **Particle System Locators** renders small indicators where particle emitters are located. +* **Label Outlines** enables small markers and rectangles where [text labels](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#labellist "modding:general:resourcetypes:mdl") are placed in the model. The text boxes below can be used to define some demo texts to test the display. +* **Water Line** renders a line that indicates the position of the [water line](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:types#metadata2 "modding:vehicles:types") definition of ships. +* **Cargo Bay Bounding Box** renders the bounding boxes of defined [cargo bays](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:basics#cargobay "modding:vehicles:basics"). +* **Cargo Slot Locators** renders small indicators at the positions of defined [cargo slots](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:advancedtopics#custom_cargo_models "modding:vehicles:advancedtopics"). +* **Bogies** renders small indicators where axles and wheels are located. +* **Bogies** renders small indicators where bogies are located. +* **Fake Bogies** renders small indicators where [fake bogies](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:advancedtopics#fake_bogies "modding:vehicles:advancedtopics") are located. + +For investigation of meshes, it is also possible to select **Vertex Settings**: + +* **Normals** renders the normals of vertices. +* **Tangents** renders the tangents of vertices. + +#### Config + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:options_config.png) + +The Config tab provides options to test various features of vehicles. In the top section **General Settings** holds various options for general testing: + +* **Enable Auto Update** decides whether and when the model should be reloaded whenever one of the source files changes. Be aware that unsaved changes to the model are lost if the model is reloaded. If you encounter black textures or crashes while exporting textures from your graphic program, this might be caused by the Model Editor reloading the texture files before they are completely written by the program. In this case, use the `On Focus` option. +* **Animation Speed Scale** is the speed factor that is used for animations. +* **Lod scale** is a slider that can be used to mimic lower geometry graphic settings. +* **Reference Model** is allows showing a second model of the same mod or the base game as a reference to compare. If a model is referenced, it is visible as static asset. It won't be used in the screenshots. Click on the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:open.png) button and navigate through the file picker to select a model. With the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=20&tok=d0735f&media=gamemanual:interface:buttons:transform.png) button you can transform the reference model and with the ![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:eye.png) button you can toggle its visibility. +* **Color** lets you choose a color for models that have [color blending materials](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mtl#color_blending_dirt_rust "modding:general:resourcetypes:mtl") in use. +* **Age** is a slider that can be used to simulate the [aging](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mtl#color_blending_dirt_rust "modding:general:resourcetypes:mtl") of the vehicle. Depending on the age, the dirt and rust layers have different intensities. + +The **Load Settings** section allows testing the [cargo](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:basics#compartment_list "modding:vehicles:basics") and [passengers](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:basics#seats "modding:vehicles:basics") of vehicles: + +* **Passengers** is a slider that lets you choose the amount of passengers that should be displayed. +* **Cargo** is a slider that lets you choose the amount of cargo that should be displayed. +* **Random Seed** is a spinner that can be used to select a seed for the randomisation of cargo slots and configurations. +* **Cargo indicators** is a list of compartments where you can select the cargo type that should be used in the preview. + +The **Particle Settings** section allows testing the [particle emitters](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#particlesystem "modding:general:resourcetypes:mdl"): + +* **Preview Particles** enables the particle rendering. +* **Reverse Direction** changes the direction of the preview velocity configured with the slider below. +* **Particle Velocity** is a slider to select a preview velocity that mimics movement of the model. +* **Particle Filter Tag** allows restricting the preview to particle emitters with a specific tag. + +The **Label Settings** section allows testing the [labels](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#labellist "modding:general:resourcetypes:mdl"). There are text inputs for the different label data types. + +#### Graphics + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:options_graphics.png) + +The Graphics tab provides graphic settings: + +* **Texture Quality** selects the maximum displayed texture mip map level. `Very High` uses the original texture resolution, `High` skips the highest resolution, … +* **Anti-Aliasing Quality** sets the anti-aliasing quality for the rendering. +* **Bloom Quality** sets the quality of the emissive bloom. +* **Enable Bloom** allows disabling or enabling the bloom altogether. +* **Enable Screen Space Reflections (SSR)** toggles the reflections on glossy surfaces based on the actual surroundings. +* **Enable Screen Space Ambient Occlusion (SSAO)** enables the smooth ambient occlusion that is computed by the engine. +* **Enable Shadows** enables shadows that are computed depending on the direction of the sun. +* **Enable Legacy HDR Rendering** switches back to the Transport Fever 2 dynamic range rendering. +* **Enable VSync** toggles the frame rate synchronization. + +Some of the graphic settings require a restart of the Model Editor to take effect. + +#### Environment + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:options_environment.png) + +The Environment tab provides several camera and environment related options. The camera settings are: + +* **Field of View (FOV)** allows choosing the field of view. The larger the chosen value is, the wider is the camera angle. +* **Background** can be used to set the rgb values for the background color that should be used when the environment is not rendered (see above). A colorpicker is opened on click to select the color by numbers, hex code or visually. + +For the environment, the following settings are available: + +* **Enable Environment** activates a gray ground face at height 0 and a simple blue skybox as the background. If unchecked, no ground face is shown. +* **Environment** offers all available [environments](https://wiki.transportfever3.com/doku.php?id=modding:environment:environments "modding:environment:environments") that may be used in the model editor. +* **Time of Day** is a slider to set the current time of the environment. +* **Day of Year** is a slider to set the day of the year. The height of the sun depends on the calendar. +* **Reference Brightness** is a slider to adjust the overall brightness. 10 is the maximum value that results in a darker mood. +* **Sun Intensity** is a slider to adjust the intensity of the sun, affecting the direct light on the planet. +* **Ambient Color (Day)** is an ambient color that tints the whole world slightly during day time. +* **HDR Exposure (Day)** is a number used to scale the hdr exposure during day time. +* **HDR Contrast (Day)** is a number used to scale the hdr contrast during day time. +* **Ambient Color (Night)** is an ambient color that tints the whole world slightly during night time. +* **HDR Exposure (Night)** is a number used to scale the hdr exposure during night time. +* **HDR Contrast (Night)** is a number used to scale the hdr contrast during night time. + +#### Icons + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:options_icons.png) + +To generate vehicle icons and take representative screenshots of the vehicle models, you can use the SCREENSHOT button on the right side of the top bar. This will generate the necessary ui icons and moves them at the correct position in the mod. Additionally, larger renderings from all sides as well as a perspective view will be generated and saved in the `screenshots/` folder in the specified `userDataPath`. + +The Icons tab provides options for the creation of ui icons and other screenshots. The **Screenshot Settings** are general settings for the screenshot generation: + +* **Screenshot extension** allows choosing the file extension that is used for the generation. The game requires the `.tga` format, while `.png` might be useful for websites. +* **Use Default Stage Files** switches between the standard stages for tracks/streets and the ones configured below. +* **Stage file (bus, tram, truck)** is the model reference that is used as street segment for screenshots of road vehicles. +* **Stage file (train, wagon)** is the model reference that is used as track segment for screenshots of rail vehicles. +* **Use Viewport Environment** switches between the standard environment for screenshots and the ones selected in the Environment. +* **Use Viewport Animations** switches between the default animation state and the one configured in the Animation Window. + +The sections below can be used to fine tune the generated icons and screenshots. The **UI Icons** setting **Max Width** sets the maximum horizontal size for ui icons. The pixel per meter ratio for the icon is set with **Pixels Per Meter**. The same settings are available for the **Large Ortho Screenshot** further down below. + +The **3D Screenshot Settings** are used for the diagonal screenshots: + +* **Angle** is the horizontal rotation around the model. +* **Height** is the height of the camera. The height is computed automatically with value `-1`. +* **Radius** is the distance of the camera to the center point of the model. The distance is computed automatically with value `-1`. +* **Field of View** is the camera angle that sets the focal length. +* **Size X** sets the maximum horizontal size. +* **Size Y** sets the maximum vertical size. + +The **Viewport Screenshot Settings** allow setting the size for viewport screenshots. + +Below are several checkboxes allowing to adjust the behavior of the screenshot button in the top bar: + +* **Disable Screenshot Button** disables the screenshot button in the top bar so it can't be triggered accidentally. +* **Generate UI Icons** will generate the ui icons for vehicle models in the mod. +* **Generate Cblend Mask** will generate the cblend masks for vehicle models in the mod. +* **Generate 3D Screenshots** will generate the perspective screenshots for vehicle models in the mod. +* **Generate Large Ortho Screenshots** will generate large orthographic screenshots for vehicle models in the mod. +* **Generate Viewport Screenshots** will generate screenshots with the current perspective in the Model Editor. +* **Generate Ortho Screenshots** will generate small orthographic renderings for vehicle models in the mod. + +The **Bulk Actions** section allows taking screenshots for multiple models at once. The **Bulk Prefix** allows selecting a folder containing multiple models. The operation is then started with Bulk Generate. + +Keep in mind that this may take a long time depending on the number of models in the mod and the hardware of the computer. + +#### Im-/ Export + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:options_import.png) + +The Im-/Export tab allows configuring the behavior when importing `.fbx` files: + +* **Overwrite Meshes** allows overwriting existing meshes when re-importing a `.fbx` file. +* **Overwrite Animations** allows overwriting existing animations when re-importing a `.fbx` file. +* **Overwrite Materials** allows overwriting existing materials when re-importing a `.fbx` file. +* **Overwrite PHYS\_TRANSPARENT\_DIFFUSE Materials** allows overwriting the placeholder materials when re-importing a `.fbx` file. +* **Overwrite Textures** allows overwriting existing textures when re-importing a `.fbx` file. +* **Use Blender Coordinate System** needs to be selected when importing `.fbx` files exported from Blender. + +When saving models, the Model Editor automatically converts `.tga` textures to `.dds`. It is possible to adjust the **Texture Conversion Quality** and the compression can be disabled completely with **Skip Compression of Existing Textures**. + +#### Tools + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:options_tools.png) + +The Tools tab provides several tools to adjust the currently opened model or several models at the same time. The general settings are: + +* **Target Mod** allows selecting the mod in which the result of the tool operation will be saved. +* **Bulk Prefix** can be used to select the folder which contains the model that will be affected. + +The **Rename** tool allows searching and replacing parts of filenames. There are two inputs: + +* **Search Token** is used to specify the string that is searched. +* **Replace Token** can be used to specify the string that shall be inserted where the search token is found. If empty, the search token is removed without replacement. + +The **Convert** tool allows migrating Transport Fever 2 models to Transport Fever 3. This covers: + +* restructuring files from `res` to the `content` structure. Be aware that the result depends on how consistent the folder structure in the `res` directory are. +* adjusting `.mtl` files to the new structure. This automatically sets the [legacy flag](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mtl#light_receiver "modding:general:resourcetypes:mtl"). +* adjusting the metadata of the mdl. New values need to be added manually. + +The **Copy** tool allows creating a copy of a model in another mod. + +The **Validate** tool allows validating several models at once. + +## Importing Models & Data + +The Model Editor supports the import of different things: + +* `.import.lua` files for material/metadata templates +* `.fbx` files for 3D models +* `.fbx` files for construction data + +### Material/Metadata Templates + +It is possible to import a preset containing both info for materials and metadata before importing 3D models. These `.import.lua` files have the following structure with three optional functions: + +```lua +fbxLoader = { + predictMaterial = function(params) + return "::physical_nrml_map_op_uv1_ao_op_mask.mat.lua" + end, + overrideProperties = function(params) + return params.properties + end, + getMetadataMap = function() + return { + availability = { + yearFrom = 1900, + yearTo = 0, + }, + } + end, +} +``` + +The `predictMaterial` function is called for every material and allows to provide a custom function to identify the material type. The `params` struct contains: + +* `fbxPath` contains the folder path of the `.fbx`, e.g. `C:/Users//Desktop/stations-water-models+main_building_small`. +* `fbxName` contains the file name of the `.fbx` without the `lodX` suffix and file ending, e.g. `test_`. +* `fbxMaterialName` contains the name of the material in the `.fbx` for which the function is called during the import, e.g. `/buildings/a/r1/4x4_04/mat/a_rs_r_wd01`. +* `textures` contains a list of texture resources that are assigned to the material in the `.fbx`, e.g. `{"/content/buildings/a/r1/shared/a_res_l1/a_rs_r_wd01_alb.dds"}`. + +Expected return value is either `nil` or a file path to a material type definition, e.g. `phys_transparent_nrml_map_cblend.mat`. + +The `overrideProperties` function is called for every material and allows to override the material properties. The `params` struct contains: + +* `fbxPath` contains the folder path of the `.fbx`, e.g. `C:/Users//Desktop/stations-water-models+main_building_small`. +* `fbxName` contains the file name of the `.fbx` without the `lodX` suffix and file ending, e.g. `test_`. +* `fbxMaterialName` contains the name of the material in the `.fbx` for which the function is called during the import, e.g. `/buildings/a/r1/4x4_04/mat/a_rs_r_wd01`. +* `materialType` contains the material type reference, e.g. `::/rendering/physical.mat`. +* `properties` contains the full table with all material properties, similar to the content of the `.mtl` files. + +Expected return value is the altered or unaltered list of properties. + +The `getMetadataMap` function has no parameters and returns a table that is used as is for the `metadata` of the models that are imported afterwards. + +##### Material Override + +This example provides a rather complex override template that alters properties of materials. It is available for [download](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:pnouam_light_soft_overlay_materials.import.lua "modding:tools:modeleditor:pnouam_light_soft_overlay_materials.import.lua (5.6Β KB)"). + +Explanation + +The example contains both a `predictMaterial` and a `overrideProperties` function used to alter material types and properties of building windows when importing them. + +The `predictMaterial` function checks if the material name ends with `PNOUA` or `PNOL` and returns a specific material type for these. Other materials are untouched by returning nothing. + +The `overrideProperties` function overrides several properties, e.g. `map_id`, `map_ao`, `map_op_1`, `map_op_2` and others. Some of them are only altered if the material name has a certain suffix. + +##### Metadata Template + +This example provides a template that contains the usual metadata for a bus model. It is available for [download](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:bus.import.lua "modding:tools:modeleditor:bus.import.lua (3.6Β KB)"). + +### FBX Model Import + +To import models, the `.fbx` file format is used. To import a single file, drag and drop it from the file explorer into the Model Editor window. To import multiple files at once, do the same with a folder. + +As there are some differences in `.fbx` files exported out of software from different vendors, not all files are imported properly. Currently, `.fbx` files from Modo and Blender are supported. See the information about [external tools](https://wiki.transportfever3.com/doku.php?id=modding:tools:external "modding:tools:external") to find out more about the available modelling software. + +#### File & Folder Names + +Each `.fbx` file may contain the 3D model of one level of detail. The `.fbx` files for the different levels of detail are distinguished by the `_lodX.fbx` ending, where X=0 is mandatory and higher levels of detail are optional. To import several files together in a model, they should be placed in the same folder. The name of the folder will be used to determine the folder structure, where the imported resources will be placed in the mod: + +* `--/` Use hyphens to define the folder hierarchy. This will place the model and its resources in `folder1/folder2/mdlname/mdlname.mdl`. +* `-+/` If the folder is set up like this, the model will end up in `folder1/folder2/mdlname.mdl`. This can be used for the import of multiple models into the same folder, e.g. for multiple units. + +#### Nodes / Meshes + +The names of nodes are structured as following: + +```lua +[#] +``` + +The `` is the name of the element that is used for the mesh by default. The element name may not contain `|`, `%` or `#`! Usually, the element names consist of lowercase words seperated with `_`. It will be suffixed with the current LOD automatically, so there is no need to append a `_lodX` manually. + +* By default, the meshes will be imported into a `msh` subfolder next to the `.mdl`. +* To reference existing meshes from other models, the element name uses a path with '/' relative to the content root directory, e.g.: `/vehicle/waggon/bay_05/msh/w1`. If the importer can find the mesh at this specified location, it will only be referenced, otherwise the mesh at that position in the folder hierarchy will be generated. +* To reference meshes from another mod, the path is prefixed with `::` and the other mod needs to be listed as dependency of the current mod in its `mod.json`. + +The following examples will have different results: + +* `w1` will create a mesh `msh/w1_lodX.msh` in the current mod relative to the directory of the model. +* `/vehicle/waggon/bay_05/msh/w1` will use or create the mesh `vehicle/waggon/bay_05/msh/w1_lodX.msh` relative to the content root of the current mod. +* `::/vehicle/waggon/bay_05/msh/w1` will use the mesh `vehicle/waggon/bay_05/msh/w1_lodX.msh` in the base game `content`. +* `master_mod::/vehicle/waggon/bay_05/msh/w1` will use the mesh `vehicle/waggon/bay_05/msh/w1_lodX.msh` from the mod with the mod id `master_mod`. + +If there is a `#` then the rest of the name behind it is ignored. This can be used to mask out `.001` or similar things automatically created by modifiers or to distinguish between different lod level meshes/nodes with the same name. + +```lua +middle_interior +middle_interior#borrowed_from_middle +``` + +These two will both create a node with mesh `…/middle_interior_lodX.msh` and name `middle_interior`. + +In Blender, the name of the empty/object is the one that is used for the node name on import. The name of the mesh assigned to the object is the one used for the `.msh` filename. + +#### Materials + +The names of materials are structured in a similar pattern as the nodes/meshes: + +```lua +[|][#] +``` + +The `` works the same as the one for meshes. Referencing existing materials in other mods and both relative and absolute is possible. To reference existing materials, use absolute paths starting with `/` like `/infrastructure/tracks/standard/mat/ballast`. If the importer can find the material at this specified location, it will only be referenced, otherwise the material at that position in the folder hierarchy will be generated with the assigned textures. + +The material types that should be used by the importer can be specified by appending `|` which is listed in the tables in the [material type documentation](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mtl#types "modding:general:resourcetypes:mtl"). + +#### Textures + +The import process recognizes albedo textures if they: + +* have the same name as the material + the suffix from below or +* are assigned to the material in the fbx. + +All other textures are recognized based on the same file name as the albedo textures together with the appropriate suffixes: + +| Map | Supported Suffixes | +| --- | --- | +| map\_albedo | `_alb` or `_albedo` | +| map\_albedo\_opacity | `_albo` or `_albedo_opacity` | +| map\_normal | `_nrm` or `_normal` | +| map\_metal\_gloss\_ao | `_mga` or `_metal_gloss_ao` | +| map\_cblend\_dirt\_rust | `_cdr` or `_cblend_dirt_rust` | +| map\_cblend | `_cblend` | +| map\_ao | `_uv1_ao` | +| map\_id | `_id` or `_emissive_ID_lod1` | +| map\_lgt | `_e` | +| map\_op\_1 | `_op1` | +| map\_op\_2 | `_op2` | + +#### Animations + +Imported models will generate `.ani` files from the key frames that are defined in animations assigned to the meshes. + +In Blender, the animations need to be saved as non linear animations (NLA) to have the correct names. It is important that the strips themselves have the correct name of the animation event. To have multiple strips (one for each animated mesh) for the same animation event, it is possible to use `#` again to clip off the `.001` suffixes. + +#### Metadata + +Some metadata elements can be (partially) imported with the `.fbx`. + +##### Light Sources + +[Light](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#lightsourcelist "modding:general:resourcetypes:mdl") objects in `.fbx` files can be imported as long as their type is one of the three: + +* `Point` +* `Spot` +* `Directional` which will be used as `Parallel` in Transport Fever 3 + +The following properties will be imported: `lightId` based on the object name, `type` as written above, `transf`, `color`, `strength`, `angleMin` and `angleMax`. The `childId` is derived from the parent to which the light is assigned as a child node in the fbx. + +In Blender, the three light types are called `Point`, `Spot` and `Sun`. The `strength` is taken from `Intensity`/`Power` and multiplied with factor 100. For the `Spot` type, the `angleMin` is calculated based on `Angle` and `Blend`. + +##### Seats + +A locator with `|seat_` or `|seat_crew_` is used to define the position, rotation and scaling of [seat](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:basics#seats1 "modding:vehicles:basics") positions. `` needs to be replaced by the name of one of the supported character animations `idle`, `sitting`, `driving_upright`, `driving`. If there are meshes attached to the node, they will be removed and not be present in the imported model. + +##### Draft Animals + +Similar to the seats, it is possible to set locations for draft animals with `|draft_animal_[()]`. The `` is a fully qualified reference to an existing `.mdl`. Optionally, it is possible to append a specific index for a color config behind the model reference. A valid example would be `something|draft_animal_mymod::/animal/draft_horse/draft_horse.mdl(2)#something`. This would pick the second color config of the `draft_horse.mdl`. + +##### Particle Emitters + +A locator with `emitter` in the name is considered as [particle emitter](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#particlesystem "modding:general:resourcetypes:mdl"). The following properties are imported: `particleId` as the complete name before the `#` comment suffix, `position` and `velocity` based on the scale along x axis. If the name contains `smoke_bright` or `smoke_dark` the properties `colorOverLifetime`, `frequency`, `lifeTime` and `sizeOverLifeTime` are set with fitting standard values. + +##### Bounding Box, Extent & Collider + +A mesh named with `|bounding_box` will be used to define the size of the [bounding box](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#bounding_box "modding:general:resourcetypes:mdl") for the model. The mesh itself will be removed on import, it’s bounding box will be used for the whole model though. + +The same method can be used to set the [extent](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#extent "modding:general:resourcetypes:mdl") with `|extent` and a box [collider](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#collider "modding:general:resourcetypes:mdl") with `|collider_list`. + +##### Labels + +A [label](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl#label_list "modding:general:resourcetypes:mdl") is defined by two locators with `|label` of which one is the child of the other. The parent defines the bottom left corner, the offset to the nested child at the top right corner defines the size of the label. They + +1. need to be rotated in the same way. +2. need to lay in the same plane along their x/y axis. +3. need to have the z axis to look forward. + +### Bulk Import + +To import many models at once, e.g. for bridges and tunnels, it is possible to drag a `.txt` or `.log` file from the file explorer into the Model Editor. It must have the following content: + +```lua +Scene; +ModRefName; +DeleteTargetFolders; +Path; +Path; +``` + +It consists of: + +* `Scene`, which is an optional tag to memorize from which source file things were exported. +* `ModRefName`, which contains the mod id of the mod where the models shall be imported to. +* `DeleteTargetFolders`, which is an optional flag that allows overwriting all existing files in the mod. +* `Path`, which contains one folder path with `_lod0.fbx`, `_lod1.fbx`… . It is possible to have any number of such lines in the file. + +### FBX Construction Data Import + +To import construction data, the `.fbx` file format is used. Drag and drop it from the file explorer into the box of the option window Im-/Export tab. + +As there are some differences in `.fbx` files exported out of software from different vendors, not all files are imported properly. Currently, `.fbx` files from Modo and Blender are supported. See the information about [external tools](https://wiki.transportfever3.com/doku.php?id=modding:tools:external "modding:tools:external") to find out more about the available modelling software. + +#### Target Construction + +The `*.fbx` file needs to have `Empty` nodes on top level that point to the correct `*.script` file. The reference is written in the name, e.g. `/industries/brewery/brewery.script`. + +This `*.script` file needs to have the following lines: + +```lua +... +--Begin Generated +Β  +--End Generated +... +``` + +Anything between these two lines will be replaced on import. + +#### Hierarchy + +Depending on the used util, different top levels are used, e.g. `base`, `static` and `level1`. They are imported from `Empty` nodes with the name `.id`. Optionally, it is possible to append a comment with `#` which will be ignored for the import. + +All the other elements described below are nested as children of these top level nodes. + +#### Collider & Terrain Alignment + +The collider of the construction is defined with a `mesh` node with the name `collider.curve[#comment]`. + +To define the geometry for the terrain alignment, you can use `mesh` nodes with the names: + +* `less.mesh[#comment]` for the mesh that defines the upper limit for the terrain. +* `greater.mesh[#comment]` for the mesh that defines the lower limit for the terrain. +* `equal.mesh` for the mesh that defines the exact terrain alignment. + +#### Set Dressing + +The position, scale and rotation of models can be defined by adding `mesh` nodes with the name `::/.mdl[#comment]`. The properties of these nodes are taken for the transformation of the models. + +There are predefined groups of random assets in the `/scripts/construction/asset_util.tl`. These can be referenced with `.grp`. + +To synchronize the randomization of multiple elements, it is possible to set a `seed(`, e.g. `seed(123)|era_a_garden_chair.grp`. + +By default, the models will adjust their z coordinate according to the terrain at their position. To enforce the height relative to the construction origin, it is possible to add an `align` tag: `align|::/.mdl[#comment]`. + +It is possible to randomly skip set dressing models. This is done by using the keyword `ignore()`, e.g. `ignore(50)|::/assets/buildings/ind/boxes/wood_box_long.mdl#` will show the wooden box in 50% of the cases. + +If these three properties shall be applied on several models or group instances, it is possible to add an `Empty` node with the property, e.g. `align[#comment]` and nest all affected instances as children. + +##### Construction Data Example + +An exemplaric `*.fbx` file containing construction data is available for [download](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:modeleditor:construction_data_example.zip "modding:tools:modeleditor:construction_data_example.zip (3.3Β MB)"). diff --git a/docs/reference/wiki/modding_tools_start.md b/docs/reference/wiki/modding_tools_start.md new file mode 100644 index 0000000..e82b1cb --- /dev/null +++ b/docs/reference/wiki/modding_tools_start.md @@ -0,0 +1,85 @@ + + +Transport Fever 3 Wiki + +[Docs](https://wiki.transportfever3.com/)Β» [Modding Manual](https://wiki.transportfever3.com/doku.php?id=modding:start "modding:start")Β» [Tools](https://wiki.transportfever3.com/doku.php?id=modding:tools "modding:tools")Β» modding:tools:start + +--- + +# Permission Denied + +Sorry, you don't have enough rights to continue. + +[Transport Fever 3 Wiki](https://wiki.transportfever3.com/) + +Search + +[Game Manual](https://wiki.transportfever3.com/doku.php?id=gamemanual "gamemanual") + +● + +[Modding Manual](https://wiki.transportfever3.com/doku.php?id=modding "modding") + +* [Introduction](https://wiki.transportfever3.com/doku.php?id=modding:introduction "modding:introduction") +* [General](https://wiki.transportfever3.com/doku.php?id=modding:general "modding:general") + + + [Mod Definition](https://wiki.transportfever3.com/doku.php?id=modding:general:moddefinition "modding:general:moddefinition") + + [Syntax](https://wiki.transportfever3.com/doku.php?id=modding:general:syntax "modding:general:syntax") + + [Mod Parameters & Scripts](https://wiki.transportfever3.com/doku.php?id=modding:general:modscripts "modding:general:modscripts") + + [Resource Types & Structure](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes "modding:general:resourcetypes") + + - [.mdl](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mdl "modding:general:resourcetypes:mdl") + - [.msh](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:msh "modding:general:resourcetypes:msh") + - [.mtl](https://wiki.transportfever3.com/doku.php?id=modding:general:resourcetypes:mtl "modding:general:resourcetypes:mtl") + + [Guidelines & Requirements](https://wiki.transportfever3.com/doku.php?id=modding:general:guidelines "modding:general:guidelines") + + [Best Practices](https://wiki.transportfever3.com/doku.php?id=modding:general:bestpractice "modding:general:bestpractice") + + [Publish a mod](https://wiki.transportfever3.com/doku.php?id=modding:general:publishing "modding:general:publishing") +* [Tools](https://wiki.transportfever3.com/doku.php?id=modding:tools "modding:tools") + + + [Model Editor](https://wiki.transportfever3.com/doku.php?id=modding:tools:modeleditor "modding:tools:modeleditor") + + [Terrain Generator Editor](https://wiki.transportfever3.com/doku.php?id=modding:tools:terraingeneratoreditor "modding:tools:terraingeneratoreditor") + + [External Tools](https://wiki.transportfever3.com/doku.php?id=modding:tools:external "modding:tools:external") +* [Vehicles](https://wiki.transportfever3.com/doku.php?id=modding:vehicles "modding:vehicles") + + + [Vehicle Basics](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:basics "modding:vehicles:basics") + + [Vehicle Types](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:types "modding:vehicles:types") + + [Vehicle Advanced Topics](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:advancedtopics "modding:vehicles:advancedtopics") + + [Repaint Mods](https://wiki.transportfever3.com/doku.php?id=modding:vehicles:repaints "modding:vehicles:repaints") +* [Constructions](https://wiki.transportfever3.com/doku.php?id=modding:constructions "modding:constructions") + + + [Construction Basics](https://wiki.transportfever3.com/doku.php?id=modding:constructions:basics "modding:constructions:basics") + + [Construction Menu](https://wiki.transportfever3.com/doku.php?id=modding:constructions:menu "modding:constructions:menu") + + [Construction Types](https://wiki.transportfever3.com/doku.php?id=modding:constructions:types "modding:constructions:types") + + [Modular Constructions](https://wiki.transportfever3.com/doku.php?id=modding:constructions:modular "modding:constructions:modular") + + [Construction Templates](https://wiki.transportfever3.com/doku.php?id=modding:constructions:templates "modding:constructions:templates") + + [Ground Textures](https://wiki.transportfever3.com/doku.php?id=modding:constructions:groundtextures "modding:constructions:groundtextures") +* [Infrastructure](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure "modding:infrastructure") + + + [Tracks and Streets](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:tracksstreets "modding:infrastructure:tracksstreets") + + [Bridges and Tunnels](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:bridgestunnels "modding:infrastructure:bridgestunnels") + + [Signals](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:signals "modding:infrastructure:signals") + + [Railroad Crossings](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:railroadcrossings "modding:infrastructure:railroadcrossings") + + [Traffic Lights](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:trafficlights "modding:infrastructure:trafficlights") + + [Edge Addons](https://wiki.transportfever3.com/doku.php?id=modding:infrastructure:edgeaddons "modding:infrastructure:edgeaddons") +* [Environment](https://wiki.transportfever3.com/doku.php?id=modding:environment "modding:environment") + + + [Climate Zones](https://wiki.transportfever3.com/doku.php?id=modding:environment:climates "modding:environment:climates") + + [Environments](https://wiki.transportfever3.com/doku.php?id=modding:environment:environments "modding:environment:environments") + + [Terrain Generators](https://wiki.transportfever3.com/doku.php?id=modding:environment:terraingenerators "modding:environment:terraingenerators") + + [Terrain Materials](https://wiki.transportfever3.com/doku.php?id=modding:environment:terrainmaterials "modding:environment:terrainmaterials") + + [Animals](https://wiki.transportfever3.com/doku.php?id=modding:environment:animals "modding:environment:animals") + + [Landscape Assets](https://wiki.transportfever3.com/doku.php?id=modding:environment:landscapeassets "modding:environment:landscapeassets") +* [Misc](https://wiki.transportfever3.com/doku.php?id=modding:misc "modding:misc") + + + [Cargo Types](https://wiki.transportfever3.com/doku.php?id=modding:misc:cargo "modding:misc:cargo") + + [People](https://wiki.transportfever3.com/doku.php?id=modding:misc:people "modding:misc:people") + + [Sound Sets](https://wiki.transportfever3.com/doku.php?id=modding:misc:soundsets "modding:misc:soundsets") + + [Playlists](https://wiki.transportfever3.com/doku.php?id=modding:misc:playlists "modding:misc:playlists") + + [Names](https://wiki.transportfever3.com/doku.php?id=modding:misc:names "modding:misc:names") + + [Localizations](https://wiki.transportfever3.com/doku.php?id=modding:misc:localizations "modding:misc:localizations") +* [Scripting](https://wiki.transportfever3.com/doku.php?id=modding:scripting "modding:scripting") + + + [API Reference](https://wiki.transportfever3.com/doku.php?id=modding:scripting:api "modding:scripting:api") + + [Missions](https://wiki.transportfever3.com/doku.php?id=modding:scripting:missions "modding:scripting:missions") + +[Transport Fever 3](https://transportfever3.com) ● [Urban Games](https://urbangames.com) Β© 2026 diff --git a/docs/reference/wiki/modding_tools_terraingeneratoreditor.md b/docs/reference/wiki/modding_tools_terraingeneratoreditor.md new file mode 100644 index 0000000..de1a336 --- /dev/null +++ b/docs/reference/wiki/modding_tools_terraingeneratoreditor.md @@ -0,0 +1,73 @@ + + +### Table of Contents + +* [Controls](#controls) +* [Nodes](#nodes) +* [Node Categories](#node_categories) + +# Terrain Generator Editor + +The Terrain Generator Editor is a node based tool specifically made to edit terrain generators and material distributions. It is embedded in the Map Editor in the game itself after enabling it in the `settings.lua`by setting the `experimentalTerrainGeneratorEditor` property to `true`. + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?media=modding:tools:terraingeneratoreditor:terrain_generator_editor.png) + +The user interface of the Terrain Generator Editor consists of three sections, a headbar, the main blueprint board and a catalogue with node types 9 at the bottom. + +The headbar provides the following options: + +1 a toggle to switch between terrain generator and material distribution mode. +2 open dialog to load an existing node tree +3 save dialog to save the node tree +4 close button to reset the terrain generator editor in the empty state +5 undo and redo buttons to revert or redo the last step +6 a cancel button to abort the current operation +7 validation button that triggers a validation based on the selected mode from 1 +8 settings dialog to set a custom seed, preview map resolution and a parallelization factor for the preview computation. + +## Controls + +To control the node graph blueprint board, you can use mouse and keyboard: + +* Hold the right mouse button or use W, A, S and D to move the board. +* Use the mouse scroll wheel to zoom in or out. +* Use CTRL+C and CTRL+V to copy and paste nodes. +* Use R to jump back to the initial view. +* Use SHIFT and left mouse to selecte multiple nodes. + +## Nodes + +![](https://wiki.transportfever3.com/lib/exe/fetch.php?w=300&tok=a92f7f&media=modding:tools:terraingeneratoreditor:node.png) + +A node can be added by clicking on one of the buttons in the node catalog 9 at the bottom. The node consists of the following parts: + +1 Input connectors that receive various kinds of data from other nodes. The symbols and colors code the different data formats: + +* blue is a single number +* red is a pair of numbers, called point +* green is a list of pairs, called point cloud +* yellow is a full map + +2 Output connectors provide data which can be forwarded to other nodes. Both input and output connectors have an unlink button to drop all existing connections. +3 Additional Parameters of the node are accessible by clicking the dropdown. For some nodes, as with `From` and `To` in the example on the right, it is possible to define a local parameter instead of connecting something to an input connector. +4 To try the generator up to the point of a certain node, use the Generate Preview button. +5 After calculation, the eye button provides a preview of the test run result. +6 This preview can be exported to .tga files with the export button. +7 Each node can be renamed and recolored. + +## Node Categories + +The bottom menu provides all defined node types categorized in tabs: + +* Special contains the nodes that are usually used at the begin and end of the node trees to manage inputs, parameters and outputs. +* Numbers contains nodes to generate and operate on single decimal number values. +* Points contains nodes to generate and operate on pairs of decimal number values. +* Point Clouds contains nodes to generate and operate on lists of pairs of decimal number values. +* Map Generators contains nodes to generate simple maps from raw data and textures. +* Noise Maps contains nodes to generate various noise patterns as maps. +* Map Operations 1 contains nodes to operate on existing maps. +* Map Operations 2 contains advanced nodes to operate on existing maps. +* Combine Maps contains nodes to combine multiple maps with and without masks. +* Ridges & Rivers contains nodes specifically made for the generation of ridges and rivers. + +When hovering over a node type, a brief summary is displayed. When hovering over inputs and outputs, small hints are displayed as well. diff --git a/docs/research/mod-tooling.md b/docs/research/mod-tooling.md new file mode 100644 index 0000000..5001dce --- /dev/null +++ b/docs/research/mod-tooling.md @@ -0,0 +1,49 @@ +# TpF3 mod tooling and mod structure + +Resolves issue #3. Offline copies of sources: `docs/reference/wiki/` (wiki, converted to Markdown) and `docs/reference/script-doc/` (selected script-doc pages; the full site has ~320 pages, we kept `api*`, `app`, and a few `content/` modules). Example mod: `.examples/ug_tf3_example_config_change`. + +## Mod folder layout +Source: wiki `modding:general:moddefinition`. + +``` +_/ dir name not functional; keep == modId + _metadata/modinfo.json name (<=32 chars), summary (<=100), description, localization, authors, tags, dependencies (mod.io ids), url + _metadata/0.png, N.png 1920x1080 previews; description.html optional + content/ all resources; mirror base-game structure + mod.script.tl optional script functions + mod.json technical definition + strings.json optional translations {lang:{key:text}} +``` +Mods are plain directories. Do not edit the install dir. Install by copying into `staging_area/` in the userdata dir (e.g. `...\Steam\userdata\\3493540\local\staging_area\`; userdata folder reachable via Settings > Advanced > Open user data folder). modId precedence if duplicated: Staging Area > Manual install dir > Subscribed. + +## mod.json +Keys: `modId` (a-z0-9_, `_`, no `_3` major suffix as in TpF2), `revision` (int, bump per release), `severityAdd`/`severityRemove` (`None|Warning|Critical`; defaults None/Warning), `visible` (default true), `cosmetic` (true only if no simulation impact; keeps achievements), `dependencies[]` ({mod:{modId,revisionMin,revisionMax}, modInfo:{displayName,url}, loadBefore (default true), optional (default false)}), `incompatibilities[]`, `params[]` (key, name, tooltip, uiType Button|Slider|ComboBox|IconButton|CheckBox, values, numbers, defaultIndex 0-based while Lua/Teal indices are 1-based), and script hooks. Static JSON on purpose so a broken definition cannot prevent game start. + +Example mod's mod.json: modId `ug_tf3_config_change`, revision 1, severityAdd None, severityRemove Warning, cosmetic false, `preRunScript.fileName = "ug_tf3_config_change::mod.script@preRunFn"`. modinfo.json there uses tag `script`; wiki sample uses "Script Mod" (see `modding:general:modtags` for the official list). + +## Teal vs Lua +Source: wiki `modding:general:syntax`. All scripts are Lua (5.2 manual referenced); scripts "usually use the Teal dialect" (statically typed Lua: `: type` annotations, `record`). Only `local` variables, no globals. Types: any, nil, boolean, integer, number, string. Teal source files are `.tl` (e.g. `mod.script.tl`); wiki examples still also show `.con.lua`/`.script.lua` for constructions, so both coexist. Import: `ug_require "::/scripts/name.lua"`. Resource refs use `::/path`. Script-doc signatures are written in Teal (`global record Api`, `function(...): T`), so it doubles as the type definition source (BaseConfig, ModelMetadata, etc.). + +## Entry points +Source: wiki `modding:general:modscripts`; example `mod.script.tl`. +Referenced from mod.json as `::@`. Base-game functions run first, then mods in activation order. +- `preRunScript` (preRunFn): before resources load. Args `(configDict {{string,string}}, allModParams {string:{string:integer}}, baseConfig BaseConfig)`. Mutate `baseConfig` fields (e.g. example sets `baseConfig.trainAccelerationFactor = 0.5`). Full property list: wiki `modding:scripting:baseconfig`. +- `runScript` (runFn): when mod loads; `(configDict, allModParams)`. Can register file filters / resource modifiers (see `modding:scripting:modifiersfilters`), but postRun preferred. +- `postRunScript` (postRunFn): once after all resources loaded; `(configDict, allModParams)`. Use `api.res.*` (e.g. `modelRep.forEachModelWithMetadata`, `getAsTable`/`setAsTable`/`addAsTable`, `setVisible`). Cannot add new 3D resources, only reference existing `.mdl`. +Own params: `allModParams[getCurrentModId()].`. The example module shape is `local mod = {}; mod.preRunFn = function(...) end; return mod`. + +## Logging and debugging +Source: wiki `modding:tools:ingame`, `modding:scripting:api`. +- Enable debug mode: `debugMode = true` in `settings.lua`, or Settings > Advanced. Enables hotkeys, debug views, Debug Tool Window (AltGr+D). +- Ingame console (key below ESC): shows `stdout.txt` output, runs Lua; commands `\clear`, `\stdout `, `\history`; CTRL+SPACE autocomplete. +- `debugPrint()` dumps table structures; wiki recommends testing API calls in the console. +- Model Editor opens a console window with debug output. Script-doc has no dedicated logging module (searched `api*`); `print` use is not documented, so verify empirically. + +## Editor tooling +Source: wiki `modding:tools:external`. +- VS Code recommended (Notepad++ alternative, Lua highlighting only). Install Teal (github.com/teal-language/tl) plus extensions `sumneko.lua` (LuaLS) and `pdesaulniers.vscode-teal`. "The Model Editor automatically creates necessary workspace configuration files in the Staging Area" (so editing mod scripts inside the staging area picks up Teal config; the config contents are not documented on the wiki). +- Model Editor (`ModelEditor.bat` in install dir; config under `%APPDATA%/Transport Fever 3/` where `userDataPath` must be set with forward slashes) for models/vehicles. Blender (FBX), GIMP/Paint.NET/Compressonator (DDS) for assets. +- Script reference: https://wiki.transportfever3.com/script-doc/ (root `api` global: res, gui, engine, type, util, cmd, modhub; plus `app`). + +## Gaps +Not resolved by sources: exact contents of the auto-generated Teal workspace files, whether `print` reaches stdout.txt, how a `.tl` is compiled (game appears to load Teal directly, undocumented). Wiki pages for baseconfig/modifiersfilters were saved; the 320 script-doc `content/` modules were mostly not.