Skip to content

Developer — Overview

Technical reference for DynamicMission, verified against the current source code (sources/DynamicMission.lua).

DynamicMission is a single Lua script (DynamicMission.lua, loaded via a DO SCRIPT FILE trigger) that acts as a dynamic mission director for DCS World. The mission maker delimits combat Regions by naming Mission Editor zones according to a coded convention; each active region periodically scans its polygon for enemy human players and clones, from templates placed in the editor (delayed-activation groups), new groups into a matching spawn zone.

The cloning mechanism is generic

Not limited to AI "opposition" in the strict sense: an MG_ template can be any DCS group category — plane, helicopter, ground vehicle/convoy, ship — armed or not. Nothing in the spawn engine restricts what a clonable group can be; it's up to the mission maker to decide what each template represents.

Regions move through a small state machine (IDLE → ACTIVE → CLEARED) driven by player presence and the capture of the airbases they contain. A neutral base is visually "anchored" by a static Jerrycan until a trigger event — landing, enemy approach, or capture — spawns a wave of ground defenses around the runway.

The spawn engine (DM.utils) is entirely internal, with no external dependency, and reads env.mission directly.

Where to go next

  • Regions — nomenclature, state machine, tick cycle.
  • Airbases — coalition tracking, the Jerrycan mechanic, defense-spawn triggers.
  • Manager & Events — DCS events listened to, startup sequence.
  • Spawn Engine — mission database reconstruction, tag grammar, zone cloning.
  • Configuration — the full DM.Config table (internal fields included).
  • Test/Debug Control SurfaceDynamicMission_TestUtils.lua function inventory.