Base Mission
Reference for the base mission type, the simplest mission class providing minimal lifecycle hooks. Returned by `gameplay_missions_missions.baseMission()`.
Reference for the base mission type, the simplest mission class providing minimal lifecycle hooks. Returned by gameplay_missions_missions.baseMission().
Module Export
Returns a constructor function (derivedClass, ...) that creates a mission instance:
return function(derivedClass, ...)
local o = ... or {}
setmetatable(o, C)
C.__index = C
o:init()
for k, v in pairs(derivedClass) do
o[k] = v
end
local init = o:init()
return o, init
endClass C - Instance Methods
| Method | Signature | Description |
|---|---|---|
init | C:init() | Sets missionTypeLabel and progressKeyTranslations |
getProgressKeyTranslation | C:getProgressKeyTranslation(progressKey) → string | Translates progress key to display label |
onStart | C:onStart() | Called when mission starts (no-op) |
onUpdate | C:onUpdate(dtReal, dtSim, dtRaw) | Called each frame (no-op) |
onStop | C:onStop(data) | Called when mission stops (no-op) |
Internals
- Sets
self.missionTypeLabelto"bigMap.missionLabels." .. self.missionType - Default progress key translations:
{default = "missions.progressKeyLabels.default", custom = "missions.progressKeyLabels.custom"} - The derived class fields are merged onto the instance after
init(), allowing overrides init()is called twice: once before merging derived class, once after
How It Works
-- Usage in a mission type constructor:
local C = {}
-- Define custom methods...
function C:onStart()
-- Custom start logic
end
-- Use baseMission as the foundation:
return function(...)
return require('/lua/ge/extensions/gameplay/missions/missionTypes/baseMission')(C, ...)
endKey Behaviors
- This is the minimal mission type - no flowgraph, no traffic, no vehicle management
- For flowgraph-based missions, use
flowMissionwhich extends this with FG manager support - All lifecycle methods are no-ops by default, designed to be overridden by derived mission types
See Also
- missionTypes/editorHelper - Mission Editor UI Element System - Related reference
- missionTypes/flowMission - Flowgraph-Based Mission Type - Related reference
- Gameplay Systems Guide - Guide
Unlocks
Reference for `gameplay_missions_unlocks`, which evaluates start/visible conditions, manages unlock dependencies between missions, and computes mission ordering depth.
Editor Helper
Reference for the editor helper class that provides a rich set of UI elements for editing mission type data in the mission editor. This is the backbone of all mission editor panels.