> Operation Flashpoint Editor Commands

This list includes the more common and most used parameters for mission editing.

Parameters in Italic used for Unit Init.

Complete list in Operation Flashpoint - Resistance: Scripting Commands (version 1.85).

 

ADDMAGAZINE

unit AddMagazine "ammotype"
this AddMagazine "M16"

Adds one magazine of a specified ammo type to a Unit.

 

ADDMAGAZINECARGO

unit AddMagazineCargo ["ammotype", amount]
this AddMagazineCargo ["M16", 10]

Adds specified number of specified ammo type to a vehicle or ammo crate as retrievable cargo.

 

ADDWEAPON

unit AddWeapon "weapontype"
this AddWeapon "M16"

Adds one specified weapon to a Unit.

 

ADDWEAPONCARGO

unit AddWeaponCargo ["weapontype", amount]
this AddWeaponCargo ["M16", 10]

Adds a specified number of specified weapons to a vehicle or ammo crate as retrievable cargo.

 

ALIVE || NOT ALIVE (TRIGGER)

Alive unit OR not Alive unit
Alive soldier01 OR not Alive soldier01

Checks whether a Unit is alive or dead / destroyed.

 

ALLOWFLEEING

unit AllowFleeing switch
this AllowFleeing 0,5

Sets likelihood of Unit fleeing. 0 = never flees, up to 1 = always flees.

 

COMMAND && COMMAND (TRIGGER)

not Alive soldier01 AND Alive truck01 AND tank01 Distance base01 < 100

Links commands that all need to be true for Trigger to activate or another Variable to be true.

 

CLEARMAGAZINECARGO
CLEARWEAPONCARGO

ClearMagazineCargo unit; ClearWeaponCargo unit
ClearMagazineCargo this; ClearWeaponCargo this

To remove magazines and weapons previously added to an object, use the stated commands.

 

DISTANCE (TRIGGER)

unit Distance object Distance
soldier01 Distance tank01 < 100

Checks the distance between a Unit and another Unit / Trigger / object in meters.

 

DOMOVE

unit DoMove GetPos object or unit DoMove GetMarkerPos "markername"
soldier01 DoMove GetPos tank01 OR tank1 DoMove GetMarkerPos "coast01"

Orders a Unit to move to the position of another Unit / object or a Marker.

 

FIRE (ACTION)

unit Fire WeaponName
soldier01 Fire "HandGrenade"

Unit will fire from given weapon.

unit Fire [ARRAY]

soldier01 Fire ["Throw","SmokeShell","SmokeShell"]
soldier01 Fire ["M203Muzzle","Flare"]
soldier01 Fire ["GrenadesMuzzle","GrenadeLauncher"]

Unit will fire from given weapon. Argument has format [muzzle, mode, magazine] or [muzzle, mode].

 

FLYINHEIGHT

unit FlyInHeight altitude
this FlyInHeight 100

Orders a helicopter to fly at a specified altitude between 50-1000 meters.

 

HINT (TRIGGER)

Hint "text"
Hint "Press W to move forward.\nPress S to move back."

Show hint text. Text can contain several lines, \n is used to indicate end of line.

 

INFLAME

unit InFlame switch
this inflame true

Lights or extinguishes Unit: Fire. true = fire lit, false = fire out

 

OBJSTATUS (TRIGGER)

"Objective#" ObjStatus "switch"
"1" objstatus "DONE"

Sets the status of objectives in the briefing notes. "Objective#" corresponds to the objective number as writen in the briefing.html file in the mission's folder.

"failed" = failed, "done" = completed, "active" = show if hidden, "hidden" = hide.

 

COMMAND || COMMAND

not Alive soldier01 OR not Alive trucko1 OR tank01 Distance base01 < 100

Links commands of which one needs to be true for Trigger to activate.

 

REMOVEALLWEAPONS

RemoveAllWeapons unit
RemoveAllWeapons this

Removes everything (weapons, ammo, equipment) from Unit's inventory.

 

REMOVEMAGAZINE

unit RemoveMagazine "ammotype"
this RemoveMagazine "M16"

Removes one magazine of a specified ammo type from a Unit.

 

REMOVEMAGAZINES

unit RemoveMagazines "ammotype"
this RemoveMagazines "M16"

Removes all magazines of a specified ammo type from a Unit.

 

REMOVEWEAPON

unit RemoveWeapon "weapontype"
this RemoveWeapon "M16"

Removes a specified weapon from a Unit.

 

SCUDSTATE (TRIGGER)

ScudState unit >= switch
ScudState scud01 >= 1

Checks status of SCUD Launcher.

1 = Launch sequence activated
2 = Missile upright, ready to launch
3 = Launch in progress (ignition)
4 = Missile high up, in flight

 

SETBEHAVIOR

unit setBehaviour "behaviourtype"
this setBehaviour "careless"

Sets behaviour of unit.

"careless" = unresponsive to threats
"safe" = guns on back, vehicles use roads/lights on
"aware" = low threat response/defence
"combat" = high threat response/defence
"stealth" = high use of cover/crawling

 

