Mission
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,StickyandArea Guard. - Infantry, vehicles and aircraft:
Move,QMove,Enter,Capture,Sabotage,Hunt,RescueandPatrol. - Infantry and vehicles:
Retreat. - Vehicles, aircraft and structures:
Unload. - Vehicles and structures:
Repair. - Vehicles only:
Harvest. - Structures only:
Construction,Selling,MissileandOpen. - No kind:
Sleep,Return,Stop,AmbushandHarmless.
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
SleeporHarmlesstoGuard. - An aircraft in the air on
Sleepswitches toGuardat once. - An infantryman, vehicle or aircraft on
Sleepswitches toGuardwhen a structure it is in radio contact with orders it away, for example when that structure is sold. - A computer-owned object on
Ambushswitches toHuntwhen 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
RepairBaynames and switches toEnteronce 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
| Input | Meaning | Engine constant | Stored value |
|---|---|---|---|
0 | Do nothing. An aircraft in the air switches to Guard at once. | MISSION_SLEEP | 0 |
1 | Attack the object's current target. An object with no target switches to its idle mission. | MISSION_ATTACK | 1 |
2 | Move toward the assigned destination. | MISSION_MOVE | 2 |
3 | Rewritten to Move before the mission is queued. | MISSION_QMOVE | 3 |
4 | Head for a map edge, preferring the edge the object's team came from. | MISSION_RETREAT | 4 |
5 | Hold position and guard. | MISSION_GUARD | 5 |
6 | Guard 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_STICKY | 6 |
7 | Enter another object cooperatively. | MISSION_ENTER | 7 |
8 | Enter a target to capture it. | MISSION_CAPTURE | 8 |
9 | Find and collect nearby Tiberium. | MISSION_HARVEST | 9 |
10 | Actively guard an area. | MISSION_GUARD_AREA | 10 |
11 | Do nothing. No kind of object acts on this mission. | MISSION_RETURN | 11 |
12 | Do nothing. No kind of object acts on this mission. | MISSION_STOP | 12 |
13 | Do nothing. A computer-owned object switches to Hunt when a player first discovers it. | MISSION_AMBUSH | 13 |
14 | Search for and destroy enemies. | MISSION_HUNT | 14 |
15 | Find a location and unload cargo. | MISSION_UNLOAD | 15 |
16 | Enter a target to destroy it. | MISSION_SABOTAGE | 16 |
17 | Play a structure's buildup. | MISSION_CONSTRUCTION | 17 |
18 | Play a structure's builddown when it is sold or undeploys. | MISSION_DECONSTRUCTION | 18 |
19 | Repair or reload a docked vehicle, heal or promote held infantry, or send a vehicle to the repair bay. | MISSION_REPAIR | 19 |
20 | Clear the threats around a nominated spot, then move to the cell the house picks and guard the area there. | MISSION_RESCUE | 20 |
21 | Run a structure's launch sequence: a missile silo's, or an EM pulse cannon's aim and fire. | MISSION_MISSILE | 21 |
22 | Do nothing, as with Sleep. | MISSION_HARMLESS | 22 |
23 | Open a gate and close it again once the way is clear. | MISSION_OPEN | 23 |
24 | Move toward the destination, fighting threats met along the way, then carry on. | MISSION_PATROL | 24 |
No enum values match this filter.
Used by
- All Assign Mission...
TACTION_ALL_ASSIGN_MISSION - Do this...
TMISSION_DO
Source files
Linked at revision 51b52aa38392.