API reference¶
Generated from the Teal definition files (*.d.tl) that ship with the game. Text from the game files is shown as is; text in highlighted boxes was written for this site.
- Engine API (
api/tealdef): the scripting interface of the game engine (api.engine,api.cmd,api.gui,api.res,api.type,api.util, …). - Base game scripts (
base/tealdef): the Lua/Teal libraries of the base game (construction utilities, vehicles, stations, GUI framework, missions, …) that mods can require and reuse.
Coverage: 13794 of 14598 symbols have a description (94 %). See coverage.
Engine API¶
| Module | Description |
|---|---|
| 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 |
| api/engine/index | 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 an |
| api/engine/system | Contains definitions for of api.engine.system |
| api/engine/util | Contains definitions for of api.engine.util |
| api/gui | Contains all GUI functionality apart from react. |
| api/index | Declares the global api table, the entry point of the engine scripting API, and the globals app and loaderHelper. api.engine reads the entity component system, api.cmd changes it through commands, api.res hol |
| api/modhub | Contains all api definitions for the modhub interface. |
| api/res | Repositories containing game resources (models, tracks, streets, ...) |
| api/type/index | Contains game command objects and related utilities. |
| api/type/mod | Contains all type definitions for the mods. |
| api/type/modhub | Contains all type definitions for the modhub. |
| api/type/transformator | Types used by transformator scripts: the per-frame scripting info a model's update script reads (vehicle, aircraft, ship, industry, world, ...), and the output objects it writes to (Transformator.TransfOutput, `Transfo |
| api/util | Contains generic util functions that are not associated with a specific game instance. All functions in this namespace can be called from anywhere. |
| api_def | Aggregate definition file: requires every engine API definition module in order (api.type, api.type.mod, api.type.modhub, api.type.transformator, api.res, api.engine, api.engine.system, api.engine.util, ` |
| app | Module controlling high level functions for the application, can be used to manipulate save games. |
| main | Basic definitions for all APIs |
Base game scripts¶
| Module | Description |
|---|---|
| base/difficulty_util | Types of /base/difficulty_util.tl (DifficultyUtil): the difficulty presets of the new-game settings and the value tables that map a settings level to a scale factor. |
| base/model_metadata_util | Types of /base/model_metadata_util.lua (ModelMetadataUtil). Each (fileName, data) function is a loadModel modifier that the base mod registers with addModifier("loadModel", ...): it receives a model file's data |
| base/post_run_util | Types of /base/post_run_util.tl (PostRunUtil), which applies the game's cost scale settings to loaded resources after all mods have run. |
| climates/gen/map_gen_util_serialized | Types of the map generator's river and ridge helpers, /climates/gen/mapgenutil.tl (MapGenUtil) and /climates/gen/rivermapgenutil.tl (RiverMapGenUtil). The map editor's node editor (`gui/node_editor/layer_nodes.sc |
| content_def | |
| game_mechanics/achievements/sound/achievement_sfx | Sound played when an achievement is earned (achievement_sfx.gres). |
| game_mechanics/celebrations/celebration_react_util | Celebration types, the GUI event that shows a celebration and the recipe that displays them. |
| game_mechanics/celebrations/gui/celebration_colors | GUI color of celebration callouts (celebration_colors.gres). |
| game_mechanics/celebrations/gui/sound/celebration_sfx | Sound of celebration callouts (celebration_sfx.gres). |
| game_mechanics/company/company | State of the company game script (::/game_mechanics/company/company.gs) and the params of its notifications. |
| game_mechanics/company/company_metadata | Company metadata of constructions (metadata.company), which ties perks, landmarks and the headquarters to company ranks and permits. |
| game_mechanics/company/company_progression_util | Company experience and rank, read from the ::game_mechanics/company/company_progression.gs game script. |
| game_mechanics/company/company_react_util | GUI helpers of the company window. |
| game_mechanics/company/company_static_util | Rank names and permit-key definitions (company_permit_key resources). |
| game_mechanics/company/company_util | Permit counting, disable reasons and state access of the company. |
| game_mechanics/company/explorations/exploration_plane | State of the plane that flies over a town during a prospection. |
| game_mechanics/company/prospection_metadata | Company metadata used when a construction is placed with the prospection tool. |
| game_mechanics/company/sound/company_sfx | Sound effects of the company window (company_sfx.gres). |
| game_mechanics/emission/emission_config_metadata | Noise and pollution figures of station modules shown in the construction menu (metadata.emissionConfig). |
| game_mechanics/emission/emission_metadata | Noise and pollution emitted by constructions (metadata.emission), and the emission config. |
| game_mechanics/emission/emissions | State of the emissions game script (eco levels of industries). |
| game_mechanics/finance/account | Params of the finances window. |
| game_mechanics/finance/finances_react_util | Chart, legend and slider recipes of the finances window. |
| game_mechanics/finance/finances_util | Labels and ordering of journal entries in the finances window. |
| game_mechanics/finance/loan | Loans offered to and taken by the player (state of loan.gs). |
| game_mechanics/finance/loan_util | Creation and payment calculation of loans. |
| game_mechanics/finance/sound/finance_sfx | Sound effects of the finances window. |
| game_mechanics/fun_elements/blimp_util | Airship that circles a town during a marketing campaign. |
| game_mechanics/fun_elements/custom_entity_util | Helpers to spawn, move and remove custom entities (script-controlled models), plus movement maths for flying ones. |
| game_mechanics/fun_elements/fun_elements | State and helpers of the fun elements game script (airships over towns, UFOs abducting cows). |
| game_mechanics/fun_elements/rocket_util | Rockets for the fireworks and for the rocket launch in campaign mission 8. |
| game_mechanics/fun_elements/ufo_util | UFO that flies in, abducts a cow from a livestock farm and leaves. |
| game_mechanics/game_time/game_time | State, config and events of the game script that drives the time of day and the cloud coverage. |
| game_mechanics/industries/industries | State and config of the industries game script (expansion and closure of industries). |
| game_mechanics/notifications/gui/notification_colors | GUI colors of the notification categories (notification_colors.gres). |
| game_mechanics/notifications/gui/sound/notification_sfx | Sounds of notification pop-ups (notification_sfx.gres). |
| game_mechanics/notifications/notification_legacy_util | Initial state and save-game migration of the notifications game-script state. |
| game_mechanics/notifications/notification_util | Helpers that read notification type resources and change or read the notifications game-script state. |
| game_mechanics/notifications/notifications | Records of the notification system, the state of its game script and the event params for adding, dismissing and ignoring notifications. |
| game_mechanics/notifications/types/notification_react_util | GUI recipes for notification icons, HUD icons and progress bars. |
| game_mechanics/notifications/types/notification_types | Params and sim params of the base game's notification types in game_mechanics/notifications/types/. |
| game_mechanics/subventions/specific_subvention | Parameters for spawning one of the four base game subsidy types for a given target, as missions do. |
| game_mechanics/subventions/subvention | Types of the subsidy system, its saved state and the interface each subsidy type script implements. |
| game_mechanics/subventions/subvention_legacy_util | Upgrade of subsidy state from older savegames. |
| game_mechanics/subventions/subvention_util | Helpers shared by the subsidy type scripts (default timeouts, rewards and penalties, card and notification data). |
| game_mechanics/subventions/subventions_gui | Window content for a single subsidy. |
| game_mechanics/towns/district_colors | Colour ranges of the three district types, loaded from district_colors.gres. |
| game_mechanics/towns/sound/town_sfx | Sound effect lists for town events, loaded from sound/town_sfx.gres. |
| game_mechanics/towns/town_cargo | Town experience and level state of the town growth script (town_cargo.gs) and its configuration. |
| game_mechanics/towns/town_growth_metadata | Construction metadata (town_growth) for town bonuses of landmarks, and the town level-up notification records. |
| game_mechanics/towns/town_marketing_metadata | Construction metadata (town_marketing) of marketing campaigns. |
| game_mechanics/towns/town_react_util | React recipes and label helpers for the town window and town rating icons. |
| game_mechanics/towns/town_util | Town ratings, reputation bookkeeping and helper functions (game_mechanics/towns/town_util.tl). |
| game_mechanics/towns/town_util_parallel | Town functions for GUI widgets that run through engine_react_util.useStepStateParallel and return plain tables. |
| game_mechanics/towns/towns | State records of the town reputation script (town.gs) and the shared town types (ratings, supply and demand, proposal statistics). |
| gui/construction/construction_colors | Colors of the construction tools, loaded from the GUI resource ::/gui/construction/construction_colors.gres. |
| gui/construction/construction_desc_react_util | Helper module for the info panel of construction menu entries (::/gui/construction/construction_desc_react_util.tl): collects the numbers (cost, maintenance, emissions, effects, permits) from a definition and its metad |
| gui/construction/construction_menu | Shared types of the construction menu: menu tabs and categories, menu entries (ConstructionDefinition), their parameters (ConstructionMenuParam), the parameter API of the menu, HUD icon configuration and custom tool |
| gui/construction/construction_react_util | Helper module of the construction menu (::/gui/construction/construction_react_util.tl). Builds the menu entries from the resource repositories (constructions, streets, tracks, modules, terrain materials, `construction |
| gui/construction/sound/construction_sfx | Sound effects of the construction tools, loaded from the GUI resource ::/gui/construction/sound/construction_sfx.gres. |
| gui/construction/track_description_metadata | Metadata accessor (track_description) that attaches the speed and lane count of a street or track type to its construction menu entry. |
| gui/construction/track_modifier_metadata | Metadata accessor (track_modifier) that attaches the noise, pollution and speed modifiers of a street type or edge decoration to its construction menu entry. |
| gui/context_helper/context_helper | State of the context helper game script (context_helper.script.tl). |
| gui/entity_window/animal/animal_eow | Extension point and plugins of the animal window (/gui/entity_window/animal/animal_eow.script.tl). |
| gui/entity_window/empty_construction/empty_construction_eow | Extension point and plugins of the window of constructions without a more specific window (empty_construction_eow.script.tl). |
| gui/entity_window/entity_window_hud | HUD icon masters, pre-filters and tooltip filters used while an entity window is open: they decide which world entities get HUD icons (and hover tooltips) related to the selected entity, e.g. the suppliers and consumers |
| gui/entity_window/entity_window_util | Shared React recipes and helpers for the entity windows (info windows of vehicles, stations, industries, towns, persons ...): stock bars, charts, action button bars, rating and progress bars, person tables, notification |
| gui/entity_window/eow_extension_util | Shared parameter interface and ownership helper for the extension points (plugins) of the entity windows. |
| gui/entity_window/fun_elements/fun_elements_eow | Extension point and plugins of the window of fun elements such as UFOs and blimps (fun_elements_eow.script.tl). |
| gui/entity_window/gameplay_colors | Colours of gameplay concepts used in the GUI, loaded from /gui/entity_window/gameplay_colors.gres. |
| gui/entity_window/industry/industry_eow | Plugin types of the industry window (industry_eow.script.tl). |
| gui/entity_window/industry_react_util | React recipes of the industry and perk windows that show production rules (inputs, outputs, progress and duration) and the workers boost. |
| gui/entity_window/line/line_eow | Plugins and widgets of the line window (line_eow.script.tl). |
| gui/entity_window/maintenance_station/maintenance_station_eow | Plugin types of the maintenance station (maintenance building) window (maintenance_station_eow.script.tl). |
| gui/entity_window/perk/perk_eow | Plugin types of the perk window (landmarks, headquarters and other company buildings) (perk_eow.script.tl). |
| gui/entity_window/sim_person/sim_person_eow | Plugin types of the resident (sim person) window (sim_person_eow.script.tl). |
| gui/entity_window/station_group/station_group_eow | Extension point of the station window (station_group_eow.script.tl); the base game registers no plugins for it. |
| gui/entity_window/town/town_eow | Plugin types and charts of the town window (town_eow.script.tl). |
| gui/entity_window/town_building/town_building_eow | Extension point of the town building window (town_building_eow.script.tl); the base game registers no plugins for it. |
| gui/entity_window/vehicle/vehicle_eow | Plugin types of the vehicle window (vehicle_eow.script.tl). |
| gui/entity_window/view_manager | Types of the entity window manager (/gui/entity_window/view_manager.tl) and of the functions that build entity window contents (make_entity_window.tl, make_non_entity_window.tl). Also the return type that a constru |
| gui/entity_window/view_manager_util | Helpers that decide whether and for which entity a window is opened when an entity is selected. |
| gui/entity_window/warehouse/warehouse_eow | Plugin types of the warehouse window (warehouse_eow.script.tl). |
| gui/game_bar/game_bar | The game bar at the bottom of the game screen (money, construction and tool buttons, statistics, calendar, speed controls) and the main radial menu. Both are created in gui/main/game.tl. |
| gui/game_bar/game_bar_widgets | Widgets shown in the game bar: game speed buttons, calendar display and the "Weather and Time" editor, camera and music player buttons, and the info display that mods can extend through GameBarInfoDisplayExtension. |
| gui/guidesystem/sound/guidesystem_sfx | Sound effects of the guide system, loaded from the GUI resource ::/gui/guidesystem/sound/guidesystem_sfx.gres. |
| gui/hud/hud_gui_config | Type of the GUI resource ::/gui/hud/hud_gui_config.gres (defined in hud_gui_config.gres.lua): distance scales, colors and vehicle icon offsets for the HUD icons drawn in the 3D view. |
| gui/hud/hud_react_util | Helpers for configuring HUD icons in the 3D view: building and editing Builtin.Type.VisibilityThresholds, the default line-viewer snap factors and per-carrier vehicle icon offsets. |
| gui/layers/layer_cargo | The "Cargo Satisfaction" map layer (button menu.layers.cargoButton). |
| gui/layers/layer_cargo_flow | The "Cargo Flow" map layer (button menu.layers.cargoFlowButton). |
| gui/layers/layer_colors | Type of the GUI resource ::/gui/layers/layer_colors.gres (defined in layer_colors.gres.lua): the colors every map layer uses. Read it with `api.gui.genericRep.get(api.gui.genericRep.find("::/gui/layers/layer_colors.g |
| gui/layers/layer_hud_filter | The "HUD Filters" layer window, where the player hides HUD icons per building type and per vehicle carrier. |
| gui/layers/layer_noise | The "Noise" map layer (button menu.layers.noiseButton). |
| gui/layers/layer_pollution | The "Pollution" map layer (button menu.layers.pollutionButton). |
| gui/layers/layer_public_transport | The "Passenger Satisfaction" map layer (button menu.layers.publicTransportButton). |
| gui/layers/layer_react_util | Shared building blocks of the map layers: gradient legend colors, town rating and demand HUD icons, filtered entity tooltips, legend containers and fallback colors for a LayerConfig. |
| gui/layers/layer_traffic | The "Traffic" map layer (button menu.layers.trafficButton). |
| gui/layers/layers_button_ridge | The layers button and its expandable ridge of layer buttons (terrain, towns, traffic, flows, noise, pollution, HUD filters), plus the parameter types shared by all layer windows. |
| gui/line_vehicle_mgmt/cargofilter_window | The per-stop cargo filter popover of the line manager (/gui/line_vehicle_mgmt/cargofilter_window.tl, which returns the window recipe directly). |
| gui/line_vehicle_mgmt/feedback_list_util | A feedback strip that shows one timed message at a time (info, warning, error or a question with an accept button), used by the line and vehicle manager and the vehicle entity window. |
| gui/line_vehicle_mgmt/line | Types for the GUI-side copy of a line that the Line & Vehicle Manager edits before it is sent to the engine with api.cmd.makeLineCreateCmd / api.cmd.makeLineUpdateCmd. |
| gui/line_vehicle_mgmt/line_react_util | Small React widgets and helpers used by the Line & Vehicle Manager and the entity windows: line colour dots and colour picker, name labels with rename and locate buttons, line balance, transported items, cargo display an |
| gui/line_vehicle_mgmt/line_util | Line utilities of the Line & Vehicle Manager (LVM): converting between the engine LINE component and the editable Line.ReactLine, stop/waypoint index conversion, automatic terminal and cargo-load assignment, the sele |
| gui/line_vehicle_mgmt/manager_hud_util | HUD icon recipe used by the Line & Vehicle Manager for stations, depots, vehicles, towns and industries while the manager tool is active. |
| gui/line_vehicle_mgmt/manager_tooltips_util | Tooltip recipes shown next to the cursor while the Line & Vehicle Manager tool is active (prefix LM = line management, VM = vehicle management). |
| gui/line_vehicle_mgmt/manager_window | The Line & Vehicle Manager window and tool, its line/depot list and vehicle list APIs, and the data types of the auto-rename and "first stop to send" schemes (loaded from rename_scheme, rename_scheme_component and `f |
| gui/line_vehicle_mgmt/sound/lvm_sfx | Sound-effect lists of the line and vehicle manager, loaded from ::/gui/line_vehicle_mgmt/sound/lvm_sfx.gres. |
| gui/line_vehicle_mgmt/vehicle_list_react_util | The vehicle list table of the line and vehicle manager (vehicle selection checkbox, line or depot, name and icons per row). |
| gui/line_vehicle_mgmt/vehicle_react_util | GUI recipes for vehicles (icons, condition, balance) and HandleVehicleChanges, which turns store results into buy, replace and sell commands. |
| gui/line_vehicle_mgmt/vehicle_store | Shared types of the vehicle store (buy / replace / modify vehicles window): store mode, browser filter and sort settings, and the shopping-cart API. |
| gui/line_vehicle_mgmt/vehicle_store_table | Parameters of the table layout of the vehicle store (/gui/line_vehicle_mgmt/vehicle_store_table.tl, which returns the recipe directly). |
| gui/line_vehicle_mgmt/vehicle_store_util | Helpers of the vehicle store: collect displayable vehicle data from model metadata, filter vehicles, match depot filter tags and transport modes, and small filter widgets. |
| gui/line_vehicle_mgmt/vehicle_store_window | The vehicle store window and its entry point, which listens for the buyVehicles, replaceVehicles and modifyVehicles GUI events. |
| gui/line_vehicle_mgmt/vehicle_util | Small helpers for vehicles and depots - lifespan and age, condition text and icons, carrier of a depot, vehicle type, capacity checks and the year-dependent value ranges used to scale the store's progress bars. |
| gui/main/button_react_util | Shortcut functions that build builtin.Button and builtin.ToggleButton nodes with a text, an icon or both as content. Load the module with ug_require "/gui/main/button_react_util.tl". |
| gui/main/callout_react_util | Recipes for callouts (small popups anchored to a node): a toggle button that opens a callout while it is pressed, and a default wrapper that draws callout content with an arrow. Callouts are shown by the callout containe |
| gui/main/cargo_react_util | React recipes and node builders for cargo: cargo icons, cargo lists of vehicles, lines and warehouses (count/capacity per cargo type with tendency, quality and loading state), the input/output arrow display of industries |
| gui/main/cargo_util | Functions that collect cargo data for the UI: stock contents of industries, warehouses and town buildings, cargo loaded in vehicles and on lines, cargo type icons, names and colours, and cargo flow counts. All functions |
| gui/main/collapsible_checkbox_list | Lists of checkbox entries under a header button: either collapsible in place (CollapsibleCheckboxList) or opened as a callout (CheckboxListCallout). Both support mouse and gamepad. |
| gui/main/color_util | Colour types of GUI resource files (*.gres) and helpers that turn them into Vec3f/Vec4f values, add transparency, mix colours and derive hover/active shades. |
| gui/main/content_card | Note: collapsible elements should not get extraChildren |
| gui/main/credits_react_util | The credits slide show of the main menu. The slides come from gui/menu/configs/credits_screen_data.lua, which returns a table of the form { slides = {...} }. |
| gui/main/default_colors | The base colour palette of the GUI, from the resource ::/gui/main/default_colors.gres. Style sheets (*.css.lua) read it with api.gui.genericRep.get(api.gui.genericRep.find("::/gui/main/default_colors.gres")).data. |
| gui/main/disable_features | Names of game UI features that a mission can switch off. Missions return them as disableFeatures = { ["Layers"] = true }; the mission script fires the setDisableFeatures React event and the game UI keeps the set in ` |
| gui/main/engine_react_util | React hooks that mirror engine data into React state. Each hook re-reads the engine through a getFromEngine callback (every step, on a timer or in a worker thread), updates the state only when the value changed, and mo |
| gui/main/free_cam_options | The free camera tool of the game UI: a tool for the tool stack that switches to the free camera (or the cockpit camera of a vehicle) and a recipe that handles leaving it. |
| gui/main/game_context | Types for the shared in-game GUI context (GameContext), the dialogue overlay and callout APIs, the game speed API and the base game's GUI save data. |
| gui/main/game_react_globals | Global access to the main parts of the in-game GUI for code that has no GameContext, loaded with ug_require "/gui/main/game_react_globals.tl". |
| gui/main/game_tooltips | Tooltip recipes for the 3D view, loaded with ug_require "/gui/main/game_tooltips.tl". |
| gui/main/game_windows | Parameter types of some in-game windows and tools, notably the context help window and the construction tool. |
| gui/main/gui_react_util | General React helpers of the game UI: icon/label indicators (the icon with a number used in HUD icons and entity windows), small layout shortcuts, colour contrast helpers, focus and input-action wrappers, the emote icon, |
| gui/main/gui_res_modding | |
| gui/main/hudIconMaster | Older declaration of the HUD icon parameter types. The base game uses the identical types from HudIconToolbox (gui/main/hud_icon_toolbox). |
| gui/main/hud_icon_toolbox | Recipes for the HUD icons drawn above entities in the 3D view (vehicles with their cargo, stocks, waiting passengers at stations, towns, perk icons, notifications), and the parameter types that custom HUD icon scripts re |
| gui/main/industry_util | Helpers for the industry UI: production boosts (worker boost and booster rules), input and output data per rule, production numbers, satellite slots, connection checks, removing industries, and finding suppliers and cons |
| gui/main/input_action_colors | Colours of the four face buttons of a gamepad, as a GUI resource (::/gui/main/input_action_colors.gres), used for key binding hints. |
| gui/main/main_mod_button_area | Horizontal button bar for mods in the game UI. Mods add buttons through the MainModButtonAreaExtension extension point; when at least one plugin exists, the radial menu gets a "Mods" entry that focuses the bar. |
| gui/main/menu_category_util | Filtering of selectable objects (bridges, tunnels, street types, ...) by menu category. Filter categories are menu_filter_category resources; objects carry a menuCategory in their metadata. Includes the filter panel, |
| gui/main/mod_entry_point | Extension point through which mods add their own top-level React UI to the game view. |
| gui/main/particle_colors | Colours of GUI particle effects, as a GUI resource (::/gui/main/particle_colors.gres), used by ParticleReactUtil. |
| gui/main/particle_react_util | Helpers for 2D GUI particle effects (builtin.ParticleSystem2d): presets for the company level-up and unlock animations and a builder that turns a plain table into a ParticleSystem2dEmitter. |
| gui/main/popover_react_util | Popover windows: small windows that open next to a toggle button and close when the user clicks outside of them or presses back. |
| gui/main/radial_menu_extension | Extension point through which mods add entries to the main radial menu of the game bar. |
| gui/main/script_param_util | Widgets for script parameters (ScriptParam): the settings of the base game and of mods that are shown as buttons, icon buttons, sliders, combo boxes or checkboxes, e.g. in the new-game and mod settings and in the const |
| gui/main/selection_colors | Colours of the selection highlight in the 3D view, as a GUI resource (::/gui/main/selection_colors.gres). |
| gui/main/selector | Result and parameter types of a line/station/vehicle selector. No base-game script uses these types; the selectors of the game UI are built with SelectorReactUtil and builtin.Selector. |
| gui/main/selector_react_util | The default entity selector of the game view: picking entities with the mouse (hover highlight, tooltips, selecting an entity opens its window), the HUD icon configuration that goes with it, and the gamepad inspector too |
| gui/main/styleutil | Helper that builds an api.gui.StyleSheet from a plain Lua table. |
| gui/main/tile_list_react_util | Tile lists: grids of tiles with an image, a title, info icons and buttons, as used for save games and mods in the main menu. |
| gui/main/tool_react_util | Helpers for tools of the tool stack (gameCtx.toolStack): register a tool that opens a window while it is active, and delegating tools that are pushed through React events. |
| gui/main/town_hud_react_util | The HUD icon of towns (name, population, growth progress and received cargo types). |
| gui/map_editor/map_editor | Windows of the map editor for generating or importing the height map, generating towns and industries and generating main connections, loaded with ug_require "/gui/map_editor/map_editor.tl". |
| gui/menu/dialog_react_util | Generic modal dialog window (title, text, a row of choice buttons) used throughout the menus and the in-game GUI. |
| gui/menu/difficulty_react_util | Toggle-button row that applies one of the difficulty presets (Easy, Medium, Hard, Very Hard) to a set of game-mechanic parameters. |
| gui/menu/graphics_presets_util | Graphics quality presets (desktop and console) and helpers to detect or apply a preset on an AppConfig. |
| gui/menu/main_menu | Shared types of the main menu and the in-game pause menu: page names, the common parameters every menu page receives, save-game groups and release-note data. |
| gui/menu/map_preview_colors | Colour resource for the town and industry markers of the map preview (MapPreviewComp) in the new-game menu. |
| gui/menu/menu_icon_react_util | Building blocks of the main menu pages (buttons, image cards, paged card grids, page frame, hint panel), loaded with ug_require "/gui/menu/menu_icon_react_util.tl". |
| gui/menu/menu_util | Small main-menu recipes: the user profile badge and the animated game-edition logo. |
| gui/menu/mod_colors | Colour resource for the mod browser. |
| gui/menu/mod_manager_react_util | Building blocks of the Mod Hub (mod browser, mod details, upload form, login, report and dependency dialogs) and helpers around the api.modhub backends. |
| gui/menu/mod_util | Checks the dependencies, load order and incompatibilities of a list of active mods and turns the findings into a readable message. |
| gui/menu/new_game_react_util | Helpers of the "new game" and "new map" settings pages, loaded with ug_require "/gui/menu/new_game_react_util.tl". |
| gui/menu/paradox_react_util | Paradox account recipes and texts (login, account creation, account linking, profile name), loaded with ug_require "/gui/menu/paradox_react_util.tl". |
| gui/menu/releasenotes_util | Builds the pages of the release-notes window from ReleaseNoteData. |
| gui/menu/savegame_react_util | Savegame helpers and recipes of the load, save and new game pages, loaded with ug_require "/gui/menu/savegame_react_util.tl". |
| gui/menu/sound/main_menu_sfx | Sound resource of the main menu. |
| gui/sound/gui_comp_sfx | specific on exits: |
| gui/statistics/statistics | The statistics window (lists of lines, vehicles, stations, towns, industries, warehouses and depots) and the parameter types of its tabs, loaded with ug_require "/gui/statistics/statistics.tl". |
| gui/statistics/statistics_react_util | Helpers shared by the statistics tabs (filter bars, search field, cargo columns, problem column), loaded with ug_require "/gui/statistics/statistics_react_util.tl". |
| industries/industry_productivity_util | Types of /industries/industry_productivity_util.tl (IndustryProductivityUtil): helpers for the worker boost of industries, which raises an industry's productivity while enough workers arrive by line. |
| industries/industry_workers | State of the ::/industries/industry_workers.gs game script, which records the workers that reach each industry by line. |
| infrastructure/traffic_light/traffic_light | |
| landmarks/hq/headquarter_util_serialized | Types of the company headquarter construction (/landmarks/hq/hq/headquarter.script.tl): a modular construction on an 8 m grid whose modules add further slots around themselves. |
| landmarks/landmark | State and notification types of the landmarks game script (/landmarks/landmarks.script.tl). |
| landmarks/landmark_util | Types of /landmarks/landmark_util.tl (LandmarkEngineUtil), which adds up the town bonuses that finished landmarks and the headquarter grant to their closest town. |
| landmarks/landmark_util_serialized | Types of /landmarks/landmark_util_serialized.tl (LandmarkUtilSerialized), the shared update function of the landmark constructions. |
| mission/arrival_tracker | Client of the arrival-tracker game script, which counts passengers and cargo delivered between two places. |
| mission/builder_util | Small geometry helpers for checking build proposals in mission tasks. |
| mission/calendar | Date helper for missions. |
| mission/guide_system/guide_system_react | GUI recipe that shows the hints (guides) of the guide system. |
| mission/guide_system/guides/guide_event | Guide task triggered by a matching script event. |
| mission/guide_system/guides/guide_generic | Guide task triggered by a custom condition function. |
| mission/guide_system/guides/guide_state | State interface shared by all guide task scripts. |
| mission/guide_system/guides/guide_timer | Guide task triggered after a delay that depends on its importance. |
| mission/guide_system/guides/guide_ui_event | Guide task triggered by a matching GUI event. |
| mission/mission_boot_util | Helpers that turn a task-data factory and a list of boot tasks into the script module that the mission or guide-system game script boots from. |
| mission/mission_colors | Colour palette (gui_res ::/mission/mission_colors.gres) used by mission markers, zones and highlights. |
| mission/mission_framework/mission_end_window_util | GUI content of the window shown at the end of a mission (stars, medals, success). |
| mission/mission_framework/mission_framework_react | GUI of the mission window (task list and task details). |
| mission/mission_framework/mission_framework_react_util | GUI building blocks of the mission window (task progress, option buttons, instruction buttons, links). |
| mission/mission_framework/mission_framework_util | Low-level access to task vtables, task contexts and the mission state. |
| mission/mission_framework/mission_framework_util_entity | Commands that change ownership of, build, upgrade or bulldoze entities during a mission. |
| mission/mission_framework/mission_framework_util_line | Finds lines that connect stations in two areas. |
| mission/mission_framework/mission_interface | onCompleteScriptFn : string onCompleteScriptFnParams : any getTaskInfoScriptFn : string getTaskInfoScriptFnParams : any |
| mission/mission_pathfinding_util | Path finding between entities and areas on the transport network, used by mission tasks. |
| mission/mission_react_util | GUI parameters of the mission dialogue / voice-over overlay. |
| mission/mission_task_util | Declarative task description (StaticTaskInfo) used by mission stories, plus helpers for task keys and areas. |
| mission/mission_types | MissionOutline: helpers that build zone polygons and circles for mission tasks. |
| mission/modifier | Resource-modifier helper that missions use to patch loaded game resources by file path. |
| mission/name_util | Helpers that rename entities of a mission savegame and check that all of them got a name. |
| mission/tasks/assign_vehicle/mission_task_assign_vehicle | Task that waits until player vehicles run on a given line or on a line between two areas. |
| mission/tasks/assign_vehicle/mission_task_visit_stations_ordered | Task that waits until a player vehicle stops in one area and then in another. |
| mission/tasks/auto_builder/mission_task_electrify | Task that electrifies the track between node pairs. |
| mission/tasks/auto_builder/mission_task_track_builder | Task that builds a prepared track segment by segment. |
| mission/tasks/auto_builder/prepare_track_building_util | Development helper that writes track segments to a file for the track-builder task. |
| mission/tasks/build_construction/mission_task_build_construction | Task that waits until the player builds something that passes a set of proposal checks. |
| mission/tasks/build_construction/mission_task_build_construction_util | Proposal checks used by the build-construction task and by other tasks that filter what the player may build. |
| mission/tasks/build_construction/mission_task_build_construction_variant | Task that waits until constructions of given files exist in given areas. |
| mission/tasks/build_path/mission_task_build_path | Task that waits until the transport network connects pairs of entities or areas. |
| mission/tasks/bulldoze/mission_task_auto_bulldoze | Task that removes constructions. |
| mission/tasks/bulldoze/mission_task_bulldoze | Task that waits until the player bulldozes given entities. |
| mission/tasks/buy_vehicle/mission_task_buy_vehicle | Task that waits until the player owns or buys suitable vehicles. |
| mission/tasks/buy_vehicle/mission_task_clone_vehicle | Task that waits until the player clones a suitable vehicle in the vehicle store. |
| mission/tasks/click_and_collect_custom_entity/mission_task_collect_entity | Task in which the player collects custom entities by clicking them. |
| mission/tasks/click_and_collect_custom_entity/mission_task_spawn_entity | Task that spawns custom entities for the player to collect. |
| mission/tasks/click_entity/mission_task_click_entity | Task that waits until the player clicks given entities or markers. |
| mission/tasks/connect_nodes/mission_task_connect_nodes | Task that only allows street or track proposals that connect given nodes. |
| mission/tasks/create_line/mission_task_create_line | Task that waits until a line serves given station areas. |
| mission/tasks/create_line/mission_task_create_line_for_towns | Task that waits until one line serves stations in all given towns. |
| mission/tasks/create_line/mission_task_stop_config | Task that waits until a line loads a cargo at a stop. |
| mission/tasks/cutscene/mission_task_cutscene | Task that plays a camera cutscene. |
| mission/tasks/dialogue/mission_task_dialogue | Task that plays a dialogue (voice-overs, subtitles, portraits). |
| mission/tasks/finish/mission_task_finish | Task that ends the mission and shows the mission-end window. |
| mission/tasks/guide/mission_task_guide | Task that plays one queued instruction and completes when it has finished. |
| mission/tasks/guide/mission_task_guide_collect_entity | Decorator for the collect-entity task that points the player to one entity after the other. |
| mission/tasks/join/mission_task_join | Task that waits until other tasks are complete. |
| mission/tasks/mission_dialogue_data | Data format of dialogue and cutscene keyframe files and of task instructions. |
| mission/tasks/non_bulldozable/mission_task_non_bulldozable | Task that keeps entities from being bulldozed. |
| mission/tasks/observe_entity/mission_task_observe_entity | Task that waits until a condition holds for each of a set of entities. |
| mission/tasks/page/mission_task_page | Task that only shows its task info and completes through an option button. |
| mission/tasks/spawn_sims/mission_task_spawn_sims | Task that places custom person entities on footpaths. |
| mission/tasks/spawn_sims/sampling_util | Poisson-disk sampling of points in a rectangle. |
| mission/tasks/subsidies/mission_task_guide_subsidies | Decorator for the subsidies task that queues an instruction when a subsidy is won or lost. |
| mission/tasks/subsidies/mission_task_subsidies | Task that offers subsidies (subventions) and waits until all are completed or failed. |
| mission/tasks/task_decorator | Wraps a task script with a second script (decorator) that adds behaviour. |
| mission/tasks/town_rating/mission_task_town_rating | Task that reports whether a town rating and a cargo amount are good enough. |
| mission/tasks/town_rating/mission_task_town_rating_observer | Task that turns several town-rating tasks into one rising or falling progress value. |
| mission/tasks/town_size/mission_task_town_size | Task that waits until a town reaches a residential capacity. |
| mission/tasks/town_size/town_size_task_util | Shared update function of the town-size tasks. |
| mission/tasks/transfer_ownership/mission_task_transfer_ownership | Task that gives lines and constructions to the player or takes them away. |
| mission/tasks/transfer_ownership/transfer_ownership_util | Ownership helpers used by mission tasks. |
| mission/tasks/transport_cargo/mission_task_empty_stocks | Task that waits until industry stocks are emptied, optionally within a time limit. |
| mission/tasks/transport_cargo/mission_task_industry_boosted | Task that waits until an industry is boosted. |
| mission/tasks/transport_cargo/mission_task_transport_cargo | Task that waits until an amount of cargo was delivered to targets. |
| mission/tasks/transport_cargo/mission_task_transport_cargo_faster | Delivery race against a simulated adversary within a time limit. |
| mission/tasks/transport_cargo/mission_task_transport_cargo_observer | Task that shows the progress of several transport-cargo tasks and completes when all are done. |
| mission/tasks/transport_cargo/mission_task_transport_passengers | Task that counts passengers travelling by line between two towns. |
| mission/tasks/utility/mission_task_cargo_needs | Task that sets the cargo needs of a town. |
| mission/tasks/utility/mission_task_check_entities | Task that checks that all entities referenced by the mission params exist. |
| mission/tasks/utility/mission_task_check_landmark_level | Task that waits until a landmark construction reaches a level. |
| mission/tasks/utility/mission_task_clouds | Task that fades the cloud coverage to a target value. |
| mission/tasks/utility/mission_task_highlight | Task that shows markers and zones. |
| mission/tasks/utility/mission_task_industry_activity | Task that turns the stocks or the station of an industry on or off. |
| mission/tasks/utility/mission_task_landmark_requirements | Task that swaps a landmark construction for a variant chosen at runtime. |
| mission/tasks/utility/mission_task_play_sound | Task that plays a sound effect. |
| mission/tasks/utility/mission_task_protected_entities | Task that protects entities from player changes. |
| mission/tasks/utility/mission_task_relay_update | Task that runs a custom update function until it reports completion. |
| mission/tasks/utility/mission_task_send_command | Task that sends an engine command. |
| mission/tasks/utility/mission_task_send_event | Task that sends a script event or a GUI React event. |
| mission/tasks/utility/mission_task_store_any | Task that stores a value computed at runtime for other tasks to read. |
| mission/tasks/utility/mission_task_substitute_constructions | Task that replaces or refreshes constructions. |
| mission/tasks/utility/mission_task_time_of_day | Task that moves the time of day to a target time. |
| mission/tasks/utility/mission_task_town_development | Task that switches the development of towns on or off. |
| mission/tasks/utility/mission_town_util | Town helper used by mission tasks. |
| mission/tasks/vehicle_util/mission_task_replace_vehicles | Task that replaces vehicles with a single-part vehicle of another model. |
| mission/tasks/vehicle_util/mission_task_sell_vehicles | Task that sells vehicles, optionally deleting their lines. |
| mission/tasks/vehicle_util/mission_task_start_vehicles | Task that starts or stops vehicles. |
| mission/tasks/vehicle_util/mission_task_vehicle_modifier | Task that changes vehicle modifiers (top speed, comfort, noise, pollution). |
| mission/tasks/vehicle_util/mission_task_vehicle_position | Task that waits until a vehicle is near a position. |
| mission/tasks/vehicle_util/mission_vehicle_util | Vehicle and line helpers used by mission tasks. |
| mission/tasks/wait/mission_task_wait | Task that completes after a fixed time. |
| mission/tasks/wait/mission_task_wait_event | Task that completes when a matching engine-side script event arrives. |
| mission/tasks/wait/mission_task_wait_for | Task that completes when a condition function returns true, optionally with a countdown. |
| mission/tasks/wait/mission_task_wait_ui_event | Task that completes when a matching GUI event arrives. |
| mission/tasks/waypoints/mission_task_waypoints | Task that waits for a line from a station group that passes given waypoints. |
| mission/tutorial/tasks/mission_task_tutorial_init | Task that prepares the map at the start of the tutorial. |
| mission/tutorial/tutorial_story_util | Helpers of the base-game tutorial story (capital town, industries, areas, vehicle lists). |
| scripts/app_util | Types of /scripts/app_util.tl (AppUtil) for choosing between mouse and gamepad behaviour. |
| scripts/audio_util | Types of /scripts/audioutil.lua (AudioUtil), helpers that build and sample the gain and pitch curves of sound sets (lists of {x, y} nodes). |
| scripts/builtin/index | marker interface for emitter shapes |
| scripts/construction/asset_util | Types of /scripts/construction/asset_util.tl (AssetUtil), the table of named asset groups that addModelsAndGroups picks random models from. |
| scripts/construction/collider_util_serialized | Types of /scripts/construction/collider_util_serialized.tl (ColliderUtilSerialized): plain-table colliders (box, cylinder, point cloud) for construction results. |
| scripts/construction/construction_config_metadata | Types of /scripts/construction/construction_config_metadata.tl: the constructionConfig metadata of constructions that are built up in levels by delivering cargo (the landmarks), with their requirements, stocks and th |
| scripts/construction/construction_specialization_metadata | Types of /scripts/construction/construction_specialization_metadata.tl: metadata accessors for a construction's constructionSpecialization and a module's specialization entry. |
| scripts/construction/construction_util_serialized | Plain lua table type definitions for construction resource scripts. These types describe the format of lua tables produced by construction scripts and read by C++ via converters. They must NOT reference C++ userdata type |
| scripts/construction/lane_util_serialized | Types of the lane helper (/scripts/construction/laneutil.lua, LaneUtilSerialized) that turns generated curve data into lane lists. |
| scripts/construction/modules_util_serialized | Types of the module helpers in /scripts/construction/modulesutil.lua (ModulesUtilSerialized) used by modular constructions and their module scripts. |
| scripts/construction/param_util | Types of /scripts/construction/param_util.tl (ParamUtil), ready-made construction parameters (track type, catenary, rotation). |
| scripts/construction/street_util_serialized | Types of /scripts/construction/street_util_serialized.tl (StreetUtilSerialized): helpers that append street/track edges (position, tangent, optional tag) to an edge list. |
| scripts/entity_util | Types of /scripts/entity_util.tl (EntityUtil): helpers to remember an entity together with its revision (so a script can detect later that it changed or was removed), and ownership/position lookups. |
| scripts/gamescript | Types for game scripts (*.gs.lua files whose updateScript, postUpdateScript, handleEventScript and guiHandleEventScript entries point to functions as "file.script@functionName"), their persistent state object |
| scripts/journal | Type of the engine's finance journal entry (api.type.JournalEntry): one booking of money with its time, amount and category. Scripts create one with api.type.JournalEntry.new() and book it with `api.cmd.makeJournalBo |
| scripts/lang_util | Types of /scripts/lang_util.tl (LangUtil): formatting of translated texts and numbers for the GUI. It wraps StringUtil.format and the engine's api.util.lang functions. Load it with `local lang_util = ug_require " |
| scripts/log | Types of the global log table, the game's script logging functions. |
| scripts/mat4 | Types of the plain-Lua 4x4 matrix library /scripts/mat4.tl (Mat4Serialized). A matrix is a flat table of 16 numbers in column-major order (elements 13, 14, 15 hold the translation), the same layout the game uses for |
| scripts/math_util | Types of the scalar math helpers in /scripts/mathutil.lua (MathUtil): interpolation, clamping, range mapping and Hermite curves. Loading the file also installs the same functions into Lua's global math table (`math |
| scripts/metadata_util | Types of /scripts/metadata_util.tl (MetadataUtil): typed accessors for the free-form metadata tables of construction descriptions, construction instances, subconstruction instances and savegame scripts. Each featur |
| scripts/polygon_util | Types of /scripts/polygon_util.tl (PolygonUtil) for 2D polygons given as lists of Vec2f points. |
| scripts/random_util | Types of /scripts/random_util.tl (RandomUtil) for weighted random selection. |
| scripts/react | Types of the GUI's React-style library, ::/gui/main/react.lua (React). A recipe is a function that returns GUI nodes; it is registered once with React.RegisterRecipe and called like a function to create nodes. Insi |
| scripts/soundset | Types used by sound-set update scripts (see /scripts/soundset_default.script.tl): the output object that receives track and event gain/pitch values, and the parameter records of custom and curve-based update functions. |
| scripts/string_util | Types of /scripts/string_util.tl (StringUtil): {placeholder} string interpolation and prefix/suffix tests. The functions come from the legacy /scripts/stringutil.lua. |
| scripts/table_util | Types of /scripts/table_util.tl (TableUtil): deep comparison and copying of tables and simple array search helpers. Load it with local table_util = ug_require "/scripts/table_util.tl" as TableUtil. |
| scripts/tex_util | Types of /scripts/tex_util.tl (TexUtil), helpers that build texture descriptions with common filter and wrap settings. |
| scripts/transformator_util | Types for transformator scripts, the per-frame scripts that animate vehicle and building models (wheels, doors, lights, pantographs, emitted person models, particles). TransformatorParams is what an update function rec |
| scripts/util/config_util | Types of /scripts/util/config_util.tl (ConfigUtil) for editing the data of a generic script resource. |
| scripts/util/index | Types of /scripts/util.tl (Util): resolving script function references and formatting game-time durations. Load it with local util = ug_require "/scripts/util.tl" as Util. |
| scripts/util/listutil | Types of /scripts/util/listutil.tl (ListUtil). |
| scripts/util/romberg_util | Types of /scripts/util/romberg.tl (RombergUtil), numerical integration with Romberg's method. |
| scripts/util/town_growth_function | Types of /scripts/util/town_growth_function.tl (TownGrowthFunction), the polynomials that scale town and company growth with level. |
| scripts/vec2 | Types of the plain-Lua 2D vector library /scripts/vec2.tl (Vec2Serialized). Unlike the engine's api.type.Vec2f, these vectors are ordinary Lua tables {x = ..., y = ...} with arithmetic metamethods, so they can be |
| scripts/vec3 | Types of the plain-Lua 3D vector library /scripts/vec3.tl (Vec3Serialized): vectors are ordinary tables {x = ..., y = ..., z = ...} with +, -, * (number times vector) and / (vector by number). Construction |
| scripts/vec4 | Types of the plain-Lua 4D vector library /scripts/vec4.tl (Vec4Serialized); mat4 uses these vectors as matrix columns. Load it with local vec4 = ug_require "/scripts/vec4.tl" as Vec4Serialized. |
| stations/station_metadata | Types of /stations/station_metadata.tl (StationMetadata), accessors for station module metadata. |
| vehicle/vehicle_modifier | Types of the VehicleModifier game script (/vehicle/vehicle_modifier.script.tl), which combines speed, noise, pollution and comfort modifiers from several sources per vehicle. |