SETCAPTIVE

person setCaptive captive
this setCaptive true

Mark unit as captive. If unit is vehicle, commander is marked. Captive is neutral to everyone. Note: This function does not remove unit's weapons.

 

SETCOMBATMODE

unit  setCombatMode "combatmode"
this setCombatMode "red"

Sets rules of engagement for a unit.

"blue" = never fire
"green" = fire only in defence
"white" = hold fire, engage at will
"yellow" = fire
"red" = fire and seek enemy

 

SETDAMMAGE

unit setDammage switch
this setDammage 0.5

Sets damage / repairs / heals a Unit.

0 = no damage / injury
0.1 to 0.9 = partially dammaged
1 = dead / destroyed (or up to 1)

 

SETFLAGTEXTURE

unit setFlagTexture "flagtype"

this setFlagTexture "RUS_Vlajka.pac"

"RUS_Vlajka.pac" = Russian flag, "USA_Vlajka.pac" = US flag. (< 1.30)

this setFlagTexture "\Flags\USSR.jpg"

"USSR.jpg" = Russian flag, "USA.jpg" = US flag. (> 1.30)

Sets flag for Unit: Flag and Flag (International).

 

SETMARKERSIZE

"marker" setMarkerSize [axis a, axis b]
"border01" setMarkerSize [30,250]

Sets the size of a Marker.

 

SETMARKERTYPE

"marker" setMarkerType "icontype"
"base01" setMarkerType "arrow"

Sets Icon type of a Marker.

("flag" = Objective crosshair, "flag1" = normal flag)

 

SKIPTIME (TRIGGER)

SkipTime hours
SkipTime 2.5

Moves time ahead by specified number of hours.

 

THIS

this command
this AddWeapon "M16"

Applies command to unit which has the command in its Initialization.

 

MULTIPLE COMMANDS (TRIGGER)

Use ; after any command to input further commands.

(car01 SetDammage 1; SkipTime 12; soldier01 AddWeapon "M4")

 

RESPAWNS

Create file named: description.ext in the mission's folder and input the following commands:

respawn = 0; (0 = none, 1 = seagull, 2 = instant, 3 = marker, 4 = leader respawn)

respawndelay = 0; (time, in seconds until respawn)

When final version of map is complete, save the mission, then, with description.ext in the mission's folder, export the saved map to multiplayer through the editor's map save option.

 

RESPAWN MARKERS

(required for respawn = 3; command)

Create Marker in editor at a desired respawn location and input the following:

Name: respawn_east [Icon]
Colour: Default
Icon: Empty
Text: respawn_east
Name / Text: may also be: respawn_west, respawn_civilian, respawn_resistance.

 

LOADED WEAPONS

When adding a weapon and ammo to a Unit, input the ammo command before the weapon command to make the unit hold a loaded weapon.

this AddMagazine "M16"; this AddWeapon "M16"

 

WAYPOINTS

Placement radius determines area, in meters, within which unit randomly reaches its waypoint. The greater the radius, the more random unit movements will be.

 

HOSTILE CIVILIANS

Make group leader of Civilian group be an Eastern, Western or Resistance unit to make grouped Civilians behave as and be treated as that type of unit by other units even if the lead unit is eliminated.

 

MULTIPLE OBJECTIVES

Create Triggers which mark objectives as completed (using objstatus commands) and add to them Variables which are marked as true when the objective is complete.

(On Activation: "1" objstatus "done"; truckdead = true)

(On Activation: "2" objstatus "done"; scuddead = true)

(On Activation: "3" objstatus "done"; basereached = true)

Then create a final Trigger which will activate and end the mission only when all Variables are true.

(Condition: truckdead = true AND scuddead = true AND basereached = true)

 

DELIVERY / RETRIEVAL OBJECTIVES

Create any vehicle and give it any name (Name: plane01)

Then create a Trigger (Switch) at a destination or place where the vehicle is to be taken and give it any name.

(Name: base1). Then add to that Trigger a distance command which will activate the Trigger only when that specific vehicle is within a certain range.
Condition: (plane01 Distance base01 < 300) OR (truck01 Distance base02 < 300)

 

DISAPPEARING MAP MARKERS

Use setmarkersize command to make any Rectangle or Ellipse type Marker disappear by setting its size to 0 when a Trigger is activated. (On Activation: "border1" setmarkersize [0,0]).

Use setmarkertype command to make Icon type Markers disappear, by switching them into an Empty Icon when a Trigger is activated (On Activation: "enemyconvoy1" setMarkerType "empty").

 

APPEARING MAP MARKERS

To make Rectangle or Ellipse type Markers appear, create a Marker with a size of 0 (Axis a: 0 Axis b: 0) then make them appear during play by increasing their size with the setmarkersize command when a Trigger is activated (On Activation: "border1" setMarkerSize [30,300]).

To make Icon type Markers appear, create a Marker and make its Icon: Empty. Use setmarkertype command to make them switch into any other Icon when a Trigger is activated.

(On Activation: "enemyconvoy1" setMarkerType "arrow").