Skip to content

Mission

INI referenceEnumsMissionType

Runtime mission state machines assignable through mission-valued scripting payloads.

Engine enum
MissionType
Input form
Integer

These are the missions an object on the map can be in. Team scripts use a separate list of team missions, described under Mapping.

Each mission has a name. A placed object’s row in a scenario file names the mission it starts in, and each mission’s settings sit in a rules.ini section of the same name, as Missions in brief describes. The name is the constant without its MISSION_ prefix, capitalized as in Guard or QMove. Two constants have other names: MISSION_GUARD_AREA is Area Guard and MISSION_DECONSTRUCTION is Selling.

Two script entries give objects a mission by its number: the Do this… team mission and the All Assign Mission… trigger action. Their pages say which objects take the mission. Both assign QMove as Move.

Each kind of object acts only on some missions:

  • Every kind, structures included: Attack, Guard, Sticky and Area Guard.
  • Infantry, vehicles and aircraft: Move, QMove, Enter, Capture, Sabotage, Hunt, Rescue and Patrol.
  • Infantry and vehicles: Retreat.
  • Vehicles, aircraft and structures: Unload.
  • Vehicles and structures: Repair.
  • Vehicles only: Harvest.
  • Structures only: Construction, Selling, Missile and Open.
  • No kind: Sleep, Return, Stop, Ambush and Harmless.

A mission that an object does not act on still becomes its mission. The object then does nothing until another mission replaces it. A script that gives a team Missile or Open therefore leaves its members standing where they are, and an aircraft given Retreat stays where it is.

An infantryman, vehicle or aircraft put on Selling keeps it for the rest of the game. It ignores every later mission and does nothing.

The missions no kind acts on differ in what ends them:

  • The wake-up trigger actions, such as Wakeup self, move an object on Sleep or Harmless to Guard.
  • An aircraft in the air on Sleep switches to Guard at once.
  • An infantryman, vehicle or aircraft on Sleep switches to Guard when a structure it is in radio contact with orders it away, for example when that structure is sold.
  • A computer-owned object on Ambush switches to Hunt when a player first discovers it.

Repair does something different on each kind of object:

  • A repair bay repairs and reloads the vehicle in radio contact with it.
  • A hospital heals the infantryman it holds, and an armory promotes one instead.
  • A construction yard plays its production animation and does nothing else.
  • A vehicle looks for a building of the type RepairBay names and switches to Enter once one accepts it. Until then it keeps searching. If its house owns no building of that type, the vehicle switches to its idle mission.

Rescue sends an infantryman, vehicle or aircraft to clear threats near a spot, then on to a cell its house picks. Once there, or at once if the house picks no cell, it switches to Area Guard. A computer house puts most of the defenders it calls up when its base is attacked on Rescue, with the object under attack as the spot.

Values

25 of 25

InputMeaningEngine constantStored value
0Do nothing. An aircraft in the air switches to Guard at once.MISSION_SLEEP0
1Attack the object's current target. An object with no target switches to its idle mission.MISSION_ATTACK1
2Move toward the assigned destination.MISSION_MOVE2
3Rewritten to Move before the mission is queued.MISSION_QMOVE3
4Head for a map edge, preferring the edge the object's team came from.MISSION_RETREAT4
5Hold position and guard.MISSION_GUARD5
6Guard in place, dropping a target that moves out of range instead of chasing it. A vehicle on this mission never scatters. An infantryman, vehicle or aircraft standing still on this mission ignores a mission that a script or trigger gives it later.MISSION_STICKY6
7Enter another object cooperatively.MISSION_ENTER7
8Enter a target to capture it.MISSION_CAPTURE8
9Find and collect nearby Tiberium.MISSION_HARVEST9
10Actively guard an area.MISSION_GUARD_AREA10
11Do nothing. No kind of object acts on this mission.MISSION_RETURN11
12Do nothing. No kind of object acts on this mission.MISSION_STOP12
13Do nothing. A computer-owned object switches to Hunt when a player first discovers it.MISSION_AMBUSH13
14Search for and destroy enemies.MISSION_HUNT14
15Find a location and unload cargo.MISSION_UNLOAD15
16Enter a target to destroy it.MISSION_SABOTAGE16
17Play a structure's buildup.MISSION_CONSTRUCTION17
18Play a structure's builddown when it is sold or undeploys.MISSION_DECONSTRUCTION18
19Repair or reload a docked vehicle, heal or promote held infantry, or send a vehicle to the repair bay.MISSION_REPAIR19
20Clear the threats around a nominated spot, then move to the cell the house picks and guard the area there.MISSION_RESCUE20
21Run a structure's launch sequence: a missile silo's, or an EM pulse cannon's aim and fire.MISSION_MISSILE21
22Do nothing, as with Sleep.MISSION_HARMLESS22
23Open a gate and close it again once the way is clear.MISSION_OPEN23
24Move toward the destination, fighting threats met along the way, then carry on.MISSION_PATROL24

Used by

Source files

Linked at revision 51b52aa38392.