veafSpawn — Dynamic Unit Spawning¶
Module ID: SPAWN | File: veafSpawn.lua
See it in game: step 02 “Sandbox: marker commands” of the demo mission.
Alias list: every ready-made marker shortcut (
-sa8,-armor,-convoy…) is in the aliases reference.
Purpose¶
Listens for F10 map marker text commands and spawns units, groups, convoys, FARPs, smoke, flares, cargo, and JTAC controllers on demand. This is the primary player-facing spawning interface.
Dependencies¶
veafMarkers— for marker event handlingveafRadio— for the radio menuveafSecurity— for permission checks (optional)
Enable¶
veafSpawn.initialize()
Call after all other modules that veafSpawn depends on.
Key Configuration Constants¶
| Constant | Default | Description |
|---|---|---|
veafSpawn.SpawnKeyphrase |
"_spawn" |
Marker prefix that triggers spawn |
veafSpawn.DestroyKeyphrase |
"_destroy" |
Marker prefix for destroy command |
veafSpawn.TeleportKeyphrase |
"_teleport" |
Marker prefix for teleport |
veafSpawn.IlluminationFlareAglAltitude |
1000 |
Default flare altitude (m AGL) |
veafSpawn.ShellingInterval |
5 |
Seconds between shelling rounds |
veafSpawn.AFAC.maximumAmount |
8 |
Max simultaneous AFACs per coalition |
veafSpawn.HideRadioMenu |
false |
Hide the Spawn submenu in F10 |
veafSpawn.LogisticUnitType |
"FARP Ammo Dump Coating" |
Static object type for logistics |
Marker Commands (Player-Facing)¶
Spawn a unit¶
_spawn unit, name [DCS_TYPE]
_spawn unit, name T-80UD, hdg 270, spacing 50
An airplane cannot be spawned this way (the command refuses it): use a CAP patrol. A helicopter can: see Spawn a helicopter.
Options:
name— unit typehdg— heading (degrees)alt— altitude (feet); for a helicopter, the height of its taskside— coalition overridecountry— country overrideskill— AI skill levelspacing— unit spacing (meters)immortal— make units invulnerable
Spawn a predefined group¶
_spawn group, name [GROUP_NAME]
The group alias must exist in the spawn database: the built-in one (e.g. sa2, sa3, …) or your optional src/spawn-groups.yaml, which extends/overrides it. The database lives in YAML and is injected into the .miz at build time (no Lua to edit). See Pipeline Reference — spawn data.
Typos abort the command. If a parameter is not recognized (e.g.
headnginstead ofheading), the spawn is not performed and the pilot gets a hint (did you mean 'heading'?). Fix the marker text and try again.
Spawn a helicopter¶
_spawn unit, name mi8
_spawn unit, name mi24, task orbit
_spawn unit, name uh1, task transport, dest FOB-NORTH
_spawn group, name [HELICOPTER_GROUP], task orbit, alt 800
The helicopter appears landed at the marker, then does what task says:
task |
What it does |
|---|---|
| (none) | stays on the ground, engine off: a target |
orbit |
takes off and circles the marker; fires at what comes by if armed, holds fire otherwise |
transport |
takes off, flies to dest and lands in the nearest clearing (up to 300 m off), only returning fire; refused without a dest. Aim at open ground: at a forest's edge it hovers and never lands |
patrol |
armed: a 1 km loop around the marker (or to and fro to dest), engaging ground units and helicopters in range; unarmed: a shuttle marker ↔ dest, 5 min on the ground at each end, for ever (refused without a dest) |
attack |
armed only: flies to dest, engages ground units and helicopters in range, then circles there |
escort |
armed only: dest is the name of a ground group, which it joins and covers |
alt is the height above the ground (feet, 500 by default), speed the speed (knots, 80 by
default). dest is a named point or coordinates, as for a convoy. capradius is an armed helicopter's
engagement range (metres, 3,000 by default).
Armed or not is the alias's call, not the type's: DCS files the Mi-8 as both an attack and a transport helicopter.
| Unarmed | Armed (loadout of the shipped dynamic slot) |
|---|---|
mi8 (Mi-8MTV2), mi26 (Mi-26), uh1 (UH-1H), ch47 (CH-47F) |
mi24 (Mi-24P), ka50 (Ka-50 III), ah64 (AH-64D), gazelle (SA342M) |
A DCS type written directly (name Mi-8MT) flies unarmed. A src/spawn-groups.yaml can add its own
aliases, with pylons, and groups of several helicopters.
Checked in game on 2026-10-02:
orbitcircles 1.5–2 km from its point,transportlands 30 m from its own on open ground.patrol,attackandescorttoo (the escort circles within 3 km of its group).
Spawn a CAP patrol¶
_spawn cap, name Su-27, alt 25000, capradius 20
Options:
name— aircraft typealt— patrol altitude (feet); never less than 150 m above the ground under the spawn point, raised otherwise (DCS does not lift a too-low aircraft: it flies into the trees)hdg— initial headingspeed— patrol speed (knots)capradius— radius of the zone the patrol defends, centred on the middle of its race-track (nautical miles, 60 by default). For a helicopter the same option is in metres (see above).distance— length of the race-track leg (nautical miles, 20 by default)
What the patrol attacks. It stays on its patrol, forbidden to shoot at aircraft, for as long as it has seen nothing worth engaging. Every ten seconds it looks at what its radar returns and keeps only enemy aircraft, airborne, inside its patrol radius: not a ship, not a vehicle, not a building, and not a pilot hanging under his parachute — even though he still belongs to his aircraft's group. What it keeps is ranked by priority (fighters first, then bombers, drones, AWACS, transports, helicopters), and the patrol engages it. As soon as there is nothing left to engage, it goes back to its route and to return fire only.
The target's aspect counts too: at the same distance, an aircraft flying at the patrol (hot) comes before one crossing it (flanking), which comes before one flying away (cold). An aircraft flying away more than 40 km from the patrol is not engaged at all: the patrol stays on its zone instead of chasing it. Facing several targets, each aircraft of the patrol is given its own, the most important first; facing one, they all go for it.
To remove a patrol, place a _destroy, radius <metres> marker on it (see Destroy units); everything inside the circle goes with it, on the ground as in the air.
A patrol built from a group template whose first waypoint carries no instructions flies without the settings its template's author intended (radar, ECM, rules of engagement). That case is reported in the DCS log, naming the template at fault.
Spawn an AWACS¶
_spawn awacs, type E-3A, alt 30000, hdg 90, dist 30, freq 251, escort f15-fox3
The -awacs alias does the same: -awacs escort f15-fox3.
The AWACS appears on the marker, airborne, and flies a race-track that starts at the marker and runs along hdg.
It needs no template: it is built from its type.
Options:
type—E-3A,E-2C(the E-2D),A-50orKJ-2000; an E-3A for blue and an A-50 for red by defaultalt— altitude (feet, 30,000 by default); raised to 150 m above the ground when needed, as for a CAPhdg— direction of the race-track (degrees, 0 by default)dist— length of the race-track (nautical miles, 30 by default)speed— speed (knots indicated); Mach 0.5 by defaultfreq— the AWACS radio frequency (MHz, AM, 251 by default)skynet false— keep it out of its side's Skynet network; it is added by defaulteplrs false(ordatalink false) — turn its datalink off; it is on by defaultescort <template>— spawn an escort too, as-escortwould (see below);escortalone takes any fighter template of the side
The escort of an AWACS is named <AWACS name> escort.
An AWACS spawned during the mission has no Mission Editor record: _move and the assets menu can neither move it nor respawn it, nor its escort.
⚠️ An AWACS added to Skynet covers its side's SAM sites and keeps them under network control. The
INVESTIGATE-SKYNET-AWACS-BLINDlot is looking into enrolled A-50s that saw no contact for a whole session. If your mission's SAMs stay dark with an AWACS in the air, tryskynet false.
Spawn an escort¶
_spawn escort, name f15-fox3
The -escort alias does the same: -escort f15-fox3.
Place the marker next to an airplane, friendly or neutral: the airplane nearest the marker, within 10 nautical miles, is the one escorted.
An enemy airplane is never escorted, and a helicopter cannot be.
name searches the side's veafSpawn- templates, as for -cap; without name, any template will do.
The escort appears 3 km behind the airplane it escorts, at its altitude.
It is given the DCS Escort task: it follows its charge and engages enemy aircraft up to 60 km from it.
Its rules of engagement are set to "open fire" after the template's own settings, so that a template written to hold fire does not make an escort that defends nothing.
To escort your own airplane, the F10 menu is enough: F10 → VEAF → SPAWN → +Escort me (fox3) or (fox2) (the + marks a protected command).
It asks the same level as -escort (known pilot).
A refusal says why: no escort template for your side, or an escort that could not be spawned; the DCS log records it too.
A mission can change the entries offered by replacing veafSpawn.EscortRadioMenuTemplates ({ "fox3", "fox2" } by default).
Spawn an AFAC/JTAC¶
_spawn afac, name A-10C, freq 133.0, mod AM, laser 1688, alt 15000
Options:
name— aircraft typefreq— radio frequencymod— modulation (AMorFM)laser— laser code, between1111and1688. Each of the last three digits runs from 1 to 8 (no0, no9):1688works,1690does not. An impossible code is ignored and the default (1688) stays in effect.alt— orbit altitude (feet)speed— orbit speed (knots)immortal— make unit invulnerable
Spawn a convoy¶
Place two markers: one with the command (start), one as the destination.
_spawn convoy, dest [DEST_MARKER_NAME], speed 50, defense 2, armor 2, size 3
Options:
dest— destination marker namespeed— convoy speed (km/h)defense [0-5]— air defense levelarmor [0-5]— armor levelsize— number of vehicles (default: 10; the-convoyalias draws a random size between 6 and 15)patrol— loop back to startoffroad— allow off-road movement
Several legs: write dest as many times as you need¶
dest can be repeated. The convoy walks the points in the order you write them, setting off again by itself on each arrival:
_spawn convoy, dest KOBULETI, dest BATUMI, dest POTI, speed 40
A single dest is still a one-leg trip: nothing changes for the markers you already use.
Two things worth knowing:
patrolapplies to the last leg only. Patrolling between two points of an itinerary would contradict the itinerary itself.- A leg starts from wherever the convoy is, not from where it spawned — it has been driving since.
The four radio commands¶
The F10 menu offers four commands doing four different things. The two brakes in particular are not interchangeable:
| Command | Effect | When to reach for it |
|---|---|---|
| Send to next point | starts the next leg at once, without waiting for arrival | to speed up a mission that is dragging |
| Hold at next point | lets the convoy finish its leg, then park at that point and wait | to pace a mission: the convoy stops somewhere you chose |
| Halt where it stands | the convoy stops on the spot, mid-road if need be | to rescue a mission going wrong |
| Resume after a halt | picks the current leg back up where it was interrupted | after halting on the spot |
"Hold at next point" and "Halt where it stands" look alike from a distance and do not substitute for one another: the first chooses where the convoy stops, the second chooses when. Every command reports what it did, naming the point involved.
On the last leg, "Hold at next point" tells you there is no next point rather than doing nothing.
Spawn smoke¶
_spawn smoke, color red
_spawn smoke, color green, shells 5
Colors: red, green, blue, white, orange
Spawn illumination flares¶
_spawn flare, power 1000000, shells 5, heading 90, distance 500
Fire a signal flare¶
_spawn signal, color green
Colors: red (the default), green, white, yellow. A flare does not come in the smoke's colours: DCS has no orange or blue one, and the command says so and fires nothing.
Spawn explosions¶
_spawn bomb, power 500, shells 3
Spawn a FARP¶
_spawn farp, name "FARP Alpha", side blue
Spawn a radio beacon¶
_spawn beacon
_spawn beacon, name "Alpha Beacon", side red
-beacon
One command places three beacons at the same spot — ADF (VHF), UHF and FM — and the on-screen message hands you all three frequencies:
Radio beacon up — ADF 245.00 kHz · UHF 251.00 MHz · FM 40.50 MHz
The beacon goes exactly where you dropped the marker, with no scatter, unlike the commands that spawn groups.
CTLD picks the frequencies, not you
CTLD draws them from its own pools so that two beacons never collide, and it exposes no way to ask for a particular one. That is why the command tells you them instead of taking them as a parameter: a beacon whose frequency nobody knows is of no use.
An option to request a frequency is proposed upstream
(VEAF/CTLD#128); a freq parameter will be added here once
it lands.
CTLD has to be running in the mission (modules: CTLD: true); otherwise the command says so rather
than doing nothing.
| Option | Default | Description |
|---|---|---|
name |
CTLD numbers it ("Beacon #1") | the beacon's display name |
side |
blue | the coalition that hears it |
radius |
0 | scatter around the marker, in metres |
Destroy units¶
_destroy, radius 500
_destroy, unitname Tank-1
| Option | Default | Description |
|---|---|---|
unitname |
— | destroys the unit, static or group with that name, and nothing else |
name |
— | same as unitname; when both are written, unitname wins |
radius |
150 | with no name: destroys every unit and static within this radius of the marker, in metres |
With neither unitname nor name, the command clears the circle: check the name before you validate the marker.
Teleport a group¶
_teleport, name "Viper Flight"
Vehicles start warm¶
Every ground vehicle the VEAF scripts spawn — marker command, combat zone, convoy, respawn of an editor group — starts with its engine warm: it has an infrared signature from its first second and shows on a targeting pod. That is the editor's COLD AT START option left unticked, which is the editor's own default.
For a cold vehicle, tick COLD AT START on the unit in the Mission Editor: a respawn keeps that choice.
A static object has no engine: it stays cold whatever happens. A target meant to show on a pod has to be a group, not a static.
Spawnable aircraft groups (src/spawnables.yaml)¶
⚠️ Not to be confused with the
_spawn groupcommand (ground/helicopter groups from theveafUnitsdatabase). This is about real aircraft groups, hidden and late-activated, thatveafSpawnclones on demand in-game.
A spawnable aircraft group is identified by the veafSpawn- name prefix (the veafSpawn runtime contract). At build time, the spawnable_aircrafts pipeline step injects src/spawnables.yaml into the .miz.
The file uses the full DCS aircraft-group schema (airplanes/helicopters → coalitions → country → group), identical to the one described in the Pipeline Reference — Step 3. It is usually produced by extracting from a mission:
veaf-tools content extract-aircraft-groups --kind spawnable
Dynamic-slot templates (dynSpawnTemplate = true, DCS Dynamic Slots) are a separate family, in src/dynamic-slot-templates.yaml (step dynamic_slot_templates) — see ADR 0002.
See Also¶
- veafMove — moving existing groups
- Lua API Reference — full
veafSpawnAPI