From d7d1bfd6e8d0951fd46f1e369e26749c4fbcac91 Mon Sep 17 00:00:00 2001 From: Bruno Carneiro Date: Fri, 13 Feb 2026 21:27:01 +0000 Subject: [PATCH] Update Mission Script API --- ...ion-script-api.md => Mission-Script-API.md | 92 +++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) rename mission-script-api.md => Mission-Script-API.md (98%) diff --git a/mission-script-api.md b/Mission-Script-API.md similarity index 98% rename from mission-script-api.md rename to Mission-Script-API.md index 2212ba8..0df95ee 100644 --- a/mission-script-api.md +++ b/Mission-Script-API.md @@ -1,46 +1,46 @@ -# Mission Script API — Documentation - -This folder documents the API available to mission scripts. Mission scripts derive from `AMission` and are loaded by the game at runtime. - -Mission scripts also use additional types such as `LimbNames`, `NamedDamageTypes`, `Point2d`, and `Point3d`; those are summarized in [External Types](external-types). - -## How mission scripts are loaded - -1. The game loads a **battle** (one `ABattle` instance) via `IScriptRemote.loadBattleScript`. -2. Missions are attached with `loadMissionScript(fileName, missionNumber, scriptFileName)`, which instantiates a class named `Mission` that inherits from `AMission`. -3. Each mission's `Init(battle, missionNumber)` is called; then the battle runs and invokes the mission's virtual `On*` methods in response to game events. - -## Documentation index - -### Core - -| Document | Description | -|----------|-------------| -| [Mission And Battle](mission-and-battle) | **AMission**, **ABattle**, **IBattle**, **DoTimeout** | -| [Gameplay](gameplay) | **IGamePlay** — main interface to the game (actors, HUD, triggers, section files, etc.) | -| [Time And Difficulty](time-and-difficulty) | **ITime**, **DifficultySetting** | -| [Player](player) | **Player** | -| [Events And Section File](events-and-section-file) | **GameEventId**, **ISectionFile** | -| [Pathfinding And Terrain](pathfinding-and-terrain) | **RecalcPathState**, **PathType**, **LandTypes**, **IRecalcPathParams**, **ActorName** | -| [Script Loading](script-loading) | **IScriptRemote**, **ScriptRemote** | -| [External Types](external-types) | Additional types used by missions (limbs, damage, geometry) | - -### World - -| Document | Description | -|----------|-------------| -| [World](world) | Index of world types | -| [Actor Hierarchy](actor-hierarchy) | **AiActor**, **AiPerson**, **AiCart**, **AiGroup**, damage types, **CrewFunction** | -| [Air](air) | **AiAircraft**, **AiAirGroup**, air waypoints, enums, **EnemyAirInterf** | -| [Ground](ground) | **AiGroundActor**, **GroundStationary**, buildings, bomb explosion, enums | -| [Triggers Spawns And Targets](triggers-spawns-targets) | **AiTrigger**, **AiAction**, **AiBirthPlace**, **AiAirport**, **AiTarget**, **Regiment** | -| [Time And User Labels](time-and-user-labels) | **ITime** (cross-link), **GPUserLabel**, **GPUserIconType** | - -## Quick start - -1. Create a class `Mission` that inherits from `AMission`. -2. Override `OnBattleInit`, `OnBattleStarted`, and any `On*` events you need (e.g. `OnTrigger`, `OnActorCreated`, `OnAircraftKilled`). -3. Use `GamePlay` (IGamePlay) for querying actors, triggers, spawning groups, HUD messages, and section files. -4. Use `Time` (ITime) for game time and tick conversion (e.g. with `Timeout`). - -Reference the API documented here when building your mission script project. +# Mission Script API — Documentation + +This folder documents the API available to mission scripts. Mission scripts derive from `AMission` and are loaded by the game at runtime. + +Mission scripts also use additional types such as `LimbNames`, `NamedDamageTypes`, `Point2d`, and `Point3d`; those are summarized in [External Types](external-types). + +## How mission scripts are loaded + +1. The game loads a **battle** (one `ABattle` instance) via `IScriptRemote.loadBattleScript`. +2. Missions are attached with `loadMissionScript(fileName, missionNumber, scriptFileName)`, which instantiates a class named `Mission` that inherits from `AMission`. +3. Each mission's `Init(battle, missionNumber)` is called; then the battle runs and invokes the mission's virtual `On*` methods in response to game events. + +## Documentation index + +### Core + +| Document | Description | +|----------|-------------| +| [Mission And Battle](mission-and-battle) | **AMission**, **ABattle**, **IBattle**, **DoTimeout** | +| [Gameplay](gameplay) | **IGamePlay** — main interface to the game (actors, HUD, triggers, section files, etc.) | +| [Time And Difficulty](time-and-difficulty) | **ITime**, **DifficultySetting** | +| [Player](player) | **Player** | +| [Events And Section File](events-and-section-file) | **GameEventId**, **ISectionFile** | +| [Pathfinding And Terrain](pathfinding-and-terrain) | **RecalcPathState**, **PathType**, **LandTypes**, **IRecalcPathParams**, **ActorName** | +| [Script Loading](script-loading) | **IScriptRemote**, **ScriptRemote** | +| [External Types](external-types) | Additional types used by missions (limbs, damage, geometry) | + +### World + +| Document | Description | +|----------|-------------| +| [World](world) | Index of world types | +| [Actor Hierarchy](actor-hierarchy) | **AiActor**, **AiPerson**, **AiCart**, **AiGroup**, damage types, **CrewFunction** | +| [Air](air) | **AiAircraft**, **AiAirGroup**, air waypoints, enums, **EnemyAirInterf** | +| [Ground](ground) | **AiGroundActor**, **GroundStationary**, buildings, bomb explosion, enums | +| [Triggers Spawns And Targets](triggers-spawns-targets) | **AiTrigger**, **AiAction**, **AiBirthPlace**, **AiAirport**, **AiTarget**, **Regiment** | +| [Time And User Labels](time-and-user-labels) | **ITime** (cross-link), **GPUserLabel**, **GPUserIconType** | + +## Quick start + +1. Create a class `Mission` that inherits from `AMission`. +2. Override `OnBattleInit`, `OnBattleStarted`, and any `On*` events you need (e.g. `OnTrigger`, `OnActorCreated`, `OnAircraftKilled`). +3. Use `GamePlay` (IGamePlay) for querying actors, triggers, spawning groups, HUD messages, and section files. +4. Use `Time` (ITime) for game time and tick conversion (e.g. with `Timeout`). + +Reference the API documented here when building your mission script project.