All Commands
# | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W
| Types | Arrays | Scripting Topics | CfgVehiclesOFP/ArmA | WeaponsOFP/ArmA |
a
Operand types:
x: Number
Type of returned value:
Description:
Absolute value of x.
Used In:
OFP/ArmA
Example:
_a = abs -3 ..........Result is 3
_a = abs -3 ..........Result is 3
Operand types:
None
Type of returned value:
Description:
Current time acceleration factor.
Used In:
OFP/ArmA
Example:
_eTime = acctime
_eTime = acctime
Operand types:
x: Number
Type of returned value:
Description:
Arccosine of x, result in degrees.
Used In:
OFP/ArmA
Example:
_angle = acos 0.5 ..........Result is 60
_angle = acos 0.5 ..........Result is 60
Operand types:
Type of returned value:
Description:
Make unit preform an action.
Format of action may be [type, target, param1, param2, param3].
Only type is required, target defaults to unit, param1, param2, param3 are type specific.
Format of action may be [type, target, param1, param2, param3].
Only type is required, target defaults to unit, param1, param2, param3 are type specific.
Used In:
OFP/ArmA
Example:
soldierOne action ["eject", vehicle soldierOne]
soldierOne action ["eject", vehicle soldierOne]
Operand types:
action: String
Type of returned value:
Description:
Returns a list of dikCodes of buttons assigned to the given user action.
Used In:
ArmA
Example:
array = actionKeys "ReloadMagazine"
array = actionKeys "ReloadMagazine"
Operand types:
[action, maxKeys]: Array
Type of returned value:
Description:
Returns a list of button images or names assigned to the given user action.
A maximum of maxKeys keys is listed.
You can find the action names in config class ControllerSchemes.
A maximum of maxKeys keys is listed.
You can find the action names in config class ControllerSchemes.
Used In:
ArmA
Example:
text = actionKeysImages "ReloadMagazine"
text = actionKeysImages "ReloadMagazine"
Operand types:
[action, maxKeys]: Array
Type of returned value:
Description:
Returns a list of button names assigned to the given user action.
A maximum of maxKeys keys is listed.
You can find the action names in config class ControllerSchemes.
A maximum of maxKeys keys is listed.
You can find the action names in config class ControllerSchemes.
Used In:
ArmA
Example:
list = actionKeysNames "ReloadMagazine"
list = actionKeysNames "ReloadMagazine"
Operand types:
[addon1, ...]: Array
Type of returned value:
Description:
Activates the listed addons.
The list of active addons is initialized during this function.
The list of active addons is initialized during this function.
Used In:
ArmA
Example:
activateAddons ["BISOFP"]
activateAddons ["BISOFP"]
Operand types:
keyName: String
Type of returned value:
Description:
Activates the given key for the current user profile.
The keys are used to unlock missions or campaigns.
See keys, keysLimit and doneKeys in the description.ext file of the missions.
The keys are used to unlock missions or campaigns.
See keys, keysLimit and doneKeys in the description.ext file of the missions.
Used In:
ArmA
Example:
activateKey "M04"
activateKey "M04"
Operand types:
unit: Object
[action, script filename, (arguments, priority, showWindow, hideOnUse, shortcut)]: Array
[action, script filename, (arguments, priority, showWindow, hideOnUse, shortcut)]: Array
Type of returned value:
Description:
Creates an action.
Action ID should be returned, but due to bug it is not.
To determine action ID use following algorithm:
First action added to given vehicle has ID zero, next has ID 1, etc.
Action ID should be returned, but due to bug it is not.
To determine action ID use following algorithm:
First action added to given vehicle has ID zero, next has ID 1, etc.
Used In:
OFP/ArmA
Example:
player addAction ["Hello", "hello.sqs"]
player addAction ["Hello", "hello.sqs"]
26 Oct 2007
An easy way to keep track of and remove actions is to set the ID of the action yourself.
This can be accomplished by doing the following:
myaction = player addAction ["Hello", "hello.sqs"]
This sets the actions ID to "myaction".
This can make keeping track actions much easier.
To remove the above action, you would use the following line:
player removeAction myaction
This can be accomplished by doing the following:
myaction = player addAction ["Hello", "hello.sqs"]
This sets the actions ID to "myaction".
This can make keeping track actions much easier.
To remove the above action, you would use the following line:
player removeAction myaction
26 Oct 2007
It seems that since 1.85+(?) addAction has correctly returned action ID although the comref doesn't reflect this.
Params passed by an action to the executed script:
[(object action was attached to), (unit that activated action), (index of action)]
So an example of an action-based script goes like this:
_obj = _this select 0
_man = _this select 1
_index = _this select 2
If you want to remove the action from the object immediately after it's triggered, use this line along with the above:
_obj removeAction _index
edited
Params passed by an action to the executed script:
[(object action was attached to), (unit that activated action), (index of action)]
So an example of an action-based script goes like this:
_obj = _this select 0
_man = _this select 1
_index = _this select 2
If you want to remove the action from the object immediately after it's triggered, use this line along with the above:
_obj removeAction _index
edited
10 Jan 2008
If arguments are passed to the action, these are accessible as _this select 3 in the action script. If you need to pass several values as arguments for an action script, pass them as an array.
Operand types:
Type of returned value:
Description:
Format of handler is [type,command].
Check scripting topic Event handlers for more information.
Index of currently added handler is returned.
Check scripting topic Event handlers for more information.
Index of currently added handler is returned.
Used In:
OFP/ArmA
Example:
player addEventHandler ["killed",{_this exec "playerKilled.sqs"}]
player addEventHandler ["killed",{_this exec "playerKilled.sqs"}]
Operand types:
Type of returned value:
Description:
Xbox Live MP only: Adds score to the Xbox Live Statistics score for the given unit (or the commander unit of the given vehicle).
Used In:
OFP/ArmA
Example:
player addLiveStats 12
player addLiveStats 12
Operand types:
Type of returned value:
Description:
Add magazine to unit.
Note: You can create invalid combinations with this function like 20 grenades.
When doing so, application behaviour is undefined.
Note: You can create invalid combinations with this function like 20 grenades.
When doing so, application behaviour is undefined.
Used In:
OFP/ArmA
Example:
player addMagazine "M16"
player addMagazine "M16"
23 Nov 2007
If the unit has magazines already, you may need to use the commands removeMagazine or removeMagazines to make space for the mags you want to add.
Operand types:
Type of returned value:
Description:
Add magazines to weapon cargo space.
Used for infantry weapons.
Format of magazines is [magazineName, count].
For magazineName values see OFPWeapons or ArmAWeapons.
Used for infantry weapons.
Format of magazines is [magazineName, count].
For magazineName values see OFPWeapons or ArmAWeapons.
Used In:
OFP/ArmA
Example:
rearmTruckOne addMagazineCargo ["M16",10]
rearmTruckOne addMagazineCargo ["M16",10]
Operand types:
[name, count]: Array
Type of returned value:
Description:
Adds count magazines of type name into magazine pool.
Used in campaign to transfer magazines into next mission.
Used in campaign to transfer magazines into next mission.
Used In:
OFP/ArmA
Example:
addMagazinePool ["M16",10]
addMagazinePool ["M16",10]
Operand types:
Type of returned value:
Description:
If the EH detects a change via publicVariable on the given variableName, code will be executed.
The following arguments are transferred to the code:
* _this select 0: variableName
* _this select 1: New variable value
The following arguments are transferred to the code:
* _this select 0: variableName
* _this select 1: New variable value
Used In:
ArmA
Example:
"mypublicVar" addPublicVariableEventHandler {hint ((_this select 0) + " has been modified to: " + str (_this select 1))}
"mypublicVar" addPublicVariableEventHandler {hint ((_this select 0) + " has been modified to: " + str (_this select 1))}
05 Sep 2008
Biki States:
Multiplayer: Note that the EH is only fired on clients where the publicVariable command has not been executed, as publicVariable does not change the variable where it has been executed.
Multiplayer: Note that the EH is only fired on clients where the publicVariable command has not been executed, as publicVariable does not change the variable where it has been executed.
Operand types:
Type of returned value:
Description:
Add number to unit rating.
This is usually used to reward for completed mission objectives.
Rating for killed enemies and killed friendlies is adjusted automatically.
When rating is lower than zero, unit is consider "renegade" and is enemy to everyone.
This is usually used to reward for completed mission objectives.
Rating for killed enemies and killed friendlies is adjusted automatically.
When rating is lower than zero, unit is consider "renegade" and is enemy to everyone.
Used In:
OFP/ArmA
Example:
player addRating 1000
player addRating 1000
Operand types:
Type of returned value:
Description:
MP only: Add unit score.
This is shown in the "I" MP screen as total.
This is shown in the "I" MP screen as total.
Used In:
OFP/ArmA
Example:
player addScore 10
player addScore 10
Operand types:
unitName: Object
Type of returned value:
Description:
Add a unit into the list of units available for team switch.
Used In:
ArmA
Example:
Operand types:
Type of returned value:
Description:
Adds the specified vehicle to the specified group.
Used In:
ArmA
Example:
Operand types:
Type of returned value:
Description:
Adds a new waypoint to a group.
The waypoint is placed randomly in a circle with the given center and radius.
The function returns a waypoint with format [group, index].
The waypoint is placed randomly in a circle with the given center and radius.
The function returns a waypoint with format [group, index].
Used In:
ArmA
Example:
grp addWaypoint [position player, 0]
grp addWaypoint [position player, 0]
Operand types:
Type of returned value:
Description:
Add weapon to unit.
Note: You can create invalid combinations with this function, for example by adding two rifles.
When doing so, application behaviour is undefined.
Note: You can create invalid combinations with this function, for example by adding two rifles.
When doing so, application behaviour is undefined.
Used In:
OFP/ArmA
Example:
player addWeapon "AK74"
player addWeapon "AK74"
23 Nov 2007
To ensure that the weapon is loaded at the start of the mission, add at least one magazine (addMagazine) before adding the weapon.
23 Nov 2007
To remove weapons use the removeAllWeapons or the removeWeapon commands.
Operand types:
Type of returned value:
Description:
Add weapons to weapon cargo space.
Used for infantry weapons.
Format of weapons is [weaponName, count].
For weaponName values see OFPWeapons or ArmAWeapons.
Used for infantry weapons.
Format of weapons is [weaponName, count].
For weaponName values see OFPWeapons or ArmAWeapons.
Used In:
OFP/ArmA
Example:
rearmTruckOne addWeaponCargo ["M16",10]
rearmTruckOne addWeaponCargo ["M16",10]
Operand types:
[name, count]: Array
Type of returned value:
Description:
Adds count weapons of type name into weapon pool.
Used in campaign to transfer weapons into next mission.
Used in campaign to transfer weapons into next mission.
Used In:
OFP/ArmA
Example:
addWeaponPool ["M16",10]
addWeaponPool ["M16",10]
Operand types:
id: Number
Type of returned value:
Description:
Returns which side an airfield is assigned to.
Following id numbers apply:
0 - Paraiso
1 - Rahmadi
2 - Pita
3 - Antigua
Following id numbers apply:
0 - Paraiso
1 - Rahmadi
2 - Pita
3 - Antigua
Used In:
ArmA
Example:
airportSide 3
airportSide 3
Operand types:
objectName: Object
Type of returned value:
Description:
Check if given person, vehicle or building is not dead / destroyed.
Used In:
OFP/ArmA
Example:
? (alive player) : _b = 1
? (alive player) : _b = 1
Operand types:
Type of returned value:
Description:
Obsolete command.
Used In:
OFP/ArmA
Example:
Operand types:
Type of returned value:
Description:
Set group courage.
The less courage, the sooner will group start fleeing.
0 means maximum courage, 1 means always fleeing.
The less courage, the sooner will group start fleeing.
0 means maximum courage, 1 means always fleeing.
Used In:
OFP/ArmA
Example:
soldierOne allowFleeing 0
soldierOne allowFleeing 0
Operand types:
Type of returned value:
Description:
Allow getting in vehicles to all units in the list.
Used In:
OFP/ArmA
Example:
[unitOne, unitTwo] allowGetIn false
[unitOne, unitTwo] allowGetIn false
Operand types:
Type of returned value:
Description:
Count how many shots are left for given magazine type.
Used In:
OFP/ArmA
Example:
player ammo "M16"
player ammo "M16"
Operand types:
Type of returned value:
Description:
a and b
Used In:
OFP/ArmA
Example:
(alive player) and (alive leader player)
(alive player) and (alive leader player)
Operand types:
Type of returned value:
Description:
Process animation on object.
Animation is defined in config file.
Wanted animation phase is set to phase.
Animation is defined in config file.
Wanted animation phase is set to phase.
Used In:
OFP/ArmA
Example:
house animate ["doors1", 1]
house animate ["doors1", 1]
Operand types:
Type of returned value:
Description:
Return animation phase of animation on object.
Used In:
OFP/ArmA
Example:
house animationPhase "doors1"
house animationPhase "doors1"
Operand types:
unitName: Object
Type of returned value:
Description:
Return the name of the current primary animation.
Used In:
ArmA
Example:
10 Jan 2008
The returned string is the name of the current move being "played" (see switchMove, playMove).
Operand types:
x: Number
Type of returned value:
None
Description:
Arcsine of x, result in degrees.
Used In:
OFP/ArmA
Example:
_angle = asin 0.5 ..........Result is 30
_angle = asin 0.5 ..........Result is 30
Operand types:
condition: Boolean
Type of returned value:
Description:
Tests a condition and if the condition is false, halts the program.
Used In:
ArmA
Example:
assert (_x>0)
assert (_x>0)
Operand types:
Type of returned value:
Description:
Assign soldier into cargo / passenger space of given vehicle.
Used In:
OFP/ArmA
Example:
player assignAsCargo truckOne
player assignAsCargo truckOne
23 Nov 2007
To make the unit get into the vehicle you will need to use the command orderGetIn after you have issued any assignAs command.
Operand types:
Type of returned value:
Description:
Assign soldier as commander of given vehicle.
Used In:
OFP/ArmA
Example:
player assignAsCommander tankOne
player assignAsCommander tankOne
Operand types:
Type of returned value:
Description:
Assign soldier as driver of given vehicle.
Used In:
OFP/ArmA
Example:
player assignAsDriver tankOne
player assignAsDriver tankOne
Operand types:
Type of returned value:
Description:
Assign soldier as gunner of given vehicle.
Used In:
OFP/ArmA
Example:
player assignAsGunner tankOne
player assignAsGunner tankOne
Operand types:
vehicleName: Object
Type of returned value:
Description:
Return the target assigned to the vehicle.
Used In:
ArmA
Example:
Operand types:
vehicleName: Object
Type of returned value:
Description:
Returns the vehicle that a unit is assigned to.
Used In:
ArmA
Example:
assignedVehicle fred
assignedVehicle fred
Operand types:
unitName: Object
Type of returned value:
Description:
Returns the role that a unit is assigned to within its assigned vehicle. The array which is returned can contain:
[] - Not assigned to any vehicle
["Driver"] - Assigned as driver
["Cargo"] - Assigned as cargo
["Turret", [turret path]] - Assigned to a turret
[] - Not assigned to any vehicle
["Driver"] - Assigned as driver
["Cargo"] - Assigned as cargo
["Turret", [turret path]] - Assigned to a turret
Used In:
ArmA
Example:
assignedVehicleRole fred
assignedVehicleRole fred
Operand types:
Type of returned value:
Description:
Assigns the vehicle (specifically its commander unit) to the given team.
The possible team values are:
"MAIN"
"RED"
"GREEN"
"BLUE"
"YELLOW"
The possible team values are:
"MAIN"
"RED"
"GREEN"
"BLUE"
"YELLOW"
Used In:
ArmA
Example:
soldier2 assignTeam "RED"
soldier2 assignTeam "RED"
Operand types:
None
Type of returned value:
None
Description:
assignToAirport used to do the same as landAt.
Now it assigns for purpose of future getout commands.
Do not use till it is fully implemented at some future date.
Now it assigns for purpose of future getout commands.
Do not use till it is fully implemented at some future date.
Used In:
ArmA
Example:
Operand types:
x: Number
Type of returned value:
Description:
Arctangens of x, result in degrees.
Used In:
OFP/ArmA
Example:
_angle = atan 1 ..........Result is 45
_angle = atan 1 ..........Result is 45
Operand types:
Type of returned value:
Description:
Returns the arctangens of x/y.
Returned value is in degrees, in the range -180 to +180, using the signs of both parameters to determine the quadrant of the return value.
Returned value is in degrees, in the range -180 to +180, using the signs of both parameters to determine the quadrant of the return value.
Used In:
OFP/ArmA
Example:
_angle = 5 atan2 3 ..........Result is 59.0362
_angle = 5 atan2 3 ..........Result is 59.0362
Operand types:
x: Number
Type of returned value:
Description:
Arctangens of x, result in degrees.
Used In:
OFP/ArmA
Example:
_angle = atg 1 ..........Result is 45
_angle = atg 1 ..........Result is 45
Operand types:
groupName: Group
Type of returned value:
Description:
Return whether leader can issue attack
Used In:
ArmA
Example:

Not to be confused with skipTime.