415
! a Operand types: a: Boolean Type of returned value: Boolean Description: not a Example: !true , result is false Category: Default grp1 != grp2 Operand types: grp1: Group grp2: Group Type of returned value: Boolean Description: Checks whether two groups are different. If either of them is grpNull, true is returned. Example: group player != group soldierOne Category: OFP a != b Operand types: a: Number b: Number Type of returned value: Boolean Description: a is not equal to b Example: counter != 4 Category: Default location1 != location2 Operand types: location1: Location Page 1 of 415 BIS Game Engine Scripting Commands 7/11/2010 http://www.arma2.com/comref/full.html

comref

Embed Size (px)

Citation preview

Page 1: comref

! a

Operand types: a: Boolean Type of returned value: Boolean Description: not a Example: !true , result is false Category: Default

grp1 != grp2

Operand types: grp1: Group grp2: Group Type of returned value: Boolean Description: Checks whether two groups are different. If either of them is grpNull, true is returned. Example: group player != group soldierOne Category: OFP

a != b

Operand types: a: Number b: Number Type of returned value: Boolean Description: a is not equal to b Example: counter != 4 Category: Default

location1 != location2

Operand types: location1: Location

Page 1 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 2: comref

location2: Location Type of returned value: Boolean Description: Checks whether two locations are different. If either of them is null, true is returned. Category: Location

a != b

Operand types: a: String b: String Type of returned value: Boolean Description: a is not equal to b (case insensitive) Example: nameOfPlayer != "John Doe" Category: Default

text1 != text2

Operand types: text1: Structured text text2: Structured text Compatibility: Version 2.01 required. Type of returned value: Boolean Description: Checks whether two structured text values are different. Category: OFP

side1 != side2

Operand types: side1: Side side2: Side Type of returned value: Boolean Description: Checks whether two side values are different. Example:

Page 2 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 3: comref

side player != west Category: OFP

control1 != control2

Operand types: control1: Control control2: Control Compatibility: Version 2.50 required. Type of returned value: Boolean Description: Checks whether two controls are different. Category: OFP PC

task1 != task2

Operand types: task1: Task task2: Task Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Checks whether two tasks are different. Category: Identity

obj1 != obj2

Operand types: obj1: Object obj2: Object Type of returned value: Boolean Description: Checks whether two objects are different. If either of them is objNull, true is returned. Example: vehicle player != player Category: OFP

Page 3 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 4: comref

display1 != display2

Operand types: display1: Display display2: Display Compatibility: Version 2.50 required. Type of returned value: Boolean Description: Checks whether two displays are different. Category: OFP PC

config1 != config2

Operand types: config1: Config config2: Config Compatibility: Version 2.58 required. Type of returned value: Boolean Description: Checks whether two config entries are different. Category: OFP PC

a % b

Operand types: a: Number b: Number Type of returned value: Number Description: The remainder of a divided by b. Note that the remainder is calculated in the real domain. Example: 4.5 % 3 , result is 1.5 Category: Default

a && b

Operand types: a: Boolean b: Boolean

Page 4 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 5: comref

Type of returned value: Boolean Description: a and b Example: alive player && alive leader player Category: Default

a * b

Operand types: a: Number b: Number Type of returned value: Number Description: a multiplied by b Example: iCounter*3 Category: Default

+ a

Operand types: a: Number Type of returned value: Number Description: unary plus: returns a Example: +4 , result is 4 Category: Default

+ a

Operand types: a: Array Type of returned value: Array Description: unary plus: returns a copy of the array

Page 5 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 6: comref

Example: + [0, 1, 2] , result is [0, 1, 2] Category: Default

a + b

Operand types: a: Number b: Number Type of returned value: Number Description: a plus b Example: counter + 1 Category: Default

arrayA + arrayB

Operand types: arrayA: Array arrayB: Array Type of returned value: Array Description: arrayA and arrayB are concatenated. Example: [0, 1, 2] + [1, 2, 3] , result is [0, 1, 2, 1, 2, 3] Category: Default

stringA + stringB

Operand types: stringA: String stringB: String Type of returned value: String Description: stringA and stringB are concatenated. Example: "I" + " am" + " blind" , result is "I am blind"

Page 6 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 7: comref

Category: Default

- a

Operand types: a: Number Type of returned value: Number Description: unary minus: zero minus a Example: - - 3 , result is 3 Category: Default

a - b

Operand types: a: Number b: Number Type of returned value: Number Description: a minus b Example: counter - 1 Category: Default

arrayA - arrayB

Operand types: arrayA: Array arrayB: Array Type of returned value: Array Description: All elements in arrayB are removed from arrayA. Example: [0, 1, 2, 4, 0, 1, 2, 3, 4, 5] - [1, 2, 3] , result is [0, 4, 0, 4, 5] Category: Default

Page 7 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 8: comref

a / b

Operand types: a: Number b: Number Type of returned value: Number Description: a divided by b Example: enemyStrenght/3 Category: Default

config / name

Operand types: config: Config name: String Compatibility: Version 2.92 required. Type of returned value: Config Description: Returns subentry of config entry with given name (alias for >>). Example: configFile / "CfgVehicles" Category: OFP PC

a : b

Operand types: a: Switch Type b: Code Type of returned value: Nothing Description: see switch Category: Default

a < b

Operand types: a: Number

Page 8 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 9: comref

b: Number Type of returned value: Boolean Description: a lesser than b Example: counter < 4 Category: Default

a <= b

Operand types: a: Number b: Number Type of returned value: Boolean Description: a lesser or equal than b Example: player distance redCar <= 100 Category: Default

display1 == display2

Operand types: display1: Display display2: Display Compatibility: Version 2.50 required. Type of returned value: Boolean Description: Checks whether two displays are equal. Category: OFP PC

control1 == control2

Operand types: control1: Control control2: Control Compatibility: Version 2.50 required. Type of returned value:

Page 9 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 10: comref

Boolean Description: Checks whether two controls are equal. Category: OFP PC

side1 == side2

Operand types: side1: Side side2: Side Type of returned value: Boolean Description: Checks whether two side values are equal. Example: side player == west Category: OFP

obj1 == obj2

Operand types: obj1: Object obj2: Object Type of returned value: Boolean Description: Checks whether two objects are the same. If either of them is objNull, false is returned. Example: player == leader player Category: OFP

config1 == config2

Operand types: config1: Config config2: Config Compatibility: Version 2.58 required. Type of returned value: Boolean Description: Checks whether two config entries are equal.

Page 10 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 11: comref

Category: OFP PC

task1 == task2

Operand types: task1: Task task2: Task Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Checks whether two tasks are equal. Category: Identity

text1 == text2

Operand types: text1: Structured text text2: Structured text Compatibility: Version 2.01 required. Type of returned value: Boolean Description: Checks whether two structured text values are equal. Category: OFP

grp1 == grp2

Operand types: grp1: Group grp2: Group Type of returned value: Boolean Description: Checks whether two groups are the same. If either of them is grpNull, false is returned. Example: group player == group soldierOne Category: OFP

a == b

Page 11 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 12: comref

Operand types: a: Number b: Number Type of returned value: Boolean Description: a equal to b Example: counter == 4 Category: Default

location1 == location2

Operand types: location1: Location location2: Location Type of returned value: Boolean Description: Checks whether two locations are the same. If either of them is null, false is returned. Category: Location

a == b

Operand types: a: String b: String Type of returned value: Boolean Description: a equal to b (case insensitive) Example: nameOfPlayer == "John Doe" Category: Default

a > b

Operand types: a: Number b: Number Type of returned value: Boolean Description:

Page 12 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 13: comref

a greater than b Example: counter > 4 Category: Default

a >= b

Operand types: a: Number b: Number Type of returned value: Boolean Description: a greater or equal than b Example: player distance redCar < 100 Category: Default

config >> name

Operand types: config: Config name: String Compatibility: Version 2.35 required. Type of returned value: Config Description: Returns subentry of config entry with given name. Example: configFile >> "CfgVehicles" Category: OFP PC

a ^ b

Operand types: a: Number b: Number Type of returned value: Number Description: a raised to the power of b

Page 13 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 14: comref

Example: count^4 Category: Default

a || b

Operand types: a: Boolean b: Boolean Type of returned value: Boolean Description: a or b Example: !alive player || !alive leader player Category: Default

abs x

Operand types: x: Number Type of returned value: Number Description: The absolute value of x. Example: abs -3 , result is 3 Category: Default

accTime

Type of returned value: Number Description: Returns the current time acceleration factor. Category: OFP

acos x

Page 14 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 15: comref

Operand types: x: Number Type of returned value: Number Description: The arccosine of x, the result is in degrees. Example: acos 0.5 , result is 60 Category: Default

unit action action

Operand types: unit: Object action: Array Type of returned value: Nothing Description: Makes the unit peform an action. The format of action can be [type, target, param1, param2, param3]. Only type is required, target defaults to unit and param1, param2, param3 are type specific. Example: soldierOne action ["eject", vehicle soldierOne] Category: OFP

actionKeys action

Operand types: action: String Compatibility: Version 2.01 required. Type of returned value: Array Description: Returns a list of dikCodes of buttons assigned to the given user action. Example: array = actionKeys "ReloadMagazine" Category: OFP

actionKeysImages action or [action, maxKeys]

Operand types: action or [action, maxKeys]: String or Array

Page 15 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 16: comref

Compatibility: Version 2.01 required. Type of returned value: Structured text 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. Example: text = actionKeysImages "ReloadMagazine" Category: OFP

actionKeysNames action or [action, maxKeys]

Operand types: action or [action, maxKeys]: String or Array Compatibility: Version 2.01 required. Type of returned value: String 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. Example: list = actionKeysNames "ReloadMagazine" Category: OFP

activateAddons [addon1, ...]

Operand types: [addon1, ...]: Array Compatibility: Version 2.32 required. Type of returned value: Nothing Description: Activates the listed addons. The list of active addons is initialized during this function. Example: activateAddons ["BISOFP"] Category: OFP

activateKey keyName

Page 16 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 17: comref

Operand types: keyName: String Compatibility: Version 2.06 required. Type of returned value: Nothing 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. Example: activateKey "M04" Category: OFP

unit addAction [action, script filename(, arguments, priority, showWindow, hideOnUse, shortcut, condition)]

Operand types: unit: Object [action, script filename(, arguments, priority, showWindow, hideOnUse, shortcut, condition)]: Array Compatibility: Version 1.10 required. Type of returned value: Description: Creates an action. The action ID should be returned, but due to a bug, it's not. To determine the action ID, use following algorithm: the first action added to the given vehicle has ID zero, the next vehicle has ID one, etc. Example: player addAction ["Hello", "hello.sqs"] Category: OFP

map addEditorObject [type, [name1, value1, ...], subtype class]

Operand types: map: Control [type, [name1, value1, ...], subtype class]: Array Compatibility: Version 2.92 required. Type of returned value: String Description: Add an object to the editor and assign arguments. Create script is called with _new equal to true. Returns the ID of the new EditorObject. Subtype class is optional. Category: Editor

Page 17 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 18: comref

object addEventHandler handler

Operand types: object: Object handler: Array Compatibility: Version 1.85 required. Type of returned value: Description: The format of handler is [type,command]. Check scripting topic Event handlers for more information. The index of the currently added handler is returned. Example: player addEventHandler ["killed",{_this exec "playerKilled.sqs"}] Category: OFP

group addGroupIcon properties

Operand types: group: Group properties: Array Compatibility: Version 5501 required. Type of returned value: Number Description: Add icon to a group. Returns icon ID Example: id = group addGroupIcon["b_inf",[offsetX,ofsetY]] Category: OFP

unit addLiveStats score

Operand types: unit: Object score: Number Compatibility: Version 2.10 required. Type of returned value: Nothing 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). Example:

Page 18 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 19: comref

player addLiveStats 10 Category: OFP

unit addMagazine weaponName

Operand types: unit: Object weaponName: String Type of returned value: Nothing Description: Adds a magazine to the unit. Note: you may create invalid combinations by using this function, for example by adding 20 grenades. When doing so, application behaviour is undefined. Example: player addMagazine "M16" Category: OFP

unit addMagazineCargo magazines

Operand types: unit: Object magazines: Array Type of returned value: Nothing Description: Adds magazines to the weapon cargo space. This is used for infantry weapons. The format of magazines is [magazineName, count]. For magazineName values see CfgWeapons. Example: rearmTruckOne addMagazineCargo ["M16", 10] Category: OFP

addMagazinePool

Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Adds count magazines of type name into the weapon pool (used in the campaign to transfer weapons to the next mission). Category: Resistance

Page 19 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 20: comref

map addMenu [text,priority]

Operand types: map: Control [text,priority]: Array Compatibility: Version 2.92 required. Type of returned value: Number Description: Adds a new menu button. Priority is optional. Category: Editor

map addMenuItem [menu or index,text,command,priority]

Operand types: map: Control [menu or index,text,command,priority]: Array Compatibility: Version 2.92 required. Type of returned value: Number Description: Creates a new menu item. Menu can be "file" or "view", index is index as returned from addMenu command. priority is optional and determines where in the menu the item will reside (higher priority items first). Category: Editor

name addPublicVariableEventHandler code

Operand types: name: String code: Code Type of returned value: Nothing Description: Create an event handler for given variable. The event handler will be executed when some client in MP exports a variable using publicVariable on all clients except the publishing one. Example: "alarm" addPublicVariableEventHandler {_this execVM "alarm.sqf"} Category: OFP

unit addRating number

Page 20 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 21: comref

Operand types: unit: Object number: Number Type of returned value: Nothing Description: Adds number to the unit rating. This is usually used to reward for completed mission objectives. The rating for killed enemies and killed friendlies is adjusted automatically. When the rating is lower than zero, a unit is considered "renegade" and is an enemy to everyone. Example: player addRating 1000 Category: OFP

unit addScore score

Operand types: unit: Object score: Number Type of returned value: Nothing Description: MP only: adds unit score. This is shown in the "I" MP screen as the total score. Example: player addScore 10 Category: OFP

addSwitchableUnit person

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Add a unit into the list of units available for team switch. Category: OFP

group addVehicle vehicle

Operand types: group: Group vehicle: Object

Page 21 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 22: comref

Compatibility: Version 5128 required. Type of returned value: Nothing Description: Tells the group it owns the vehicle now. Category: OFP

group addWaypoint [center, radius] or [center, radius, index]

Operand types: group: Group [center, radius] or [center, radius, index]: Array Compatibility: Version 1.86 required. Type of returned value: Array Description: Adds (or inserts when index is given) 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]. Example: grp addWaypoint [position player, 0] Category: OFP

unit addWeapon weaponName

Operand types: unit: Object weaponName: String Type of returned value: Nothing Description: Adds the weapon to the unit. Note: you may create invalid combinations by using this function, for example by adding two rifles. When doing so, application behaviour is undefined. Example: player addWeapon "AK74" Category: OFP

unit addWeaponCargo weapons

Operand types: unit: Object

Page 22 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 23: comref

weapons: Array Type of returned value: Nothing Description: Adds weapons to the weapon cargo space. This is used for infantry weapons. The format of weapons is [weaponName, count]. For weaponName values see CfgWeapons. Example: rearmTruckOne addWeaponCargo ["M16", 10] Category: OFP

addWeaponPool [name, count]

Operand types: [name, count]: Array Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Adds count weapons of type name into the weapon pool (used in campaigns to transfer weapons to the next mission). Category: Resistance

airportSide airportId

Operand types: airportId: Number Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Checks a side of the airport. Example: airportSide 0 , result is west Category: OFP

AISFinishHeal [unit,unit,bool]

Operand types: [unit,unit,bool]: Array Compatibility: Version 5501 required.

Page 23 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 24: comref

Type of returned value: Nothing Description: AIS end state. Example: AISFinishHeal [wounded,medic,true] Category: OFP

alive obj

Operand types: obj: Object Type of returned value: Boolean Description: Checks whether the given person, vehicle or building is't dead / destroyed. Example: alive player Category: OFP

allGroups

Compatibility: Version 5501 required. Type of returned value: Array Description: Return a list of all groups. Category: OFP

map allow3DMode bool

Operand types: map: Control bool: Boolean Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Allow/dissallow 3D mode. Category: Editor

Page 24 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 25: comref

obj allowDamage allow

Operand types: obj: Object allow: Boolean Type of returned value: Nothing Description: Obsolete. Category: OFP

obj allowDammage allow

Operand types: obj: Object allow: Boolean Type of returned value: Nothing Description: Obsolete. Category: OFP

map allowFileOperations bool

Operand types: map: Control bool: Boolean Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Allow/dissallow file ops (load/save etc). Category: Editor

unit allowFleeing courage

Operand types: unit: Object or Group courage: Number Type of returned value: Nothing Description:

Page 25 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 26: comref

Sets the group courage. The less courage, the sooner the group will start fleeing. 0 means maximum courage, while 1 means always fleeing. Example: soldierOne allowFleeing 0 Category: OFP

unitArray allowGetIn allow

Operand types: unitArray: Array allow: Boolean Type of returned value: Nothing Description: Allows the getting in of vehicles of all units in the list. Example: [unitOne, unitTwo] allowGetIn false Category: OFP

allUnits

Compatibility: Version 5501 required. Type of returned value: Array Description: Return a list of all units (all persons except agents). Category: OFP

unit ammo magazine

Operand types: unit: Object magazine: String Type of returned value: Number Description: Counts how many shots the unit has left for the given magazine type. Example: player ammo "M16" Category: OFP

Page 26 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 27: comref

a and b

Operand types: a: Boolean b: Boolean Type of returned value: Boolean Description: a and b Example: alive player and alive leader player Category: Default

object animate [animation, phase]

Operand types: object: Object [animation, phase]: Array Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Process animation on object. Animation is defined in config file. Wanted animation phase is set to phase. Example: house animate ["doors1", 1] Category: Resistance

object animationPhase animation

Operand types: object: Object animation: String Compatibility: Version 1.75 required. Type of returned value: Number Description: Return animation phase of animation on object. Example: house animationPhase "doors1" Category: Resistance

Page 27 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 28: comref

animationState man

Operand types: man: Object Compatibility: Version 2.92 required. Type of returned value: String Description: Return the name of the current primary animation. Category: OFP

armoryPoints

Compatibility: Version 5500 required. Type of returned value: Number Description: Return the stored value of armory points. Category: OFP

asin x

Operand types: x: Number Type of returned value: Number Description: The arcsine of x, the result is in degrees. Example: asin 0.5 , result is 30 Category: Default

assert codition

Operand types: codition: Boolean Compatibility: Version 2.00 required. Type of returned value: Boolean

Page 28 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 29: comref

Description: Tests a condition and if the condition is false, halts the program. Example: assert (_x>0) Category: Default

soldier assignAsCargo vehicle

Operand types: soldier: Object vehicle: Object Type of returned value: Nothing Description: Assigns the soldier to the cargo / passenger space of the given vehicle. Example: player assignAsCargo tankOne Category: OFP

soldier assignAsCommander vehicle

Operand types: soldier: Object vehicle: Object Type of returned value: Nothing Description: Assigns the soldier as commander of the given vehicle. Example: player assignAsCommander tankOne Category: OFP

soldier assignAsDriver vehicle

Operand types: soldier: Object vehicle: Object Type of returned value: Nothing Description: Assigns the soldier as driver of the given vehicle.

Page 29 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 30: comref

Example: player assignAsDriver tankOne Category: OFP

soldier assignAsGunner vehicle

Operand types: soldier: Object vehicle: Object Type of returned value: Nothing Description: Assigns the soldier as gunner of the given vehicle. Example: player assignAsGunner tankOne Category: OFP

assignedCargo vehicle

Operand types: vehicle: Object Compatibility: Version 5501 required. Type of returned value: Array Description: Returns the list of soldiers assigned to the given vehicle as a cargo. Category: OFP

assignedCommander vehicle

Operand types: vehicle: Object Compatibility: Version 5501 required. Type of returned value: Object Description: Returns the soldier assigned to the given vehicle as a commander. Category: OFP

Page 30 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 31: comref

assignedDriver vehicle

Operand types: vehicle: Object Compatibility: Version 5501 required. Type of returned value: Object Description: Returns the soldier assigned to the given vehicle as a driver. Category: OFP

assignedGunner vehicle

Operand types: vehicle: Object Compatibility: Version 5501 required. Type of returned value: Object Description: Returns the soldier assigned to the given vehicle as a gunner. Category: OFP

assignedTarget vehicle

Operand types: vehicle: Object Compatibility: Version 2.92 required. Type of returned value: Object Description: Return the target assigned to the vehicle. Category: OFP

assignedVehicle person

Operand types: person: Object Compatibility: Version 5130 required. Type of returned value: Object Description:

Page 31 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 32: comref

Return the vehicle person is assigned to. Category: OFP

assignedVehicleRole person

Operand types: person: Object Compatibility: Version 5130 required. Type of returned value: Array Description: Return the position in vehicle person is assigned to. Category: OFP

vehicle assignTeam team

Operand types: vehicle: Object team: String Compatibility: Version 2.05 required. Type of returned value: Nothing Description: Assigns the vehicle (specifically its commander unit) to the given team. The possible team values are: "MAIN", "RED", "GREEN", "BLUE" and "YELLOW". Example: soldier2 assignTeam "RED" Category: OFP

airplane assignToAirport airportId

Operand types: airplane: Object airportId: Number Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set airport to be used by AI on getout Example:

Page 32 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 33: comref

plane assignToAirport 0 Category: OFP

atan x

Operand types: x: Number Type of returned value: Number Description: The arctangens of x, the result is in degrees. Example: atan 1 , result is 45 Category: Default

x atan2 y

Operand types: x: Number y: Number Type of returned value: Number Description: Returns the arctangens of x/y. The returned value is in degrees, in the range from -180 to +180, using the signs of both parameters to determine the quadrant of the returned value. Example: 5 atan2 3 , result is 59.0362 Category: Default

atg x

Operand types: x: Number Type of returned value: Number Description: The arctangens of x, the result is in degrees. Example: atg 1 , result is 45 Category: Default

Page 33 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 34: comref

attachedObject location

Operand types: location: Location Compatibility: Version 2.90 required. Type of returned value: Object Description: Return object attached to given location. Category: Location

location attachObject object

Operand types: location: Location object: Object Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Attach a object to given location. Category: Location

obj attachTo [obj, offset, MemPoint]

Operand types: obj: Object [obj, offset, MemPoint]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Attaches an object to another object. The offset is applied to the object center unless a memory point is provided. Example: player attachTo [car, [0,2,0],hatch1] Category: OFP

attackEnabled group

Operand types:

Page 34 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 35: comref

group: Object or GroupCompatibility: Version 2.92 required. Type of returned value: Boolean Description: Return whether leader can issue attack commands. Category: OFP

behaviour unit

Operand types: unit: Object Type of returned value: String Description: Returns the behaviour mode of the given unit ("CARELESS","SAFE","AWARE","COMBAT" or "STEALTH"). Example: behaviour player Category: OFP

benchmark

Type of returned value: Number Description: Returns the value of "3D performance" as it is in OFP preferences. This can be used to estimate computer performance. The function can be used to create missions that are able to adapt to computer peformance. Example: ? benchmark>2000 : setviewdistance 2000 Category: OFP

boundingBox object

Operand types: object: Object Compatibility: Version 2.92 required. Type of returned value: Array Description:

Page 35 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 36: comref

Returns a bounding box of given object in model coordinates space. The result is in format [[minX, minZ, minY], [maxX, maxZ, maxY]]. Category: OFP

boundingCenter object

Operand types: object: Object Compatibility: Version 5501 required. Type of returned value: Array Description: Returns the position of original (loaded) center of object in model coordinates. The result is in format [x, z, y] Category: OFP

breakOut name

Operand types: name: String Type of returned value: Nothing Description: Breaks block out scope named 'name'. Nil is returned. Category: Default

breakTo name

Operand types: name: String Type of returned value: Nothing Description: Breaks block to scope named 'name'. Nil is returned. Category: Default

building buildingExit index

Operand types: building: Object index: Number

Page 36 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 37: comref

Type of returned value: Array Description: Returns the given indexed exit in a building. The returned value is in format Position. Example: buildingExit [building, 1] Category: OFP

building buildingPos index

Operand types: building: Object index: Number Type of returned value: Array Description: Returns the given indexed position in a building. The returned value is in format Position. Example: building buildingPos 1 Category: OFP

buttonAction control

Operand types: control: Control Compatibility: Version 2.92 required. Type of returned value: String Description: Returns the action assigned to the given button or active text. The action is any expression in this scripting language. Example: _action = buttonAction _button Category: OFP PC

buttonAction idc

Operand types: idc: Number Compatibility: Version 1.50 required.

Page 37 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 38: comref

Type of returned value: String Description: Returns the action assigned to the control with id idc of the topmost user dialog. The action is any expression in this scripting language. The function can be used for buttons and active texts. Example: _action = buttonAction 100 Category: Resistance

buttonSetAction [idc, action]

Operand types: [idc, action]: Array Compatibility: Version 1.50 required. Type of returned value: Nothing Description: Assigns an action to the control with id idc of the topmost user dialog. Action is any expression in this scripting language. The function can be used for buttons and active texts. Example: buttonSetAction [100, "player exec ""reply.sqs"""] Category: Resistance

control buttonSetAction action

Operand types: control: Control action: String Compatibility: Version 2.91 required. Type of returned value: Nothing Description: Assigns an action to the given button or active text. Action is any expression in this scripting language. Example: _control buttonSetAction "player exec ""reply.sqs""" Category: OFP PC

cadetMode

Page 38 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 39: comref

Type of returned value: Boolean Description: Returns true if the mission is played in cadet mode and false in veteran mode. Category: OFP

call code

Operand types: code: Code Compatibility: Version 1.85 required. Type of returned value: Any Description: Executes the given code. Example: call {"x=2"} Category: Default

pars call body

Operand types: pars: Any body: Code Compatibility: Version 1.85 required. Type of returned value: Any Description: Executes the function body. Argument pars is passed as _this. Example: [1,2] call {(_this select 0)+(_this select 1)} , result is 3 Category: Default

camera camCommand command

Operand types: camera: Object command: String Type of returned value: Nothing Description:

Page 39 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 40: comref

Executes a command on the given camera / actor object. The "manual on" and "manual off" commands are recognized for all types. For the "camera" type, the following commands can be used: "inertia on" and "inertia off". For the "seagull" type it's one of: "landed" and "airborne". Example: _camera camCommand "Manual on" Category: OFP

camera camCommit time

Operand types: camera: Object time: Number Type of returned value: Nothing Description: Commits the camera changes smoothly over time. A time of zero results in an immediate change. Example: _camera camCommit 5 Category: OFP

camera camCommitPrepared time

Operand types: camera: Object time: Number Compatibility: Version 2.95 required. Type of returned value: Nothing Description: Commits the prepared camera changes smoothly over time. A time of zero results in an immediate change. Example: _camera camCommit 5 Category: OFP

camCommitted camera

Operand types: camera: Object Type of returned value: Boolean

Page 40 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 41: comref

Description: Checks whether the camera has finished committing. Example: camCommitted _camera Category: OFP

camera camConstuctionSetParams [[x,y,z],radius, max above land]

Operand types: camera: Object [[x,y,z],radius, max above land]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets construction camera parameters. Example: _camera camConstuctionSetParams [getpos player,50,20] Category: OFP

type camCreate position

Operand types: type: String position: Array Type of returned value: Object Description: Creates a camera or an actor of the given type on the given initial position (format Position). Its type is one of "CAMERA" or "SEAGULL". Example: _camera = camCreate getPos player Category: OFP

camDestroy camera

Operand types: camera: Object Type of returned value: Nothing Description:

Page 41 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 42: comref

Destroys the camera. Category: OFP

camera cameraEffect effect

Operand types: camera: Object effect: Array Type of returned value: Nothing Description: Switches the camera to the given vehicle / camera. The format of effect is [name, position]. Name is one of: "Internal", "External", "Fixed" or "FixedWithZoom". Position is one of: "TOP", "LEFT", "RIGHT", "FRONT" or "BACK" ("BACK" is normally used). Example: cameraEffect ["External", "Back"] Category: OFP

cameraEffectEnableHUD enable

Operand types: enable: Boolean Compatibility: Version 5501 required. Type of returned value: Nothing Description: Enable / disable showing of in-game UI during currently active camera effect. Category: OFP

cameraInterest entity

Operand types: entity: Object Compatibility: Version 2.57 required. Type of returned value: Number Description: Return camera interest for given entity. Category: OFP

Page 42 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 43: comref

cameraOn

Compatibility: Version 1.56 required. Type of returned value: Object Description: Returns the vehicle to which the camera is attached. Category: OFP

cameraView

Compatibility: Version 5501 required. Type of returned value: String Description: Return type of camera. Category: OFP

campaignConfigFile

Compatibility: Version 2.90 required. Type of returned value: Config Description: Return root of campaign description.ext entries hierarchy. Category: OFP PC

camera camPreload time

Operand types: camera: Object time: Number Compatibility: Version 2.95 required. Type of returned value: Nothing Description: Preload the scene for he prepared camera. Time gives timeout, zero means no (infinite) timeout. Example: _camera camCommit 5

Page 43 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 44: comref

Category: OFP

camPreloaded camera

Operand types: camera: Object Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Checks whether the camera has finished preloading. Example: camPreloaded _camera Category: OFP

camera camPrepareBank bank

Operand types: camera: Object bank: Number Compatibility: Version 2.95 required. Type of returned value: Nothing Description: Prepares the camera bank angle. See also camPreload and camCommitPrepared. Example: _camera camPrepareBank -0.1 Category: OFP

camera camPrepareDir direction

Operand types: camera: Object direction: Number Compatibility: Version 2.95 required. Type of returned value: Nothing Description: Prepares the camera heading. See also camPreload and camCommitPrepared. Example:

Page 44 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 45: comref

_camera camPrepareDir 150 Category: OFP

camera camPrepareDive dive

Operand types: camera: Object dive: Number Compatibility: Version 2.95 required. Type of returned value: Nothing Description: Prepares the camera dive angle. See also camPreload and camCommitPrepared. Example: _camera camPrepareDive -0.1 Category: OFP

camera camPrepareFocus focusRange

Operand types: camera: Object focusRange: Array Compatibility: Version 2.95 required. Type of returned value: Nothing Description: focusRange is in format [distance,blur]. Prepares the camera focus blur. See also camPreload and camCommitPrepared. Example: _camera camPrepareFocus [50, 1] Category: OFP

camera camPrepareFov fieldOfView

Operand types: camera: Object fieldOfView: Number Compatibility: Version 2.95 required. Type of returned value: Nothing

Page 45 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 46: comref

Description: Prepares the camera field of view (zoom). See also camPreload and camCommitPrepared. Example: _camera camPrepareFov 0.1 Category: OFP

camera camPrepareFovRange fovRange

Operand types: camera: Object fovRange: Array Compatibility: Version 2.95 required. Type of returned value: Nothing Description: Prepares the camera field of view range for auto zooming. See also camPreload and camCommitPrepared. Example: _camera camPrepareFovRange [0.1, 0.5] Category: OFP

camera camPreparePos position

Operand types: camera: Object position: Array Compatibility: Version 2.95 required. Type of returned value: Nothing Description: Prepares the camera position (format Position). See also camPreload and camCommitPrepared. Example: _camera camPreparePos getPos player Category: OFP

camera camPrepareRelPos position

Operand types: camera: Object position: Array

Page 46 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 47: comref

Compatibility: Version 2.95 required. Type of returned value: Nothing Description: Prepares the camera position relative to the current position of the currect target (see camPrepareTarget). See also camPreload and camCommitPrepared. Example: _camera camPrepareRelPos [10,5] Category: OFP

camera camPrepareTarget position

Operand types: camera: Object position: Array Compatibility: Version 2.95 required. Type of returned value: Nothing Description: Prepares the camera target to a position (format Position). See also camPreload and camCommitPrepared. Example: _camera camPrepareTarget getPos player Category: OFP

camera camPrepareTarget target

Operand types: camera: Object target: Object Compatibility: Version 2.95 required. Type of returned value: Nothing Description: Prepares the camera target. See also camPreload and camCommitPrepared. Example: _camera camPrepareTarget player Category: OFP

camera camSetBank bank

Page 47 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 48: comref

Operand types: camera: Object bank: Number Type of returned value: Nothing Description: Sets the camera bank angle. It does not automatically commit changes. Example: _camera camSetBank -0.1 Category: OFP

camera camSetDir direction

Operand types: camera: Object direction: Number Type of returned value: Nothing Description: Sets the camera heading. It does not automatically commit changes. Example: _camera camSetDir 150 Category: OFP

camera camSetDive dive

Operand types: camera: Object dive: Number Type of returned value: Nothing Description: Sets the camera dive angle. It does not automatically commit changes. Example: _camera camSetDive -0.1 Category: OFP

camera camSetFocus focusRange

Operand types: camera: Object focusRange: Array

Page 48 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 49: comref

Type of returned value: Nothing Description: focusRange is in format [distance,blur]. Sets the camera focus blur. It does not automatically commit changes. Example: _camera camSetFocus [50, 1] Category: OFP

camera camSetFov fieldOfView

Operand types: camera: Object fieldOfView: Number Type of returned value: Nothing Description: Sets the camera field of view (zoom). It does not automatically commit changes. Example: _camera camSetFov 0.1 Category: OFP

camera camSetFovRange fovRange

Operand types: camera: Object fovRange: Array Type of returned value: Nothing Description: Sets the camera field of view range for auto zooming. It does not automatically commit changes. Example: _camera camSetFovRange [0.1, 0.5] Category: OFP

camera camSetPos position

Operand types: camera: Object position: Array Type of returned value: Nothing

Page 49 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 50: comref

Description: Sets the camera position (format Position). It does not automatically commit changes. Example: _camera camSetPos getPos player Category: OFP

camera camSetRelPos position

Operand types: camera: Object position: Array Type of returned value: Nothing Description: Sets the camera position relative to the current position of the currect target (see camSetTarget). It does not automatically commit changes. Example: _camera camSetRelPos [10,5] Category: OFP

camera camSetTarget target

Operand types: camera: Object target: Object Type of returned value: Nothing Description: Sets the camera target. It does not automatically commit changes. Example: _camera camSetTarget player Category: OFP

camera camSetTarget position

Operand types: camera: Object position: Array Type of returned value: Nothing Description: Sets the camera target to a position (format Position). It does not automatically commit changes.

Page 50 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 51: comref

Example: _camera camSetTarget getPos player Category: OFP

camTarget camera

Operand types: camera: Object Compatibility: Version 5501 required. Type of returned value: Object Description: Returns camera's target. Example: camTarget _camera Category: OFP

camUseNVG set

Operand types: set: Boolean Compatibility: Version 2.73 required. Type of returned value: Nothing Description: Set / clear using of night vision during cutscenes. Category: OFP

canFire vehicle

Operand types: vehicle: Object Type of returned value: Boolean Description: Checks whether the given vehicle is able to fire. It does not check for ammo, only for damage. Example: canFire vehicle player Category: OFP

Page 51 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 52: comref

canMove vehicle

Operand types: vehicle: Object Type of returned value: Boolean Description: Checks whether the given vehicle is able to move. It does not test for fuel, only the damage status is checked. Example: canMove vehicle player Category: OFP

canStand soldier

Operand types: soldier: Object Type of returned value: Boolean Description: Checks whether the given soldier is able to stand up. Example: canStand player Category: OFP

canUnloadInCombat vehicle

Operand types: vehicle: Object Compatibility: Version 5501 required. Type of returned value: Boolean Description: Check if cargo of this vehicle want to get out when in combat. Category: OFP

captive unit

Operand types: unit: Object

Page 52 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 53: comref

Type of returned value: Boolean Description: Checks whether the unit is a captive. If the unit is a vehicle, its commander is checked instead. Example: captive player Category: OFP

captiveNum unit

Operand types: unit: Object Type of returned value: Number Description: Checks whether the unit is a captive. If the unit is a vehicle, its commander is checked instead. Example: captive player Category: OFP

case b

Operand types: b: Any Type of returned value: Switch Type Description: see switch Category: Default

try-Block catch code

Operand types: try-Block: Exception Type code: Code Type of returned value: Any Description: processes code, when exception is thrown in try block Category: Default

Page 53 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 54: comref

ceil x

Operand types: x: Number Type of returned value: Number Description: The ceil value of x. Example: ceil 5.25 , result is 6 Category: Default

cheatsEnabled

Compatibility: Version 1.56 required. Type of returned value: Boolean Description: Checks whether cheats are enabled (whether the designers' version is running). Category: Resistance

civilian

Type of returned value: Side Description: The Civilian side. Category: OFP

clearGroupIcons group

Operand types: group: Group Compatibility: Version 5501 required. Type of returned value: Nothing Description: Removes all icon from group. Example: clearGroupIcons group

Page 54 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 55: comref

Category: OFP

clearMagazineCargo unit

Operand types: unit: Object Type of returned value: Nothing Description: Removes all magazines from the vehicle cargo space. Example: clearMagazineCargo jeepOne Category: OFP

clearMagazinePool

Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Removes all magazines from the weapon pool (this is used in campaigns to transfer weapons to the next mission). Category: Resistance

clearOverlay map

Operand types: map: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Clear the current overlay. Example: clearOverlay _map Category: Editor

clearRadio

Page 55 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 56: comref

Compatibility: Version 2.73 required. Type of returned value: Nothing Description: Clean up the content of radio protocol history. Category: OFP

clearVehicleInit vehicle

Operand types: vehicle: Object Compatibility: Version 5154 required. Type of returned value: Nothing Description: Clear vehicle init field. Example: clearVehicleInit soldier3 Category: OFP

clearWeaponCargo unit

Operand types: unit: Object Type of returned value: Nothing Description: Removes all weapons from the vehicle cargo space. Example: clearWeaponCargo jeepOne Category: OFP

clearWeaponPool

Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Removes all weapons from the weapon pool (this is used in campaigns to transfer weapons to the next mission).

Page 56 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 57: comref

Category: Resistance

closeDialog idc

Operand types: idc: Number Compatibility: Version 1.50 required. Type of returned value: Nothing Description: Closes the topmost user dialog as if a button with id idc was pressed. Example: closeDialog 1 Category: Resistance

display closeDisplay exitcode

Operand types: display: Display exitcode: Number Compatibility: Version 2.53 required. Type of returned value: Nothing Description: Close given display. Example: _display closeDisplay IDC_OK Category: OFP PC

closeOverlay map

Operand types: map: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Closes the current overlay without committing. Category: Editor

Page 57 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 58: comref

collapseObjectTree map

Operand types: map: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Collapse the object tree. Example: collapseObjectTree _map Category: Editor

combatMode grp

Operand types: grp: Object or Group Type of returned value: String Description: Returns the combat mode of the given unit ("BLUE","GREEN","YELLOW" or "RED"). Example: combatMode group player Category: OFP

unit commandChat chatText

Operand types: unit: Object or Array chatText: String Compatibility: Version 5501 required. Type of returned value: Nothing Description: Types text to the command radio channel. Note: this function only types text to the list, it does not broadcast the message. If you want the message to show on all computers, you have to execute it on all of them. Example: soldierOne commandChat "Show this text" Category: OFP

Page 58 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 59: comref

commander vehicle

Operand types: vehicle: Object Type of returned value: Object Description: Returns the commander of the vehicle. If the vehicle is not a vehicle, but a person, the person is returned instead. Example: commander vehicle player Category: OFP

unit commandFire target

Operand types: unit: Object or Array target: Object Type of returned value: Nothing Description: Orders a unit to commence firing on the given target (via the radio). If the target is objNull, the unit is ordered to commence firing on its current target (set using doTarget or commandTarget). Example: soldierOne commandFire player Category: OFP

unit commandFollow formationLeader

Operand types: unit: Object or Array formationLeader: Object Type of returned value: Nothing Description: Orders a unit to follow the given unit (via the radio). Example: soldierOne commandFollow player Category: OFP

Page 59 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 60: comref

unit(s) commandFSM [fsm name, position, target]

Operand types: unit(s): Object or Array [fsm name, position, target]: Array Compatibility: Version 2.53 required. Type of returned value: Nothing Description: Orders a unit to process command defined by FSM file (via the radio). Example: soldierOne commandFSM ["move.fsm", position player, player] Category: OFP PC

commandGetOut unit

Operand types: unit: Object or Array Compatibility: Version 2.28 required. Type of returned value: Nothing Description: Orders the unit to get out from the vehicle (via the radio). Example: commandGetOut unitOne Category: OFP

commandingMenu

Compatibility: Version 5501 required. Type of returned value: String Description: Return the name of the topmost commanding menu. Category: OFP

unit commandMove position

Operand types: unit: Object or Array

Page 60 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 61: comref

position: Array Type of returned value: Nothing Description: Orders the unit to move to the given position (format Position) (via the radio). Example: soldierOne commandMove getMarkerPos "MarkerMoveOne" Category: OFP

unit commandRadio radioName

Operand types: unit: Object or Array radioName: String Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sends the message to the command radio channel. The message is defined in the description.ext file or radio protocol. Example: soldierOne commandRadio "messageOne" Category: OFP

commandStop unit

Operand types: unit: Object or Array Type of returned value: Nothing Description: Orders the unit to stop (via the radio). Note: the stop command is never finished; the unit will never be ready. Example: commandStop unitOne Category: OFP

unit commandTarget position

Operand types: unit: Object or Array

Page 61 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 62: comref

position: Object Type of returned value: Nothing Description: Orders the unit to target the given target (via the radio). Example: soldierOne commandTarget player Category: OFP

unit commandWatch position

Operand types: unit: Object or Array position: Array Type of returned value: Nothing Description: Orders the unit to watch the given position (format Position) (via the radio). Example: soldierOne commandWatch getMarkerPos "MarkerMoveOne" Category: OFP

unit commandWatch target

Operand types: unit: Object or Array target: Object Type of returned value: Nothing Description: Orders the unit to watch the given target (via the radio). Example: soldierOne commandWatch player Category: OFP

comment comment

Operand types: comment: String Compatibility: Version 1.85 required. Type of returned value:

Page 62 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 63: comref

Nothing Description: This function does nothing. It's used to create comments. Example: comment "This is a comment." Category: Default

commitOverlay map

Operand types: map: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Commit the current overlay. Example: commitOverlay _map Category: Editor

compile expression

Operand types: expression: String Compatibility: Version 2.60 required. Type of returned value: Code Description: Compile expression. Example: _function = "a = a + 1"; _compiled = compile _function; call _compiled; Category: Default

completedFSM FSM handle

Operand types: FSM handle: Number Compatibility: Version 5500 required. Type of returned value:

Page 63 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 64: comref

Boolean Description: Check whether the given FSM completes. The FSM handle is the number returned by the execFSM command. Category: OFP

composeText [text1, text2, ...]

Operand types: [text1, text2, ...]: Array Compatibility: Version 2.01 required. Type of returned value: Structured text Description: Creates a structured text by joining the given structured or plain texts. Example: txt = composeText ["First line", image "data\isniper.paa", lineBreak, "Second line"] Category: OFP

configFile

Compatibility: Version 2.35 required. Type of returned value: Config Description: Return root of config entries hierarchy. Category: OFP PC

configName config

Operand types: config: Config Compatibility: Version 2.35 required. Type of returned value: String Description: Returns name of config entry. Example: _name = configName (configFile >> "CfgVehicles") , result is "CfgVehicles"

Page 64 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 65: comref

Category: OFP PC

controlNull

Compatibility: Version 2.92 required. Type of returned value: Control Description: A non-existing control. This value is not equal to anything, including itself. Category: OFP PC

copyFromClipboard

Compatibility: Version 5500 required. Type of returned value: String Description: Return the content of the (text) clipboard. Category: OFP

copyToClipboard text

Operand types: text: String Compatibility: Version 5500 required. Type of returned value: Nothing Description: Copy the text to the clipboard. Category: OFP

groupTo copyWaypoints groupFrom

Operand types: groupTo: Group groupFrom: Group Compatibility: Version 5500 required. Type of returned value: Nothing

Page 65 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 66: comref

Description: Copy the chain of waypoints from source to target group. The target group will start to process waypoints from the first one. Category: OFP

cos x

Operand types: x: Number Type of returned value: Number Description: The cosine of x, the argument is in degrees. Example: cos 60 , result is 0.5 Category: Default

count config

Operand types: config: Config Compatibility: Version 2.35 required. Type of returned value: Number Description: Returns count of subentries. Example: _count = count (configFile >> "CfgVehicles") Category: OFP PC

count array

Operand types: array: Array Type of returned value: Number Description: The number of elements in the array. Example: count [0,0,1,2] , result is 4

Page 66 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 67: comref

Category: Default

condition count array

Operand types: condition: Code array: Array Type of returned value: Number Description: Counts the elements in the array for which the given condition is true. It is calculated as follows: 1) Set the count to 0. 2) For each element in the array assign an element as _x and evaluate the condition expression. If it's true, increase the count. Example: "_x > 2" count [0, 1, 1, 2, 3, 3] , result is 2 Category: Default

unit countEnemy array

Operand types: unit: Object array: Array Type of returned value: Number Description: Counts how many units in the array are considered enemy by the given unit. Example: player countEnemy list triggerOne Category: OFP

unit countFriendly array

Operand types: unit: Object array: Array Type of returned value: Number Description: Counts how many units in the array are considered friendly by the given unit. Example: player countFriendly list triggerOne Category: OFP

Page 67 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 68: comref

side countSide array

Operand types: side: Side array: Array Type of returned value: Number Description: Checks how many vehicles belong to the given side. Example: west countSide list triggerOne Category: OFP

typeName countType array

Operand types: typeName: String array: Array Type of returned value: Number Description: Counts how many vehicles in the array are of the given type. For types see CfgVehicles. Example: "Tank" countType list triggerOne Category: OFP

unit countUnknown array

Operand types: unit: Object array: Array Type of returned value: Number Description: Counts how many units in the array are considered unknown to the given unit. Example: player countUnknown list triggerOne Category: OFP

createAgent [type, position, markers, placement, special]

Page 68 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 69: comref

Operand types: [type, position, markers, placement, special]: Array Compatibility: Version 2.89 required. Type of returned value: Object Description: Creates an (independent) agent (person) of the given type (type is a name of a subclass of CfgVehicles). If the markers array contains several marker names, the position of a random one is used. Otherwise, the given position is used. The unit is placed inside a circle with this position as its center and placement as its radius. Special properties can be: "NONE" and "FORM". Example: agent = createAgent ["SoldierWB", position player, [], 0, "FORM"] Category: OFP

createCenter side

Operand types: side: Side Compatibility: Version 1.86 required. Type of returned value: Side Description: Creates a new AI center for the given side. Example: center = createCenter East Category: OFP

createDialog name

Operand types: name: String Compatibility: Version 1.50 required. Type of returned value: Boolean Description: Creates a user dialog from the resource template name. If a user dialog already exists, it creates a child dialog of the topmost user dialog. The class name is searched in the description.ext file of the mission, the description.ext file of the campaign and the globlal resource.cpp file. The function returns its success. Example: _ok = createDialog "RscDisplayGame" Category: Resistance

Page 69 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 70: comref

createDiaryLink [subject, object, text]

Operand types: [subject, object, text]: Array Compatibility: Version 5500 required. Type of returned value: String Description: Create a link to the section of diary given by subject. Record is selected based on given object (diary record, task or unit). Example: _link = createDiarySubject ["Group", player, "Player"] Category: Identity

person createDiaryRecord [subject, text(, task(, state))] or [subject, [title, text](, task(, state))]

Operand types: person: Object [subject, text(, task(, state))] or [subject, [title, text](, task(, state))]: Array Compatibility: Version 2.53 required. Type of returned value: Diary record Description: Create a new record in a log. Example: _record = player createDiaryRecord ["diary", "Kill all enemies."] Category: Identity

person createDiarySubject [subject, display name] or [subject, display name, picture]

Operand types: person: Object [subject, display name] or [subject, display name, picture]: Array Compatibility: Version 2.92 required. Type of returned value: Number Description: Create a new subject page in a log. Example:

Page 70 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 71: comref

_index = player createDiarySubject ["myPage", "My page"] Category: Identity

parent createDisplay name

Operand types: parent: Display name: String Compatibility: Version 2.53 required. Type of returned value: Nothing Description: Create child display of given display and load from resource "name". Example: _display createDisplay "RscObserver" Category: OFP PC

CreateGearDialog [unit,resource]

Operand types: [unit,resource]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Opens gear dialog for given unit. Example: CreateGearDialog [palyer,"RscDisplayGear"] Category: OFP

createGroup side

Operand types: side: Side Compatibility: Version 1.86 required. Type of returned value: Group Description: Creates a new AI group for the given center (side).

Page 71 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 72: comref

Example: group = createGroup East Category: OFP

createGuardedPoint [side, position, idStatic, vehicle]

Operand types: [side, position, idStatic, vehicle]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Adds a point guarded by the given side. If idStatic is not negative, the position of a static object with the given id is guarded. If the given vehicle is valid, the starting position of the vehicle is guarded, otherwise the given position is guarded. Example: point = createGuardedPoint [East, [0, 0], -1, vehicle player] Category: OFP

createLocation [type, position, sizeX, sizeZ]

Operand types: [type, position, sizeX, sizeZ]: Array Compatibility: Version 2.90 required. Type of returned value: Location Description: Create location of given type with given size at given position. Category: Location

createMarker [name, position]

Operand types: [name, position]: Array Compatibility: Version 1.86 required. Type of returned value: String Description: Creates a new marker on the given position. The marker name has to be unique. The marker is created on all computers in a network session.

Page 72 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 73: comref

Example: marker = createMarker [Marker1, position player] Category: OFP

createMarkerLocal [name, position]

Operand types: [name, position]: Array Compatibility: Version 2.92 required. Type of returned value: String Description: Creates a new marker on the given position. The marker name has to be unique. The marker is only created on the computer where the command is called. Example: marker = createMarkerLocal [Marker1, position player] Category: OFP

map createMenu index

Operand types: map: Control index: Number Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Creates a previously added menu. Category: Editor

createMine [type, position, markers, placement]

Operand types: [type, position, markers, placement]: Array Compatibility: Version 2.32 required. Type of returned value: Object Description: Creates a mine of the given type (type is the name of the subclass of CfgVehicles). If the markers array contains several marker names, the position of a random one is used. Otherwise, the given position is used. The mine is placed inside a circle with this position as its center and placement as its

Page 73 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 74: comref

radius. Example: mine = createMine ["MineMine", position player, [], 0] Category: OFP

parent createMissionDisplay root

Operand types: parent: Display root: String Compatibility: Version 5140 required. Type of returned value: Display Description: Create single missions display as a child of given display. The mission dialog will be set to the directory given as an argument "root". Example: _display createMissionDisplay "Tutorial" Category: OFP PC

person createSimpleTask [name] or [name, parentTask]

Operand types: person: Object [name] or [name, parentTask]: Array Compatibility: Version 5500 required. Type of returned value: Task Description: Create a new simple task (subtask of parentTask). Category: Identity

createSoundSource [type, position, markers, placement]

Operand types: [type, position, markers, placement]: Array Compatibility: Version 2.32 required. Type of returned value: Object Description:

Page 74 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 75: comref

Creates a sound source of the given type (type is the name of the subclass of CfgVehicles). If the markers array contains several marker names, the position of a random one is used. Otherwise, the given position is used. The sound source is placed inside a circle with this position as its center and placement as its radius. Example: soundSource = createSoundSource ["LittleDog", position player, [], 0] Category: OFP

teamMember createTask [[type] or [type, parentTask], priority, name1, value1, name2, value2, ...]

Operand types: teamMember: [[type] or [type, parentTask], priority, name1, value1, name2, value2, ...]: Array Compatibility: Version 2.62 required. Type of returned value: Task Description: Create a new AI task (subtask of parentTask). Type is name of registered task type. Category: Identity

createTrigger [type, position]

Operand types: [type, position]: Array Compatibility: Version 1.86 required. Type of returned value: Object Description: Creates a new trigger on the given position. An object of the given type is created; this type must be a class name in CfgNonAIVehicles or CfgVehicles with simulation=detector. Example: trigger = createTrigger["EmptyDetector", position player] Category: OFP

group createUnit [type, position, markers, placement, special]

Operand types: group: Group [type, position, markers, placement, special]: Array Compatibility:

Page 75 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 76: comref

Version 2.32 required. Type of returned value: Object Description: Creates a unit (person) of the given type (type is a name of a subclass of CfgVehicles) and makes it a member of the given group. If the markers array contains several marker names, the position of a random one is used. Otherwise, the given position is used. The unit is placed inside a circle with this position as its center and placement as its radius. Special properties can be: "NONE" and "FORM". Example: unit = group player createUnit ["SoldierWB", position player, [], 0, "FORM"] Category: OFP

type createUnit unitInfo

Operand types: type: String unitInfo: Array Compatibility: Version 1.34 required. Type of returned value: Nothing Description: Creates a unit of the given type. The format of unitInfo is: [pos (Position), group (Group), init (String), skill (Number), rank (String)]. Note: init, skill and rank are optional. Their default values are "", 0.5, "PRIVATE". Example: "SoldierWB" createUnit [getMarkerPos "barracks", groupAlpha] Category: OFP

createVehicle [type, position, markers, placement, special]

Operand types: [type, position, markers, placement, special]: Array Compatibility: Version 2.32 required. Type of returned value: Object Description: Creates a vehicle of the given type (type is the name of the subclass in CfgVehicles). If the markers array contains several marker names, the position of a random one is used. Otherwise, the given position is used. The vehicle is placed inside a circle with this position as center and placement as its radius. Special properties can be: "NONE", "FLY" and "FORM". Example: veh = createVehicle ["Cobra", position player, [], 0, "FLY"] Category: OFP

Page 76 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 77: comref

type createVehicle pos

Operand types: type: String pos: Array Compatibility: Version 1.34 required. Type of returned value: Object Description: Creates an empty vehicle of the given type. Pos is in format Position. See CfgVehicles for possible type values. Example: _tank = "M1Abrams" createVehicle getmarkerpos "tankFactory" Category: OFP

type createVehicleLocal pos

Operand types: type: String pos: Array Compatibility: Version 2.56 required. Type of returned value: Object Description: Creates an empty vehicle of the given type. Pos is in format Position. See CfgVehicles for possible type values. Vehicle is not transferred through network in MP games. Example: _tank = "M1Abrams" createVehicleLocal getmarkerpos "tankFactory" Category: OFP

crew vehicle

Operand types: vehicle: Object Type of returned value: Array Description: Returns all units mounted in the given vehicle. If the vehicle is not a vehicle, but person, a list containing only persons is returned. Example: crew vehicle player

Page 77 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 78: comref

Category: OFP

ctrlActivate control

Operand types: control: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Launch actions attached to given (button based) control. Example: ctrlActivate _control Category: OFP PC

control ctrlAddEventHandler [handler name, function]

Operand types: control: Control [handler name, function]: Array Compatibility: Version 5501 required. Type of returned value: Number Description: Add an event handler to the given control. Returns id of the handler or -1 when failed. Example: _id = _control ctrlAddEventHandler ["KeyDown", ""] Category: OFP PC

ctrlAutoScrollDelay control

Operand types: control: Control Compatibility: Version 5501 required. Type of returned value: Number Description: Returns number of seconds until auto-scroll starts. -2 if scrollbar not present. Example: _delay = ctrlAutoScrollDelay _control

Page 78 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 79: comref

Category: OFP PC

ctrlAutoScrollRewind control

Operand types: control: Control Compatibility: Version 5501 required. Type of returned value: Boolean Description: True if auto-scroll should move back to start after it reach end. Example: _rewind = ctrlAutoScrollRewind _control Category: OFP PC

ctrlAutoScrollSpeed control

Operand types: control: Control Compatibility: Version 5501 required. Type of returned value: Number Description: Returns number of seconds to auto-scroll one line. -1 if auto-scroll is disabled. -2 if scrollbar not present. Example: _speed = ctrlAutoScrollSpeed _control Category: OFP PC

control ctrlCommit time

Operand types: control: Control time: Number Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Commit control animation.

Page 79 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 80: comref

Example: _control ctrlCommit 2 Category: OFP PC

ctrlCommitted control

Operand types: control: Control Compatibility: Version 2.50 required. Type of returned value: Boolean Description: Check if the control animation is finished. Example: _done = ctrlCommitted _control Category: OFP PC

ctrlEnable [idc, enable]

Operand types: [idc, enable]: Array Compatibility: Version 1.50 required. Type of returned value: Nothing Description: Enables / disables the control with id idc of the topmost user dialog. Example: ctrlEnable [100, false] Category: Resistance

control ctrlEnable enable

Operand types: control: Control enable: Boolean Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Enable / disable given control.

Page 80 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 81: comref

Example: _control ctrlEnable false Category: OFP PC

ctrlEnabled control

Operand types: control: Control Compatibility: Version 2.50 required. Type of returned value: Boolean Description: Returns whether given control is enabled. Example: _ok = ctrlEnabled _control Category: OFP PC

ctrlEnabled idc

Operand types: idc: Number Compatibility: Version 1.50 required. Type of returned value: Boolean Description: Returns whether the control with id idc of the topmost user dialog is enabled. Example: _enabled = ctrlEnabled 100 Category: Resistance

ctrlFade control

Operand types: control: Control Compatibility: Version 2.50 required. Type of returned value: Number Description: Returns the current fade factor of control.

Page 81 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 82: comref

Example: _scale = ctrlFade _control Category: OFP PC

map ctrlMapAnimAdd frame

Operand types: map: Control frame: Array Compatibility: Version 1.92 required. Type of returned value: Nothing Description: Adds the next frame to the map animation. The format of frame is [time, zoom, position], the format of position is Position2D. Example: _map ctrlMapAnimAdd [1, 0.1, getMarkerPos "anim1"] Category: OFP PC

ctrlMapAnimClear control

Operand types: control: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Clears the map animation. Category: OFP PC

ctrlMapAnimCommit control

Operand types: control: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Plays the map animation.

Page 82 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 83: comref

Category: OFP PC

ctrlMapAnimDone control

Operand types: control: Control Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Checks whether the map animation has finished. Category: OFP PC

control ctrlMapCursor texture names

Operand types: control: Control texture names: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Changes default cursor texture ("Track", "Move","Array", "Scroll") to custom one. To restore default texture, write empty string. If new texture does not exist, default cursor texture is used. Example: <map_control> ctrlMapCursor ["Track","customCursor"] Category: OFP

ctrlMapMouseOver control

Operand types: control: Control Compatibility: Version 5501 required. Type of returned value: Array Description: Returns description of map sign mouse cursor is over. Category: OFP

Page 83 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 84: comref

ctrlMapScale control

Operand types: control: Control Compatibility: Version 2.92 required. Type of returned value: Number Description: Return the current scale of the map control. Category: OFP PC

map ctrlMapScreenToWorld [x, y]

Operand types: map: Control [x, y]: Array Compatibility: Version 5127 required. Type of returned value: Array Description: Convert position in the map from screen coordinates to world coordinates. Category: OFP PC

map ctrlMapWorldToScreen position

Operand types: map: Control position: Array Compatibility: Version 5127 required. Type of returned value: Array Description: Convert position in the map from world coordinates to screen coordinates. Category: OFP PC

ctrlParent control

Operand types: control: Control Compatibility: Version 2.50 required. Type of returned value:

Page 84 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 85: comref

Display Description: Returns container of given control. Example: _display = ctrlParent _control Category: OFP PC

ctrlPosition control

Operand types: control: Control Compatibility: Version 2.50 required. Type of returned value: Array Description: Returns the current position and size of control as [x, y, w, h] array. Example: _pos = ctrlPosition _control Category: OFP PC

control ctrlRemoveAllEventHandlers handler name

Operand types: control: Control handler name: String Compatibility: Version 5501 required. Type of returned value: Nothing Description: Remove all even handlers from the given control. Example: _control ctrlRemoveAllEventHandlers "KeyDown" Category: OFP PC

control ctrlRemoveEventHandler [handler name, id]

Operand types: control: Control [handler name, id]: Array Compatibility:

Page 85 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 86: comref

Version 5501 required.Type of returned value: Nothing Description: Remove a given event handler from the given control. Example: _control ctrlRemoveEventHandler ["KeyDown", 0] Category: OFP PC

ctrlScale control

Operand types: control: Control Compatibility: Version 5501 required. Type of returned value: Number Description: Returns the current scale of control. Example: _scale = ctrlScale _control Category: OFP PC

display ctrlSetActiveColor color

Operand types: display: Control color: Array Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets text color of given control when control is selected. Color is in format Color. Example: _control ctrlSetActiveColor [1, 0, 0, 1] Category: OFP PC

control ctrlSetAutoScrollDelay delay

Operand types: control: Control

Page 86 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 87: comref

delay: Number Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets number of second before auto-scroll starts. Example: _control ctrlSetAutoScrollDelay 5 Category: OFP PC

control ctrlSetAutoScrollRewind delay

Operand types: control: Control delay: Boolean Compatibility: Version 5501 required. Type of returned value: Nothing Description: Defines if scroll should rewind when auto-scroll reach end. Example: _control ctrlSetAutoScrollDelay 5 Category: OFP PC

control ctrlSetAutoScrollSpeed speed

Operand types: control: Control speed: Number Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets number of second required to scroll to next line. If speed smaller than 0, auto-scroll is disabled. Example: _control ctrlSetAutoScrollSpeed 5 Category: OFP PC

display ctrlSetBackgroundColor color

Page 87 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 88: comref

Operand types: display: Control color: Array Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets background color of given control. Color is in format Color. Example: _control ctrlSetBackgroundColor [1, 0, 0, 1] Category: OFP PC

control ctrlSetEventHandler [handler name, function]

Operand types: control: Control [handler name, function]: Array Compatibility: Version 2.54 required. Type of returned value: Nothing Description: Sets given event handler of given control Example: _control ctrlSetEventHandler ["KeyDown", ""] Category: OFP PC

control ctrlSetFade fade

Operand types: control: Control fade: Number Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets wanted transparency for control animation. Example: _control ctrlSetFade 1 Category: OFP PC

Page 88 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 89: comref

ctrlSetFocus control

Operand types: control: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set the input focus on given control. Example: ctrlSetFocus _control Category: OFP PC

control ctrlSetFont name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets the main font of given control. Example: _control ctrlSetFont "TahomaB" Category: OFP PC

control ctrlSetFontH1 name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H1 font of given HTML control. Example: _control ctrlSetFontH1 "TahomaB" Category: OFP PC

Page 89 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 90: comref

control ctrlSetFontH1B name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H1 bold font of given HTML control. Example: _control ctrlSetFontH1B "TahomaB" Category: OFP PC

control ctrlSetFontH2 name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H2 font of given HTML control. Example: _control ctrlSetFontH2 "TahomaB" Category: OFP PC

control ctrlSetFontH2B name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H2 bold font of given HTML control. Example: _control ctrlSetFontH2B "TahomaB" Category: OFP PC

Page 90 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 91: comref

control ctrlSetFontH3 name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H3 font of given HTML control. Example: _control ctrlSetFontH3 "TahomaB" Category: OFP PC

control ctrlSetFontH3B name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H3 bold font of given HTML control. Example: _control ctrlSetFontH3B "TahomaB" Category: OFP PC

control ctrlSetFontH4 name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H4 font of given HTML control. Example: _control ctrlSetFontH4 "TahomaB"

Page 91 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 92: comref

Category: OFP PC

control ctrlSetFontH4B name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H4 bold font of given HTML control. Example: _control ctrlSetFontH4B "TahomaB" Category: OFP PC

control ctrlSetFontH5 name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H5 font of given HTML control. Example: _control ctrlSetFontH5 "TahomaB" Category: OFP PC

control ctrlSetFontH5B name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H5 bold font of given HTML control.

Page 92 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 93: comref

Example: _control ctrlSetFontH5B "TahomaB" Category: OFP PC

control ctrlSetFontH6 name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H5 font of given HTML control. Example: _control ctrlSetFontH6 "TahomaB" Category: OFP PC

control ctrlSetFontH6B name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H6 bold font of given HTML control. Example: _control ctrlSetFontH6B "TahomaB" Category: OFP PC

control ctrlSetFontHeight height

Operand types: control: Control height: Number Compatibility: Version 2.50 required. Type of returned value: Nothing

Page 93 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 94: comref

Description: Sets the main font size of given control. Example: _control ctrlSetFontHeight 0.05 Category: OFP PC

control ctrlSetFontHeightH1 height

Operand types: control: Control height: Number Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H1 font size of given HTML control. Example: _control ctrlSetFontHeightH1 0.05 Category: OFP PC

control ctrlSetFontHeightH2 height

Operand types: control: Control height: Number Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H2 font size of given HTML control. Example: _control ctrlSetFontHeightH2 0.05 Category: OFP PC

control ctrlSetFontHeightH3 height

Operand types: control: Control height: Number Compatibility:

Page 94 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 95: comref

Version 2.50 required. Type of returned value: Nothing Description: Sets H3 font size of given HTML control. Example: _control ctrlSetFontHeightH3 0.05 Category: OFP PC

control ctrlSetFontHeightH4 height

Operand types: control: Control height: Number Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H4 font size of given HTML control. Example: _control ctrlSetFontHeightH4 0.05 Category: OFP PC

control ctrlSetFontHeightH5 height

Operand types: control: Control height: Number Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H5 font size of given HTML control. Example: _control ctrlSetFontHeightH5 0.05 Category: OFP PC

control ctrlSetFontHeightH6 height

Operand types:

Page 95 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 96: comref

control: Control height: Number Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets H6 font size of given HTML control. Example: _control ctrlSetFontHeightH6 0.05 Category: OFP PC

control ctrlSetFontP name

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets P font of given HTML control. Example: _control ctrlSetFontP "TahomaB" Category: OFP PC

control ctrlSetFontP height

Operand types: control: Control height: Number Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets P font size of given HTML control. Example: _control ctrlSetFontHeightP 0.05 Category: OFP PC

control ctrlSetFontPB name

Page 96 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 97: comref

Operand types: control: Control name: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets P bold font of given HTML control. Example: _control ctrlSetFontPB "TahomaB" Category: OFP PC

display ctrlSetForegroundColor color

Operand types: display: Control color: Array Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets background color of given control. Color is in format Color. Example: _control ctrlSetForegroundColor [1, 0, 0, 1] Category: OFP PC

control ctrlSetPosition [x, y, w, h]

Operand types: control: Control [x, y, w, h]: Array Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets wanted position and size for control animation. Width and height are optional. Example: _control ctrlSetPosition [0.5, 0.5] Category: OFP PC

Page 97 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 98: comref

control ctrlSetScale scale

Operand types: control: Control scale: Number Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets wanted scale for control animation. Top left corner remains same. Example: _control ctrlScale 0.5 Category: OFP PC

control ctrlSetStructuredText structured text

Operand types: control: Control structured text: Structured text Compatibility: Version 2.53 required. Type of returned value: Nothing Description: Set the structured text which will be displayed in structured text control. Example: _control ctrlSetStructuredText parseText "First line&lt;img image=data\isniper.paa/&gt;&ltbr/&gt;Second line" Category: OFP PC

ctrlSetText [idc, text]

Operand types: [idc, text]: Array Compatibility: Version 1.50 required. Type of returned value: Nothing Description: Sets the text that will be shown in the control with id idc of the topmost user dialog. This can be used for static texts, buttons, edit lines and active texts. Example: ctrlSetText [100, "Hello, world"] Category: Resistance

Page 98 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 99: comref

control ctrlSetText text

Operand types: control: Control text: String Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets the text that will be shown in given control. Example: _control ctrlSetText "Hello, world." Category: OFP PC

display ctrlSetTextColor color

Operand types: display: Control color: Array Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Sets text color of given control. Color is in format Color. Example: _control ctrlSetTextColor [1, 0, 0, 1] Category: OFP PC

display ctrlSetTooltip text

Operand types: display: Control text: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets tooltip text of given control. Example: _control ctrlSetTooltip "tooltip"

Page 99 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 100: comref

Category: OFP PC

display ctrlSetTooltipColorBox color

Operand types: display: Control color: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets tooltip border color of given control. Color is in format Color. Example: _control ctrlSetTooltipColorBox [1, 0, 0, 1] Category: OFP PC

display ctrlSetTooltipColorShade color

Operand types: display: Control color: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets tooltip background color of given control. Color is in format Color. Example: _control ctrlSetTooltipColorShade [1, 0, 0, 1] Category: OFP PC

display ctrlSetTooltipColorText color

Operand types: display: Control color: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets tooltip text color of given control. Color is in format Color.

Page 100 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 101: comref

Example: _control ctrlSetTooltipColorText [1, 0, 0, 1] Category: OFP PC

ctrlShow [idc, show]

Operand types: [idc, show]: Array Compatibility: Version 1.50 required. Type of returned value: Nothing Description: Shows / hides the control with id idc of the topmost user dialog. Example: ctrlShow [100, true] Category: Resistance

control ctrlShow show

Operand types: control: Control show: Boolean Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Show / hide given control. Example: _control ctrlShow false Category: OFP PC

ctrlShown control

Operand types: control: Control Compatibility: Version 2.50 required. Type of returned value: Boolean Description: Returns whether given control is shown.

Page 101 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 102: comref

Example: _ok = ctrlShown _control Category: OFP PC

ctrlText control

Operand types: control: Control Compatibility: Version 2.50 required. Type of returned value: String Description: Returns the text shown in given control. Example: _text = ctrlText _control Category: OFP PC

ctrlText idc

Operand types: idc: Number Compatibility: Version 1.50 required. Type of returned value: String Description: Returns the text shown in the control with id idc of the topmost user dialog. This can be used for static texts, buttons, edit lines and active texts. Example: _message = ctrlText 100 Category: Resistance

ctrlType control

Operand types: control: Control Compatibility: Version 2.56 required. Type of returned value: Number Description:

Page 102 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 103: comref

Returns value representing type of control. Example: _type = ctrlType _control Category: OFP PC

ctrlVisible idc

Operand types: idc: Number Compatibility: Version 1.50 required. Type of returned value: Boolean Description: Returns whether the control with id idc of the topmost user dialog is visible. Example: _visible = ctrlVisible 100 Category: Resistance

currentCommand vehicle

Operand types: vehicle: Object Compatibility: Version 2.92 required. Type of returned value: String Description: Return the current command type (empty string when no command). Category: OFP

currentMagazine vehicle

Operand types: vehicle: Object Compatibility: Version 5500 required. Type of returned value: String Description: Return the name of the type of the currently using magazine (on the primary turret for vehicles). Category: OFP

Page 103 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 104: comref

currentTask person

Operand types: person: Object Compatibility: Version 5501 required. Type of returned value: Task Description: Return current task of given person. Category: Identity

currentTasks teamMember

Operand types: teamMember: Compatibility: Version 2.91 required. Type of returned value: Array Description: List all uncompleted tasks. Category: Identity

currentWaypoint group

Operand types: group: Group Compatibility: Version 5500 required. Type of returned value: Number Description: Return the index of the current waypoint. Category: OFP

currentWeapon vehicle

Operand types: vehicle: Object Compatibility: Version 5500 required. Type of returned value:

Page 104 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 105: comref

String Description: Return the name of the currently selected weapon (on the primary turret for vehicles). Category: OFP

cursorTarget

Compatibility: Version 5500 required. Type of returned value: Object Description: This is the entity pointed to by a players cursor. Example: alive cursorTarget Category: OFP

layer cutFadeOut duration

Operand types: layer: Number duration: Number Compatibility: Version 5126 required. Type of returned value: Nothing Description: Terminate the effect in the given layer and set duration of the fade out phase to the given time. Example: 0 cutFadeIn 1.0 Category: OFP

cutObj effect

Operand types: effect: Array Type of returned value: Nothing Description: Object background - the argument uses format ["name","type",speed] or ["name","type"]. If speed is not given, it's assumed to be one. The object can be defined in the description.ext file. Example:

Page 105 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 106: comref

cutObj ["TVSet", "plain"] Category: OFP

layer cutObj effect

Operand types: layer: Number effect: Array Compatibility: Version 5126 required. Type of returned value: Nothing Description: Object background - the right argument uses format ["name","type",speed] or ["name","type"]. If speed is not given, it's assumed to be one. The left argument define layer in which the effect is show, 0 is the back most. The object can be defined in the description.ext file. Example: 0 cutObj ["TVSet", "plain"] Category: OFP

cutRsc effect

Operand types: effect: Array Type of returned value: Nothing Description: Resource background - the argument uses format ["name","type",speed] or ["name","type"]. If speed is not given, it's assumed to be one. The resource can be defined in the description.ext file. Example: cutRsc ["binocular", "PLAIN"] Category: OFP

layer cutRsc effect

Operand types: layer: Number effect: Array Compatibility: Version 5126 required. Type of returned value: Nothing Description:

Page 106 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 107: comref

Resource background - the right argument uses format ["name","type",speed] or ["name","type"]. If speed is not given, it's assumed to be one. The left argument define layer in which the effect is show, 0 is the back most. The resource can be defined in the description.ext file. Example: 0 cutRsc ["binocular", "PLAIN"] Category: OFP

cutText effect

Operand types: effect: Array Type of returned value: Nothing Description: Text background - the argument uses format ["text","type",speed] or ["text","type"]. If speed is not given, it's assumed to be one. Type may be one of: "PLAIN", "PLAIN DOWN", "BLACK", "BLACK FADED", "BLACK OUT", "BLACK IN", "WHITE OUT" or "WHITE IN". Example: cutText ["", "BLACK OUT"] Category: OFP

layer cutText effect

Operand types: layer: Number effect: Array Compatibility: Version 5126 required. Type of returned value: Nothing Description: Text background - the right argument uses format ["text","type",speed] or ["text","type"]. If speed is not given, it's assumed to be one. Type may be one of: "PLAIN", "PLAIN DOWN", "BLACK", "BLACK FADED", "BLACK OUT", "BLACK IN", "WHITE OUT" or "WHITE IN". The left argument define layer in which the effect is show, 0 is the back most. Example: 0 cutText ["", "BLACK OUT"] Category: OFP

damage object

Operand types:

Page 107 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 108: comref

object: Object Compatibility: Version 1.50 required. Type of returned value: Number Description: Returns the object damage in a range of 0 to 1. Note: this function is identical to getDammage. Example: damage player Category: OFP

date

Compatibility: Version 2.92 required. Type of returned value: Array Description: Return the actual mission date and time as an array [year, month, day, hour, minute]. Category: OFP

DateToNumber date

Operand types: date: Array Compatibility: Version 5501 required. Type of returned value: Number Description: Convert date to float number. Example: time = DateToNumber [year,month,day,hour,minute] Category: OFP

dayTime

Type of returned value: Number Description: Returns the time in the world, in hours. Category: OFP

Page 108 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 109: comref

debugLog anything

Operand types: anything: Any Type of returned value: Nothing Description: Dumps the argument's type and value to the debugging output. Example: debugLog player Category: OFP

default a

Operand types: a: Code Type of returned value: Nothing Description: see switch Category: Default

deg x

Operand types: x: Number Type of returned value: Number Description: Converts x from radians to degrees. Example: deg 1 , result is 57.295 Category: Default

deleteCenter side

Operand types: side: Side Compatibility: Version 1.86 required. Type of returned value:

Page 109 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 110: comref

Nothing Description: Destroys the AI center of the given side. Example: deleteCenter East Category: OFP

deleteCollection object

Operand types: object: Object Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Delete a collection. Category: OFP

map deleteEditorObject object

Operand types: map: Control object: String Compatibility: Version 2.92 required. Type of returned value: Any Description: Delete the editor object. Requires all editor object links to be removed prior. Category: Editor

deleteGroup group

Operand types: group: Group Type of returned value: Nothing Description: Destroys the given AI group. Example: deleteGroup group

Page 110 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 111: comref

Category: OFP

deleteIdentity identityName

Operand types: identityName: String Compatibility: Version 1.75 required. Type of returned value: Boolean Description: Deletes an identity created by saveIdentity from the campaign progress file. Example: deleteIdentity "playerIdentity" Category: Resistance

deleteLocation location

Operand types: location: Location Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Delete the given location. Category: Location

deleteMarker name

Operand types: name: String Type of returned value: Nothing Description: Destroys the given marker. The marker is destroyed on all computers in a network session. Example: deleteMarker "Marker1" Category: OFP

deleteMarkerLocal name

Page 111 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 112: comref

Operand types: name: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Destroys the given marker. The marker is only destroyed on the computer where the command is called. Example: deleteMarkerLocal "Marker1" Category: OFP

deleteStatus statusName

Operand types: statusName: String Compatibility: Version 1.75 required. Type of returned value: Boolean Description: Deletes a status created by saveStatus from the campaign progress file. Example: deleteStatus "playerState" Category: Resistance

deleteVehicle object

Operand types: object: Object Compatibility: Version 1.34 required. Type of returned value: Nothing Description: Deletes any unit or vehicle. Only vehicles inserted in the editor or created during a mission can be deleted. The player unit cannot be deleted. Example: deleteVehicle tank Category: OFP

deleteWaypoint waypoint

Page 112 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 113: comref

Operand types: waypoint: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Removes the waypoint. Example: deleteWaypoint [grp, 2] Category: OFP

detach obj

Operand types: obj: Object Compatibility: Version 5501 required. Type of returned value: Nothing Description: Detaches an object. Example: detach player Category: OFP

diag_fps

Compatibility: Version 5500 required. Type of returned value: Number Description: Returns average framerate over last 16 frames. Category: OFP

diag_fpsmin

Compatibility: Version 5500 required. Type of returned value: Number Description:

Page 113 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 114: comref

Returns minimal framerate. Calculated from the longest frame over last 16 frames. Category: OFP

diag_frameno

Compatibility: Version 5500 required. Type of returned value: Number Description: Returns number of frame currently displayed . Category: OFP

diag_log anything

Operand types: anything: Any Compatibility: Version 5501 required. Type of returned value: Nothing Description: Dumps the argument's type and value to the report file. Example: diag_log player Category: OFP

diag_tickTime

Compatibility: Version 5501 required. Type of returned value: Number Description: Real time spent from the start of the game. Category: OFP

dialog

Compatibility: Version 1.78 required.

Page 114 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 115: comref

Type of returned value: Boolean Description: Returns whether a user dialog is present. Category: Resistance

person diarySubjectExists name

Operand types: person: Object name: String Compatibility: Version 5501 required. Type of returned value: Boolean Description: Checks whether given subject is present in the diary of given person. Category: Identity

difficultyEnabled flag

Operand types: flag: String Compatibility: Version 5127 required. Type of returned value: Boolean Description: Check if given difficulty setting is currently enabled. For possible values of flag, see config class Flags in CfgDificulties. Category: OFP

direction object

Operand types: object: Object Compatibility: Version 1.50 required. Type of returned value: Number Description: Returns the object heading in the range of 0 to 360. Example: direction player

Page 115 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 116: comref

Category: OFP

direction location

Operand types: location: Location Compatibility: Version 2.90 required. Type of returned value: Number Description: Return direction (angle) of given location. Category: Location

unit directSay radioName

Operand types: unit: Object radioName: String Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sends the message to the direct channel. The message is defined in the description.ext file or radio protocol. Example: soldierOne directSay "messageOne" Category: OFP

unit disableAI section

Operand types: unit: Object section: String Type of returned value: Nothing Description: Disables parts of the AI behaviour to get more control over a unit. Section is one of "TARGET" (disables watching assigned targets), "AUTOTARGET" (disables independed target assigning and watching of unknown targets) or "MOVE" (disables movement). Example: soldierOne disableAI "Move"

Page 116 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 117: comref

Category: OFP

unit disableConversation lock

Operand types: unit: Object lock: Boolean Type of returned value: Nothing Description: Lock / unlock the unit to using conversation. Implemented by the counter, so lock - unlock need to be matched. Example: player disableConversation true Category: OFP

disableSerialization

Compatibility: Version 5501 required. Type of returned value: Nothing Description: Disable saving of script containing this command. After this, script can work with the data types which do not support serialization (UI types). Category: Default

disableUserInput disable

Operand types: disable: Boolean Type of returned value: Nothing Description: Disables all user input. This is normally used only in cutscenes to disable the player's controls. Category: OFP

display displayAddEventHandler [handler name, function]

Operand types: display: Display

Page 117 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 118: comref

[handler name, function]: Array Compatibility: Version 5501 required. Type of returned value: Number Description: Add an event handler to the given display. Returns id of the handler or -1 when failed. Example: _id = _display displayAddEventHandler ["KeyDown", ""] Category: OFP PC

display displayCtrl idc

Operand types: display: Display idc: Number Compatibility: Version 2.50 required. Type of returned value: Control Description: Return child control with specified idc. Example: _control = _display displayCtrl 101 Category: OFP PC

displayNull

Compatibility: Version 2.92 required. Type of returned value: Display Description: A non-existing display. This value is not equal to anything, including itself. Category: OFP PC

display displayRemoveAllEventHandlers handler name

Operand types: display: Display handler name: String Compatibility: Version 5501 required.

Page 118 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 119: comref

Type of returned value: Nothing Description: Remove all even handlers from the given display. Example: _display displayRemoveAllEventHandlers "KeyDown" Category: OFP PC

display displayRemoveEventHandler [handler name, id]

Operand types: display: Display [handler name, id]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Remove a given event handler from the given display. Example: _display displayRemoveEventHandler ["KeyDown", 0] Category: OFP PC

display displaySetEventHandler [handler name, function]

Operand types: display: Display [handler name, function]: Array Compatibility: Version 2.54 required. Type of returned value: Nothing Description: Sets given event handler of given display. Example: _control displaySetEventHandler ["KeyDown", ""] Category: OFP PC

dissolveTeam team

Operand types: team: String

Page 119 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 120: comref

Compatibility: Version 2.05 required. Type of returned value: Nothing Description: Dissolves the given team. All members become members of the main team. Possible team values are: "RED", "GREEN", "BLUE" or "YELLOW". Example: dissolveTeam "RED" Category: OFP

obj1 or pos1 distance obj2 or pos2

Operand types: obj1 or pos1: Object or Array obj2 or pos2: Object or Array Type of returned value: Number Description: Computes the distance between two objects or positions. Example: player distance leader player Category: OFP

location1 or pos1 distance location2 or pos2

Operand types: location1 or pos1: location2 or pos2: Compatibility: Version 5501 required. Type of returned value: Number Description: Computes the distance between two locations or positions. Category: Location

distributionRegion

Compatibility: Version 5129 required. Type of returned value: Number

Page 120 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 121: comref

Description: Return the region where the game was sold (based on distribution id). Category: OFP

with do code

Operand types: with: With Type code: Code Compatibility: Version 5501 required. Type of returned value: Nothing Description: Execute the code inside the given namespace. Example: with missionNamespace do {global=global+1} Category: Default

forCommand do code

Operand types: forCommand: for type code: Code Type of returned value: Any Description: End of for command, starts cycle Example: for "_x" from 20 to 10 step -2 do {..code..} Category: Default

while do code

Operand types: while: While Type code: Code Compatibility: Version 1.85 required. Type of returned value: Nothing Description: Repeats the code while the condition is true. Note: the maximum repeat count for the loop is

Page 121 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 122: comref

10000. If the condition is still true after the loop was repeated 10000 times, the loop will be terminated and an error message is shown. Example: while "a>b" do {a=a+1} Category: Default

switch do block

Operand types: switch: Switch Type block: Code Type of returned value: Any Description: Switch form Example: switch (_a) do { case 1: {block}; case 2 : {block}; default {block};} Category: Default

unit doFire target

Operand types: unit: Object or Array target: Object Type of returned value: Nothing Description: Orders a unit to commence firing on the given target (silently). If the target is objNull, the unit is ordered to commence firing on its current target (set using doTarget or commandTarget). Example: soldierOne doFire objNull Category: OFP

unit doFollow position

Operand types: unit: Object or Array position: Object Type of returned value: Nothing Description: Orders a unit to follow the given unit (silently).

Page 122 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 123: comref

Example: soldierOne doFollow player Category: OFP

unit(s) doFSM [fsm name, position, target]

Operand types: unit(s): Object or Array [fsm name, position, target]: Array Compatibility: Version 2.53 required. Type of returned value: Nothing Description: Orders a unit to process command defined by FSM file (silently). Example: soldierOne doFSM ["move.fsm", position player, player] Category: OFP PC

doGetOut unit

Operand types: unit: Object or Array Compatibility: Version 2.28 required. Type of returned value: Nothing Description: Orders a unit to get out from the vehicle (silently). Example: doGetOut unitOne Category: OFP

unit doMove position

Operand types: unit: Object or Array position: Array Type of returned value: Nothing Description: Orders the unit to move to the given position (format Position) (silently).

Page 123 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 124: comref

Example: soldierOne doMove getMarkerPos "MarkerMoveOne" Category: OFP

doStop unit

Operand types: unit: Object or Array Type of returned value: Nothing Description: Orders the unit to stop (silently). Note: the stop command is never finished; the unit will never be ready. Example: doStop unitOne Category: OFP

unit doTarget position

Operand types: unit: Object or Array position: Object Type of returned value: Nothing Description: Orders the unit to target the given target (silently). Example: soldierOne doTarget player Category: OFP

unit doWatch position

Operand types: unit: Object or Array position: Array Type of returned value: Nothing Description: Orders the unit to watch the given position (format Position) (silently). Example: soldierOne doWatch getMarkerPos "MarkerMoveOne"

Page 124 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 125: comref

Category: OFP

unit doWatch target

Operand types: unit: Object or Array target: Object Type of returned value: Nothing Description: Orders the unit to watch the given target (silently). Example: soldierOne doWatch player Category: OFP

map drawArrow [position1, position2, color]

Operand types: map: Control [position1, position2, color]: Array Compatibility: Version 2.35 required. Type of returned value: Nothing Description: Draw arrow in map. Category: OFP PC

map drawEllipse [center, a, b, angle, color, fill]

Operand types: map: Control [center, a, b, angle, color, fill]: Array Compatibility: Version 2.35 required. Type of returned value: Nothing Description: Draw ellipse in map. Category: OFP PC

Page 125 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 126: comref

map drawIcon [texture, color, position, width, height, angle, text, shadow]

Operand types: map: Control [texture, color, position, width, height, angle, text, shadow]: Array Compatibility: Version 2.35 required. Type of returned value: Nothing Description: Draw icon in map. Category: OFP PC

map drawLine [position1, position2, color]

Operand types: map: Control [position1, position2, color]: Array Compatibility: Version 2.35 required. Type of returned value: Nothing Description: Draw line in map. Category: OFP PC

map drawLink [from, to, param type, line type, color]

Operand types: map: Control [from, to, param type, line type, color]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: The editor will draw a line between the two specified editor objects. Line type can be LINE or ARROW. Category: Editor

map drawLocation location

Operand types: map: Control location: Location

Page 126 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 127: comref

Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Draw location in the map. Category: Location PC

map drawRectangle [center, a, b, angle, color, fill]

Operand types: map: Control [center, a, b, angle, color, fill]: Array Compatibility: Version 2.35 required. Type of returned value: Nothing Description: Draw rectangle in map. Category: OFP PC

driver vehicle

Operand types: vehicle: Object Type of returned value: Object Description: Returns the driver of the vehicle. If the vehicle is not a vehicle, but a person, the person is returned instead. Example: driver vehicle player Category: OFP

drop array

Operand types: array: Array Compatibility: Version 1.50 required. Type of returned value: Nothing Description: Drops a particle into the scene. Array is in format ParticleArray.

Page 127 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 128: comref

Category: Resistance

east

Type of returned value: Side Description: The East side. Category: OFP

echo text

Operand types: text: String Compatibility: Version 2.00 required. Type of returned value: Nothing Description: Sends any text into the debugger console or the logfile. Example: echo "Text in logfile" Category: Default

map editObject object

Operand types: map: Control object: String Compatibility: Version 2.92 required. Type of returned value: Any Description: Show the edit object dialog for the given object. Category: Editor

map editorSetEventHandler [handler name, function]

Operand types: map: Control

Page 128 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 129: comref

[handler name, function]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets given event handler of given editor. Example: _map editorSetEventHandler ["SelectObject", ""] Category: Editor

effectiveCommander vehicle

Operand types: vehicle: Object Compatibility: Version 2.92 required. Type of returned value: Object Description: Returns the effective commander (who really commands) of the vehicle. Category: OFP

ifCode else elseCode

Operand types: ifCode: Code elseCode: Code Compatibility: Version 1.85 required. Type of returned value: Array Description: Constructs an array that can be processed by then. Example: if (a>b) then {c=0} else {c=1} Category: Default

vehicle emptyPositions position

Operand types: vehicle: Object position: String

Page 129 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 130: comref

Compatibility: Version 2.92 required. Type of returned value: Number Description: Returns the number of available cargo, driver, gunner or commander positions in the vehicle. Example: _freePositions = (vehicle player) freePositions "cargo" Category: OFP

unit enableAI section

Operand types: unit: Object section: String Compatibility: Version 2.53 required. Type of returned value: Nothing Description: Enables parts of the AI behaviour. Section is one of "TARGET" (enables watching assigned targets), "AUTOTARGET" (enables independed target assigning and watching of unknown targets) or "MOVE" (enables movement). Example: soldierOne enableAI "Move" Category: OFP

group enableAttack enable

Operand types: group: Object or Group enable: Boolean Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set if leader can issue attack commands. Category: OFP

enableEndDialog

Type of returned value:

Page 130 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 131: comref

Nothing Description: Enables the dialog buttons to be shown during the OnPlayerKilled script. Category: OFP

enableEnvironment enabled

Operand types: enabled: Boolean Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Enable/disable environmental effects (ambient life + sound). Example: enableEnvironment false Category: OFP

enableRadio enable

Operand types: enable: Boolean Type of returned value: Nothing Description: Enables radio transmissions to be heard and seen on screen. Category: OFP

object enableReload enable

Operand types: object: Object enable: Boolean Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Enable / disable reload right after magazine is empty. Example: _vehicle enableReload false

Page 131 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 132: comref

Category: OFP

enableSaving enable or [enable, save]

Operand types: enable or [enable, save]: Compatibility: Version 5501 required. Type of returned value: Nothing Description: Enable / disable saving of the game. When disabled, the autosave is created (if not forbidden by save == false). Category: OFP

enableSentences enable

Operand types: enable: Boolean Type of returned value: Nothing Description: Enables radio transmissions to be heard and seen on screen. It does not affect KBTell conversations. Category: OFP

entity enableSimulation enable

Operand types: entity: Object enable: Boolean Type of returned value: Nothing Description: Enable / disable simulation for given entity. Category: OFP

enableTeamSwitch enable

Operand types: enable: Boolean Compatibility: Version 2.92 required.

Page 132 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 133: comref

Type of returned value: Nothing Description: Enable / disable team switch. Category: OFP

endLoadingScreen

Compatibility: Version 5501 required. Type of returned value: Nothing Description: Finish loading screen displaying (started by startLoadingScreen). Category: OFP

endMission end type

Operand types: end type: String Compatibility: Version 5501 required. Type of returned value: Nothing Description: Finish the mission. The end type can be "CONTINUE", "KILLED", "LOSER", "END1", "END2", "END3", "END4", "END5", or "END6". Category: OFP

vehicle engineOn on

Operand types: vehicle: Object on: Boolean Compatibility: Version 1.90 required. Type of returned value: Nothing Description: Switches the vehicle's engine on (true) or off (false). Example: vehicle player engineOn false Category: OFP

Page 133 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 134: comref

estimatedEndServerTime

Compatibility: Version 5501 required. Type of returned value: Number Description: Estimated end of MP game converted to serverTime. Category: OFP

estimatedTimeLeft timeLeft

Operand types: timeLeft: Number Compatibility: Version 1.34 required. Type of returned value: Nothing Description: Returns the estimated time left in the game. Using this function the designer can provide a "time left" estimate that is shown in the "Game in progress" screen or in the master browser. For missions with a hard set limit adjusted via Param1, the following example can be used in the init.sqs file. Example: estimatedTimeLeft Param1 Category: OFP

map evalObjectArgument [object, argument]

Operand types: map: Control [object, argument]: Array Compatibility: Version 2.35 required. Type of returned value: Any Description: Return object argument in mission editor. Category: Editor

argument exec script

Operand types:

Page 134 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 135: comref

argument: Any script: String Type of returned value: Nothing Description: Executes a script. Argument is passed to the script as local variable _this. The script is first searched in the mission folder, then in the campaign scripts subfolder and finally in the global scripts folder. Example: [player, jeepOne] exec "getIn.sqs" Category: OFP

map execEditorScript [object, script]

Operand types: map: Control [object, script]: Array Compatibility: Version 2.92 required. Type of returned value: Any Description: Execute an editor script for the specified object. Example: _map execEditorScript ["_team_1", "create"] Category: Editor

execFSM filename

Operand types: filename: String Compatibility: Version 5500 required. Type of returned value: Number Description: Execute the scripted FSM. The FSM file is first searched in the mission folder, then in the campaign scripts folder and finally in the global scripts folder. Return the FSM handler or 0 when failed. Example: execFSM "test.fsm" Category: OFP

Page 135 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 136: comref

argument execFSM filename

Operand types: argument: Any filename: String Compatibility: Version 5500 required. Type of returned value: Number Description: Execute the scripted FSM. Argument is passed to the FSM as local variable _this. The FSM file is first searched in the mission folder, then in the campaign scripts folder and finally in the global scripts folder. Return the FSM handler or 0 when failed. Example: player execFSM "test.fsm" Category: OFP

execVM filename

Operand types: filename: String Compatibility: Version 2.58 required. Type of returned value: Script Description: Compile and execute function (sqf). The function is first searched in the mission folder, then in the campaign scripts folder and finally in the global scripts folder. Example: execVM "test.sqf" Category: OFP PC

argument execVM filename

Operand types: argument: Any filename: String Compatibility: Version 2.60 required. Type of returned value: Script Description: Compile and execute function (sqf). Argument is passed to the script as local variable _this. The function is first searched in the mission folder, then in the campaign scripts folder and finally in the global scripts folder. Example:

Page 136 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 137: comref

player execVM "test.sqf" Category: OFP PC

exit

Type of returned value: Nothing Description: Exits the script. Category: OFP

if exitWith code

Operand types: if: If Type code: Code Compatibility: Version 2 required. Type of returned value: Any Description: if result of condition is true, evaluates code, and current block with result of code Example: if (_x>5) exitWith {echo "_x is too big";_x} , result is [when _x is greater then 5, outputs message and terminates code in current level with value of _x Category: Default

exp x

Operand types: x: Number Type of returned value: Number Description: The exponential value of x. Example: exp 1 , result is 2.7182 Category: Default

expectedDestination person

Page 137 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 138: comref

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: Array Description: Return expected destination of unit as a [position, planningMode, forceReplan]. Category: OFP

faction unit

Operand types: unit: Object Compatibility: Version 5501 required. Type of returned value: String Description: Gets unit faction. If faction is not defined, returns empty string. Category: OFP

time fadeMusic volume

Operand types: time: Number volume: Number Type of returned value: Nothing Description: Causes a smooth change in the music volume. The change duration is given by time, the target volume by volume. The default music volume is 0.5. Example: 5 fadeMusic 0 Category: OFP

time fadeRadio volume

Operand types: time: Number volume: Number Type of returned value: Nothing Description:

Page 138 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 139: comref

Causes a smooth change in the radio volume. The change duration is given by time, the target volume by volume. The default radio volume is 1.0. Example: 5 fadeRadio 0.1 Category: OFP

time fadeSound volume

Operand types: time: Number volume: Number Type of returned value: Nothing Description: Causes a smooth change in the master volume. The change duration is given by time, the target volume by volume. The default master volume is 1.0. Example: 5 fadeSound 0.1 Category: OFP

failMission end type

Operand types: end type: String Compatibility: Version 5501 required. Type of returned value: Nothing Description: Finish the mission. The end type can be "CONTINUE", "KILLED", "LOSER", "END1", "END2", "END3", "END4", "END5", or "END6". Mission saves will not be deleted. Category: OFP

false

Type of returned value: Boolean Description: Always false. Category: Default

Page 139 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 140: comref

fillWeaponsFromPool person

Operand types: person: Object Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Adds magazines from the campaign pool to the person (depending on the weapons the person has). Example: fillWeaponsFromPool victor Category: Resistance

array find x

Operand types: array: Array x: Any Compatibility: Version 2.92 required. Type of returned value: Number Description: Returns the position of the first array element that matches x, returns -1 if not found. Example: [0, 1, 2] find 1 , result is 1 Category: Default

object findCover [position, hidePosition, maxDist, minDist, visibilityPosition, ignoreObject]

Operand types: object: Object [position, hidePosition, maxDist, minDist, visibilityPosition, ignoreObject]: Array Compatibility: Version 2.92 required. Type of returned value: Object Description: Returns the object where the object should search for cover. The minDist, visibilityPosition and ignoreObject parameters are optional. visibilityPosition is used to select cover that can see a certain position. ignoreObject is an object that is ignored in visibility check. Category: OFP

Page 140 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 141: comref

findDisplay idd

Operand types: idd: Number Compatibility: Version 2.54 required. Type of returned value: Display Description: Find display by its IDD. Example: _display = findDisplay 1 Category: OFP PC

map findEditorObject value

Operand types: map: Control value: Any Compatibility: Version 2.92 required. Type of returned value: String Description: Return object that matches the provided reference. Category: Editor

map findEditorObject [type, name1, value1, ...]

Operand types: map: Control [type, name1, value1, ...]: Array Compatibility: Version 2.35 required. Type of returned value: String Description: Return object of given type with given arguments. Use [type, game value] to search by object reference of a specific editor object type. Category: Editor

center findEmptyPosition [radius, maxDistance] or [radius, maxDistance, vehicleType]

Page 141 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 142: comref

Operand types: center: Array [radius, maxDistance] or [radius, maxDistance, vehicleType]: Array Compatibility: Version 5501 required. Type of returned value: Array Description: Search for the position nearest (up to maxDistance) to the center, with the free area (vehicle of the given type can be placed anywhere) of the given radius. When not found, empty array is returned. Category: OFP

center findEmptyPositionReady [radius, maxDistance]

Operand types: center: Array [radius, maxDistance]: Array Compatibility: Version 5501 required. Type of returned value: Array Description: Check if findEmptyPosition can be called without waiting for files. Category: OFP

object findNearestEnemy position

Operand types: object: Object position: Object or Array Compatibility: Version 2.92 required. Type of returned value: Object Description: Find the nearest enemy from the specified position. Category: OFP

finishMissionInit

Compatibility: Version 2.33 required. Type of returned value: Nothing Description:

Page 142 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 143: comref

Finish world initialization before mission is launched. Category: OFP

finite x

Operand types: x: Number Type of returned value: Boolean Description: True, if number is finite (not infinite and valid number) Example: finite 10/0 , result is false Category: Default

unit fire weaponName

Operand types: unit: Object weaponName: String Type of returned value: Nothing Description: The unit will fire from the given weapon. Example: soldierOne fire "HandGrenade" Category: OFP

unit fire array

Operand types: unit: Object array: Array Type of returned value: Nothing Description: The unit will fire from the given weapon. The array has format [muzzle, mode, magazine] or [muzzle, mode]. Example: soldierOne fire ["throw","SmokeShell","SmokeShell"] Category: OFP

Page 143 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 144: comref

flag unit

Operand types: unit: Object Type of returned value: Object Description: If the unit has a flag, this flag is returned. If not, objNull is returned. Example: flag player Category: OFP

flagOwner flag

Operand types: flag: Object Type of returned value: Object Description: When used on a flag, the returned value is the person that has this flag. When used on anything else, objNull is returned. Example: flagowner flagOne Category: OFP

fleeing unit

Operand types: unit: Object Type of returned value: Boolean Description: Checks whether the unit is fleeing. A dead or empty unit returns false. Example: fleeing player Category: OFP

floor x

Operand types:

Page 144 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 145: comref

x: Number Type of returned value: Number Description: The floor value of x. Example: floor 5.25 , result is 5 Category: Default

helicopter flyInHeight height

Operand types: helicopter: Object height: Number Type of returned value: Nothing Description: Sets the height level for the helicopter. The accepted range is from 50 to 1000. Example: cobraOne flyInHeight 150 Category: OFP

fog

Compatibility: Version 2.92 required. Type of returned value: Number Description: Return the current fog. Category: OFP

fogForecast

Compatibility: Version 2.92 required. Type of returned value: Number Description: Return the fog forecast. Category: OFP

Page 145 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 146: comref

for var

Operand types: var: String Type of returned value: for type Description: Starts for sequence, use in complette form(see example). Example: for "_x" from 1 to 10 do {debugLog _x;} Category: Default

for forspec

Operand types: forspec: Array Type of returned value: for type Description: creates cycle, using C like style. See example. Example: for [{_x=1},{_x<=10},{_x=_x+1}] do {debugLog _x;} Category: Default

forceEnd

Type of returned value: Nothing Description: Forces the mission to terminate. Category: OFP

forceMap show

Operand types: show: Boolean Compatibility: Version 1.27 required. Type of returned value: Nothing Description: Forces the map to display.

Page 146 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 147: comref

Example: forceMap true Category: OFP

object forceSpeed speed

Operand types: object: Object speed: Number Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Force the speed of the given object. Category: OFP

command forEach array

Operand types: command: Code array: Array Type of returned value: Nothing Description: Executes the given command for each element in array. It's executed as follows: for each element of array an element is assigned as _x and the command is executed. Example: "_x setdammage 1" forEach units group player Category: Default

format format

Operand types: format: Array Type of returned value: String Description: The first argument of the array is in format string. This string may contain references to the following arguments using format %1, %2, etc. Each %x is replaced by the corresponding argument. %x may appear in the string in any order. Example: format ["%1 - %2 - %1", 1, "text"] , result is "1 - text - 1"

Page 147 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 148: comref

Category: OFP

formation grp

Operand types: grp: Object or Group Type of returned value: String Description: Returns the formation of the group ("COLUMN", "STAG COLUMN", "WEDGE", "ECH LEFT", "ECH RIGHT", "VEE" or "LINE"). Example: formation group player Category: OFP

formationDirection person

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: Number Description: Return the direction unit watching in formation. Category: OFP

formationLeader person

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: Object Description: Return leader of the formation. Category: OFP

formationMembers person

Page 148 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 149: comref

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: Array Description: Return list of units (drivers) in the formation. Category: OFP

formationPosition person

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: Array Description: Return position of unit in the formation. Category: OFP

formationTask person

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: String Description: Return the current task of the unit in the formation. Category: OFP

formatText [format, arg1, arg2, ...]

Operand types: [format, arg1, arg2, ...]: Array Compatibility: Version 2.01 required. Type of returned value: Structured text Description: Creates a structured text by replacing %1, %2, etc. in format by plain or structured texts given as arguments.

Page 149 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 150: comref

Example: txt = formatText ["Image: %1", image "data\isniper.paa"] Category: OFP

formLeader unit

Operand types: unit: Object Type of returned value: Object Description: Returns the formation leader for the given unit. For dead units objNull is returned. The result is often the same as groupLeader, but not always. Example: formLeader player != leader player Category: OFP

for "_var" from b

Operand types: for "_var": for type b: Number Type of returned value: for type Description: Continue sequence of 'for' command. Example: for "_x" from 10 to 20 do {..code..} Category: Default

fuel vehicle

Operand types: vehicle: Object Type of returned value: Number Description: Checks how much fuel is left in the gas tank, in the range from 0 to 1. Example: fuel vehicle player

Page 150 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 151: comref

Category: OFP

gearSlotData control

Operand types: control: Control Compatibility: Version 5501 required. Type of returned value: String Description: Returns gear slot item name. Example: weapon = gearSlotData _control Category: OFP PC

getArray config

Operand types: config: Config Compatibility: Version 2.35 required. Type of returned value: Array Description: Extract array from config entry. Example: _array = getArray (configFile >> "CfgVehicles" >> "Thing" >> "threat") Category: OFP PC

getDammage obj

Operand types: obj: Object Type of returned value: Number Description: Returns the object damage in the range from 0 to 1. Example: getDammage player Category: OFP

Page 151 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 152: comref

getDir obj

Operand types: obj: Object Type of returned value: Number Description: Returns the object heading in the range from 0 to 360. Example: getDir player Category: OFP

getEditorCamera map

Operand types: map: Control Compatibility: Version 2.92 required. Type of returned value: Object Description: Fetches a reference to the mission editor camera. Category: Editor

getEditorMode map

Operand types: map: Control Compatibility: Version 2.92 required. Type of returned value: String Description: Returns the current mode of the editor. Category: Editor

map getEditorObjectScope object

Operand types: map: Control object: String Compatibility: Version 2.92 required. Type of returned value:

Page 152 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 153: comref

String Description: Returns the editor object scope of the specified editor object. Category: Editor

side1 getFriend side2

Operand types: side1: Side side2: Side Compatibility: Version 5501 required. Type of returned value: Number Description: Returns if sides are friendly or hostile. For a value smaller than 0.6 it results in being enemy, otherwise it's friendly. Example: value = west getFriend east Category: OFP

FSM handle getFSMVariable name

Operand types: FSM handle: Number name: String Compatibility: Version 5501 required. Type of returned value: Any Description: Return the value of variable in the variable space of given FSM. The FSM handle is the number returned by the execFSM command. Category: OFP

group getGroupIcon ID

Operand types: group: Group ID: Number Compatibility: Version 5501 required. Type of returned value: Array

Page 153 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 154: comref

Description: Get group icon properties. Example: group getGroupIcon id Category: OFP

getGroupIconParams group

Operand types: group: Group Compatibility: Version 5501 required. Type of returned value: Array Description: Returns group icons params. [color, text,scale, visible] Example: getGroupIconParams group Category: OFP

getGroupIcons group

Operand types: group: Group Compatibility: Version 5501 required. Type of returned value: Array Description: Returns all group icons.[[id,icon,[offsetx,offsety],[..],..] Example: getGroupIcons group Category: OFP

object getHideFrom enemy

Operand types: object: Object enemy: Object Compatibility: Version 2.92 required. Type of returned value:

Page 154 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 155: comref

Array Description: Returns the hiding position in format Position. If enemy is null it is the some position in front of the object or enemy position otherwise. Category: OFP

getMarkerColor marker

Operand types: marker: String Compatibility: Version 1.21 required. Type of returned value: String Description: Gets the marker color. See setMarkerColor. Example: getMarkerColor "MarkerOne" Category: OFP

getMarkerPos markerName

Operand types: markerName: String Type of returned value: Array Description: Returns the marker positon in format [x,z,y]. Example: getMarkerPos "markerOne" Category: OFP

getMarkerSize marker

Operand types: marker: String Compatibility: Version 1.21 required. Type of returned value: Array Description: Gets the marker size. See setMarkerSize.

Page 155 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 156: comref

Example: getMarkerSize "MarkerOne" Category: OFP

getMarkerType marker

Operand types: marker: String Compatibility: Version 1.21 required. Type of returned value: String Description: Gets the type of the marker. See setMarkerType. Example: getMarkerType "MarkerOne" Category: OFP

getNumber config

Operand types: config: Config Compatibility: Version 2.35 required. Type of returned value: Number Description: Extract number from config entry. Example: _array = getNumber (configFile >> "CfgVehicles" >> "Thing" >> "maxSpeed") Category: OFP PC

map getObjectArgument [object, argument]

Operand types: map: Control [object, argument]: Array Compatibility: Version 2.35 required. Type of returned value: String Description: Return name of object argument in mission editor.

Page 156 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 157: comref

Category: Editor

map getObjectChildren object

Operand types: map: Control object: String Compatibility: Version 2.92 required. Type of returned value: Array Description: Return a list of all the children of the specified object. Category: Editor

map getObjectProxy object

Operand types: map: Control object: String Compatibility: Version 2.92 required. Type of returned value: Object Description: Return the proxy object associated with the given editor object. Category: Editor

getPos obj

Operand types: obj: Object Type of returned value: Array Description: Returns the object position in format Position. Example: getPos player Category: OFP

getPos location

Page 157 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 158: comref

Operand types: location: Location Compatibility: Version 5501 required. Type of returned value: Array Description: Return (raw) position of given location. Category: Location

getPosASL obj

Operand types: obj: Object Compatibility: Version 2.53 required. Type of returned value: Array Description: Returns the object position in format PositionASL. Example: getPosASL player Category: OFP

object getSpeed speedMode

Operand types: object: Object speedMode: String Compatibility: Version 2.92 required. Type of returned value: Number Description: Get the speed for the given speed mode. SpeedMode can be: "AUTO","SLOW","NORMAL","FAST". Category: OFP

getText config

Operand types: config: Config Compatibility: Version 2.35 required.

Page 158 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 159: comref

Type of returned value: String Description: Extract text from config entry. Example: _array = getText (configFile >> "CfgVehicles" >> "Thing" >> "icon") Category: OFP PC

namespace getVariable name

Operand types: namespace: Namespace name: String Compatibility: Version 5501 required. Type of returned value: Any Description: Return the value of variable in the given namespace. Category: Default

group getVariable name

Operand types: group: Group name: String Compatibility: Version 5501 required. Type of returned value: Any Description: Return the value of variable in the variable space of given group. Category: OFP

location getVariable name

Operand types: location: Location name: String Compatibility: Version 2.92 required. Type of returned value: Any Description:

Page 159 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 160: comref

Return the value of variable in the variable space of given location. Category: Location

object getVariable name

Operand types: object: Object name: String Compatibility: Version 2.92 required. Type of returned value: Any Description: Return the value of variable in the variable space of given object. Category: OFP

map getVariable name

Operand types: map: Control name: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Get variable from the variable space of given map. Category: Editor

task getVariable name

Operand types: task: Task name: String Compatibility: Version 2.92 required. Type of returned value: Any Description: Return the value of variable in the variable space of given task. Category: Identity

Page 160 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 161: comref

getWPPos waypoint

Operand types: waypoint: Array Compatibility: Version 1.21 required. Type of returned value: Array Description: Gets the waypoint position. The format of waypoint is Waypoint. Example: getWPPos [groupOne, 1] Category: OFP

unit(s) glanceAt position

Operand types: unit(s): Object or Array position: Object or Array Compatibility: Version 2.40 required. Type of returned value: Nothing Description: Control what the unit is glancing at (target or position) (format Position) Example: someSoldier glanceAt otherSoldier; otherSoldier glanceAt getMarkerPos "markerOne" Category: OFP

unit globalChat chatText

Operand types: unit: Object chatText: String Type of returned value: Nothing Description: Types text to the global radio channel. Note: this function only types text to the list, it does not broadcast the message. If you want the message to show on all computers, you have to execute it on all of them. Example: soldierOne globalChat "Show this text" Category: OFP

Page 161 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 162: comref

unit globalRadio radioName

Operand types: unit: Object radioName: String Type of returned value: Nothing Description: Sends the message to the global radio channel. The message is defined in the description.ext file or radio protocol. Example: soldierOne globalRadio "messageOne" Category: OFP

goto label

Operand types: label: String Type of returned value: Nothing Description: Only in scripts: go to given label. Note: the string argument is used here. Be sure to use double quotes around the label name in goto. Example: goto "Loop" Category: OFP

group obj

Operand types: obj: Object Type of returned value: Group Description: Returns the group to which the given unit is assigned. For dead units, grpNull is returned. Example: group player == group leader player Category: OFP

unit groupChat chatText

Operand types:

Page 162 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 163: comref

unit: Object chatText: String Type of returned value: Nothing Description: Types text to the group radio channel. Note: this function only types text to the list, it does not broadcast the message. If you want the message to show on all computers, you have to execute it on all of them. Example: soldierOne groupChat "Show this text" Category: OFP

groupIconSelectable

Compatibility: Version 5501 required. Type of returned value: Boolean Description: Return if groups icon raises onClick and onOver events. Category: OFP

groupIconsVisible

Compatibility: Version 5501 required. Type of returned value: Array Description: Return group icons are visible. Category: OFP

unit groupRadio radioName

Operand types: unit: Object radioName: String Type of returned value: Nothing Description: Sends the message to the group radio channel. The message is defined in the description.ext file or radio protocol. Example:

Page 163 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 164: comref

soldierOne groupRadio "messageOne" Category: OFP

groupSelectedUnits unit

Operand types: unit: Object Compatibility: Version 5501 required. Type of returned value: Array Description: Returns selected groups in sgroup. Example: array = groupSelectedUnits unit Category: OFP

unit groupSelectUnit [unit,bool]

Operand types: unit: Object [unit,bool]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Select unit from unit's group. Example: player groupSelectUnit [unit,true] Category: OFP

grpNull

Type of returned value: Group Description: A non-existing group. This value is not equal to anything, including itself. Example: group player == objNull , result is false Category: OFP

Page 164 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 165: comref

gunner vehicle

Operand types: vehicle: Object Type of returned value: Object Description: Returns the gunner of the vehicle. If the vehicle is not a vehicle, but a person, the person is returned. Example: gunner vehicle player Category: OFP

halt

Compatibility: Version 2.00 required. Type of returned value: Nothing Description: Stops the program into a debugger. Example: halt Category: Default

handsHit soldier

Operand types: soldier: Object Type of returned value: Number Description: Checks whether the soldier's hands are hit (causing inaccurate aiming). Example: handsHit leader player Category: OFP

unit hasWeapon weaponName

Operand types:

Page 165 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 166: comref

unit: Object weaponName: String Type of returned value: Boolean Description: Checks whether the unit has the given weapon. Example: player hasWeapon "M16" Category: OFP

hcAllGroups unit

Operand types: unit: Object Compatibility: Version 5501 required. Type of returned value: Array Description: Returns selected groups in high command. Example: array = hcAllGroups unit Category: OFP

unit hcGroupParams group

Operand types: unit: Object group: Group Compatibility: Version 5501 required. Type of returned value: Array Description: Returns parameters describing group in high command bar. Return value is [string,float[4]] Example: unit hcGroupParams group Category: OFP

hcLeader group

Operand types:

Page 166 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 167: comref

group: Group Compatibility: Version 5501 required. Type of returned value: Object Description: Returns group's HC commander. Example: hcLeader group Category: OFP

hcRemoveAllGroups unit

Operand types: unit: Object Compatibility: Version 5501 required. Type of returned value: Nothing Description: Remove all groups from unit's high command bar. Example: hcRemoveAllGroups unit Category: OFP

unit hcRemoveGroup group

Operand types: unit: Object group: Group Compatibility: Version 5501 required. Type of returned value: Nothing Description: Removes group from unit's high command bar. Example: unit HCRemoveGroup group Category: OFP

hcSelected unit

Page 167 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 168: comref

Operand types: unit: Object Compatibility: Version 5501 required. Type of returned value: Array Description: Returns selected groups in high command. Example: array = hcSelected unit Category: OFP

unit hcSelectGroup array

Operand types: unit: Object array: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Select given group in HC bar. Example: unit hcSelectGroup [group,true] Category: OFP

unit hcSetGroup array

Operand types: unit: Object array: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Add group to unit's high command bar. Array parameters are group, group name and team (teammain, teamred, teamgreen, teamblue, teamyellow) . Group is the only necessary parameter. Example: unit hcSetGroup [group,"HQ","teamred"] or player hcSetGroup [group] Category: OFP

Page 168 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 169: comref

hcShowBar bool

Operand types: bool: Boolean Compatibility: Version 5501 required. Type of returned value: Nothing Description: Shows or hides HC bar. There must be some groups under hc command to show hc bar. Example: hcShowBar true Category: OFP

hcShownBar

Compatibility: Version 5501 required. Type of returned value: Boolean Description: Return a list of all groups. Category: OFP

hideBody person

Operand types: person: Object Compatibility: Version 2.10 required. Type of returned value: Nothing Description: Hides the body of the given person. Example: hideBody player Category: OFP

hint text

Operand types: text: Text or String Type of returned value:

Page 169 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 170: comref

Nothing Description: Shows a text hint. The text can contain several lines. \n is used to indicate the end of a line. Example: hint "Press W to move forward" Category: OFP

hintC text

Operand types: text: String Type of returned value: Nothing Description: Shows a text hint. The text can contain several lines. \n is used to indicate the end of a line. This hint has to be confirmed. Example: hintC "Press W to move forward" Category: OFP

title hintC text

Operand types: title: String text: Structured text Compatibility: Version 2.01 required. Type of returned value: Nothing Description: Creates a hint dialog with the given title and text. Category: OFP

title hintC text

Operand types: title: String text: String Compatibility: Version 2.01 required. Type of returned value: Nothing Description:

Page 170 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 171: comref

Creates a hint dialog with the given title and text. Category: OFP

title hintC [text1, text2, ...]

Operand types: title: String [text1, text2, ...]: Array Compatibility: Version 2.01 required. Type of returned value: Nothing Description: Creates a hint dialog with the given title and text. Texts can be plain or structured. Category: OFP

hintCadet text

Operand types: text: Text or String Type of returned value: Nothing Description: Shows a text hint only when using cadet mode. The text can contain several lines. \n is used to indicate the end of a line. Example: hintCadet "Press W to move forward" Category: OFP

hintSilent text

Operand types: text: Text or String Compatibility: Version 5501 required. Type of returned value: Nothing Description: Same as hint, but without a sound. Category: OFP

Page 171 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 172: comref

control htmlLoad filename

Operand types: control: Control filename: String Compatibility: Version 2.53 required. Type of returned value: Nothing Description: Load HTML from file to given control. Example: _control htmlLoad "briefing.html" Category: OFP PC

if condition

Operand types: condition: Boolean Compatibility: Version 1.85 required. Type of returned value: If Type Description: The first part of the if command. Example: if (a>b) then {a=b} Category: Default

image filename

Operand types: filename: String Compatibility: Version 2.01 required. Type of returned value: Structured text Description: Creates a structured text containing the given image. Example: txt1 = image "data\isniper.paa" Category: OFP

Page 172 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 173: comref

importAllGroups map

Operand types: map: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Imports all groups into the RTE. Category: Editor

importance location

Operand types: location: Location Compatibility: Version 2.90 required. Type of returned value: Number Description: Return importance of given location. Category: Location

x in array

Operand types: x: Any array: Array Type of returned value: Boolean Description: Checks whether x is equal to any element in the array. Example: 1 in [0, 1, 2] , result is true Category: Default

position in location

Operand types: position: Array location: Location Compatibility: Version 2.92 required.

Page 173 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 174: comref

Type of returned value: Boolean Description: Check if the position is inside area defined by the location. Category: Location

soldier in vehicle

Operand types: soldier: Object vehicle: Object Type of returned value: Boolean Description: Checks whether the soldier is mounted in the vehicle. Example: player in jeepOne Category: OFP

fireplace inflame burn

Operand types: fireplace: Object burn: Boolean Type of returned value: Nothing Description: Controls fireplace buring. Set to true to inflame the fireplace. Example: fireplaceOne inflame true Category: OFP

inflamed fireplace

Operand types: fireplace: Object Compatibility: Version 1.04 required. Type of returned value: Boolean Description: Check if fireplace is inflamed (buring).

Page 174 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 175: comref

Example: inflamed fireplaceOne Category: OFP

inGameUISetEventHandler [handler name, function]

Operand types: [handler name, function]: Array Compatibility: Version 2.91 required. Type of returned value: Nothing Description: Sets given event handler of in-game UI. Category: OFP

inheritsFrom config

Operand types: config: Config Compatibility: Version 2.92 required. Type of returned value: Config Description: Returns base entry of config entry. Example: _base = inheritsFrom (configFile >> "CfgVehicles" >> "Car") Category: OFP PC

initAmbientLife

Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Initialize the ambient life. Category: OFP

inputAction name

Page 175 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 176: comref

Operand types: name: String Compatibility: Version 5500 required. Type of returned value: Number Description: Return the state of input devices mapped to given input action (see CfgDefaultKeysMapping for action names). Category: OFP

map insertEditorObject [type, value, [name1, value1, ...], subtype class]

Operand types: map: Control [type, value, [name1, value1, ...], subtype class]: Array Compatibility: Version 2.92 required. Type of returned value: String Description: Insert an object to the editor and assign arguments. Create script is not called. Returns the ID of the new EditorObject. Subtype class is optional. Category: Editor

[object, lod name] intersect [begin, end]

Operand types: [object, lod name]: Array [begin, end]: Array Compatibility: Version 2.53 required. Type of returned value: Array Description: Find named selection in object which is in specified lod intersected by given section of a line. Example: [tank, "VIEW" intersect [[1500, 1500, 2], [1550, 1500, 2]] Category: OFP

isArray config

Operand types: config: Config

Page 176 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 177: comref

Compatibility: Version 2.35 required. Type of returned value: Boolean Description: Check if config entry represents array. Example: _ok = isArray (configFile >> "CfgVehicles") , result is false Category: OFP PC

isClass config

Operand types: config: Config Compatibility: Version 2.35 required. Type of returned value: Boolean Description: Check if config entry represents config class. Example: _ok = isClass (configFile >> "CfgVehicles") , result is true Category: OFP PC

isDedicated

Compatibility: Version 5501 required. Type of returned value: Boolean Description: Return true for dedicated server. Category: OFP

isEngineOn vehicle

Operand types: vehicle: Object Compatibility: Version 1.90 required. Type of returned value: Boolean Description:

Page 177 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 178: comref

Checks whether the engine is on. Example: on = isEngineOn vehicle player Category: OFP

position isFlatEmpty [float minDistance,float precizePos,float maxGradient,float gradientRadius,float onWater,bool onShore,object skipobj]

Operand types: position: Array [float minDistance,float precizePos,float maxGradient,float gradientRadius,float onWater,bool onShore,object skipobj]: Array Compatibility: Version 5501 required. Type of returned value: Array Description: Chek if given area is flat and emty. Example: newposition = position isFlatEmpty(10, 0, 0.5, 5, 0, false, player) Category: OFP

isFormationLeader person

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Returns true if the specified person is subgroup leader. Category: OFP

isHidden person

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: Boolean Description:

Page 178 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 179: comref

Return whether the person is hidden (reached the hiding position). Category: OFP

isKeyActive keyName

Operand types: keyName: String Compatibility: Version 2.06 required. Type of returned value: Boolean Description: Checks whether the given key is active in the current user profile. Example: ok = isKeyActive "M04" Category: OFP

object isKindOf typeName

Operand types: object: Object typeName: String Compatibility: Version 2.30 required. Type of returned value: Boolean Description: Checks whether the object is of the given type. Example: vehicle player isKindOf "Tank" Category: OFP

typeName1 isKindOf typeName2

Operand types: typeName1: String typeName2: String Compatibility: Version 5160 required. Type of returned value: Boolean Description: Checks whether the type typeName1 is inherited from the type typeName1.

Page 179 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 180: comref

Example: "Tank" isKindOf "Land" , result is true Category: OFP

isMarkedForCollection object

Operand types: object: Object Compatibility: Version 2.13 required. Type of returned value: Boolean Description: Checks whether the object is marked for weapons collection. Example: marked = isMarkedForCollection truck Category: OFP

isMultiplayer

Compatibility: Version 5501 required. Type of returned value: Boolean Description: Return true if multiPlayer. Category: OFP

isNil variable

Operand types: variable: Compatibility: Version 2.00 required. Type of returned value: Boolean Description: Tests whether the variable is null. The function returns true if the variable is null and false if it's not. Example: if (isNil("_pokus")) then {_pokus=0;}

Page 180 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 181: comref

Category: Default

isNull location

Operand types: location: Location Compatibility: Version 5501 required. Type of returned value: Boolean Description: Check whether the value is null. Category: Location

isNull control

Operand types: control: Control Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Checks whether the value is equal to controlNull. Note: a==controlNull does not work, because controlNull is not equal to anything, even to itself. Example: isNull controlNull , result is true Category: OFP PC

isNull grp

Operand types: grp: Group Type of returned value: Boolean Description: Checks whether the value is equal to grpNull. Note: a==GrpNull does not work, because grpNull is not equal to anything, even to itself. Example: isNull group player , result is false Category: OFP

Page 181 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 182: comref

isNull task

Operand types: task: Task Compatibility: Version 5160 required. Type of returned value: Boolean Description: Checks whether the value is equal to taskNull. Note: a==TaskNull does not work, because taskNull is not equal to anything, even to itself. Example: isNull taskNull , result is true Category: Identity

isNull display

Operand types: display: Display Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Checks whether the value is equal to displayNull. Note: a==displayNull does not work, because displayNull is not equal to anything, even to itself. Example: isNull displayNull , result is true Category: OFP PC

isNull obj

Operand types: obj: Object Type of returned value: Boolean Description: Checks whether the value is equal to objNull. Note: a==ObjNull does not work, because objNull is not equal to anything, even to itself. Example: isNull objNull , result is true Category: OFP

Page 182 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 183: comref

isNumber config

Operand types: config: Config Compatibility: Version 2.35 required. Type of returned value: Boolean Description: Check if config entry represents number. Example: _ok = isNumber (configFile >> "CfgVehicles") , result is false Category: OFP PC

isOnRoad position or object

Operand types: position or object: Object or Array Compatibility: Version 5501 required. Type of returned value: Boolean Description: Check whether given position is on road. Category: OFP

isPlayer person

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Check if given person is the player. Category: OFP

isRealTime map

Operand types: map: Control Compatibility: Version 2.92 required.

Page 183 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 184: comref

Type of returned value: Boolean Description: Returns true if the mission editor is operating in real time mode. Example: _isRealTime = isRealTime _map Category: Editor

isServer

Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Returns true if the computer is the server. Category: OFP

isShowing3DIcons map

Operand types: map: Control Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Returns true if the editor is set to draw 3D icons. Category: Editor

isText config

Operand types: config: Config Compatibility: Version 2.35 required. Type of returned value: Boolean Description: Check if config entry represents text. Example: _ok = isText (configFile >> "CfgVehicles") , result is false

Page 184 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 185: comref

Category: OFP PC

items unit

Operand types: unit: Object Compatibility: Version 5501 required. Type of returned value: Array Description: Returns an array of names of all special items of the vehicle. Example: items player Category: OFP

unitArray join group

Operand types: unitArray: Array group: Object or Group Type of returned value: Nothing Description: Joins all units in the array to the given group. Note: the total number of group members cannot exceed 12. Note: This function is unsupported in MP in version 1.33 and before. Example: [unitOne, unitTwo] join player Category: OFP

unit joinAs [group, id]

Operand types: unit: Object [group, id]: Array Type of returned value: Nothing Description: Joins the unit to the given group, if position id is available, this one is used. Example: player joinAs [_group, 4] Category: OFP

Page 185 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 186: comref

unit joinAsSilent [group, id]

Operand types: unit: Object [group, id]: Array Type of returned value: Nothing Description: Joins the unit to the given group, if position id is available, this one is used. Avoid any radio communication related to joining. Example: player joinAsSilent [_group, 4] Category: OFP

unitArray joinSilent group

Operand types: unitArray: Array group: Object or Group Type of returned value: Nothing Description: Joins all units in the array to the given group. Avoid any radio communication related to joining. Example: [unitOne, unitTwo] joinSilent player Category: OFP

person kbAddDatabase filename

Operand types: person: Object filename: String Compatibility: Version 2.42 required. Type of returned value: Boolean Description: Register knowledge base database to given person. Example: _unit kbAddDatabase "chat.txt" Category: OFP PC

Page 186 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 187: comref

person kbAddDatabaseTargets filename

Operand types: person: Object filename: String Compatibility: Version 2.45 required. Type of returned value: Boolean Description: Register target list knowledge base database to given person. Example: _unit kbAddDatabase "chat.txt" Category: OFP PC

person kbAddTopic [name, filename(, task type(, player event handler))]

Operand types: person: Object [name, filename(, task type(, player event handler))]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Register conversation topic to given person. Category: OFP PC

person kbHasTopic name

Operand types: person: Object name: String Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Check if conversation topic was registered to given person. Category: OFP PC

person kbReact [receiver, topic, sentence id, [argument name, argument value, argument text, argument speech], ...]

Page 187 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 188: comref

Operand types: person: Object [receiver, topic, sentence id, [argument name, argument value, argument text, argument speech], ...]: Array Compatibility: Version 5500 required. Type of returned value: Nothing Description: Pass a non-verbal communication to the receiver. Category: OFP PC

person kbRemoveTopic name

Operand types: person: Object name: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Unregister conversation topic from given person. Category: OFP PC

person kbTell [receiver, topic, sentence id, [argument name, argument value, argument text, argument speech], ...]

Operand types: person: Object [receiver, topic, sentence id, [argument name, argument value, argument text, argument speech], ...]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Make the person tell to the receiver the sentence. Category: OFP PC

person kbWasSaid [receiver, topic, sentence id, max. age]

Operand types: person: Object [receiver, topic, sentence id, max. age]: Array

Page 188 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 189: comref

Compatibility: Version 5500 required. Type of returned value: Boolean Description: Check if given item was said by person to someone. Category: OFP PC

keyImage dikCode

Operand types: dikCode: Number Compatibility: Version 2.01 required. Type of returned value: Structured text Description: Returns a structured text, containing an image or name (if no image is found) of the button (on the keyboard, mouse or joystick) with the given code. Example: name = keyImage 28 , result is "Enter" Category: OFP

keyName dikCode

Operand types: dikCode: Number Compatibility: Version 2.01 required. Type of returned value: String Description: Returns the name of a button (on the keyboard, mouse or joystick) with the given code. Example: name = keyName 28 , result is "Enter" Category: OFP

unit knowsAbout target

Operand types: unit: Object or Group target: Object Type of returned value:

Page 189 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 190: comref

Number Description: Checks whether the unit knows about the target (and how much). If the unit is a vehicle, the vehicle commander is considered instead. Example: soldierOne knowsAbout jeepOne Category: OFP

side knowsAbout target

Operand types: side: Side target: Object Compatibility: Version 5501 required. Type of returned value: Number Description: Checks whether the side knows about the target (and how much). Example: east knowsAbout jeepOne Category: OFP

helicopter land mode

Operand types: helicopter: Object mode: String Type of returned value: Nothing Description: Forces a helicopter landing. The landing mode may be "LAND" (a complete stop), "GET IN" (hovering very low for another unit to get in), "GET OUT" (hovering low for another unit to get out) or "NONE" (cancel landing). Example: cobraOne land "LAND" Category: OFP

airplane landAt airportId

Operand types: airplane: Object

Page 190 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 191: comref

airportId: Number Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Order AI airplane to land at given airport Example: plane landAt 0 Category: OFP

landResult helicopter

Operand types: helicopter: Object Compatibility: Version 5501 required. Type of returned value: String Description: Return the result of helicopter landing position searching (performed after land command). The value can be "Found" (position found), "NotFound" (position not found), "NotReady" (position searching is still in progress) or empty string when wrong argument given. Category: OFP

lbAdd [idc, text]

Operand types: [idc, text]: Array Compatibility: Version 1.50 required. Type of returned value: Number Description: Adds an item with the given text to the listbox or combobox with id idc of the topmost user dialog. It returns the index of the newly added item. Example: _index = lbAdd [101, "First item"] Category: Resistance

control lbAdd text

Operand types:

Page 191 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 192: comref

control: Control text: String Compatibility: Version 2.91 required. Type of returned value: Number Description: Adds an item with the given text to the given listbox or combobox. It returns the index of the newly added item. Example: _index = _control lbAdd "First item" Category: OFP PC

lbClear idc

Operand types: idc: Number Compatibility: Version 1.50 required. Type of returned value: Nothing Description: Clears all items in the listbox or combobox with id idc of the topmost user dialog. Example: lbClear 101 Category: Resistance

lbClear control

Operand types: control: Control Compatibility: Version 2.91 required. Type of returned value: Nothing Description: Clears all items in the given listbox or combobox. Example: lbClear _control Category: OFP PC

lbColor [idc, index]

Page 192 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 193: comref

Operand types: [idc, index]: Array Compatibility: Version 1.50 required. Type of returned value: Array Description: Returns the text color of the item with the given index of the listbox or combobox with id idc of the topmost user dialog. The color is returned in format Color. Example: _color = lbColor [101, 0] Category: Resistance

control lbColor index

Operand types: control: Control index: Number Compatibility: Version 2.91 required. Type of returned value: Array Description: Returns the text color of the item with the given index of the given listbox or combobox. Example: _color = _control lbColor 0 Category: OFP PC

lbCurSel idc

Operand types: idc: Number Compatibility: Version 1.50 required. Type of returned value: Number Description: Returns the index of the selected item of the listbox or combobox with id idc of the topmost user dialog. Example: _index = lbCurSel 101 Category: Resistance

Page 193 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 194: comref

lbCurSel control

Operand types: control: Control Compatibility: Version 2.91 required. Type of returned value: Number Description: Returns the index of the selected item of the given listbox or combobox. Example: _index = lbCurSel _control Category: OFP PC

lbData [idc, index]

Operand types: [idc, index]: Array Compatibility: Version 1.50 required. Type of returned value: String Description: Returns the additional text (invisible) in an item with the given index of the listbox or combobox with id idc of the topmost user dialog. Example: _data = lbData [101, 0] Category: Resistance

control lbData index

Operand types: control: Control index: Number Compatibility: Version 2.91 required. Type of returned value: String Description: Returns the additional text (invisible) in an item with the given index of the given listbox or combobox. Example: _data = _control lbData 0 Category: OFP PC

Page 194 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 195: comref

lbDelete [idc, index]

Operand types: [idc, index]: Array Compatibility: Version 1.50 required. Type of returned value: Nothing Description: Removes the item with the given index from the listbox or combobox with id idc of the topmost user dialog. Example: lbDelete [101, 0] Category: Resistance

control lbDelete index

Operand types: control: Control index: Number Compatibility: Version 2.91 required. Type of returned value: Nothing Description: Removes the item with the given index from the given listbox or combobox. Example: _control lbDelete 0 Category: OFP PC

control lbIsSelected index

Operand types: control: Control index: Number Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Check whether given row of the given listbox is selected. Example: _selected = _control lbIsSelected 0

Page 195 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 196: comref

Category: OFP PC

lbPicture [idc, index]

Operand types: [idc, index]: Array Compatibility: Version 1.50 required. Type of returned value: String Description: Returns the picture name of the item with the given index of the listbox or combobox with id idc of the topmost user dialog. Example: _picture = lbPicture [101, 0] Category: Resistance

control lbPicture index

Operand types: control: Control index: Number Compatibility: Version 2.91 required. Type of returned value: String Description: Returns the picture name of the item with the given index of the given listbox or combobox. Example: _picture = _control lbPicture 0 Category: OFP PC

lbSelection control

Operand types: control: Control Compatibility: Version 2.92 required. Type of returned value: Array Description: Returns the array of selected rows indices in the given listbox. Example:

Page 196 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 197: comref

_indices = lbSelection _control Category: OFP PC

lbSetColor [idc, index, color]

Operand types: [idc, index, color]: Array Compatibility: Version 1.50 required. Type of returned value: Nothing Description: Sets the color of the item with the given index of the listbox or combobox with id idc of the topmost user dialog to the given color. Color is in format Color. Example: lbSetColor [101, 0, [0, 1, 0, 0.5]] Category: Resistance

control lbSetColor [index, color]

Operand types: control: Control [index, color]: Array Compatibility: Version 2.91 required. Type of returned value: Nothing Description: Sets the text color of the item with the given index of the given listbox or combobox. Color is in format Color. Example: _control lbSetColor [0, [0, 1, 0, 0.5]] Category: OFP PC

lbSetCurSel [idc, index]

Operand types: [idc, index]: Array Compatibility: Version 1.50 required. Type of returned value: Nothing Description:

Page 197 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 198: comref

Selects the item with the given index of the listbox or combobox with id idc of the topmost user dialog. Example: lbSetCurSel [101, 0] Category: Resistance

control lbSetCurSel index

Operand types: control: Control index: Number Compatibility: Version 2.91 required. Type of returned value: Nothing Description: Selects the item with the given index of the given listbox or combobox. Example: _control lbSetCurSel 0 Category: OFP PC

lbSetData [idc, index, data]

Operand types: [idc, index, data]: Array Compatibility: Version 1.50 required. Type of returned value: Nothing Description: Sets the additional text (invisible) in the item with the given index of the listbox or combobox with id idc of the topmost user dialog to the given data. Example: lbSetData [101, 1, "#1"] Category: Resistance

control lbSetData [index, data]

Operand types: control: Control [index, data]: Array Compatibility:

Page 198 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 199: comref

Version 2.91 required. Type of returned value: Nothing Description: Sets the additional text (invisible) in the item with the given index of the given listbox or combobox to the given data. Example: _control lbSetData [1, "#1"] Category: OFP PC

lbSetPicture [idc, index, name]

Operand types: [idc, index, name]: Array Compatibility: Version 1.50 required. Type of returned value: Nothing Description: Sets the picture in the item with the given index of the listbox or combobox with id idc of the topmost user dialog. Name is the picture name. The picture is searched in the mission directory, the dtaExt subdirectory of the campaign directory and the dtaExt directory and the data bank (or directory). Example: lbSetPicture [101, 0, "iskoda"] Category: Resistance

control lbSetPicture [index, name]

Operand types: control: Control [index, name]: Array Compatibility: Version 2.91 required. Type of returned value: Nothing Description: Sets the picture in the item with the given index of the given listbox or combobox. Name is the picture name. The picture is searched in the mission directory, the dtaExt subdirectory of the campaign directory and the dtaExt directory and the data bank (or directory). Example: _control lbSetPicture [0, "iskoda"] Category: OFP PC

Page 199 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 200: comref

control lbSetSelected [index, selected]

Operand types: control: Control [index, selected]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Set the selection state of the given row of the given listbox. Listbox must support multiple selection Example: _control lbSetSelection [0, true] Category: OFP PC

lbSetValue [idc, index, value]

Operand types: [idc, index, value]: Array Compatibility: Version 1.50 required. Type of returned value: Nothing Description: Sets the additional integer value in the item with the given index of the listbox or combobox with id idc of the topmost user dialog to the given value. Example: lbSetValue [101, 0, 1] Category: Resistance

control lbSetValue [index, value]

Operand types: control: Control [index, value]: Array Compatibility: Version 2.91 required. Type of returned value: Nothing Description: Sets the additional integer value in the item with the given index of the given listbox or combobox to the given value. Example: _control lbSetValue [0, 1]

Page 200 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 201: comref

Category: OFP PC

lbSize control

Operand types: control: Control Compatibility: Version 2.91 required. Type of returned value: Number Description: Returns the number of items in the given listbox or combobox. Example: _n = lbSize _control Category: OFP PC

lbSize idc

Operand types: idc: Number Compatibility: Version 1.50 required. Type of returned value: Number Description: Returns the number of items in the listbox or combobox with id idc of the topmost user dialog. Example: _n = lbSize 101 Category: Resistance

lbSort control

Operand types: control: Control Compatibility: Version 5148 required. Type of returned value: Number Description: Sorts the given listbox or combobox by item text. Example: lbSort _control

Page 201 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 202: comref

Category: OFP PC

lbSortByValue control

Operand types: control: Control Compatibility: Version 5148 required. Type of returned value: Number Description: Sorts the given listbox or combobox by item value. Example: lbSortByValue _control Category: OFP PC

lbText [idc, index]

Operand types: [idc, index]: Array Compatibility: Version 1.50 required. Type of returned value: String Description: Returns the shown text in the item with the given index of the listbox or combobox with id idc of the topmost user dialog. Example: _text = lbText [101, 0] Category: Resistance

control lbText index

Operand types: control: Control index: Number Compatibility: Version 2.91 required. Type of returned value: String Description: Returns the shown text in the item with the given index of the given listbox or combobox. Example:

Page 202 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 203: comref

_text = _control lbText 0 Category: OFP PC

lbValue [idc, index]

Operand types: [idc, index]: Array Compatibility: Version 1.50 required. Type of returned value: Number Description: Returns the additional integer value in the item with the given index of the listbox or combobox with id idc of the topmost user dialog. Example: _value = lbValue [101, 0] Category: Resistance

control lbValue index

Operand types: control: Control index: Number Compatibility: Version 2.91 required. Type of returned value: Number Description: Returns the additional integer value in the item with the given index of the given listbox or combobox. Example: _value = _control lbValue 0 Category: OFP PC

leader unit

Operand types: unit: Object Type of returned value: Object Description: Returns the group leader for the given unit. For dead units, objNull is returned.

Page 203 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 204: comref

Example: leader player Category: OFP

leader grp

Operand types: grp: Group Type of returned value: Object Description: Returns the group leader for the given group. For a dead unit, grpNull is returned. Example: leader group player == leader player Category: OFP

group leaveVehicle vehicle

Operand types: group: Object vehicle: Object Type of returned value: Nothing Description: Ceases the using of the vehicle in the group. It unassigns all grouped units from the vehicle. Example: soldierOne leaveVehicle jeepOne Category: OFP

group leaveVehicle vehicle

Operand types: group: Group vehicle: Object Type of returned value: Nothing Description: Ceases the using of the vehicle in the group. It unassigns all grouped units from the vehicle. Example: groupOne leaveVehicle jeepOne Category: OFP

Page 204 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 205: comref

lifeState unit

Operand types: unit: Object Compatibility: Version 5501 required. Type of returned value: String Description: Returns the life state of the given unit. Category: OFP

light lightAttachObject [object, position]

Operand types: light: Object [object, position]: Array Compatibility: Version 2.58 required. Type of returned value: Nothing Description: Attach light to given object (at given position). Category: OFP

lightDetachObject light

Operand types: light: Object Compatibility: Version 2.58 required. Type of returned value: Nothing Description: Detach light from object. Category: OFP

lightIsOn lamppost

Operand types: lamppost: Object Compatibility: Version 1.04 required.

Page 205 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 206: comref

Type of returned value: String Description: Checks whether the lampost is turned on. Possible values are "ON", "OFF" and "AUTO" (auto means the lamp will be shining during the night automatically). Example: lightIsOn nearestObject [player, "StreetLamp"] != "OFF" Category: OFP

object limitSpeed speed

Operand types: object: Object speed: Number Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Limit speed of given vehicle to given value (in km/h). Category: OFP

lineBreak

Compatibility: Version 2.01 required. Type of returned value: Structured text Description: Creates a structured text containing a line break. Example: txt3 = lineBreak Category: OFP

list trigger

Operand types: trigger: Object Type of returned value: Array Description: Returns a list of units that would activate the given trigger. For a trigger of type "Not present" the list is the same as the list that would be returned for type "Present".

Page 206 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 207: comref

Example: list triggerOne Category: OFP

map listObjects type

Operand types: map: Control type: String Compatibility: Version 2.92 required. Type of returned value: Array Description: Return the list of all objects of given type. Category: Editor

ln x

Operand types: x: Number Type of returned value: Number Description: The natural logarithm of x. Example: ln 10 , result is 2.302 Category: Default

lnbAddArray [IDC,[[[text,text], [value,..], [data,..]], [[text,text], [value,..], [data,..]],]]

Operand types: [IDC,[[[text,text], [value,..], [data,..]], [[text,text], [value,..], [data,..]],]]: Array Compatibility: Version 5501 required. Type of returned value: Number Description: Adds list of rows of strings. Example: _index = lnbAddRow [idc,[[[]],[[]]]] . Returns row index.

Page 207 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 208: comref

Category: Resistance

lnbAddColumn [idc, position]

Operand types: [idc, position]: Array Compatibility: Version 1.50 required. Type of returned value: Number Description: Adds an column at given position. It returns the index of the newly added column. Example: _index = lnbAddColumn [105, 0.8] Category: Resistance

control lnbAddColumn position

Operand types: control: Control position: Number Compatibility: Version 5501 required. Type of returned value: Number Description: Adds an item with the given text to the given listbox or combobox. It returns the index of the newly added item. Example: _index = _control lbAdd "First item" Category: OFP PC

lnbAddRow [idc, [text, text,...]]

Operand types: [idc, [text, text,...]]: Array Compatibility: Version 5501 required. Type of returned value: Number Description: Adds an row of strings. Example:

Page 208 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 209: comref

_index = lnbAddRow [105, ["First column", "second column", ...]]. Returns row index. Category: Resistance

control lnbAddRow [text1,text2,...]

Operand types: control: Control [text1,text2,...]: Array Compatibility: Version 5501 required. Type of returned value: Number Description: Adds an row to the end od 2d listbox . It returns the index of the newly added row. Example: _index = _control lnbAdd [t1,t2,t3,...] Category: OFP PC

lnbClear idc

Operand types: idc: Number Compatibility: Version 5501 required. Type of returned value: Nothing Description: Clears all items in the 2D listbox. Example: lnbClear 101 Category: Resistance

lnbClear control

Operand types: control: Control Compatibility: Version 2.91 required. Type of returned value: Nothing Description: Clears all items in the given listbox or combobox.

Page 209 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 210: comref

Example: lbClear _control Category: OFP PC

lnbColor [idc, [row, column]

Operand types: [idc, [row, column]: Array Compatibility: Version 5501 required. Type of returned value: Array Description: Returns the text color of the item with the given position of the 2D listbox. The color is returned in format Color. Example: _color = lnbColor [101, [0,1]] Category: Resistance

control lnbColor [row, column]

Operand types: control: Control [row, column]: Array Compatibility: Version 5501 required. Type of returned value: Array Description: Returns the text color of the item with the given position of the given 2D listbox. Example: _color = _control lnbColor [row, column] Category: OFP PC

lnbCurSelRow control

Operand types: control: Control Compatibility: Version 2.91 required. Type of returned value: Number Description:

Page 210 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 211: comref

Returns the index of the selected item of the given listbox or combobox. Example: _index = lbCurSel _control Category: OFP PC

lnbCurSelRow idc

Operand types: idc: Number Compatibility: Version 5501 required. Type of returned value: Number Description: Returns the index of the selected row id 2D listbox. Example: _row = lnbCurSel 105 Category: Resistance

lnbData [idc, [row, column]

Operand types: [idc, [row, column]: Array Compatibility: Version 5501 required. Type of returned value: String Description: Returns the additional text (invisible) in an item with the given position of the 2D listbox. Example: _data = lnbData [101, [0,1]] Category: Resistance

control lnbData [row, column]

Operand types: control: Control [row, column]: Array Compatibility: Version 5501 required. Type of returned value: String

Page 211 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 212: comref

Description: Returns the additional text (invisible) in an item with the given position of the given 2D listbox. Example: _data = _control lnbData [row, column] Category: OFP PC

lnbDeleteColumn [idc, index]

Operand types: [idc, index]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Removes column with given index. Example: lnbDeleteColumn [101, 0] Category: Resistance

control lnbDeleteColumn index

Operand types: control: Control index: Number Compatibility: Version 5501 required. Type of returned value: Nothing Description: Removes the item with the given index from the given listbox or combobox. Example: _control lbDelete 0 Category: OFP PC

lnbDeleteRow [idc, index]

Operand types: [idc, index]: Array Compatibility: Version 1.50 required. Type of returned value:

Page 212 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 213: comref

Nothing Description: Removes row with given index from the 2D listbox. Example: lnbDeleteRow [105, 0] Category: Resistance

control lnbDeleteRow row

Operand types: control: Control row: Number Compatibility: Version 5501 required. Type of returned value: Nothing Description: Removes row with the given index from the given listbox or combobox. Example: _control lnbDelete 0 Category: OFP PC

lnbGetColumnsPosition control

Operand types: control: Control Compatibility: Version 2.91 required. Type of returned value: Array Description: Returns the index of the selected item of the given listbox or combobox. Example: _index = lbCurSel _control Category: OFP PC

lnbGetColumnsPosition idc

Operand types: idc: Number Compatibility: Version 5501 required.

Page 213 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 214: comref

Type of returned value: Array Description: Returns the columns position in 2D listbox. Example: _n = lnbGetColumnsSize 105 Category: Resistance

lnbPicture [idc, [row, column]

Operand types: [idc, [row, column]: Array Compatibility: Version 5501 required. Type of returned value: String Description: Returns the picture name of the item with the given position of the 2D listbox. Example: _picture = lnbPicture [101, [0,1]] Category: Resistance

control lnbPicture [row, column]

Operand types: control: Control [row, column]: Array Compatibility: Version 5501 required. Type of returned value: String Description: Returns the picture name of the item with the given position of the given listbox or combobox. Example: _picture = _control lnbPicture [row, column] Category: OFP PC

lnbSetColor [idc, [row, column], color]

Operand types: [idc, [row, column], color]: Array Compatibility:

Page 214 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 215: comref

Version 5501 required.Type of returned value: Nothing Description: Sets the color of the item with the given position of the 2D listbox. Color is in format Color. Example: lnbSetColor [101, [0,1], [0, 1, 0, 0.5]] Category: Resistance

control lnbSetColor [[row, column], color]

Operand types: control: Control [[row, column], color]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets the text color of the item with the given position of the given 2D listbox . Color is in format Color. Example: _control lnbSetColor [[row, column], [0, 1, 0, 0.5]] Category: OFP PC

lnbsetColumnsPos [idc, [row, column], data]

Operand types: [idc, [row, column], data]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets the additional text (invisible) in the item with the given position of the 2D listbox. Example: lnbSetData [101, [0,1], "#1"] Category: Resistance

control lnbSetColumnsPos [pos1,pos2,...]

Operand types:

Page 215 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 216: comref

control: Control [pos1,pos2,...]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Set position of 2d listbox columns. Example: _control lbSetColumnsPos [pos1,pos2,...] Category: OFP PC

lnbSetCurSelRow [idc, index]

Operand types: [idc, index]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Selects the row with the given index of the 2D listbox. Example: lnbSetCurSel [105, 0] Category: Resistance

control lnbSetCurSelRow row

Operand types: control: Control row: Number Compatibility: Version 5501 required. Type of returned value: Nothing Description: Selects the item with the given index of the given listbox or combobox. Example: _control lbSetCurSel row Category: OFP PC

lnbSetData [idc, [row, column], data]

Page 216 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 217: comref

Operand types: [idc, [row, column], data]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets the additional text (invisible) in the item with the given position of the 2D listbox. Example: lnbSetData [101, [0,1], "#1"] Category: Resistance

control lnbSetData [[row, column], data]

Operand types: control: Control [[row, column], data]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets the additional text (invisible) in the item with the given position of the given 2D listbox to the given data. Example: _control lnbSetData [[row, column], "#1"] Category: OFP PC

lnbSetPicture [idc, [row, column], name]

Operand types: [idc, [row, column], name]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets the picture in the item with the given position of the 2D listbox. Name is the picture name. The picture is searched in the mission directory, the dtaExt subdirectory of the campaign directory and the dtaExt directory and the data bank (or directory). Example: lnbSetPicture [101, [0,1], "iskoda"] Category: Resistance

Page 217 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 218: comref

control lnbSetPicture [[row, column], name]

Operand types: control: Control [[row, column], name]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets the picture in the item with the given position of the given 2D listbox. Name is the picture name. The picture is searched in the mission directory, the dtaExt subdirectory of the campaign directory and the dtaExt directory and the data bank (or directory). Example: _control lnbSetPicture [[row, column], "iskoda"] Category: OFP PC

lnbSetText [idc, [row, column], data]

Operand types: [idc, [row, column], data]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets the additional text (invisible) in the item with the given position of the 2D listbox. Example: lnbSetData [101, [0,1], "#1"] Category: Resistance

control lnbSetText [[row, column], text]

Operand types: control: Control [[row, column], text]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets the additional text (invisible) in the item with the given index of the given 2D listbox to the given data. Example: _control lnbSetData [[row, column], "#1"]

Page 218 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 219: comref

Category: OFP PC

lnbSetValue [idc, [row, column], value]

Operand types: [idc, [row, column], value]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets the additional integer value in the item with the position index of the 2D listbox. Example: lnbSetValue [101, [0,1], 1] Category: Resistance

control lnbSetValue [[row, column], value]

Operand types: control: Control [[row, column], value]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets the additional integer value in the item with the given position of the given 2D listbox to the given value. Example: _control lnbSetValue [[row, column], 1] Category: OFP PC

lnbSize idc

Operand types: idc: Number Compatibility: Version 5501 required. Type of returned value: Array Description: Returns [X,Y] size of 2D listbox. Example:

Page 219 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 220: comref

_n = lnbSize 105 Category: Resistance

lnbSize control

Operand types: control: Control Compatibility: Version 2.91 required. Type of returned value: Array Description: Returns the number of items in the given listbox or combobox. Example: _n = lbSize _control Category: OFP PC

lnbText [idc, [row, column]]

Operand types: [idc, [row, column]]: Array Compatibility: Version 1.50 required. Type of returned value: String Description: Returns the shown text in the item with the given position of the 2D listbox. Example: _text = lnbText [101, [0,1]] Category: Resistance

control lnbText [row, column]

Operand types: control: Control [row, column]: Array Compatibility: Version 5501 required. Type of returned value: String Description: Returns the shown text in the item with the given position of the given 2D listbox.

Page 220 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 221: comref

Example: _text = _control lnbText [row, column] Category: OFP PC

lnbValue [idc, [row, column]

Operand types: [idc, [row, column]: Array Compatibility: Version 5501 required. Type of returned value: Number Description: Returns the additional integer value in the item with the given position of the 2D listbox. Example: _value = lnbValue [101, [0,1]] Category: Resistance

control lnbValue [row, column]

Operand types: control: Control [row, column]: Array Compatibility: Version 5501 required. Type of returned value: Number Description: Returns the additional integer value in the item with the given position of the given 2D listbox. Example: _value = _control lnbValue [row, column] Category: OFP PC

loadFile filename

Operand types: filename: String Compatibility: Version 1.82 required. Type of returned value: String Description: Returns the content of the given file.

Page 221 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 222: comref

Example: loadFile "myFunction.sqf" , result is "if a>b then {a} else {b}" Category: OFP

loadGame

Compatibility: Version 5501 required. Type of returned value: Nothing Description: Load a game from the autosave, if failed, restart the mission. Category: OFP

person loadIdentity name

Operand types: person: Object name: String Compatibility: Version 1.75 required. Type of returned value: Boolean Description: Loads person's identity from objects.sav file in campaign directory (from entry name). Example: player loadIdentity "playerIdentity" Category: Resistance

map loadOverlay config

Operand types: map: Control config: Config Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Creates the load overlay dialog for the specified type of overlay. Category: Editor

Page 222 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 223: comref

object loadStatus name

Operand types: object: Object name: String Compatibility: Version 1.75 required. Type of returned value: Boolean Description: Loads object's properties from objects.sav file in campaign directory (from entry name). Example: player loadStatus "playerState" Category: Resistance

local obj

Operand types: obj: Object Type of returned value: Boolean Description: MP: checks whether the given unit is local on the computer. This can be used when one or more activation fields or scripts need to be performed only on one computer. In SP all objects are local. Note: all static objects are local on all computers. Example: local unitName Category: OFP

localize stringName

Operand types: stringName: String Type of returned value: String Description: Replaces the string with the given name with the corresponding localized text from the stringtable.csv file. Example: localize "STR_DN_FROG" Category: OFP

Page 223 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 224: comref

locationNull

Compatibility: Version 5501 required. Type of returned value: Location Description: A non-existing location. This value is not equal to anything, including itself. Category: Location

locationPosition location

Operand types: location: Location Compatibility: Version 2.90 required. Type of returned value: Array Description: Return position of given location. Category: Location

vehicle lock lock

Operand types: vehicle: Object lock: Boolean Type of returned value: Nothing Description: Locks the vehicle (disables mounting / dismounting) for the player. Example: jeepOne lock true Category: OFP

vehicle lockCargo lock

Operand types: vehicle: Object lock: Boolean Compatibility: Version 5501 required. Type of returned value: Nothing

Page 224 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 225: comref

Description: Lock the all cargo positions of the vehicle. Category: OFP

vehicle lockCargo [cargo index, lock]

Operand types: vehicle: Object [cargo index, lock]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Lock the cargo position of the vehicle. Category: OFP

vehicle lockDriver lock

Operand types: vehicle: Object lock: Boolean Compatibility: Version 5501 required. Type of returned value: Nothing Description: Lock the driver position of the vehicle. Category: OFP

locked unit

Operand types: unit: Object Type of returned value: Boolean Description: Checks whether the vehicle is locked for the player. If it's locked, the player cannot mount / dismount without an order. Example: locked jeepOne Category: OFP

Page 225 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 226: comref

vehicle lockedCargo cargo index

Operand types: vehicle: Object cargo index: Number Compatibility: Version 5501 required. Type of returned value: Boolean Description: Check whether cargo position of the vehicle is locked. Category: OFP

lockedDriver vehicle

Operand types: vehicle: Object Compatibility: Version 5501 required. Type of returned value: Boolean Description: Check whether driver position of the vehicle turret is locked. Category: OFP

vehicle lockedTurret turret path

Operand types: vehicle: Object turret path: Array Compatibility: Version 5501 required. Type of returned value: Boolean Description: Check whether gunner position of the vehicle turret is locked. Category: OFP

vehicle lockTurret [turret path, lock]

Operand types: vehicle: Object [turret path, lock]: Array Compatibility: Version 5501 required.

Page 226 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 227: comref

Type of returned value: Nothing Description: Lock the gunner position of the vehicle turret. Category: OFP

group lockWp lockWP

Operand types: group: Object or Group lockWP: Boolean Type of returned value: Nothing Description: Disables switching to the next waypoint (the current waypoint will never complete while lockWp is used). This is sometimes used during cut-scenes. Example: groupOne lockWP true Category: OFP

log x

Operand types: x: Number Type of returned value: Number Description: The base-10 logarithm of x. Example: log 10 , result is 1 Category: Default

unit(s) lookAt position

Operand types: unit(s): Object or Array position: Object or Array Compatibility: Version 2.40 required. Type of returned value: Nothing Description: Control what the unit is looking at (target or position) (format Position)

Page 227 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 228: comref

Example: someSoldier lookAt otherSoldier; otherSoldier lookAt getMarkerPos "markerOne" Category: OFP

map lookAtPos position

Operand types: map: Control position: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Center the map on, and point the camera at, the position. Category: Editor

magazines vehicle

Operand types: vehicle: Object Compatibility: Version 1.75 required. Type of returned value: Array Description: Returns an array with the type names of all the vehicle's magazines. Example: magazines player Category: Resistance

mapAnimAdd frame

Operand types: frame: Array Compatibility: Version 1.27 required. Type of returned value: Nothing Description: Adds the next frame to the map animation. The format of frame is [time, zoom, position], the format of position is Position2D.

Page 228 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 229: comref

Example: mapAnimAdd [1, 0.1, getMarkerPos "anim1"] Category: OFP

mapAnimClear

Compatibility: Version 1.27 required. Type of returned value: Nothing Description: Clears the map animation. Category: OFP

mapAnimCommit

Compatibility: Version 1.27 required. Type of returned value: Nothing Description: Plays the map animation. Category: OFP

mapAnimDone

Compatibility: Version 1.27 required. Type of returned value: Boolean Description: Checks whether the map animation has finished. Category: OFP

markerAlpha markerName

Operand types: markerName: String Compatibility: Version 5501 required. Type of returned value: Number

Page 229 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 230: comref

Description: Gets the marker alpha. See setMarkerAlpha. Example: markerAlpha "MarkerOne" Category: OFP

markerBrush name

Operand types: name: String Compatibility: Version 5501 required. Type of returned value: String Description: Gets the marker brush. See setMarkerBrush. Example: markerBrush "MarkerOne" Category: OFP

markerColor markerName

Operand types: markerName: String Compatibility: Version 1.50 required. Type of returned value: String Description: Gets the marker color. See setMarkerColor. Note: this function is identical to getMarkerColor. Example: markerColor "MarkerOne" Category: OFP

markerDir markerName

Operand types: markerName: String Compatibility: Version 2.92 required. Type of returned value: Array

Page 230 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 231: comref

Description: Gets the marker direction. See setMarkerDir. Example: markerDir "MarkerOne" Category: OFP

markerPos markerName

Operand types: markerName: String Compatibility: Version 1.50 required. Type of returned value: Array Description: Returns the marker positon in format [x,z,y]. Note: this function is identical to getMarkerPos. Example: markerPos "markerOne" Category: OFP

markerShape name

Operand types: name: String Compatibility: Version 5501 required. Type of returned value: String Description: Gets the marker shape. See setMarkerShape. Example: markerShape "MarkerOne" Category: OFP

markerSize markerName

Operand types: markerName: String Compatibility: Version 1.50 required. Type of returned value: Array

Page 231 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 232: comref

Description: Gets the marker size. See setMarkerSize. Note: this function is identical to getMarkerSize. Example: markerSize "MarkerOne" Category: OFP

markerText markerName

Operand types: markerName: String Compatibility: Version 2.92 required. Type of returned value: Array Description: Gets the marker text. See setMarkerText. Example: markerText "MarkerOne" Category: OFP

markerType markerName

Operand types: markerName: String Compatibility: Version 1.50 required. Type of returned value: String Description: Gets the type of the marker. See setMarkerType. Note: this function is identical to getMarkerType. Example: markerType "MarkerOne" Category: OFP

a max b

Operand types: a: Number b: Number Type of returned value: Number Description:

Page 232 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 233: comref

The greater of a,b Example: 3 max 2 , result is 3 Category: Default

a min b

Operand types: a: Number b: Number Type of returned value: Number Description: The smaller of a,b Example: 3 min 2 , result is 2 Category: Default

missionConfigFile

Compatibility: Version 2.90 required. Type of returned value: Config Description: Return root of mission description.ext entries hierarchy. Category: OFP PC

missionName

Compatibility: Version 1.80 required. Type of returned value: String Description: Returns the name of the current mission. Category: OFP

missionNamespace

Page 233 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 234: comref

Compatibility: Version 5501 required. Type of returned value: Namespace Description: Return the global namespace attached to mission. Category: OFP

missionStart

Compatibility: Version 1.80 required. Type of returned value: Array Description: Returns the time of the mission start in format [year, month, day, hour, minute, second]. Category: OFP

a mod b

Operand types: a: Number b: Number Type of returned value: Number Description: The remainder of a divided by b. Note that the remainer is calculated in the real domain. Example: 3 mod 2 , result is 1 Category: Default

object modelToWorld modelPos

Operand types: object: Object modelPos: Array Compatibility: Version 2.92 required. Type of returned value: Array Description: Converts position from object model space to world space. Category: OFP

Page 234 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 235: comref

morale unit

Operand types: unit: Object Compatibility: Version 5500 required. Type of returned value: Number Description: Checks a current morale level of the unit (-1..+1). Example: morale leader player , result is 0.5 Category: OFP

group move pos

Operand types: group: Object or Group pos: Array Type of returned value: Nothing Description: Creates a move waypoint on the given position (format Position) and makes it the currently active group waypoint. Example: groupOne move getPos player Category: OFP

soldier moveInCargo vehicle

Operand types: soldier: Object vehicle: Object Type of returned value: Nothing Description: Moves the soldier into the vehicle's cargo position. (Immediately, without animation). Example: soldierOne moveInCargo jeepOne Category: OFP

Page 235 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 236: comref

soldier moveInCargo [vehicle, CargoIndex]

Operand types: soldier: Object [vehicle, CargoIndex]: Array Type of returned value: Nothing Description: Moves the soldier into a vehicle's specified cargo position. (Immediately, without animation). Example: soldierOne moveInCargo jeepOne Category: OFP

soldier moveInCommander vehicle

Operand types: soldier: Object vehicle: Object Type of returned value: Nothing Description: Moves the soldier into the vehicle's commander position. (Immediatetely, without animation). Example: soldierOne moveInCommander jeepOne Category: OFP

soldier moveInDriver vehicle

Operand types: soldier: Object vehicle: Object Type of returned value: Nothing Description: Moves the soldier into the vehicle's driver position. (Immediately, without animation). Example: soldierOne moveInDriver jeepOne Category: OFP

soldier moveInGunner vehicle

Operand types:

Page 236 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 237: comref

soldier: Object vehicle: Object Type of returned value: Nothing Description: Moves the soldier into the vehicle's gunner position. (Immediately, without animation). Example: soldierOne moveInGunner jeepOne Category: OFP

soldier moveInTurret [vehicle, turret path]

Operand types: soldier: Object [vehicle, turret path]: Array Type of returned value: Nothing Description: Moves the soldier into the vehicle's turret. (Immediately, without animation). Example: soldierOne moveInTurret [tank, [0, 0]] Category: OFP

map moveObjectToEnd object

Operand types: map: Control object: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Shifts an editor object to the end of the objects array. This means that the object will be drawn last (after all other objects). Category: Editor

moveOut soldier

Operand types: soldier: Object Compatibility: Version 5501 required.

Page 237 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 238: comref

Type of returned value: Nothing Description: Moves the soldier out of vehicle. (Immediately, without animation). Category: OFP

moveTime soldier

Operand types: soldier: Object Compatibility: Version 5500 required. Type of returned value: Number Description: Returns the current time of the most important RTM animation currently being played on the soldier. Example: moveTime player Category: OFP PC

person moveTo position

Operand types: person: Object position: Array Compatibility: Version 2.61 required. Type of returned value: Nothing Description: Low level command to person to move to given position. Category: OFP

moveToCompleted person

Operand types: person: Object Compatibility: Version 2.62 required. Type of returned value: Boolean Description: Check if latest low level moveTo command is finished.

Page 238 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 239: comref

Category: OFP

moveToFailed person

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Check if latest low level moveTo command failed. Category: OFP

musicVolume

Type of returned value: Number Description: Checks the current music volume (set by fadeMusic). Category: OFP

name object

Operand types: object: Object Type of returned value: String Description: Returns the name of the variable assigned to the object in the mission editor. When used on a vehicle, the name of the first crew member is returned (in order: commander, driver, gunner). Example: name vehicle player Category: OFP

name location

Operand types: location: Location Compatibility: Version 2.90 required.

Page 239 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 240: comref

Type of returned value: String Description: Return name of global vatiable containing given location. Category: Location

position nearEntities radius or [typeName, radius] or [[typeName1, typeName2, ...], radius]

Operand types: position: Object or Array radius or [typeName, radius] or [[typeName1, typeName2, ...], radius]: Compatibility: Version 5501 required. Type of returned value: Array Description: Find entities in the circle with given radius. If typeName(s) is (are) given, only entities of given type (or its subtype) are listed. Example: _list = position player nearObjects 50 Category: OFP

nearestBuilding obj

Operand types: obj: Object Type of returned value: Object Description: Returns the nearest building to the given object. Example: neareastBuilding player Category: OFP

nearestLocation [position, type]

Operand types: [position, type]: Array Compatibility: Version 2.90 required. Type of returned value: Location

Page 240 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 241: comref

Description: Find the nearest location (to the given position) of given type. Category: Location

nearestLocations [position, [types], distance, <position to sort from>]

Operand types: [position, [types], distance, <position to sort from>]: Array Compatibility: Version 2.92 required. Type of returned value: Array Description: Find the nearest locations (from the given position) of certain types, within the specified distance. If <position to sort from> is provided, locations will be ordered by distance from this point. Category: Location

nearestLocationWithDubbing position

Operand types: position: Array Compatibility: Version 5501 required. Type of returned value: Location Description: Find the nearest location (to the given position) having it speech non-empty. Category: Location

nearestObject pos

Operand types: pos: Array Type of returned value: Object Description: Returns the nearest object of the given type to the given position or object. Pos may be using format [x,y,z, "type"] or [object, "type"]. Example: nearestObject [player, "StreetLamp"] Category: OFP

Page 241 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 242: comref

position nearestObject type

Operand types: position: Array type: String Compatibility: Version 2.01 required. Type of returned value: Object Description: Find object nearest to given position with given type. Example: obj = position player nearestObject "Building" Category: Resistance

position nearestObject id

Operand types: position: Array id: Number Compatibility: Version 2.01 required. Type of returned value: Object Description: Find object nearest to given position with given Visitor id. Example: obj = position player nearestObject 1234 Category: Resistance

nearestObjects pos

Operand types: pos: Array Compatibility: Version 2.92 required. Type of returned value: Array Description: Returns a list of nearest objects of the given types to the given position or object, within the specified distance. Pos may be using format [x,y,z, ["type",...], limit] or [object, ["type",...], limit]. Example: nearestObjects [player, ["Car","Tank"], 200] Category: OFP

Page 242 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 243: comref

position nearObjects radius or [typeName, radius]

Operand types: position: Object or Array radius or [typeName, radius]: Compatibility: Version 2.92 required. Type of returned value: Array Description: Find objects in the circle with given radius. If typeName is given, only objects of given type (or its subtype) are listed. Example: _list = position player nearObjects 50 Category: OFP

position nearObjectsReady radius

Operand types: position: Object or Array radius: Number Compatibility: Version 5501 required. Type of returned value: Boolean Description: Check whether all data are loaded to nearObjects will return in reasonable time. Example: _ok = position player nearObjectsReady 50 Category: OFP

position or object nearRoads radius

Operand types: position or object: Object or Array radius: Number Compatibility: Version 5500 required. Type of returned value: Array Description: Find the road segments within the circle of given radius. Example: _list = player nearRoads 50

Page 243 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 244: comref

Category: OFP

unit nearTargets radius

Operand types: unit: Object radius: Number Type of returned value: Array Description: Check target database of the unit for all targets in max. distance radius around it. The output is list of items: [position, type, side, subj. cost, object] Category: OFP

needReload vehicle

Operand types: vehicle: Object Compatibility: Version 2.92 required. Type of returned value: Number Description: Return how much vehicle wants to reload its weapons. Category: OFP

map newOverlay config

Operand types: map: Control config: Config Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Creates the new overlay dialog for the specified type of overlay. Category: Editor

nextMenuItemIndex map

Operand types:

Page 244 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 245: comref

map: Control Compatibility: Version 2.92 required. Type of returned value: Number Description: Returns the next available menu item index. Category: Editor

nextWeatherChange

Compatibility: Version 2.92 required. Type of returned value: Number Description: Return the time (in seconds) when the next weather change will occur. Category: OFP

nil

Type of returned value: Any Description: Nil value. This value can be used to undefine an existing variable. Example: variableToDestroy = nil Category: Default

map nMenuItems menu index

Operand types: map: Control menu index: Compatibility: Version 2.92 required. Type of returned value: Number Description: Returns the total number of user-added menu items belonging to the given menu. Category: Editor

Page 245 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 246: comref

not a

Operand types: a: Boolean Type of returned value: Boolean Description: not a Example: not false , result is true Category: Default

NumberToDate [year,time]

Operand types: [year,time]: Array Compatibility: Version 5501 required. Type of returned value: Array Description: Convert float number to date. Example: date = NumberToDate [2008,0.5324] Category: OFP

objNull

Type of returned value: Object Description: A non-existing object. This value is not equal to anything, including itself. Example: player == objNull , result is false Category: OFP

objective objStatus status

Operand types: objective: String status: String Type of returned value:

Page 246 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 247: comref

Nothing Description: Sets the briefing objective status. Status may be one of: "ACTIVE", "FAILED", "DONE" or "HIDDEN". Example: "obj_1" objStatus "FAILED" Category: OFP

onBriefingGroup sound

Operand types: sound: String Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Defines a sound (voice) that is played the first time when the Group section in the briefing is selected. Example: onBriefingGroup "GroupVoiceOver" Category: Resistance

onBriefingNotes sound

Operand types: sound: String Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Defines a sound (voice) that is played the first time when the Notes section in the briefing is selected. Example: onBriefingNotes "NotesVoiceOver" Category: Resistance

onBriefingPlan sound

Operand types: sound: String

Page 247 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 248: comref

Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Defines a sound (voice) that is played the first time when the Plan section in the briefing is selected. Example: onBriefingPlan "PlanVoiceOver" Category: Resistance

onBriefingTeamSwitch sound

Operand types: sound: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Defines a sound (voice) that is played the first time when the Team switch section in the briefing is selected. Example: onBriefingTeamSwitch "TeamSwitchVoiceOver" Category: Resistance

onCommandModeChanged command

Operand types: command: Compatibility: Version 5501 required. Type of returned value: Nothing Description: Defines an action performed when commnad mode change. Command receives _isHighCommand bool Category: OFP

map onDoubleClick command

Operand types: map: Control

Page 248 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 249: comref

command: String Compatibility: Version 2.92 required. Type of returned value: Any Description: Defines an action performed when the user double clicks on the map. Command receives: _pos array position _units array selected units _shift,_alt bool key state Category: Editor

onGroupIconClick command

Operand types: command: Compatibility: Version 5501 required. Type of returned value: Nothing Description: Defines an action performed when palyer clicked on group marker (3D or in a map) Category: OFP

onGroupIconOverEnter command

Operand types: command: Compatibility: Version 5501 required. Type of returned value: Nothing Description: Defines an action performed when palyer clicked on group marker (3D or in a map) Category: OFP

onGroupIconOverLeave command

Operand types: command: Compatibility: Version 5501 required. Type of returned value: Nothing

Page 249 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 250: comref

Description: Defines an action performed when palyer clicked on group marker (3D or in a map) Category: OFP

onHCGroupSelectionChanged command

Operand types: command: Compatibility: Version 5501 required. Type of returned value: Nothing Description: Defines an action performed when HC group has been selected. Command receives _group group selected group _isSelected bool new selection state Category: OFP

onMapSingleClick command

Operand types: command: Compatibility: Version 1.91 required. Type of returned value: Nothing Description: Defines an action performed when the user clicks on the map. Command receives: _pos array position _units array selected units _shift,_alt bool key state If the click is processed, command should return true. Example: onMapSingleClick """SoldierEG"" createUnit [_pos, group player]" Category: Resistance

parameters onMapSingleClick command

Operand types: parameters: Any command: Compatibility:

Page 250 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 251: comref

Version 5500 required.Type of returned value: Nothing Description: Defines an action performed when the user clicks on the map. Command receives: _pos array position _units array selected units _shift,_alt bool key state _this any parameters passed to this function If the click is processed, command should return true. Example: "SoldierEG" onMapSingleClick "_this createUnit [_pos, group player]" Category: OFP

onPlayerConnected statement

Operand types: statement: Compatibility: Version 2.10 required. Type of returned value: Nothing Description: This statement is launched whenever a player is connected to a MP session. Variables _id and _name are set. Category: Resistance

onPlayerDisconnected statement

Operand types: statement: Compatibility: Version 2.10 required. Type of returned value: Nothing Description: This statement is launched whenever a player is disconnected from a MP session. Variables _id and _name are set. Category: Resistance

onPreloadFinished command

Page 251 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 252: comref

Operand types: command: Compatibility: Version 5501 required. Type of returned value: Nothing Description: Defines an action performed after the preload screen finished. Category: OFP

onPreloadStarted command

Operand types: command: Compatibility: Version 5501 required. Type of returned value: Nothing Description: Defines an action performed just before the preload screen started. Category: OFP

map onShowNewObject command

Operand types: map: Control command: String Compatibility: Version 2.92 required. Type of returned value: Any Description: Defines an action performed when the user right clicks on the map and selects New Object. Set to empty for default behavior. Command receives: _pos array position Category: Editor

onTeamSwitch command

Operand types: command: Compatibility: Version 5500 required. Type of returned value:

Page 252 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 253: comref

Nothing Description: Defines an action performed when the team switch is finished. Command receives: _from object previous unit _to object current units Category: OFP

a or b

Operand types: a: Boolean b: Boolean Type of returned value: Boolean Description: a or b Example: not alive player or not alive leader player Category: Default

unitArray orderGetIn order

Operand types: unitArray: Array order: Boolean Type of returned value: Nothing Description: Forces all units in the list to get in their assigned vehicle. Example: [unitOne, unitTwo] orderGetIn true Category: OFP

overcast

Compatibility: Version 2.92 required. Type of returned value: Number Description:

Page 253 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 254: comref

Return the current overcast. Category: OFP

overcastForecast

Compatibility: Version 2.92 required. Type of returned value: Number Description: Return the overcast forecast. Category: OFP

owner object

Operand types: object: Object Compatibility: Version 5501 required. Type of returned value: Number Description: On server machine, return the ID of the client where the object is local. Otherwise return 0. Category: OFP

parseNumber string

Operand types: string: String Compatibility: Version 2.92 required. Type of returned value: Number Description: Parse string containing real number. Example: parseNumber "0.125" Category: Default

parseText text

Page 254 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 255: comref

Operand types: text: String Compatibility: Version 2.01 required. Type of returned value: Structured text Description: Creates a structured text by parsing the given XML description. Example: txt = parseText "First line&lt;img image=data\isniper.paa/&gt;&ltbr/&gt;Second line" Category: OFP

parsingNamespace

Compatibility: Version 5501 required. Type of returned value: Namespace Description: Return the global namespace attached to config parser. Category: OFP

pi

Type of returned value: Number Description: pi (180 degrees converted to radians) Example: pi , result is 3.1415 Category: Default

pickWeaponPool obj

Operand types: obj: Object Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Transfers weapons and magazines from the cargo space of object obj to the weapon pool (used in campaigns to transfer weapons to the next mission).

Page 255 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 256: comref

Category: Resistance

playableUnits

Compatibility: Version 5501 required. Type of returned value: Array Description: Return a list of playable units (occupied by both AI or players). Category: OFP

soldier playAction action

Operand types: soldier: Object action: String Compatibility: Version 5500 required. Type of returned value: Nothing Description: When used on a person, a smooth transition to the given action will be initiated. Example: soldierOne playAction "SitDown" Category: OFP

soldier playActionNow action

Operand types: soldier: Object action: String Compatibility: Version 5501 required. Type of returned value: Nothing Description: When used on a person, a smooth transition to the given action will be initiated, but all previous playAction are discarded. Example: soldierOne playActionNow "SitDown" Category: OFP

Page 256 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 257: comref

player

Type of returned value: Object Description: This is the person controlled by the player. In MP this value is different on each computer. Example: alive player Category: OFP

playerRespawnTime

Compatibility: Version 2.92 required. Type of returned value: Number Description: Return the player remaining time to respawn. Category: OFP

playerSide

Compatibility: Version 2.09 required. Type of returned value: Side Description: Returns the player's side. This is valid even when the player controlled person is dead (a difference from player side). Category: OFP

playersNumber side

Operand types: side: Side Compatibility: Version 1.80 required. Type of returned value: Number Description: Returns the number of players playing on the given side.

Page 257 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 258: comref

Category: OFP

soldier playGesture moveName

Operand types: soldier: Object moveName: String Compatibility: Version 5500 required. Type of returned value: Nothing Description: When used on a person, a smooth transition to the given move will be initiated. Example: soldierOne playGesture "Wave" Category: OFP

playMission [campaign, mission] or [campaign, mission, skipBriefing]

Operand types: [campaign, mission] or [campaign, mission, skipBriefing]: Array Compatibility: Version 2.19 required. Type of returned value: Nothing Description: The mission is launched (from the main menu). Both campaign and mission are given as their directory name. If the campaign is empty, a single mission is launched. If skipBriefing is true, the intro and briefing are skipped. Example: playMission["XOutrage","x05Negotiator.Noe"] Category: OFP

soldier playMove moveName

Operand types: soldier: Object moveName: String Type of returned value: Nothing Description: When used on a person, a smooth transition to the given move will be initiated. Example:

Page 258 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 259: comref

soldierOne playMove "Stand" Category: OFP

soldier playMoveNow moveName

Operand types: soldier: Object moveName: String Compatibility: Version 5501 required. Type of returned value: Nothing Description: When used on a person, a smooth transition to the given move will be initiated, but all previous playAction are discarded. Example: soldierOne playMoveNow "Stand" Category: OFP

playMusic nameAndPos

Operand types: nameAndPos: Array Type of returned value: Nothing Description: Plays music defined in the description.ext file. The format of nameAndPos is [name,position]. Position is in seconds. Example: playMusic ["Track13", 30] Category: OFP

playMusic name

Operand types: name: String Type of returned value: Nothing Description: Plays music defined in the description.ext file. Example: playMusic "musicname"

Page 259 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 260: comref

Category: OFP

playScriptedMission [world, expression, config]

Operand types: [world, expression, config]: Array Compatibility: Version 5500 required. Type of returned value: Nothing Description: Load the given world, launch an empty mission and execute the given expression. Config (optional) can reference to the config entry replacing description.ext for this mission. Category: OFP

playSound name

Operand types: name: String Type of returned value: Nothing Description: Plays a sound defined in the description.ext file. Example: playSound "soundname" Category: OFP

position object

Operand types: object: Object Compatibility: Version 1.50 required. Type of returned value: Array Description: Returns the object position in format Position. Example: position player Category: OFP

Page 260 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 261: comref

position location

Operand types: location: Location Compatibility: Version 2.90 required. Type of returned value: Array Description: Return (raw) position of given location. Category: Location

positionCameraToWorld position

Operand types: position: Array Compatibility: Version 2.52 required. Type of returned value: Array Description: Transform position from camera coordinate space to world coordinate space. Example: _worldPos = positionCameraToWorld _cameraPos Category: OFP PC

map posScreenToWorld [x, y]

Operand types: map: Control [x, y]: Array Compatibility: Version 2.54 required. Type of returned value: Array Description: Convert screen coordinates in map to world coordinates. Category: OFP PC

map posWorldToScreen position

Operand types: map: Control position: Array

Page 261 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 262: comref

Compatibility: Version 2.54 required. Type of returned value: Array Description: Convert world coordinates to screen coordinates in map. Category: OFP PC

number ppEffectAdjust array

Operand types: number: Number array: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set post process effect parameters Example: hndl ppEffectAdjust [0.0075, 0.0075, 0.1, 0.1] Category: Visual

string ppEffectAdjust array

Operand types: string: String array: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Adjust parameters for specified post process effect Example: "radialBlurr" ppEffectEnable [] Category: Visual

array ppEffectCommit scalar

Operand types: array: Array scalar: Number

Page 262 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 263: comref

Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set time when old pars are replaced by last set, if 0 set immediately Example: hndl ppEffectCommit 0 Category: Visual

number ppEffectCommit number

Operand types: number: Number number: Number Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set time when old pars are replaced by last set, if 0 set immediately Example: hndl ppEffectCommit 0 Category: Visual

string ppEffectCommit number

Operand types: string: String number: Number Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set time when old pars are replaced by last set, if 0 set immediately Example: ... Category: Visual

ppEffectCommitted effect

Page 263 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 264: comref

Operand types: effect: Number Compatibility: Version 5501 required. Type of returned value: Boolean Description: Check whether given post process effect is commited Category: Visual

ppEffectCommitted effect

Operand types: effect: String Compatibility: Version 5501 required. Type of returned value: Boolean Description: Check whether given post process effect is commited Category: Visual

ppEffectCreate effect

Operand types: effect: Array Compatibility: Version 5501 required. Type of returned value: Array Description: Create post process effect specified by name and priority Category: Visual

ppEffectCreate effect

Operand types: effect: Array Compatibility: Version 5501 required. Type of returned value: Number Description: Create post process effect specified by name and priority

Page 264 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 265: comref

Category: Visual

ppEffectDestroy effect

Operand types: effect: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Create post process effect specified by name and priority Category: Visual

ppEffectDestroy effect

Operand types: effect: Number Compatibility: Version 5501 required. Type of returned value: Nothing Description: Destroy post process effect given by handle Category: Visual

number ppEffectEnable bool

Operand types: number: Number bool: Boolean Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Enable / disable post process effect Example: hndl ppEffectEnable true Category: Visual

string ppEffectEnable bool

Page 265 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 266: comref

Operand types: string: String bool: Boolean Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Enable/disable specified post process effect, is overloaded form multiple effects. Example: "radialBlurr" ppEffectEnable true, ["chromAberration", "radialBlurr"] ppEffectEnable true Category: Visual

array ppEffectEnable bool

Operand types: array: Array bool: Boolean Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Enable/disable specified post process effect, is overloaded form multiple effects. Example: "radialBlurr" ppEffectEnable true, ["chromAberration", "radialBlurr"] ppEffectEnable true Category: Visual

precision entity

Operand types: entity: Object Compatibility: Version 2.92 required. Type of returned value: Number Description: Return the precision of the given entity. Category: OFP

preloadCamera position

Operand types:

Page 266 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 267: comref

position: Array Compatibility: Version 2.50 required. Type of returned value: Boolean Description: Preload all textures and models around given position Category: OFP

distance preloadObject object

Operand types: distance: Number object: Object or String Compatibility: Version 2.50 required. Type of returned value: Boolean Description: Preload all data for given object. Category: OFP

preloadSound sound

Operand types: sound: String Compatibility: Version 2.50 required. Type of returned value: Boolean Description: Make sure sound can start playing without any delay once we need it. Category: OFP

preloadTitleObj effect

Operand types: effect: Array Type of returned value: Boolean Description: Object title - argument uses format ["text","type",speed] or ["name","type"]. Speed is ignored. Preload data The object can be defined in the description.ext file. Example:

Page 267 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 268: comref

titleObj ["BISLogo","plain"] Category: OFP

preloadTitleRsc effect

Operand types: effect: Array Type of returned value: Boolean Description: Resource title - argument uses format ["name","type",speed] or ["name","type"]. Speed is ignored. Preload data The resource can be defined in the description.ext file. Example: titleRsc ["BIS", "PLAIN"] Category: OFP

preprocessFile filename

Operand types: filename: String Compatibility: Version 1.82 required. Type of returned value: String Description: Returns the preprocessed content of the given file. The preprocessor is C-like, it supports comments using // or /* and */ and macros defined with #define. Example: preprocessFile "myFunction.sqf" , result is "if a>b then {a} else {b}" Category: OFP

preprocessFileLineNumbers filename

Operand types: filename: String Compatibility: Version 2.58 required. Type of returned value: String Description: Returns the preprocessed content of the given file. The preprocessor is C-like, it supports comments using // or /* and */ and macros defined with #define.

Page 268 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 269: comref

Example: preprocessFileLineNumbers "myFunction.sqf" , result is "if a>b then {a} else {b}" Category: OFP

primaryWeapon vehicle

Operand types: vehicle: Object Compatibility: Version 1.75 required. Type of returned value: String Description: Returns the name of the vehicle's primary weapon (an empty string if there is none). Example: primaryWeapon player Category: Resistance

priority task

Operand types: task: Task Compatibility: Version 2.91 required. Type of returned value: Number Description: Return the priority of the task. Category: Identity

private variable

Operand types: variable: String or Array Compatibility: Version 1.85 required. Type of returned value: Nothing Description: Introduces one or more local variables in the innermost scope. Category: Default

Page 269 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 270: comref

processDiaryLink link

Operand types: link: String Compatibility: Version 5500 required. Type of returned value: Nothing Description: Open the diary screen on the record specified by link. Category: Identity

processInitCommands

Compatibility: Version 2.33 required. Type of returned value: Nothing Description: Process commands stored using setVehicleInit. Category: OFP

progressLoadingScreen progress

Operand types: progress: Number Compatibility: Version 5501 required. Type of returned value: Nothing Description: If loading screen is show, set progress bar to the given value (from interval [0, 1]) Category: OFP

progressPosition control

Operand types: control: Control Compatibility: Version 5500 required. Type of returned value: Number Description: Returns the current position in the progress bar.

Page 270 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 271: comref

Example: _pos = progressPosition _control Category: OFP PC

control progressSetPosition pos

Operand types: control: Control pos: Number Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets the current position in the progress bar. Example: _control sliderSetPosition 0 Category: OFP PC

publicVariable varName

Operand types: varName: String Type of returned value: Nothing Description: Broadcasts the variable value to all computers. Only type Number is supported in versions 1.33 and before. The following types are supported since 1.34: Number, Boolean, Object and Group. Example: publicVariable "CTFscoreOne" Category: OFP

putWeaponPool obj

Operand types: obj: Object Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Transfers weapons and magazines from the weapon pool (used in campaigns to transfer weapons to the next mission) into the cargo space of object obj.

Page 271 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 272: comref

Category: Resistance

queryMagazinePool name

Operand types: name: String Compatibility: Version 1.75 required. Type of returned value: Number Description: Returns the number of magazines of type name in the weapon pool (used in campaigns to transfer weapons to the next mission). Category: Resistance

queryWeaponPool name

Operand types: name: String Compatibility: Version 1.75 required. Type of returned value: Number Description: Returns the number of weapons of type name in the weapon pool (used in campaigns to transfer weapons to the next mission). Category: Resistance

rad x

Operand types: x: Number Type of returned value: Number Description: Converts x from degrees to radians. Example: rad 180 , result is 3.1415 Category: Default

radioVolume

Page 272 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 273: comref

Type of returned value: Number Description: Checks the current radio volume (set by setRadioVolume). Category: OFP

rain

Compatibility: Version 2.92 required. Type of returned value: Number Description: Return the current rain. Category: OFP

random x

Operand types: x: Number Type of returned value: Number Description: The random real value from 0 to x. (0<=random<1) Example: random 1 Category: Default

rank unit

Operand types: unit: Object Compatibility: Version 2.92 required. Type of returned value: String Description: Return the rank of the given unit. Category: OFP

rankId unit

Page 273 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 274: comref

Operand types: unit: Object Compatibility: Version 5500 required. Type of returned value: Number Description: Return the rank of the given unit for comparison. Category: OFP

rating unit

Operand types: unit: Object Type of returned value: Number Description: Checks the unit rating. This rating is increased for killing enemies, decreased for killing friendlies and can be changed by a mission designer. Example: rating player Category: OFP

rectangular location

Operand types: location: Location Compatibility: Version 2.90 required. Type of returned value: Boolean Description: Check if given location has rectangular shape. Category: Location

registeredTasks teamMember

Operand types: teamMember: Compatibility: Version 2.91 required. Type of returned value: Array Description:

Page 274 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 275: comref

List all registered task types. Category: Identity

teamMember registerTask entry name

Operand types: teamMember: entry name: String Compatibility: Version 2.90 required. Type of returned value: Boolean Description: Register a new task type. Parameters are defined in the given config class (subclass of CfgTasks). Category: Identity

reload vehicle

Operand types: vehicle: Object Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Reload all weapons. Category: OFP

reloadEnabled vehicle

Operand types: vehicle: Object Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Check whether magazine is reloaded whenever emptied. Category: OFP

who remoteControl whom

Page 275 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 276: comref

Operand types: who: Object whom: Object Compatibility: Version 5501 required. Type of returned value: Nothing Description: Switch on remote control of the unit. Example: player remoteControl gunner _uav Category: OFP

unit removeAction index

Operand types: unit: Object index: Number Compatibility: Version 1.11 required. Type of returned value: Nothing Description: Removes the action with the given id. Example: player removeAction 0 Category: OFP

object removeAllEventHandlers handlerType

Operand types: object: Object handlerType: String Compatibility: Version 1.85 required. Type of returned value: Nothing Description: Removes all event handlers of the given type which were added by addEventHandler. Example: player removeAllEventHandlers "killed" Category: OFP

Page 276 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 277: comref

removeAllItems unit

Operand types: unit: Object Compatibility: Version 5501 required. Type of returned value: Nothing Description: Removes all special items from the unit. Example: removeAllItems player Category: OFP

removeAllWeapons unit

Operand types: unit: Object Type of returned value: Nothing Description: Removes all weapons from the unit. Example: removeAllWeapons player Category: OFP

map removeDrawIcon [object, string identifier]

Operand types: map: Control [object, string identifier]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Removes an icon for an editor object. Category: Editor

map removeDrawLinks [from, param type]

Operand types: map: Control

Page 277 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 278: comref

[from, param type]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Remove all drawn links for the given editor object for the given editor object type. Pass an empty string as param type to remove all draw links for an object. Category: Editor

object removeEventHandler handler

Operand types: object: Object handler: Array Compatibility: Version 1.85 required. Type of returned value: Nothing Description: Removes event handler added by addEventHandler. Format of handler is [type,index]. Index is returned by addEventHandler. When any handler is removed, all handler indices higher that the deleted one should be decremented. Example: player removeEventHandler ["killed",0] Category: OFP

group removeGroupIcon icon ID

Operand types: group: Group icon ID: Number Compatibility: Version 5501 required. Type of returned value: Nothing Description: Remove icon with given ID from group. Example: group removeGroupIcon id Category: OFP

unit removeMagazine weaponName

Page 278 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 279: comref

Operand types: unit: Object weaponName: String or Array Type of returned value: Nothing Description: Removes the magazine from the unit. Note: you may create invalid combinations by using this function. When doing so, application behaviour is undefined. Example: player removeMagazine "M16" Category: OFP

unit removeMagazines weaponName

Operand types: unit: Object weaponName: String Type of returned value: Nothing Description: Removes all magazines of the given type from the unit. Note: you may create invalid combinations by using this function. When doing so, application behaviour is undefined. Example: player removeMagazines "M16" Category: OFP

map removeMenuItem index of menu item to delete

Operand types: map: Control index of menu item to delete: Number Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Removes a previously added menu item. Category: Editor

map removeMenuItem text of menu item to delete

Operand types: map: Control

Page 279 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 280: comref

text of menu item to delete: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Removes a previously added menu item. Category: Editor

person removeSimpleTask task

Operand types: person: Object task: Task Compatibility: Version 5501 required. Type of returned value: Nothing Description: Remove a simple task from the list of simple tasks. Category: Identity

removeSwitchableUnit person

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Remove a unit from the list of units available for team switch. Category: OFP

unit removeWeapon weaponName

Operand types: unit: Object weaponName: String Type of returned value: Nothing Description: Removes the weapon from the unit. Note: you may create invalid combinations by using this function. When doing so, application behaviour is undefined.

Page 280 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 281: comref

Example: player removeWeapon "M16" Category: OFP

requiredVersion version

Operand types: version: String Compatibility: Version 1.21 required. Type of returned value: Boolean Description: Checks whether the appropriate version of the application is available. If it's not, a warning message is shown and false is returned. The version format is "Major.Minor", e.g. "1.30". Example: requiredVersion "1.30" Category: OFP

resistance

Type of returned value: Side Description: The Resistance side. Category: OFP

array resize count

Operand types: array: Array count: Number Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Changes the array size. This function can be used to add or remove elements from the array. Example: array resize 2 Category: Default

Page 281 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 282: comref

vehicle respawnVehicle [delay = -1, count = 0]

Operand types: vehicle: Object [delay = -1, count = 0]: Array Compatibility: Version 2.52 required. Type of returned value: Nothing Description: Set vehicle as respawnable in MP games. Delay is respawn delay, default respawnDelay from description.ext is used. Count tells how many respawns is processed (default unlimited). Example: car respawnVehicle [5.0, 3] Category: OFP

restartEditorCamera map

Operand types: map: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Restarts the mission editor camera (if it was deleted by a script, for example). Category: Editor

group reveal unit

Operand types: group: Object or Group unit: Object Type of returned value: Nothing Description: Reveals the unit to the group. It does not matter whether the group can know about the unit or not. Example: soldierOne reveal soldierTwo Category: OFP

reversedMouseY

Page 282 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 283: comref

Compatibility: Version 5501 required. Type of returned value: Boolean Description: Return if mouse vertical axe is inverted. Category: OFP

roadsConnectedTo road segment

Operand types: road segment: Object Compatibility: Version 5500 required. Type of returned value: Array Description: Find the road segments connected to the given road segment. Category: OFP

round x

Operand types: x: Number Type of returned value: Number Description: The round value of x. Example: round -5.25 , result is -5 Category: Default

runInitScript

Compatibility: Version 2.33 required. Type of returned value: Nothing Description: Launch init.sqs script. Category: OFP

Page 283 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 284: comref

SafeZoneH

Compatibility: Version 5501 required. Type of returned value: Number Category: OFP

SafeZoneW

Compatibility: Version 5501 required. Type of returned value: Number Category: OFP

SafeZoneX

Compatibility: Version 5501 required. Type of returned value: Number Category: OFP

SafeZoneY

Compatibility: Version 5501 required. Type of returned value: Number Category: OFP

saveGame

Type of returned value: Nothing Description: Creates an autosave game (used for Retry).

Page 284 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 285: comref

Category: OFP

person saveIdentity name

Operand types: person: Object name: String Compatibility: Version 1.75 required. Type of returned value: Boolean Description: Saves person's identity to objects.sav file in campaign directory as entry name. Example: player saveIdentity "playerIdentity" Category: Resistance

saveOverlay map

Operand types: map: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Save the current overlay. Example: saveOverlay _map Category: Editor

object saveStatus name

Operand types: object: Object name: String Compatibility: Version 1.75 required. Type of returned value: Boolean Description: Saves object's properties to objects.sav file in campaign directory as entry name.

Page 285 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 286: comref

Example: player saveStatus "playerState" Category: Resistance

saveVar varName

Operand types: varName: String Type of returned value: Nothing Description: Saves the variable value into the global campaign space. The variable is then available to all following missions in the campaign. Example: saveVar "varOne" Category: OFP

savingEnabled

Compatibility: Version 5501 required. Type of returned value: Boolean Description: Check if saving the game is enabled. Category: OFP

unit or [unit, target] say speechName

Operand types: unit or [unit, target]: Object or Array speechName: Array Compatibility: Version 1.75 required. Type of returned value: Nothing Description: The format of speechName is [sound, maxTitlesDistance] or [sound, maxTitlesDistance, speed]. The unit will play the given sound. If the unit is a person, it will also pefrorm the corresponding lipsync effect. If the camera is not withing the given range, the title is not shown. The sound is defined in the description.ext file. If target is given, titles will be written to the conversation history. Category: OFP

Page 286 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 287: comref

unit or [unit, target] say speechName

Operand types: unit or [unit, target]: Object or Array speechName: String Type of returned value: Nothing Description: The unit will play the given sound. If the unit is a person, it will also pefrorm the corresponding lipsync effect. The sound is defined in the description.ext file. If target is given, titles will be written to the conversation history. Example: soldierOne say "speechId" Category: OFP

unit or [unit, target] say2D speechName

Operand types: unit or [unit, target]: Object or Array speechName: String Compatibility: Version 5501 required. Type of returned value: Nothing Description: Functionally same as Say, only difference is sound played as 2D (mono) allways. Example: soldierOne say "speechId" Category: OFP

unit or [unit, target] say2D speechName

Operand types: unit or [unit, target]: Object or Array speechName: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Functionally same as Say, only difference is sound played as 2D (mono) allways. Category: OFP

Page 287 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 288: comref

unit or [unit, target] say3D speechName

Operand types: unit or [unit, target]: Object or Array speechName: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Functionally same as Say, only difference is sound played as 3D allways. Category: OFP

unit or [unit, target] say3D speechName

Operand types: unit or [unit, target]: Object or Array speechName: String Compatibility: Version 5501 required. Type of returned value: Nothing Description: Functionally same as Say, only difference is sound played as 3D allways. Example: soldierOne say "speechId" Category: OFP

scopeName name

Operand types: name: String Type of returned value: Nothing Description: defines name of current scope. Name is visible in debugger, and name is also used as reference in some commands. Scope name can be defined only once per scope. Category: Default

score unit

Operand types: unit: Object Type of returned value:

Page 288 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 289: comref

Number Description: MP: returns the unit's score. Example: score unitOne Category: OFP

screenToWorld position

Operand types: position: Array Compatibility: Version 5501 required. Type of returned value: Array Description: Returns the position on landscape (in world coordinates) corresponding to the given point on screen (in UI coordinates). Category: OFP

scriptDone script

Operand types: script: Script Compatibility: Version 2.50 required. Type of returned value: Boolean Description: Check if script is already finished Category: OFP

scriptName name

Operand types: name: String Compatibility: Version 5501 required. Type of returned value: Nothing Description: Assign a friendly name to the VM script thjis command is executed from. Example:

Page 289 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 290: comref

scriptName "Trading" Category: Default

scudState scud

Operand types: scud: Object Compatibility: Version 1.28 required. Type of returned value: Number Description: Returns the current state of the given scud launcher. The following states are recognized: 0 - No activity, 1 - Launch preparation, 2 - Launch prepared, 3 - Ignition and 4 - Launched. Note: non-integral values are used to indicate a transition between states. Example: scudState scudOne>=4 Category: OFP

secondaryWeapon vehicle

Operand types: vehicle: Object Compatibility: Version 1.75 required. Type of returned value: String Description: Returns the name of a vehicle's secondary weapon (an empty string if there is none). Example: secondaryWeapon player Category: Resistance

array select index

Operand types: array: Array index: Boolean Type of returned value: Any Description: If the index is false, this selects the first element of the array. If it is true, it selects the second one.

Page 290 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 291: comref

Category: Default

config select index

Operand types: config: Config index: Number Compatibility: Version 2.35 required. Type of returned value: Config Description: Returns subentry with given index. Example: (configFile >> "CfgVehicles") select 0 Category: OFP PC

array select index

Operand types: array: Array index: Number Type of returned value: Any Description: Selects index element of the array. Index 0 denotes the first element, 1 the second, etc. Example: [1, 2, 3] select 1 , result is 2 Category: Default

selectBestPlaces [_position, _radius, _expression, _precision, _sourcesCount]

Operand types: [_position, _radius, _expression, _precision, _sourcesCount]: Array Compatibility: Version 5500 required. Type of returned value: Array Description: Find the places with the max. value of _expression in the given area. Category: OFP

Page 291 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 292: comref

person selectDiarySubject subject

Operand types: person: Object subject: String Compatibility: Version 5500 required. Type of returned value: Nothing Description: Select the subject page in a log. Category: Identity

selectedEditorObjects map

Operand types: map: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Returns a list of currently selected editor objects. Category: Editor

map selectEditorObject object

Operand types: map: Control object: String Compatibility: Version 2.92 required. Type of returned value: Any Description: Select an editor object. Does not un-select previously selected objects. Category: Editor

object selectionPosition selection name

Operand types: object: Object selection name: String Compatibility: Version 2.92 required.

Page 292 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 293: comref

Type of returned value: Array Description: Search for selection in the object model (first in the memory level, then in other levels). Returns position in model space. Category: OFP

group selectLeader unit

Operand types: group: Group unit: Object Compatibility: Version 2.33 required. Type of returned value: Nothing Description: Select group leader. Example: group player selectLeader player Category: OFP

selectNoPlayer

Compatibility: Version 5501 required. Type of returned value: Nothing Description: Switch player to no unit. Category: OFP

selectPlayer unit

Operand types: unit: Object Compatibility: Version 2.33 required. Type of returned value: Nothing Description: Switch player to given unit. Example:

Page 293 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 294: comref

selectPlayer aP Category: OFP

unit selectWeapon weapon

Operand types: unit: Object weapon: String Compatibility: Version 1.27 required. Type of returned value: Nothing Description: Selects the given weapon. For weapon values see CfgWeapons. Example: soldierOne selectWeapon "LAWLauncher" Category: OFP

object sendSimpleCommand command

Operand types: object: Object command: String Compatibility: Version 2.26 required. Type of returned value: Nothing Description: Sends a simple command to the vehicle's driver / gunner. Example: vehicle player sendSimpleCommand "STOP" Category: OFP

sender sendTask [receiver, [type] or [type, parentTask], priority, name1, value1, name2, value2, ...]

Operand types: sender: [receiver, [type] or [type, parentTask], priority, name1, value1, name2, value2, ...]: Array Compatibility: Version 2.92 required. Type of returned value: Task

Page 294 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 295: comref

Description: Create a new AI task (subtask of parentTask). Type is name of registered task type. Category: Identity

task sendTaskResult [state, result, sentence]

Operand types: task: Task [state, result, sentence]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Send a result of the task to the task sender. Category: Identity

serverTime

Compatibility: Version 5501 required. Type of returned value: Number Description: Server time synchronized to clients. Category: OFP

array set element

Operand types: array: Array element: Array Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Format of element is [index, value]. Changes an element of the given array. If the element does not exist, index+1 is called to create it. Example: array set [0, "Hello"] Category: Default

Page 295 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 296: comref

setAccTime accFactor

Operand types: accFactor: Number Type of returned value: Nothing Description: Sets the time acceleration coeficient. It can also be used to slow down time in cutscenes. Example: setAccTime 0.1 Category: OFP

airportId setAirportSide side

Operand types: airportId: Number side: Side Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set owner of the airport Example: 0 setAirportSide east Category: OFP

vehicle setAmmoCargo ammoCargo

Operand types: vehicle: Object ammoCargo: Number Type of returned value: Nothing Description: Sets the amount of ammo resources in the cargo space of a repair vehicle. Ammo resources are used to resupply vehicles; soldiers use individual magazines instead. An amount of one indicates a full cargo. Example: rearmTruckOne setAmmoCargo 0 Category: OFP

Page 296 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 297: comref

setAperture set

Operand types: set: Number Compatibility: Version 2.73 required. Type of returned value: Nothing Description: Sets custom camera apreture (-1 to do it automatically). Category: OFP

setArmoryPoints points

Operand types: points: Number Compatibility: Version 5500 required. Type of returned value: Nothing Description: Store the given amount of armory points. Category: OFP

text setAttributes [name1, value1, name2, value2, ...]

Operand types: text: Text or String [name1, value1, name2, value2, ...]: Array Compatibility: Version 2.01 required. Type of returned value: Structured text Description: Returns a structured text created by the given structured or plain text by setting attributes to the given values. Example: txt = img setAttributes ["image", "data\iSoldier.paa"] Category: OFP

group setBehaviour behaviour

Operand types: group: Object or Group

Page 297 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 298: comref

behaviour: String Type of returned value: Nothing Description: Sets the group behaviour mode. Behaviour is one of: "CARELESS", "SAFE", "AWARE", "COMBAT" or "STEALTH". Example: groupOne setBehaviour "SAFE" Category: OFP

entity setCameraInterest interest

Operand types: entity: Object interest: Number Compatibility: Version 2.57 required. Type of returned value: Nothing Description: Set camera interest for given entity. Example: _soldier setCameraInterest 50 Category: OFP

person setCaptive captive

Operand types: person: Object captive: Type of returned value: Nothing Description: Marks the unit as captive. If the unit is a vehicle, the vehicle commander is marked instead. A captive is neutral to everyone. Note: This function does not remove the unit's weapons. Example: setCaptive player Category: OFP

group setCombatMode mode

Operand types:

Page 298 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 299: comref

group: Object or Group mode: String Type of returned value: Nothing Description: Sets the group's combat mode (engagement rules). Mode can be one of: "BLUE" (Never fire), "GREEN" (Hold fire - defend only), "WHITE" (Hold fire, engage at will), "YELLOW" (Fire at will) or "RED" (Fire at will, engage at will). Example: groupOne setCombatMode "BLUE" Category: OFP

person setCurrentTask task

Operand types: person: Object task: Task Compatibility: Version 5501 required. Type of returned value: Nothing Description: Set the task as a current task of the person. Category: Identity

group setCurrentWaypoint waypoint

Operand types: group: Group waypoint: Array Compatibility: Version 5129 required. Type of returned value: Nothing Description: Switch the group to process the given waypoint. Category: OFP

object setDamage damage

Operand types: object: Object damage: Number Compatibility:

Page 299 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 300: comref

Version 1.50 required. Type of returned value: Nothing Description: Damages / repairs the object. Damage 0 means the object is fully functional, damage 1 means it's completely destroyed / dead. Note: this function is identical to setDammage. It was introduced to fix a spelling error in the original function name. Example: player setdamage 1 Category: OFP

obj setDammage dammage

Operand types: obj: Object dammage: Number Type of returned value: Nothing Description: Damages / repairs the object. Damage 0 means the object is fully functional, damage 1 means it's completely destroyed / dead. Example: player setdammage 1 Category: OFP

setDate [year, month, day, hour, minute]

Operand types: [year, month, day, hour, minute]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Sets the actual mission date and time. Category: OFP

object setDestination [position, planningMode, forceReplan]

Operand types: object: Object [position, planningMode, forceReplan]: Array Compatibility:

Page 300 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 301: comref

Version 2.92 required. Type of returned value: Nothing Description: Set the destination for path planning of the pilot. Category: OFP

obj setDir heading

Operand types: obj: Object heading: Number Type of returned value: Nothing Description: Sets the object heading. The accepted heading range is from 0 to 360. Example: player setDir 180 Category: OFP

location setDirection direction

Operand types: location: Location direction: Number Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Set a new direction (angle) of given location. Category: Location

map setDrawIcon [object, texture, color, offset, width, height, maintain size?, angle, string identifier, shadow, is3D, draw line?, priority]

Operand types: map: Control [object, texture, color, offset, width, height, maintain size?, angle, string identifier, shadow, is3D, draw line?, priority]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing

Page 301 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 302: comref

Description: Set the icon to be shown in 2D editor for the specified editor object. If maintain size is false, icon will not scale depending on the scale of the map. If maintain size is a number, the icon will maintain size if map scale is below that number. is3D, show line and priority are optional. Category: Editor

particleSource setDropInterval interval

Operand types: particleSource: Object interval: Number Compatibility: Version 2.56 required. Type of returned value: Nothing Description: Set interval of emitting particles from particle source. Example: _source setDropInterval 0.05 Category: OFP

map setEditorMode mode

Operand types: map: Control mode: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets map mode to MAP, 3D or PREVIEW. Category: Editor

map setEditorObjectScope [objects,editor type,condition,scope,subordinates also]

Operand types: map: Control [objects,editor type,condition,scope,subordinates also]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description:

Page 302 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 303: comref

This command defines the level of access a user has to editor objects. objects is an array of either Editor Objects (eg [_unit_0]) or actual Game Objects (eg [player]). If the array is empty then the command will automatically parse all editor objects. editor type is the editor type to effect (eg unit), or for none. condition is an executable string that must evaluate to true or false. If true, the scope of the evaluated editor object will be modified. scope is one of HIDE, VIEW, SELECT, LINKTO, LINKFROM, ALLNODRAG, ALLNOTREE or ALL. subordinates also is a boolean value, if true then subordinates in the editor will be assigned the same scope as the parent. Example: _map setEditorObjectScope [[],vehicle,side effectiveCommander _x != side player,HIDE,false]; Category: Editor

trigger or waypoint setEffectCondition statement

Operand types: trigger or waypoint: Object or Array statement: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: The statement is executed when the trigger or waypoint is activated and the effects are launched depending on the result. If the result is a boolean and true, the effect was launched. If the result is an object, the effect was launched if the result is the player or the player vehicle. If the result is an array, the effect was launched if the result contains the player or the player vehicle. Example: trigger setEffectCondition "thisList" Category: OFP

person setFace soldier

Operand types: person: Object soldier: String Type of returned value: Nothing Description: Sets the person's face. Example: setFace "Face10" Category: OFP

person setFaceanimation blink

Page 303 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 304: comref

Operand types: person: Object blink: Number Type of returned value: Nothing Description: Sets the facial animation phase (eye blinking). Blink is in the range from 0 to 1. Example: setFaceAnimation 0.5 Category: OFP

flag setFlagOwner owner

Operand types: flag: Object owner: Object Type of returned value: Nothing Description: Sets the flag owner. When the owner is set to objNull, the flag is returned to the flagpole. Example: setFlagOwner objNull Category: OFP

flag setFlagSide side

Operand types: flag: Object side: Side Type of returned value: Nothing Description: Sets the flag side. Example: setFlagSide east Category: OFP

flag setFlagTexture texture

Operand types: flag: Object texture: String

Page 304 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 305: comref

Type of returned value: Nothing Description: Sets the flag texture. If the texture is "", the flag is not drawn. Example: setFlagTexture "usa_vlajka.pac" Category: OFP

time setFog fog

Operand types: time: Number fog: Number Type of returned value: Nothing Description: Changes the fog value smoothly during the given time (in seconds). A time of zero means there will be an immediate change. A fog level of zero is minimum fog and a fog level of one is maximum fog. Example: 1800 setFog 0.5 Category: OFP

group setFormation formation

Operand types: group: Object or Group formation: String Type of returned value: Nothing Description: Sets the group formation. Formation is one of: "COLUMN", "STAG COLUMN", "WEDGE", "ECH LEFT", "ECH RIGHT", "VEE" or "LINE". Example: groupOne setFormation "LINE" Category: OFP

object setFormationTask task

Operand types: object: Object task: String

Page 305 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 306: comref

Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set the current task of the formation member. Category: OFP

group setFormDir heading

Operand types: group: Object or Group heading: Number Type of returned value: Nothing Description: Sets the formation heading. The accepted heading range is from 0 to 360. The formation is facing this direction unless an enemy is seen. When the group is moving, this value is overridden by the movement direction. Example: player setformdir 180 Category: OFP

side1 setFriend [side2, value]

Operand types: side1: Side [side2, value]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Sets how friendly side1 is with side2. For a value smaller than 0.6 it results in being enemy, otherwise it's friendly. Category: OFP

FSM handle setFSMVariable [name, value]

Operand types: FSM handle: Number [name, value]: Array Compatibility: Version 5501 required.

Page 306 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 307: comref

Type of returned value: Nothing Description: Set variable to given value in the variable space of given FSM. The FSM handle is the number returned by the execFSM command. Category: OFP

vehicle setFuel amount

Operand types: vehicle: Object amount: Number Type of returned value: Nothing Description: Sets the fuel amount. A fuel level of one is a full gas tank. Example: jeepOne setFuel 0 Category: OFP

vehicle setFuelCargo amount

Operand types: vehicle: Object amount: Number Type of returned value: Nothing Description: Sets the fuel amount in the cargo space of a refuelling vehicle. A fuel level of one is a full gas tank. Example: refuelTruckOne setFuelCargo 0 Category: OFP

group setGroupIcon properties

Operand types: group: Group properties: Array Compatibility: Version 5501 required. Type of returned value: Nothing

Page 307 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 308: comref

Description: Set group icons properties. Example: setGroupIcon[id,"b_inf",[offsetX,ofsetY]] Category: OFP

group setGroupIconParams properties

Operand types: group: Group properties: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Set group icons parameters. [color,string,float,bool] Example: group setGroupIconParams [[1,1,1,1],"text",scale,show] Category: OFP

setGroupIconsSelectable bool

Operand types: bool: Boolean Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets if group icons raises onclick and onover events. Example: selectableGroupIcons true Category: OFP

setGroupIconsVisible array

Operand types: array: Array Compatibility: Version 5501 required. Type of returned value:

Page 308 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 309: comref

Nothing Description: Sets if group icons are visible. Example: showGroupIcons [true,true] Category: OFP

group setGroupid [nameFomat, nameParam1, ...]

Operand types: group: Object or Group [nameFomat, nameParam1, ...]: Array Type of returned value: Nothing Description: Sets the group identity. nameFormat contains strings "%CLASS_NAME" where CLASS_NAME is name of class in CfgWorlds, parameters are names of subclasses of CLASS_NAME with the description of the name subpart. Category: OFP

object setHideBehind [objectWhereHide, hidePosition]

Operand types: object: Object [objectWhereHide, hidePosition]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: It sets the data for hiding. ObjectWhereHide can be taken using findCover. HidePosition can be taken using getHideFrom. Category: OFP

object setHit [part, damage]

Operand types: object: Object [part, damage]: Array Compatibility: Version 2.30 required. Type of returned value: Nothing Description:

Page 309 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 310: comref

Damage / repair part of object. Damage 0 means fully functional, damage 1 means completely destroyed / dead. Example: vehicle player setHit ["engine", 1] Category: OFP

person setIdentity identity

Operand types: person: Object identity: String Type of returned value: Nothing Description: Sets the identity of a person. Identities are defined in the descripion.ext file of the mission or campaign. Example: setIdentity "JohnDoe" Category: OFP

location setImportance importance

Operand types: location: Location importance: Number Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Set a new importance of given location. Category: Location

light setLightAmbient [r, g, b]

Operand types: light: Object [r, g, b]: Array Compatibility: Version 2.58 required. Type of returned value: Nothing Description:

Page 310 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 311: comref

Set ambient color of light. Category: OFP

light setLightBrightness brightness

Operand types: light: Object brightness: Number Compatibility: Version 2.58 required. Type of returned value: Nothing Description: Set brightness of light. Category: OFP

light setLightColor [r, g, b]

Operand types: light: Object [r, g, b]: Array Compatibility: Version 2.58 required. Type of returned value: Nothing Description: Set diffuse color of light. Category: OFP

marker setMarkerAlpha alpha

Operand types: marker: String alpha: Number Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets the marker alpha. The marker is modified on all computers in a network session. Example: "MarkerOne" setMarkerAlpha 0.5 Category: OFP

Page 311 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 312: comref

marker setMarkerAlphaLocal alpha

Operand types: marker: String alpha: Number Compatibility: Version 5501 required. Type of returned value: Nothing Description: Sets the marker alpha. The marker is only modified on the computer where the command is called. Example: "MarkerOne" setMarkerAlpha 0.5 Category: OFP

name setMarkerBrush brush

Operand types: name: String brush: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Selects the fill texture for the marker ("RECTANGLE" or "ELLIPSE"). Brush is the name of the subclass in CfgMarkerBrushes. The marker is modified on all computers in a network session. Example: "Marker1" setMarkerBrush "DiagGrid" Category: OFP

name setMarkerBrushLocal brush

Operand types: name: String brush: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Selects the fill texture for the marker ("RECTANGLE" or "ELLIPSE"). Brush is the name of the subclass in CfgMarkerBrushes. The marker is only modified on the computer where the command is called.

Page 312 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 313: comref

Example: "Marker1" setMarkerBrushLocal "DiagGrid" Category: OFP

marker setMarkerColor color

Operand types: marker: String color: String Compatibility: Version 1.21 required. Type of returned value: Nothing Description: Sets the marker color. Color is one of: "Default", "ColorBlack", "ColorRed", "ColorRedAlpha", "ColorGreen", "ColorGreenAlpha", "ColorBlue", "ColorYellow" or "ColorWhite". The marker is modified on all computers in a network session. Example: "MarkerOne" setMarkerColor "ColorBlack" Category: OFP

marker setMarkerColorLocal color

Operand types: marker: String color: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets the marker color. Color is one of: "Default", "ColorBlack", "ColorRed", "ColorRedAlpha", "ColorGreen", "ColorGreenAlpha", "ColorBlue", "ColorYellow" or "ColorWhite". The marker is only modified on the computer where the command is called. Example: "MarkerOne" setMarkerColorLocal "ColorBlack" Category: OFP

name setMarkerDir angle

Operand types: name: String angle: Number

Page 313 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 314: comref

Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Sets the orientation of the marker. Angle is in degrees. The marker is modified on all computers in a network session. Example: "Marker1" setMarkerDir 90 Category: OFP

name setMarkerDirLocal angle

Operand types: name: String angle: Number Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets the orientation of the marker. Angle is in degrees. The marker is only modified on the computer where the command is called. Example: "Marker1" setMarkerDirLocal 90 Category: OFP

markerName setMarkerPos pos

Operand types: markerName: String pos: Array Type of returned value: Nothing Description: Moves the marker. The format of pos is Position2D. The marker is modified on all computers in a network session. Example: "MarkerOne" setMarkerPos getMarkerPos "MarkerTwo" Category: OFP

markerName setMarkerPosLocal pos

Page 314 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 315: comref

Operand types: markerName: String pos: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Moves the marker. The format of pos is Position2D. The marker is only modified on the computer where the command is called. Example: "MarkerOne" setMarkerPosLocal getMarkerPos "MarkerTwo" Category: OFP

name setMarkerShape shape

Operand types: name: String shape: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Selects the shape (type) of the marker. Shape can be "ICON", "RECTANGLE" or "ELLIPSE". The marker is modified on all computers in a network session. Example: "Marker1" setMarkerShape "RECTANGLE" Category: OFP

name setMarkerShapeLocal shape

Operand types: name: String shape: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Selects the shape (type) of the marker. Shape can be "ICON", "RECTANGLE" or "ELLIPSE". The marker is only modified on the computer where the command is called. Example: "Marker1" setMarkerShapeLocal "RECTANGLE" Category: OFP

Page 315 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 316: comref

marker setMarkerSize size

Operand types: marker: String size: Array Compatibility: Version 1.21 required. Type of returned value: Nothing Description: Sets the marker size. Size is in format [a-axis, b-axis]. The marker is modified on all computers in a network session. Example: "MarkerOne" setMarkerSize [100, 200] Category: OFP

marker setMarkerSizeLocal size

Operand types: marker: String size: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets the marker size. Size is in format [a-axis, b-axis]. The marker is only modified on the computer where the command is called. Example: "MarkerOne" setMarkerSizeLocal [100, 200] Category: OFP

name setMarkerText text

Operand types: name: String text: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Sets the text label of an existing marker. The marker is modified on all computers in a network session.

Page 316 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 317: comref

Example: "Marker1" setMarkerText You are here. Category: OFP

name setMarkerTextLocal text

Operand types: name: String text: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets the text label of an existing marker. The marker is only modified on the computer where the command is called. Example: "Marker1" setMarkerTextLocal You are here. Category: OFP

markerName setMarkerType markerType

Operand types: markerName: String markerType: String Type of returned value: Nothing Description: Sets the marker type. Type may be any of: "Flag", "Flag1", "Dot", "Destroy", "Start", "End", "Warning", "Join", "Pickup", "Unknown", "Marker", "Arrow" or "Empty". The marker is modified on all computers in a network session. Example: "MarkerOne" setMarkerType "Arrow" Category: OFP

markerName setMarkerTypeLocal markerType

Operand types: markerName: String markerType: String Compatibility: Version 2.92 required. Type of returned value:

Page 317 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 318: comref

Nothing Description: Sets the marker type. Type may be any of: "Flag", "Flag1", "Dot", "Destroy", "Start", "End", "Warning", "Join", "Pickup", "Unknown", "Marker", "Arrow" or "Empty". The marker is only modified on the computer where the command is called. Example: "MarkerOne" setMarkerTypeLocal "Arrow" Category: OFP

person setMimic mimic

Operand types: person: Object mimic: String Type of returned value: Nothing Description: Sets a unit's mimic. The following values are recognized: "Default", "Normal", "Smile", "Hurt", "Ironic", "Sad", "Cynic", "Surprised", "Agresive" and "Angry". Example: setMimic "Angry" Category: OFP

setMousePosition [x, y]

Operand types: [x, y]: Array Compatibility: Version 2.91 required. Type of returned value: Nothing Description: Move (UI) mouse pointer to specified position of the screen. Example: setMousePosition [0.5, 0.5] Category: OFP

trigger or waypoint setMusicEffect track

Operand types: trigger or waypoint: Object or Array track: String

Page 318 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 319: comref

Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Defines the music track played on activation. Track is a subclass name of CfgMusic. "$NONE$" (no change) or "$STOP$" (stops the current music track). Example: trigger setMusicEffect "Track1" Category: OFP

location setName name

Operand types: location: Location name: String Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Set which global variable will contain given location. Category: Location

map setObjectArguments [object, [name1, value1, ...]]

Operand types: map: Control [object, [name1, value1, ...]]: Array Compatibility: Version 2.92 required. Type of returned value: Any Description: Set object arguments in mission editor. Category: Editor

map setObjectProxy [object, proxy object]

Operand types: map: Control [object, proxy object]: Array Compatibility: Version 2.92 required.

Page 319 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 320: comref

Type of returned value: Any Description: Set the proxy object associated with the given editor object. Category: Editor

object setObjectTexture texture

Operand types: object: Object texture: Array Compatibility: Version 1.75 required. Type of returned value: Nothing Category: Resistance

time setOvercast overcast

Operand types: time: Number overcast: Number Type of returned value: Nothing Description: Changes the overcast level to the given value smoothly during the given time (in seconds). A time of zero means an immediate change. An overcast level of zero means clear (sunny) weather and with an overcast level of one, storms and showers are very likely. Example: 1800 setOvercast 0.5 Category: OFP

particleSource setParticleCircle [radius, velocity]

Operand types: particleSource: Object [radius, velocity]: Array Compatibility: Version 2.56 required. Type of returned value: Nothing Description: Update particle source to create particles on circle with given radius. Velocity is transformed and

Page 320 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 321: comref

added to total velocity. Category: OFP

particleSource setParticleParams array

Operand types: particleSource: Object array: Array Compatibility: Version 2.56 required. Type of returned value: Nothing Description: Set parameters to particle source. Array is in format ParticleArray. Category: OFP

particleSource setParticleRandom [lifeTime, position, moveVelocity, rotationVelocity, size, color, randomDirectionPeriod, randomDirectionIntensity, {angle}]

Operand types: particleSource: Object [lifeTime, position, moveVelocity, rotationVelocity, size, color, randomDirectionPeriod, randomDirectionIntensity, {angle}]: Array Compatibility: Version 2.56 required. Type of returned value: Nothing Description: Set randomization of particle source parameters. Category: OFP

setPlayable unit

Operand types: unit: Object Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Create MP role for the unit. Example: setPlayable aP

Page 321 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 322: comref

Category: OFP

obj setPos pos

Operand types: obj: Object pos: Array Type of returned value: Nothing Description: Sets the object position. The pos array uses the Position format. Example: player setPos [getpos player select 0, getpos player select 1 + 10] Category: OFP

obj setPosASL pos

Operand types: obj: Object pos: Array Compatibility: Version 2.53 required. Type of returned value: Nothing Description: Sets the object position. The pos array uses the PositionASL format. Example: player setPosASL [getposASL player select 0, getposASL player select 1 + 10, getPosASL select 2] Category: OFP

obj setPosASL2 pos

Operand types: obj: Object pos: Array Compatibility: Version 2.53 required. Type of returned value: Nothing Description: Sets the object position. The pos array uses the PositionASL format. The version of the command does not offset based on object center. Example:

Page 322 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 323: comref

player setPosASL [getposASL player select 0, getposASL player select 1 + 10, getPosASL select 2] Category: OFP

location setPosition position

Operand types: location: Location position: Array Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Set a new position of given location. Category: Location

index setRadioMsg text

Operand types: index: Number text: String Type of returned value: Nothing Description: Sets the radio message (0, 0, map radio) to the given text. Use "NULL" to disable the radio slot. Example: 0 setRadioMsg "Alpha Radio" Category: OFP

time setRain rainDensity

Operand types: time: Number rainDensity: Number Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Changes the rain density smoothly during the given time (in seconds). A time of zero means an immediate change. A rain level of zero is no rain and a rain level of one is maximum rain. Rain is not possible when overcast is smaller than 0.7. Example:

Page 323 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 324: comref

60 setRain 1 Category: OFP

unit setRank rank

Operand types: unit: Object rank: String Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets rank of given unit. Possible values: PRIVATE, CORPORAL, SERGEANT, LIEUTENANT, CAPTAIN, MAJOR or COLONEL. Example: player setRank "COLONEL" Category: OFP

location setRectangular rectangular

Operand types: location: Location rectangular: Boolean Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Set if given location has rectangular shape. Category: Location

vehicle setRepairCargo amount

Operand types: vehicle: Object amount: Number Type of returned value: Nothing Description: Sets the amount or repair resources in the cargo space of a repair vehicle. An amount of one is a full cargo space. Example:

Page 324 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 325: comref

repairTruckOne setRepairCargo 0 Category: OFP

location setSide side

Operand types: location: Location side: Side Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Set a new target side of given location. Category: Location

task setSimpleTaskDescription [description, descriptionShort, descriptionHUD]

Operand types: task: Task [description, descriptionShort, descriptionHUD]: Array Compatibility: Version 5500 required. Type of returned value: Nothing Description: Attach descriptions to the simple task. Category: Identity

task setSimpleTaskDestination position

Operand types: task: Task position: Array Compatibility: Version 5500 required. Type of returned value: Nothing Description: Attach a destination to the simple task. Category: Identity

Page 325 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 326: comref

location setSize [sizeX, sizeZ]

Operand types: location: Location [sizeX, sizeZ]: Array Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Set a new size (width, height) of given location. Category: Location

vehicle setSkill skill

Operand types: vehicle: Object skill: Number Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Sets ability levell of person (commander unit). Value of skill may vary from 0 to 1. Example: hero setSkill 1 Category: Resistance

vehicle setSkill [type, skill]

Operand types: vehicle: Object [type, skill]: Array Compatibility: Version 2.65 required. Type of returned value: Nothing Description: Sets skill of given type of person (commander unit). Value of skill may vary from 0 to 1. Example: hero setSkill ["Endurance", 1] Category: OFP PC

Page 326 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 327: comref

trigger or waypoint setSoundEffect [sound, voice, soundEnv, soundDet]

Operand types: trigger or waypoint: Object or Array [sound, voice, soundEnv, soundDet]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Defines the different sound effects. Sound / voice plays a 2D / 3D sound from CfgSounds. SoundEnv plays an enviromental sound from CfgEnvSounds. SoundDet (only for triggers) creates a dynamic sound object attached to a trigger defined in CfgSFX. Example: trigger setSoundEffect ["Alarm", "", "", ""] Category: OFP

group setSpeedMode mode

Operand types: group: Object or Group mode: String Type of returned value: Nothing Description: Sets the group speed mode. Mode may be one of: "LIMITED" (half speed), "NORMAL" (full speed, maintain formation) or "FULL" (do not wait for any other units in the formation). Example: groupOne setSpeedMode "LIMITED" Category: OFP

object setTargetAge age

Operand types: object: Object age: String Compatibility: Version 2.32 required. Type of returned value: Nothing Description: Sets how the target is known to the other centers. They behave like the target was seen age seconds ago. Possible age values are: "ACTUAL", "5 MIN", "10 MIN", "15 MIN", "30 MIN", "60 MIN", "120 MIN" or "UNKNOWN". Example: player setTargetAge "10 MIN"

Page 327 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 328: comref

Category: OFP

task setTaskResult [state, result]

Operand types: task: Task [state, result]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set a result of the task. Category: Identity

task setTaskState state

Operand types: task: Task state: String Compatibility: Version 2.89 required. Type of returned value: Nothing Description: Set a new state of the task. Category: Identity

setTerrainGrid grid

Operand types: grid: Number Compatibility: Version 1.75 required. Type of returned value: Nothing Description: Sets the desired terrain resolution (in meters). For default landscapes the supported resolutions are: 50, 25, 12.5, 6.25 and 3.125. If you select an unsupported resolution, the nearest supported resolution is used instead. Example: setTerrainGrid 12.5 Category: OFP

Page 328 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 329: comref

location setText text

Operand types: location: Location text: String Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Set a new text attached to given location. Category: Location

trigger or waypoint setTitleEffect [type, effect, text]

Operand types: trigger or waypoint: Object or Array [type, effect, text]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Defines the title effect. Type can be "NONE", "OBJECT", "RES" or "TEXT". For "TEXT", the effect defines a subtype: "PLAIN", "PLAIN DOWN", "BLACK", "BLACK FADED", "BLACK OUT", "BLACK IN", "WHITE OUT" or "WHITE IN". Text is shown as text itself. For "OBJECT", text defines the shown object, a subclass of CfgTitles. For "RES", text defines a resource class, a subclass of RscTitles. Example: trigger setTitleEffect ["TEXT", "PLAIN DOWN", "Hello world."] Category: OFP

trigger setTriggerActivation [by, type, repeating]

Operand types: trigger: Object [by, type, repeating]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Defines the trigger activation type. The first argument - who activates trigger (side, radio, vehicle or group member): "NONE", "EAST", "WEST", "GUER", "CIV", "LOGIC", "ANY", "ALPHA", "BRAVO", "CHARLIE", "DELTA", "ECHO", "FOXTROT", "GOLF", "HOTEL", "INDIA", "JULIET", "STATIC", "VEHICLE", "GROUP", "LEADER" or "MEMBER". The second argument -

Page 329 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 330: comref

when is it activated (presention or detection by the specified side): "PRESENT", "NOT PRESENT", "WEST D", "EAST D", "GUER D" or "CIV D". The third argument - whether the activation is repeating. Example: trigger setTriggerActivation ["WEST", "EAST D", true] Category: OFP

trigger setTriggerArea [a, b, angle, rectangle]

Operand types: trigger: Object [a, b, angle, rectangle]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Defines the area controlled by the trigger. The area is rectangular or elliptic, the width is 2 * a, the height is 2 * b. It is rotated angle degrees. Example: trigger setTriggerArea [100, 50, 45, false] Category: OFP

trigger setTriggerStatements [cond, activ, desactiv]

Operand types: trigger: Object [cond, activ, desactiv]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: The first argument can modify the condition of when the trigger is activated. The result of the activation defined by trigger activation is in variable this. Variable thisList contains all vehicles which caused the activation. Activ and desactiv expressions are launched upon trigger activation / deactivation. Example: trigger setTriggerStatements ["this", "ok = true", "ok = false"] Category: OFP

trigger setTriggerText text

Page 330 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 331: comref

Operand types: trigger: Object text: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Sets the text label attached to the trigger object. This is used for example as a radio slot label for radio activated triggers. Example: trigger setTriggerText "Call for support" Category: OFP

trigger setTriggerTimeout [min, mid, max, interruptable]

Operand types: trigger: Object [min, mid, max, interruptable]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Defines the time between condition satisfaction and trigger activation (randomly from min to max, with an average value mid). If the last argument is true, the condition must be fullfilled all the time. Example: trigger setTriggerTimeout [5, 10, 7, false] Category: OFP

trigger setTriggerType action

Operand types: trigger: Object action: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Sets the type of action processed by the trigger after activation (no action, a waypoints switch or an end of mission): "NONE", "SWITCH", "END1", "END2", "END3", "END4", "END5", "END6", "LOOSE" or "WIN". Example: trigger setTriggerType "END1"

Page 331 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 332: comref

Category: OFP

location setType type

Operand types: location: Location type: String Compatibility: Version 2.90 required. Type of returned value: Nothing Description: Set a new type of given location. Category: Location

unit setUnconscious set

Operand types: unit: Object set: Boolean Compatibility: Version 5501 required. Type of returned value: Nothing Description: Set / reset the unconscious life state of the given unit (in MP works only for a local unit). Category: OFP

unit setUnitAbility skill

Operand types: unit: Object skill: Number Compatibility: Version 2.33 required. Type of returned value: Nothing Description: Sets skill of given unit. Skill may vary from 0.2 to 1.0. Example: player setUnitSkill 1.0 Category: OFP

Page 332 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 333: comref

unit setUnitPos mode

Operand types: unit: Object mode: String Type of returned value: Nothing Description: Sets the unit position rules. Mode may be one of: "DOWN", "UP" or "AUTO". Example: soldierOne setUnitPos "Down" Category: OFP

unit setUnitPosWeak mode

Operand types: unit: Object mode: String Compatibility: Version 5117 required. Type of returned value: Nothing Description: Equal to setUnitPos, for usage in formation FSM (to avoid collision with setUnitPos used by the mission). Example: soldierOne setUnitPosWeak "Down" Category: OFP

unit setUnitRank rank

Operand types: unit: Object rank: String Compatibility: Version 2.33 required. Type of returned value: Nothing Description: Sets rank of given unit. Possible values: PRIVATE, CORPORAL, SERGEANT, LIEUTENANT, CAPTAIN, MAJOR or COLONEL. Example: player setUnitRank "COLONEL" Category: OFP

Page 333 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 334: comref

namespace setVariable [name, value]

Operand types: namespace: Namespace [name, value]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Set variable to given value in the given namespace. Category: Default

group setVariable [name, value]

Operand types: group: Group [name, value]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Set variable to given value in the variable space of given group. If public is true then the value is broadcast to all computers. Category: OFP

object setVariable [name, value, public]

Operand types: object: Object [name, value, public]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set variable to given value in the variable space of given object. If public is true then the value is broadcast to all computers. Category: OFP

map setVariable [name, value]

Page 334 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 335: comref

Operand types: map: Control [name, value]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set variable to given value in the variable space of given map. Category: Editor

task setVariable [name, value]

Operand types: task: Task [name, value]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set variable to given value in the variable space of given task. Category: Identity

location setVariable [name, value]

Operand types: location: Location [name, value]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Set variable to given value in the variable space of given location. Category: Location

object setVectorDir [x, z, y]

Operand types: object: Object [x, z, y]: Array Compatibility: Version 2.61 required. Type of returned value:

Page 335 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 336: comref

Nothing Description: Set object's direction vector. Up vector will remain unchanged. Category: OFP

object setVectorDirAndUp [[x, z, y],[x, y, z]]

Operand types: object: Object [[x, z, y],[x, y, z]]: Array Compatibility: Version 5164 required. Type of returned value: Nothing Description: Set object's direction and up vector Category: OFP

object setVectorUp [x, z, y]

Operand types: object: Object [x, z, y]: Array Compatibility: Version 2.61 required. Type of returned value: Nothing Description: Set object's up vector. Direction vector will remain unchanged. Category: OFP

object setVehicleAmmo value

Operand types: object: Object value: Number Compatibility: Version 2.32 required. Type of returned value: Nothing Description: Sets how much ammunition (compared to the current configuration of magazines, but fully loaded) the vehicle has. The value ranges from 0 to 1. Example:

Page 336 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 337: comref

player setVehicleAmmo 0 Category: OFP

object setVehicleArmor value

Operand types: object: Object value: Number Compatibility: Version 2.32 required. Type of returned value: Nothing Description: Sets the armor (or health for men) state of the vehicle (a value from 0 to 1). Example: player setVehicleArmor 0.5 Category: OFP

object setVehicleId id

Operand types: object: Object id: Number Compatibility: Version 2.33 required. Type of returned value: Nothing Description: Sets id (integer value) to vehicle. By this id vehicle is referenced by triggers and waypoints. Example: player setVehicleId 1 Category: OFP

vehicle setVehicleInit statement

Operand types: vehicle: Object statement: String Compatibility: Version 2.33 required. Type of returned value: Nothing Description:

Page 337 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 338: comref

Execute statement attached to vehicle. This statement is also propagated over network in MP games. Example: soldier3 setVehicleInit "this allowfleeing 0" Category: OFP

vehicle setVehicleLock state

Operand types: vehicle: Object state: String Compatibility: Version 2.33 required. Type of returned value: Nothing Description: Set how vehicle is locked for player. Possible values: UNLOCKED, DEFAULT or LOCKED. Example: veh1 setVehicleLock "LOCKED" Category: OFP

object setVehiclePosition [position, markers, placement]

Operand types: object: Object [position, markers, placement]: Array Compatibility: Version 2.32 required. Type of returned value: Nothing Description: Changes the object position. If the markers array contains more than one marker names, the position of a random one is used. Otherwise, the given position is used. The object is placed inside a circle with this position as its center and placement as its radius. Example: player setVehiclePosition [[0, 0, 0], ["Marker1"], 0] Category: OFP

object setVehicleVarName name

Operand types: object: Object

Page 338 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 339: comref

name: String Compatibility: Version 2.32 required. Type of returned value: Nothing Description: Sets the name of the variable which contains a reference to this object. It is necessary in MP to change the variable content after a respawn. Example: player setVehicleVarName "aP" Category: OFP

vehicle setVelocity [x, z, y]

Operand types: vehicle: Object [x, z, y]: Array Compatibility: Version 1.80 required. Type of returned value: Nothing Description: Sets the velocity (speed vector) of a vehicle. Category: OFP

setViewDistance distance

Operand types: distance: Number Type of returned value: Nothing Description: Sets the rendering distance. Default is 900 meters. The accepted range is from 500 to 5000 meters. Example: setviewdistance 2000 Category: OFP

map setVisibleIfTreeCollapsed [object, visible if tree collapsed]

Operand types: map: Control [object, visible if tree collapsed]: Array Compatibility:

Page 339 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 340: comref

Version 2.92 required. Type of returned value: Nothing Description: Sets whether or not the object is visible even if the tree is collapsed. Category: Editor

waypoint setWaypointBehaviour mode

Operand types: waypoint: Array mode: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Switches the unit behaviour when the waypoint becomes active. Possible values are: "UNCHANGED", "CARELESS", "SAFE", "AWARE", "COMBAT" and "STEALTH". Example: [grp, 2] setWaypointBehaviour "AWARE" Category: OFP

waypoint setWaypointCombatMode mode

Operand types: waypoint: Array mode: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: The group combat mode is switched when the waypoint becomes active. Possible values are: "NO CHANGE", "BLUE", "GREEN", "WHITE", "YELLOW" and "RED". Example: [grp, 2] setWaypointCombatMode "RED" Category: OFP

waypoint setWaypointCompletionRadius radius

Operand types: waypoint: Array

Page 340 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 341: comref

radius: Number Compatibility: Version 5500 required. Type of returned value: Nothing Description: Set the radius around the waypoint where is the waypoint completed. Example: [grp, 2] setWaypointCompletionRadius 30 Category: OFP

waypoint setWaypointDescription text

Operand types: waypoint: Array text: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Sets the description shown in the HUD while the waypoint is active. Example: [grp, 2] setWaypointDescription "Move here." Category: OFP

waypoint setWaypointFormation formation

Operand types: waypoint: Array formation: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Switches the group formation when the waypoint becomes active. Possible values are: "NO CHANGE", "COLUMN", "STAG COLUMN", "WEDGE", "ECH LEFT", "ECH RIGHT", "VEE" and "LINE". Example: [grp, 2] setWaypointFormation "LINE" Category: OFP

Page 341 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 342: comref

waypoint setWaypointHousePosition pos

Operand types: waypoint: Array pos: Number Compatibility: Version 1.86 required. Type of returned value: Nothing Description: For waypoints attached to a house, this defines the target house position. Example: [grp, 2] setWaypointHousePosition 1 Category: OFP

waypoint setWaypointPosition [center, radius]

Operand types: waypoint: Array [center, radius]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Moves the waypoint to a random position in a circle with the given center and radius. Example: [grp, 2] setWaypointPosition [position player, 0] Category: OFP

waypoint setWaypointScript command

Operand types: waypoint: Array command: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Attaches a script to a scripted waypoint. Command consist of a script name and additional script arguments. Example: [grp, 2] setWaypointScript "find.sqs player" Category: OFP

Page 342 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 343: comref

waypoint setWaypointSpeed mode

Operand types: waypoint: Array mode: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Switches the group speed mode when the waypoint becomes active. Possible values are: "UNCHANGED", "LIMITED", "NORMAL" and "FULL". Example: [grp, 2] setWaypointSpeed "FULL" Category: OFP

waypoint setWaypointStatements [condition, statement]

Operand types: waypoint: Array [condition, statement]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: The waypoint is done only when the condition is fulfilled. When the waypoint is done, the statement expression is executed. Example: [grp, 2] setWaypointStatements ["true", ""] Category: OFP

waypoint setWaypointTimeout [min, mid, max]

Operand types: waypoint: Array [min, mid, max]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Defines the time between condition satisfaction and waypoint finish (randomly from min to max, with an average value mid).

Page 343 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 344: comref

Example: [grp, 2] setWaypointTimeout [5, 10, 6] Category: OFP

waypoint setWaypointType type

Operand types: waypoint: Array type: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Changes the waypoint type. Type can be: "MOVE", "DESTROY", "GETIN", "SAD", "JOIN", "LEADER", "GETOUT", "CYCLE", "LOAD", "UNLOAD", "TR UNLOAD", "HOLD", "SENTRY", "GUARD", "TALK", "SCRIPTED", "SUPPORT", "GETIN NEAREST", "AND" or "OR". Example: [grp, 2] setWaypointType "HOLD" Category: OFP

setWind [x, z, forced]

Operand types: [x, z, forced]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Set current (forced == false) or permanent (forced == true) wind direction and force. Category: OFP

wapoint setWPPos position

Operand types: wapoint: Array position: Array Compatibility: Version 1.21 required. Type of returned value: Nothing Description: Sets the waypoint position. Waypoint uses format Waypoint. Position uses format Position2D.

Page 344 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 345: comref

Example: [groupOne, 1] setWPPos getMarkerPos "MarkerOne" Category: OFP

map show3DIcons bool

Operand types: map: Control bool: Boolean Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Toggle the drawing of 3D icons. Category: Editor

showCinemaBorder show

Operand types: show: Boolean Type of returned value: Nothing Description: Forces drawing of the cinema borders. This is normally used in cutscenes to indicate the player has no control. Category: OFP

showCommandingMenu class name

Operand types: class name: String Compatibility: Version 5500 required. Type of returned value: Nothing Description: Create the commanding menu described by the given config class. When class name is empty, current commanding menu is hidden. Category: OFP

Page 345 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 346: comref

showCompass show

Operand types: show: Boolean Type of returned value: Nothing Description: Enables the compass (the default is true). Category: OFP

showGps show

Operand types: show: Boolean Type of returned value: Nothing Description: Enables the GPS receiver (the default is false). Category: OFP

showHUD enable

Operand types: enable: Boolean Compatibility: Version 5501 required. Type of returned value: Nothing Description: Enable / disable showing of HUD. Category: OFP

map showLegend bool

Operand types: map: Control bool: Boolean Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Show/hide map legend. Category: Editor

Page 346 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 347: comref

showMap show

Operand types: show: Boolean Type of returned value: Nothing Description: Enables the map (the default is true). Example: showMap true Category: OFP

shownCompass

Type of returned value: Boolean Description: Checks whether the player has the compass enabled. Category: OFP

map showNewEditorObject [type, class, side, position]

Operand types: map: Control [type, class, side, position]: Array Compatibility: Version 2.92 required. Type of returned value: Any Description: Show the add editor object dialog, type is editor object type, class is class definition to automatically select, side filters by a certain side, pos is position to create the object. Category: Editor

shownGps

Type of returned value: Boolean Description: Checks whether the player has the GPS receiver enabled. Category: OFP

Page 347 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 348: comref

shownMap

Type of returned value: Boolean Description: Checks whether the player has the map enabled. Category: OFP

shownPad

Type of returned value: Boolean Description: Checks whether the player has the notebook enabled. Category: OFP

shownRadio

Type of returned value: Boolean Description: Checks whether the player has the radio transmitter enabled. Category: OFP

shownWarrant

Type of returned value: Boolean Description: Checks whether the player has the ID card enabled. (Obsolete). Category: OFP

shownWatch

Type of returned value: Boolean Description: Checks whether the player has the watch enabled. Category: OFP

Page 348 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 349: comref

showPad show

Operand types: show: Boolean Type of returned value: Nothing Description: Enables the notepad (the default is true). Category: OFP

showRadio show

Operand types: show: Boolean Type of returned value: Nothing Description: Enables the radio (the default is false). Category: OFP

showSubtitles enable

Operand types: enable: Boolean Compatibility: Version 5501 required. Type of returned value: Boolean Description: Enable / disable showing of subtitles. Return the previous state. Category: OFP

showWarrant show

Operand types: show: Boolean Type of returned value: Nothing Description: Obsolete. Enables the ID card (the default is false). Category: OFP

Page 349 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 350: comref

showWatch show

Operand types: show: Boolean Type of returned value: Nothing Description: Enables the watch (the default is true). Category: OFP

waypoint showWaypoint show

Operand types: waypoint: Array show: String Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Sets the condition determining when the waypoint is shown. Possible values are: "NEVER", "EASY" and "ALWAYS". Example: [grp, 2] showWaypoint "ALWAYS" Category: OFP

side location

Operand types: location: Location Compatibility: Version 2.90 required. Type of returned value: Side Description: Return target side of given location. Category: Location

side unit

Operand types: unit: Object

Page 350 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 351: comref

Type of returned value: Side Description: Returns the side of the unit. Example: side player == west Category: OFP

side group

Operand types: group: Group Compatibility: Version 5501 required. Type of returned value: Side Description: Returns the side of the group. Example: side group player == west Category: OFP

unit sideChat chatText

Operand types: unit: Object or Array chatText: String Type of returned value: Nothing Description: Types text to the side radio channel. Note: this function only types text to the list, it does not broadcast the message. If you want the message to show on all computers, you have to execute it on all of them. Example: soldierOne sideChat "Show this text" Category: OFP

sideEnemy

Compatibility: Version 1.78 required. Type of returned value:

Page 351 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 352: comref

Side Description: The Enemy side (used for renegades). Category: OFP

sideFriendly

Compatibility: Version 1.78 required. Type of returned value: Side Description: The Friendly side (used for captives). Category: OFP

sideLogic

Compatibility: Version 1.86 required. Type of returned value: Side Description: The Logic side. Category: OFP

unit sideRadio radioName

Operand types: unit: Object or Array radioName: String Type of returned value: Nothing Description: Sends the message to the side radio channel. The message is defined in the description.ext file or radio protocol. Example: soldierOne sideRadio "messageOne" Category: OFP

sideUnknown

Page 352 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 353: comref

Compatibility: Version 5501 required. Type of returned value: Side Description: The unknown side. Category: OFP

simpleTasks person

Operand types: person: Object Compatibility: Version 5501 required. Type of returned value: Array Description: Return all simple tasks assigned to given person. Category: Identity

simulationEnabled entity

Operand types: entity: Object Compatibility: Version 5500 required. Type of returned value: Boolean Description: Check if the entity has enabled simulation. Category: OFP

sin x

Operand types: x: Number Type of returned value: Number Description: The sine of x, the argument is in degrees. Example: sin 30 , result is 0.5 Category: Default

Page 353 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 354: comref

size location

Operand types: location: Location Compatibility: Version 2.90 required. Type of returned value: Array Description: Return size of given location (width, height). Category: Location

sizeOf typeName

Operand types: typeName: String Compatibility: Version 5160 required. Type of returned value: Number Description: Return the size of the entity of given type. Category: OFP

skill person

Operand types: person: Object Compatibility: Version 1.75 required. Type of returned value: Number Description: Returns the current level of ability of the person. Example: skill player Category: Resistance

vehicle skill type

Operand types: vehicle: Object

Page 354 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 355: comref

type: String Compatibility: Version 2.65 required. Type of returned value: Number Description: Returns skill of given type of person (commander unit). Value of skill may vary from 0 to 1. Example: hero skill "Endurance" Category: OFP PC

skipTime duration

Operand types: duration: Number Type of returned value: Nothing Description: Skips the specified time. Daytime is adjusted, a weather change is estimated and no changes to any units are done. Duration is in hours. Example: skipTime 2.5 Category: OFP

sleep delay

Operand types: delay: Number Compatibility: Version 2.60 required. Type of returned value: Nothing Description: Suspend execution of script for given time. Example: sleep 0.5 Category: OFP

sliderPosition idc

Operand types: idc: Number

Page 355 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 356: comref

Compatibility: Version 1.79 required. Type of returned value: Number Description: Returns the current thumb position of the slider with id idc of the topmost user dialog. Example: _pos = sliderPosition 101 Category: Resistance

sliderPosition control

Operand types: control: Control Compatibility: Version 2.92 required. Type of returned value: Number Description: Returns the current thumb position of the given slider. Example: _pos = sliderPosition _control Category: OFP PC

sliderRange idc

Operand types: idc: Number Compatibility: Version 1.79 required. Type of returned value: Array Description: Returns the limits (as an array [min, max]) of the slider with id idc of the topmost user dialog. Example: _limits = sliderRange 100 Category: Resistance

sliderRange control

Operand types: control: Control

Page 356 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 357: comref

Compatibility: Version 2.92 required. Type of returned value: Array Description: Returns the limits (as an array [min, max]) of the given slider. Example: _limits = sliderRange _control Category: OFP PC

sliderSetPosition [idc, pos]

Operand types: [idc, pos]: Array Compatibility: Version 1.79 required. Type of returned value: Nothing Description: Sets the current thumb position of the slider with id idc of the topmost user dialog. Example: sliderSetPosition [100, 0] Category: Resistance

control sliderSetPosition pos

Operand types: control: Control pos: Number Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets the current thumb position of the given slider. Example: _control sliderSetPosition 0 Category: OFP PC

sliderSetRange [idc, min, max]

Operand types:

Page 357 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 358: comref

[idc, min, max]: Array Compatibility: Version 1.79 required. Type of returned value: Nothing Description: Sets the limits of the slider with id idc of the topmost user dialog. Example: sliderSetRange [100, 0, 10] Category: Resistance

control sliderSetRange [min, max]

Operand types: control: Control [min, max]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets the limits of the slider with id idc of the given slider. Example: _control sliderSetRange [0, 10] Category: OFP PC

sliderSetSpeed [idc, line, page]

Operand types: [idc, line, page]: Array Compatibility: Version 1.79 required. Type of returned value: Nothing Description: Sets the speed (a click on the arrow results in a move per line. A click on the scale outside the thumb results in a move per page) of the slider with id idc of the topmost user dialog. Example: sliderSetSpeed [100, 0.5, 2.0] Category: Resistance

control sliderSetSpeed [line, page]

Page 358 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 359: comref

Operand types: control: Control [line, page]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets the speed (a click on the arrow results in a move per line. A click on the scale outside the thumb results in a move per page) of the given slider. Example: _control sliderSetSpeed [0.5, 2.0] Category: OFP PC

sliderSpeed idc

Operand types: idc: Number Compatibility: Version 1.79 required. Type of returned value: Array Description: Returns the speed (as an array [line, page]) of the slider with id idc of the topmost user dialog. Example: _speed = sliderSpeed Category: Resistance

sliderSpeed control

Operand types: control: Control Compatibility: Version 2.92 required. Type of returned value: Array Description: Returns the speed (as an array [line, page]) of the given slider. Example: _speed = sliderSpeed _control Category: OFP PC

someAmmo unit

Page 359 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 360: comref

Operand types: unit: Object Type of returned value: Boolean Description: Checks whether the unit has some ammo remaining. Example: someAmmo vehicle player Category: OFP

soundVolume

Type of returned value: Number Description: Checks the current sound volume (set by setSoundVolume). Category: OFP

arguments spawn script

Operand types: arguments: Any script: Code Compatibility: Version 2.50 required. Type of returned value: Script Description: Executes a script. Argument is passed to the script as local variable _this. Category: OFP

speed obj

Operand types: obj: Object Type of returned value: Number Description: Returns the object speed (in km/h). Example: speed player Category: OFP

Page 360 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 361: comref

speedMode grp

Operand types: grp: Object or Group Type of returned value: String Description: Returns the speed mode of the group ("LIMITED", "NORMAL" or "FULL"). Example: speedMode group player Category: OFP

sqrt x

Operand types: x: Number Type of returned value: Number Description: The square root of x. Example: sqrt 9 , result is 3 Category: Default

startLoadingScreen [text] or [text, resource]

Operand types: [text] or [text, resource]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Shows loading screen with the given text, using the given resource. When loading screen is shown, simulation and scene drawing is disabled, scripts run at full speed. Category: OFP

for /.../ step step

Operand types: for /.../: for type

Page 361 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 362: comref

step: Number Type of returned value: for type Description: Optionaly can set step. If you want to count down, step must be specified, and set negative. Default value is 1. Example: for "_x" from 20 to 10 step -2 do {..code..} Category: Default

unit stop stop

Operand types: unit: Object stop: Boolean Type of returned value: Nothing Description: Stops an AI unit. This function is obsolete. Use disableAI to get better control over stopping a unit. Example: soldierOne stop true Category: OFP

stopped unit

Operand types: unit: Object Type of returned value: Boolean Description: Checks whether the unit is stopped using the "stop" command. Example: stopped jeepOne Category: OFP

str any value

Operand types: any value: Any Compatibility: Version 2.00 required. Type of returned value:

Page 362 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 363: comref

String Description: Converts any variable to a string. Example: str(2+3) , result is "5" Category: Default

supportInfo mask

Operand types: mask: String Compatibility: Version 2.00 required. Type of returned value: Array Description: Creates list of supported operators and type. Each field of array has format: "x:name" where x is 't' - type, 'n' - nullary operator, 'u' - unary operator, 'b' - binary operator. 'name' is operator's/type's name (in case operator, type of input operands is included). `mask` parameter can be empty string, or one of field. In this case, function returns empty array, if operator is not included in list. `mask` can contain wildcards, for example: *:name, t:*, t:name* or *:*. Example: supportInfo "b:select*" , result is ["b:ARRAY select SCALAR","b:ARRAY select BOOL"] Category: Default

surfaceIsWater [x, y]

Operand types: [x, y]: Array Compatibility: Version 2.58 required. Type of returned value: Boolean Description: Returns whether water is on given position. Category: OFP

surfaceType [x, y]

Operand types: [x, y]: Array Compatibility: Version 2.58 required.

Page 363 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 364: comref

Type of returned value: String Description: Returns what surface is on given position. Category: OFP

switch exp

Operand types: exp: Any Type of returned value: Switch Type Description: Begins switch form Example: switch (_a) do { case 1: {block}; case 2 : {block}; default {block};} Category: Default

switchableUnits

Compatibility: Version 2.92 required. Type of returned value: Array Description: Return a list of units accessible through team switch. Category: OFP

soldier switchAction action

Operand types: soldier: Object action: String Compatibility: Version 5500 required. Type of returned value: Nothing Description: When used on a person, the given action is started immediately (there is no transition). Use switchmove "" to switch back to the default movement if there is no transition back, otherwise the person may be stuck. Example: soldierOne switchAction "SitDown"

Page 364 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 365: comref

Category: OFP

unit switchCamera mode

Operand types: unit: Object mode: String Type of returned value: Nothing Description: Switches the camera to the given vehicle / camera. Mode is one of: "INTERNAL" (1st person), "GUNNER" (optics / sights), "EXTERNAL" (3rd person) or "GROUP" (group). Example: sniperOne switchCamera "gunner" Category: OFP

soldier switchGesture moveName

Operand types: soldier: Object moveName: String Compatibility: Version 5500 required. Type of returned value: Nothing Description: When used on a person, the given move is started immediately (there is no transition). Example: soldierOne switchGesture "Wave" Category: OFP

lamppost switchLight mode

Operand types: lamppost: Object mode: String Type of returned value: Nothing Description: Controls the lamppost mode. Mode may be "ON", "OFF" and "AUTO". "AUTO" is default and means the lampost is only on during nighttime. Example:

Page 365 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 366: comref

nearestObject [player, "StreetLamp"] switchLight "Off" Category: OFP

soldier switchMove moveName

Operand types: soldier: Object moveName: String Type of returned value: Nothing Description: When used on a person, the given move is started immediately (there is no transition). Use switchmove "" to switch back to the default movement if there is no transition back, otherwise the person may be stuck. Example: soldierOne switchMove "FXStandDip" Category: OFP

synchronizedObjects unit

Operand types: unit: Object Compatibility: Version 5501 required. Type of returned value: Array Description: Return the list of objects synchronized with the given unit. Category: OFP

unit synchronizeObjectsAdd [objects]

Operand types: unit: Object [objects]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Add given objects to the unit's list of synchronized objects. Category: OFP

Page 366 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 367: comref

unit synchronizeObjectsRemove [objects]

Operand types: unit: Object [objects]: Array Compatibility: Version 5501 required. Type of returned value: Nothing Description: Remove given objects from the unit's list of synchronized objects. Category: OFP

trigger synchronizeTrigger [waypoint1, waypoint2, ...]

Operand types: trigger: Object [waypoint1, waypoint2, ...]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Synchronizes the trigger with waypoints. Each waypoint is given as an array [group, index]. Example: trigger synchronizeWaypoint [] Category: OFP

waypoint synchronizeWaypoint [waypoint1, waypoint2, ...]

Operand types: waypoint: Array [waypoint1, waypoint2, ...]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Synchronizes the waypoint with other waypoints. Each waypoint is given as an array [group, index]. Example: [group1, 2] synchronizeWaypoint [[group2, 3]] Category: OFP

Page 367 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 368: comref

trigger synchronizeWaypoint [waypoint1, waypoint2, ...]

Operand types: trigger: Object [waypoint1, waypoint2, ...]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Synchronizes the trigger with waypoints. Each waypoint is given as an array [group, index]. Example: trigger synchronizeWaypoint [] Category: OFP

tan x

Operand types: x: Number Type of returned value: Number Description: The tangens of x, the argument is in degrees. Example: tan 45 , result is 1 Category: Default

[speaker, side, unit, place, time] targetsAggregate candidates

Operand types: [speaker, side, unit, place, time]: Array candidates: Array Compatibility: Version 2.92 required. Type of returned value: Array Description: Aggregate candidates. Category: Conversations

speaker targetsQuery [receiver, side, unit, place, time]

Operand types:

Page 368 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 369: comref

speaker: Object [receiver, side, unit, place, time]: Array Compatibility: Version 2.92 required. Type of returned value: Array Description: Find all targets known to sender matching given query. Category: Conversations

taskChildren task

Operand types: task: Task Compatibility: Version 2.92 required. Type of returned value: Array Description: Return the child tasks of the specified task. Category: Identity

taskCompleted task

Operand types: task: Task Compatibility: Version 2.89 required. Type of returned value: Boolean Description: Return if task is completed. (state Succeeded, Failed or Canceled) Category: Identity

taskDescription task

Operand types: task: Task Compatibility: Version 5501 required. Type of returned value: Array Description: Returns the descripction of the task.

Page 369 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 370: comref

Category: Identity

taskDestination task

Operand types: task: Task Compatibility: Version 2.92 required. Type of returned value: Array Description: Returns the position of the task (as specified by destination parameter in config). Category: Identity

taskHint text

Operand types: text: Array Type of returned value: Nothing Description: Shows info about new,changed or failed task. The text can contain several lines. \n is used to indicate the end of a line. Example: taskHint "Capture town." Category: OFP

taskNull

Compatibility: Version 5153 required. Type of returned value: Task Description: A non-existing task. This value is not equal to anything, including itself. Example: taskNull == taskNull , result is false Category: Identity

taskParent task

Page 370 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 371: comref

Operand types: task: Task Compatibility: Version 2.92 required. Type of returned value: Task Description: Return the parent task of the specified task. Category: Identity

taskResult task

Operand types: task: Task Compatibility: Version 2.92 required. Type of returned value: Array Description: Return the result of the given task. Category: Identity

taskState task

Operand types: task: Task Compatibility: Version 2.89 required. Type of returned value: String Description: Return the state of the given task. Category: Identity

teamSwitch

Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Invoke the team switch dialog (force it even when conditions are noy met). Category: OFP

Page 371 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 372: comref

teamSwitchEnabled

Compatibility: Version 2.92 required. Type of returned value: Boolean Description: Check if tam switch is currently enabled. Category: OFP

terminate script

Operand types: script: Script Compatibility: Version 2.50 required. Type of returned value: Nothing Description: Terminate (abort) the script Category: OFP

text location

Operand types: location: Location Compatibility: Version 2.90 required. Type of returned value: String Description: Return text attached to given location. Category: Location

text text

Operand types: text: String Compatibility: Version 2.01 required. Type of returned value: Structured text Description: Creates a structured text containing the given plain text.

Page 372 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 373: comref

Example: txt2 = text "Hello world." Category: OFP

textLog anything

Operand types: anything: Any Type of returned value: Nothing Description: Dumps the argument value into the debugging output. Example: textLog player Category: OFP

tg x

Operand types: x: Number Type of returned value: Number Description: The tangens of x, the argument is in degrees. Example: tg 45 , result is 1 Category: Default

if then else

Operand types: if: If Type else: Array Compatibility: Version 1.85 required. Type of returned value: Any Description: The first or second element of the array is executed depending on the result of the if condition. The result of the executed expression is returned as a result (the result may be nothing). Example: if (a>b) then {c=1} else {c=2};if (a>b) then [{c=1},{c=2}]

Page 373 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 374: comref

Category: Default

if then codeToExecute

Operand types: if: If Type codeToExecute: Code Compatibility: Version 1.85 required. Type of returned value: Any Description: The code is executed when the if condition is met. If the code is executed, the last value calculated in the code is returned. If the code is not executed, nothing is returned. Example: if (a>b) then {c=1} Category: Default

throw expression

Operand types: expression: Any Type of returned value: Nothing Description: Throws an exception. The exception is processed by first catch block. See try. Example: throw "invalid argument" Category: Default

time

Type of returned value: Number Description: Returns the time that elapsed since the mission started (in seconds). Category: OFP

titleCut effect

Page 374 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 375: comref

Operand types: effect: Array Type of returned value: Nothing Description: Obsolete. Category: OFP

titleFadeOut duration

Operand types: duration: Number Compatibility: Version 5126 required. Type of returned value: Nothing Description: Terminate the title effect and set duration of the fade out phase to the given time. Example: titleFadeIn 1.0 Category: OFP

titleObj effect

Operand types: effect: Array Type of returned value: Nothing Description: Object title - the argument uses format ["text","type",speed] or ["name","type"]. If speed is not given, it's assumed to be one. The object can be defined in the description.ext file. Example: titleObj ["BISLogo","plain"] Category: OFP

titleRsc effect

Operand types: effect: Array Type of returned value: Nothing Description: Resource title - the argument uses format ["name","type",speed] or ["name","type"]. If speed is not

Page 375 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 376: comref

given, it's assumed to be one. Resource can be defined in the description.ext file. Example: titleRsc ["BIS", "PLAIN"] Category: OFP

titleText effect

Operand types: effect: Array Type of returned value: Nothing Description: Text title - the argument uses format ["text","type",speed] or ["text","type"]. If speed is not given, it's assumed to be one. Example: titleText ["Show this text", "PLAIN"] Category: OFP

for "_var" from a to b

Operand types: for "_var" from a: for type b: Number Type of returned value: for type Description: Continue sequence of 'for' command. Example: for "_x" from 10 to 20 do {..code..} Category: Default

toArray string

Operand types: string: String Compatibility: Version 5195 required. Type of returned value: Array Description: Convert the string to the array of characters.

Page 376 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 377: comref

Example: toArray "ArmA" , result is [65, 114, 109, 65] Category: Default

toLower string

Operand types: string: String Compatibility: Version 5195 required. Type of returned value: String Description: Convert the string to lower case. Example: toLower "ArmA" , result is "arma" Category: Default

toString characters

Operand types: characters: Array Compatibility: Version 5195 required. Type of returned value: String Description: Convert the array of characters to the string. Example: toString [65, 114, 109, 65] , result is "ArmA" Category: Default

toUpper string

Operand types: string: String Compatibility: Version 5195 required. Type of returned value: String Description: Convert the string to upper case.

Page 377 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 378: comref

Example: toUpper "ArmA" , result is "ARMA" Category: Default

triggerActivated trigger

Operand types: trigger: Object Compatibility: Version 5501 required. Type of returned value: Boolean Description: Returns true if the trigger has been activated. Category: OFP

triggerActivation trigger

Operand types: trigger: Object Compatibility: Version 5501 required. Type of returned value: Array Description: Returns trigger activation in the form [by, type, repeating] Category: OFP

triggerArea trigger

Operand types: trigger: Object Compatibility: Version 5501 required. Type of returned value: Array Description: Returns trigger area in the form [a, b, angle, rectangle] Category: OFP

triggerAttachedVehicle trigger

Page 378 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 379: comref

Operand types: trigger: Object Compatibility: Version 5101 required. Type of returned value: Object Description: Returns vehicle attached to the trigger (for example using triggerAttachVehicle) Category: OFP

trigger triggerAttachObject objectId

Operand types: trigger: Object objectId: Number Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Assigns a static object to the trigger. The activation source is changed to "STATIC". Example: trigger triggerAttachObject 1234 Category: OFP

trigger triggerAttachVehicle [] or [vehicle]

Operand types: trigger: Object [] or [vehicle]: Array Compatibility: Version 1.86 required. Type of returned value: Nothing Description: If [] is given, the trigger is detached from the assigned vehicle. If the activation source is "VEHICLE", "GROUP", "LEADER" or "MEMBER", it's changed to "NONE". If [vehicle] is given, the trigger is attached to the vehicle or its group. When the source is "GROUP", "LEADER" or "MEMBER", it's attached to the group, otherwise it's attached to the vehicle and the source is changed to "VEHICLE". Example: trigger triggerAttachVehicle [player] Category: OFP

Page 379 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 380: comref

triggerStatements trigger

Operand types: trigger: Object Compatibility: Version 5501 required. Type of returned value: Array Description: Returns trigger statements in the form [cond, activ, desactiv] Category: OFP

triggerText trigger

Operand types: trigger: Object Compatibility: Version 5501 required. Type of returned value: String Description: Returns trigger text. Category: OFP

triggerTimeout trigger

Operand types: trigger: Object Compatibility: Version 5501 required. Type of returned value: Array Description: Returns trigger timeout in the form [min, mid, max, interruptable] Category: OFP

triggerType trigger

Operand types: trigger: Object Compatibility: Version 5501 required. Type of returned value: String Description:

Page 380 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 381: comref

Returns trigger type. Category: OFP

true

Type of returned value: Boolean Description: Always true. Category: Default

try code

Operand types: code: Code Type of returned value: Exception Type Description: Defines try-catch structure. This is structured exception block. Any thrown exception in try block is caught in catch block. The structured exception block has following formtry //begin of try-catch block { //block, that can throw exception } catch{ //block, that process an exception. Exception is described in _exception variable }; Category: Default

vehicle turretUnit turret path

Operand types: vehicle: Object turret path: Array Compatibility: Version 5501 required. Type of returned value: Object Description: Returns the unit in the vehicle turret. Category: OFP

type task

Operand types: task: Task Compatibility:

Page 381 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 382: comref

Version 2.91 required. Type of returned value: String Description: Return the type of the task. Category: Identity

type location

Operand types: location: Location Compatibility: Version 2.90 required. Type of returned value: String Description: Return type of given location. Category: Location

typeName any

Operand types: any: Any Compatibility: Version 2.00 required. Type of returned value: String Description: Returns type-name of expression. Type is returned as string Example: typeName "hello" , result is "string" Category: Default

typeOf object

Operand types: object: Object Compatibility: Version 1.91 required. Type of returned value: String Description: Returns the name of the type of the given object.

Page 382 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 383: comref

Example: typeOf player , result is "SoldierWB" Category: OFP

uiNamespace

Compatibility: Version 5501 required. Type of returned value: Namespace Description: Return the global namespace attached to user interface. Category: OFP

unassignTeam vehicle

Operand types: vehicle: Object Compatibility: Version 2.05 required. Type of returned value: Nothing Description: Unassigns the vehicle (its commander unit) from his team. This is equal to vehicle assignTeam "MAIN". Example: unassignTeam soldier2 Category: OFP

unassignVehicle unit

Operand types: unit: Object Type of returned value: Nothing Description: The person is unassigned from the vehicle. If he is currently inside, the group leader will issue an order to disembark. Example: unassignVehicle player Category: OFP

Page 383 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 384: comref

unitPos person

Operand types: person: Object Compatibility: Version 2.92 required. Type of returned value: String Description: Return the unit position rules. Category: OFP

unitReady unit

Operand types: unit: Object or Array Type of returned value: Boolean Description: Checks whether the unit is ready. A unit is busy when it's given an order like "move", until the command is finished. Example: unitReady player Category: OFP

units unit

Operand types: unit: Object Type of returned value: Array Description: Returns an array with all the units in the group of the given object. For a destroyed object an empty array is returned. Example: player in units player Category: OFP

units grp

Operand types: grp: Group Type of returned value:

Page 384 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 385: comref

Array Description: Returns an array with all the units in the group. Example: player in units group player Category: OFP

unlockAchievement name

Operand types: name: String Compatibility: Version 5501 required. Type of returned value: Boolean Description: Unlock the given achievement. Category: OFP

teamMember unregisterTask name

Operand types: teamMember: name: String Compatibility: Version 2.90 required. Type of returned value: Boolean Description: Unregister a task type. Category: Identity

map updateDrawIcon [object, string identifier, color, offset, width, height, maintain size?, angle, shadow]

Operand types: map: Control [object, string identifier, color, offset, width, height, maintain size?, angle, shadow]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Updates the icon to be shown in 2D editor for the specified editor object. If maintain size is false,

Page 385 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 386: comref

icon will not scale depending on the scale of the map. If maintain size is a number, the icon will maintain size if map scale is below that number. Category: Editor

map updateMenuItem [menu item index,text,command]

Operand types: map: Control [menu item index,text,command]: Array Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Sets the text and command for the menu item. index is index as returned from addMenuItem command. command is optional. Category: Editor

updateObjectTree map

Operand types: map: Control Compatibility: Version 2.92 required. Type of returned value: Nothing Description: Update the editor object tree. Category: Editor

soldier useAudioTimeForMoves toggle

Operand types: soldier: Object toggle: Boolean Type of returned value: Nothing Description: Switch between elapsed gamet time and audio time being used as animation timer. Used for audio/animation synchronization. Example: player useAudioTimeForMoves true Category: OFP

Page 386 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 387: comref

vectorDir obj

Operand types: obj: Object Compatibility: Version 2.61 required. Type of returned value: Array Description: Return object's direction vector in world coordinates as [x, z, y]. Category: OFP

vectorUp obj

Operand types: obj: Object Compatibility: Version 2.61 required. Type of returned value: Array Description: Return object's up vector in world coordinates as [x, z, y]. Category: OFP

vehicle unit

Operand types: unit: Object Type of returned value: Object Description: Returns the vehicle in which the given unit is mounted. If there is none, the unit is returned. Example: vehicle player != player Category: OFP

unit vehicleChat chatText

Operand types: unit: Object chatText: String Type of returned value:

Page 387 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 388: comref

Nothing Description: Types text to the vehicle radio channel. Note: this function only types text to the list, it does not broadcast the message. If you want the message to show on all computers, you have to execute it on all of them. Example: soldierOne vehicleChat "Show this text" Category: OFP

unit vehicleRadio radioName

Operand types: unit: Object radioName: String Type of returned value: Nothing Description: Sends the message to the vehicle radio channel. The message is defined in the description.ext file or radio protocol. Example: soldierOne vehicleRadio "messageOne" Category: OFP

vehicles

Compatibility: Version 2.92 required. Type of returned value: Array Description: Return a list of vehicles in the current mission. Example: _vehicles = vehicles Category: OFP

vehicles

Compatibility: Version 2.92 required. Type of returned value: Array Description:

Page 388 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 389: comref

Return a list of vehicles in the current mission. Example: _vehicles = vehicles Category: OFP

vehicleVarName object

Operand types: object: Object Compatibility: Version 2.91 required. Type of returned value: String Description: Returns the name of the variable which contains a reference to this object. Category: OFP

velocity vehicle

Operand types: vehicle: Object Compatibility: Version 1.80 required. Type of returned value: Array Description: Returns the velocity (speed vector) of the vehicle as an array with format [x, z, y]. Category: OFP

verifySignature filename

Operand types: filename: String Compatibility: Version 2.91 required. Type of returned value: Boolean Description: Check if file is signed by an accepted key. Category: OFP

Page 389 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 390: comref

viewDistance

Compatibility: Version 5501 required. Type of returned value: Number Description: Returns the rendering distance. Category: OFP

visibleMap

Compatibility: Version 5501 required. Type of returned value: Boolean Description: Return true if the main map is shown (active). Category: OFP

waitUntil condition

Operand types: condition: Code Compatibility: Version 2.60 required. Type of returned value: Nothing Description: Suspend execution of script until condition is satisfied. Example: _i = 0; waitUntil {_i = _i + 1; _i >= 100} Category: Default

waypointAttachedObject waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: Object Description: Gets the object attached to the waypoint.

Page 390 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 391: comref

Example: waypointAttachedObject [groupOne, 1] Category: OFP

waypointAttachedVehicle waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: Object Description: Gets the vehicle attached to the waypoint. Example: waypointAttachedVehicle [groupOne, 1] Category: OFP

waypoint waypointAttachObject idStatic or object

Operand types: waypoint: Array idStatic or object: Compatibility: Version 1.86 required. Type of returned value: Nothing Description: Attaches a static object to the given waypoint. Example: [grp, 2] waypointAttachObject 1234 Category: OFP

waypoint waypointAttachVehicle vehicle

Operand types: waypoint: Array vehicle: Object Compatibility: Version 1.86 required. Type of returned value: Nothing

Page 391 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 392: comref

Description: Attaches a vehicle to the given waypoint. Example: [grp, 2] waypointAttachVehicle vehicle player Category: OFP

waypointBehaviour waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: String Description: Gets the waypoint behavior. Example: waypointBehaviour [groupOne, 1] Category: OFP

waypointCombatMode waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: String Description: Gets the waypoint combat mode. Example: waypointCombatMode [groupOne, 1] Category: OFP

waypointCompletionRadius waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: Number

Page 392 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 393: comref

Description: Gets the radius around the waypoint where is the waypoint completed. Example: _radius = waypointCompletionRadius [groupOne, 1] Category: OFP

waypointDescription waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: String Description: Gets the waypoint description. Example: waypointDescription [groupOne, 1] Category: OFP

waypointFormation waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: String Description: Gets the waypoint formation. Example: waypointFormation [groupOne, 1] Category: OFP

waypointHousePosition waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: Number

Page 393 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 394: comref

Description: Gets the house position assigned to the waypoint. Example: waypointHousePosition [groupOne, 1] Category: OFP

waypointPosition waypoint

Operand types: waypoint: Array Compatibility: Version 1.50 required. Type of returned value: Array Description: Gets the waypoint position. Waypoint uses format Waypoint. Note: this function is identical to getWaypointPosition. Example: waypointPosition [groupOne, 1] Category: OFP

waypoints group

Operand types: group: Object or Group Compatibility: Version 5129 required. Type of returned value: Array Description: Return the list of waypoints for given group. Category: OFP

waypointScript waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: String Description: Gets the waypoint script.

Page 394 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 395: comref

Example: waypointScript [groupOne, 1] Category: OFP

waypointShow waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: String Description: Gets the waypoint show/hide status. Example: waypointShow [groupOne, 1] Category: OFP

waypointSpeed waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: String Description: Gets the waypoint speed. Example: waypointSpeed [groupOne, 1] Category: OFP

waypointStatements waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: Array Description: Gets the waypoint statements.

Page 395 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 396: comref

Example: waypointStatements [groupOne, 1] Category: OFP

waypointTimeout waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: Array Description: Gets the waypoint timeout values. Example: waypointTimeout [groupOne, 1] Category: OFP

waypointType waypoint

Operand types: waypoint: Array Compatibility: Version 5500 required. Type of returned value: String Description: Gets the waypoint type. Example: waypointType [groupOne, 1] Category: OFP

vehicle weaponDirection weaponName

Operand types: vehicle: Object weaponName: String Compatibility: Version 2.61 required. Type of returned value: Array Description:

Page 396 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 397: comref

Returns direction where is given weapon aiming. Example: _dir = _vehicle weaponDirection "M16" Category: OFP

weapons vehicle

Operand types: vehicle: Object Compatibility: Version 1.75 required. Type of returned value: Array Description: Returns an array of names of all the vehicle's weapons. Example: weapons player Category: Resistance

west

Type of returned value: Side Description: The West side. Category: OFP

while condition

Operand types: condition: Code Compatibility: Version 1.85 required. Type of returned value: While Type Description: The first part of the while contruct. Example: while "x<10" do {x=x+1} Category: Default

Page 397 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 398: comref

wind

Compatibility: Version 2.92 required. Type of returned value: Array Description: Return the current wind vector. Category: OFP

with namespace

Operand types: namespace: Namespace Compatibility: Version 5501 required. Type of returned value: With Type Description: The first part of the with contruct. Example: with missionNamespace do {global=global+1} Category: Default

worldName

Compatibility: Version 2.92 required. Type of returned value: String Description: Return the name of the currently loaded world. Category: OFP

object worldToModel worldPos

Operand types: object: Object worldPos: Array Compatibility: Version 2.92 required. Type of returned value: Array Description:

Page 398 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 399: comref

Converts position from world space to object model space. Category: OFP

worldToScreen position

Operand types: position: Array Compatibility: Version 5501 required. Type of returned value: Array Description: Converts position in world space into screen (UI) space. Category: OFP

Any

Description: Anyhing - any value.

Any Value

Description: Any value.

Anything

Description: Anything, including nothing.

Array

Description: An array of items, each may be of any type.

Boolean

Description: Boolean (true or false).

Page 399 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 400: comref

Code

Description: Part of code (compiled).

Config

Description: Config file entry.

Control

Description: Control UI object.

Diary record

Description: Diary record.

Display

Description: Display UI object.

Exception Type

Description: A helper type used in try-catch constructs.

for type

Description: This type handles for cycles. Usage of this type: for "_var" from :expr: to :expr: [step <expr>] do {..code..};Second usage: for [":initPhase:",":condition:",":updatePhase:"] do {...code...};

Group

Page 400 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 401: comref

Description: A group.

If Type

Description: A helper type used in if..then constructs.

Location

Description: Location.

Namespace

Description: Namespace - set of variables.

Nothing

Description: Nothing - no value.

Number

Description: A real number.

Number or Nothing

Description: Number or Nothing.

Object

Description: A game object (like a soldier, vehicle or building).

Page 401 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 402: comref

Object or Array

Description: Object or Array.

Object or Group

Description: Object or group. If you pass a group, its leader is considered.

Object or String

Description: Object or String.

Orientation

Description:

Script

Description:

Side

Description: The name of the side (see west, east, civilian and resistance).

String

Description: An ASCII string.

String or Array

Description: String or Array.

Page 402 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 403: comref

String or Code

Description: String or Code.

Structured text

Description:

Switch Type

Description: A helper type used in switch constructs.

Target

Description:

Task

Description: Task.

Text or String

Description: Text or String.

Transformation

Description:

Vector

Page 403 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 404: comref

Description:

While Type

Description: A helper type used in while..do constructs.

With Type

Description: A helper type used in while..do constructs.

Color

Format: [r, g, b, a] Description: Color, r is intensity of red, g intensity of green, b intensity of blue and a alpha (1 - transparancy). All of them are fon interval [0, 1]. Category: OFP

ParticleArray

Format: [ShapeName, AnimationName, Type, TimerPeriod, LifeTime, Position, MoveVelocity, RotationVelocity, Weight, Volume, Rubbing, Size, Color, AnimationPhase, RandomDirectionPeriod, RandomDirectionIntensity, OnTimer, BeforeDestroy, Object, {angle}] Description: Global parameters: ShapeName - Name of the shape associated with the particle. AnimationName -Name of the animation of the shape. Type - Type of the particle (either "Billboard" or "SpaceObject"). TimerPeriod - The period of calling the "OnTimer" event (in sec). LifeTime - Life time of the particle (in sec). Physical parameters: Position - Either 3D coordinate (xzy) or name of the selection - in this case the Object property must be set. MoveVelocity - 3D vector (xyz) which describes the velocity vector of the particle (direction and speed in m/s). RotationVelocity - Float number which determines number of rotations in one second. Weight - Weight of the particle (in kg). Volume - Volume of the particle (in m^3). Rubbing - Float number without dimension which determines the impact of the density od the enviroment on this particle. 0 - no impact (vacuum). Render parameters: Note that all these values are set as arrays to show their development in time. F.I. if you set the array [1,2] as a size then at the beginning the size of the particle will be 1 and at the end of the life time of the particle it's size will be 2. The rest od the values during the life time will be lineary interpolated. Size - Size of the particle in time to render (m). Color - Color of the particle in time to render (RGBA). AnimationPhase - Phase of the animation in time. Random parameters: RandomDirectionPeriod - Period of changing the velocity vector (s). RandomDirectionIntensity -

Page 404 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 405: comref

Each MoveVelocity component will be changed with random value from interval <0, RandomDirectionIntensity>. OnTimer - Name of the script to run every period determined by TimerPeriod property. Position of the particle is stored in "this" variable. BeforeDestroy - Name of the script to run right before destroying the particle. Position of the particle is stored in "this" variable. Object - Object to bind this particle to. Category: OFP

Position

Format: [x,z] or [x,z,y] Description: Position, x coordinates are from East to West, z coordinates are from South to North, y is the height above ground and the default y is 0. Category: OFP

Position2D

Format: [x,z] Description: x coordinates are from East to West, z coordinates are from South to North. Category: OFP

PositionASL

Format: [x,z,y] Description: Position, x coordinates are from East to West, z coordinates are from South to North, y is the height above see level. Category: OFP

Waypoint

Format: [group,index] Description: Group is of type Group, index selects the waypoint (index 0 selects the first waypoint which is always created on the group starting position). Category: OFP

Page 405 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 406: comref

Array assignment

Assignments used on arrays assign only a pointer to the same array to the target variable. When b is an array, after executing a = b both a and b represent the same array. When b is changed, a is changed as well. One particular situation that can lead to this behaviour is aList = list sensor_name. You can force creating a copy of an array by using the unary operator +Array.

Code strings

Many languague constructs (including forEach, if and while) use the concept of "code strings". Code is passed to them as a string and they interpret it as code if they wish. Since 1.85 string constants can be written in two ways: using double quotes (like "Hello") or curled braces (like {a=a+1}). While both ways are currently equivalent and a string constant is created, we recommend to use curled braces for code only, as this makes scripts easier to read; moreover future versions of the scripting language may precompile code enclosed in curled braces.

Event based scripts

There are some scripts in the game which are launched when a particular event occured. Some of them have a name given by the mission designer (scripted waypoint, particle scripts (since 1.50) or user action scripts). Names of others are given by the program. init.sqs - launched when the mission is started (before the briefing screen) - no arguments initIntro.sqs - launched when the intro is started (since 1.50) - no arguments exit.sqs - launched when the mission is finished (before the debriefing screen, since 1.50) - argument: end # - number of game endings onFlare.sqs - launched when an illuminating shell is lit(since 1.45) - arguments: [[r, g, b], gunner] - r, g, b is the light color

Event handlers

Event handlers can be defined in a unit config or by function addEventHandler. Multiple handlers can be attached at one time. The event handler types are defined below. Each handler receives arguments in _this. _this select 0 is always the source of the event. Other argument types and meaning are defined below. "Killed" object:killer "Hit" object:causedBy,scalar:howMuch "Engine" bool:engineState "GetIn" string:position (1),object:unit

Page 406 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 407: comref

"GetOut" string:position (1),object:unit "Fired" string:weapon,string:muzzle,string:mode,string:ammo "IncomingMissile" string:ammo,object:whoFired "Dammaged" string:selectionName,scalar:howMuch "Gear" bool:gearState "Fuel" bool:fuelState "Init" No arguments (1) position can be "driver", "gunner", "commander", "cargo" MP notes: "Killed" and "Hit" event handlers are executed where the given unit is local. All other event handlers are executed on all computers. Events added by addEventHandler may be different on each computer.

Functions - SQF

While script syntax (see exec) is line based, functions (see call, then, do) is based on structured expressions and end-of-line has no special meaning, it is considered to be equivalent to a space. Semicolon is therefore required even when ending a line. Note: scripts can do some things that are not possible in functions. Scripts can wait suspended until a certain condition it met and they can also use goto to change the execution point at any time. Main language contructs used in functions are: if..then..else while..do Curled braces Multiple commands (including assigment commands) delimited with a semicolon The result of the last expression evaluated is returned as a function result. This can be nothing when a function returns no value. Example 1 (max.sqf) comment "Return the maximum of the first and second argument"; private {"_a","_b"}; _a = _this select 0; _b = _this select 1; if (_a>_b) then {_a} else {_b} Example 2 (infantrySafe.sqf) comment "Switch all infantry units to safe mode"; { if (vehicle _x == _x) then { _x setBehaviour "safe" } } forEach _this

Page 407 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 408: comref

Due to the line-based nature of scripts it is not possible to create multiline string constants in them. To overcome this limitation you can store multiline in separate files and load them using the loadFile or preprocessFile functions (the second uses a C-like preprocessor with // or /* */ comments and #define macros). The recommended file extension for functions is .SQF (as opposed to .SQS used for scripts).

Local variables

A local variable is any variable which name starts with an underscore. All other variables are global. Each of the commands then, do, while, forEach, count, exec and call define a visibility scope for local variables. All local variables from outer scopes are visible as well. If assignment is made into a variable that does not exist in any visible scope, it is created in the innermost scope. You can use function private to introduce variables at any given scope.

Script syntax

Each script line may be one of the following: Comment: line starting with ';'. Example: ;This is comment Label: line starting with '#'. Example: #LabelName Waiting for a condition: line starting with '@'. Example: @condition Waiting for a time: line starting with '&'. Example: &endTime is equivalent to @_time >= (endTime) Delay: line starting with '~'. Example: ~delay is equivalent to __waitUntil = _time+(cas) ; &__waitUntil Command: any expression returning no value. Example: _unit setBehaviour "safe" Assignment: assignment of any value to variable. Example: _a = 10 Conditional: ? condition : command or assignmented, the command is executed only when the condition is satisfied. Example: ?_condVar>10:_var=_var+2 Note: variable _time is reserved. It is used to keep the time elapsed since the script execution started. Local variables can be used during script execution to avoid variable conflicts. A local variable name starts with an underscore ('_'). Variables starting with two underscores are reserved and should never be used.

Page 408 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 409: comref

Triggers

The Condition expression is used to determine when the trigger is activated. Boolean variable this is set during evaluation of the condition expression to the primary sensor activation condition. Array variable thisList is set to the list of all vehicles that would satisfy the primary sensor activation condition. Condition must return a boolean value. The On Activation and On Deactivation expressions define actions that are peformed when the trigger condition changes to true or false. Expressions must either be an assignment or return nothing (see type none). Variable denoting trigger can be created by filling in the name field.

Variables

Variables have to be inicialized before being used. When any uninitialized variable is detected in any expression, the whole expression results nil (an undefined value). When an undefined value is encountered in a field where a boolean value is expected, it is converted to false. Variables may be unitialized by assigning it the nil value. This effectively destroys the variable as if it never existed.

Waypoints

The Condition expression is used to determine when the waypoint execution is terminated. Boolean variable this is set during evaluation of the condition expression to the primary waypoint termination condition. Array variable thisList is set to the list of all units in the group that the given waypoint is assigned to. Condition must return a boolean value. The On Activation expression defines an action that is peformed after the waypoint is terminated. The expression must either be an assignment or return nothing (see type none).

Vehicle

Config entry: CfgVehicles

Value Description - All any vehicle+ Logic game logic invisible unit- Land ground vehicle- Car- Motorcycle- Tank- APC- Man+ Civilian+ Civilian2+ Civilian3

Page 409 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 410: comref

- Soldier- SoldierLAW- Air air vehicle- Helicopter helicopter- Plane airplane- Ship- SmallShip- BigShip+ Jeep+ JeepMG+ Rapid+ RapidY+ Skoda+ SkodaBlue+ SkodaRed+ SkodaGreen+ Tractor- Truck+ Truck5t 5 ton truck+ Truck5tOpen+ Truck5tRepair+ Truck5tReammo+ Truck5tRefuel+ SoldierWB basic western soldier+ SoldierWG western soldier with grenade launcher+ SoldierWMedic+ SoldierWCrew+ SoldierWPilot+ SoldierWMG western soldier with machine gun+ SoldierWLAW western soldier with LAW launcher+ SoldierWAT western soldier with guided AT missile+ SoldierWAA western soldier with AA missile+ SoldierWMortar western soldier with riffle grenade+ SoldierWSniper+ SoldierWSaboteurPipe+ SoldierWSaboteurDay+ SoldierWMiner+ OfficerW+ SoldierWCaptive+ M1Abrams+ M60+ M113+ M113Ambul+ Cobra- Ch47D

Page 410 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 411: comref

+ ParachuteEast+ ParachuteWest+ ParachuteC+ ParachuteG+ UH60+ UH60MG- Su25+ A10+ Cessna+ BoatW+ M2StaticMG+ UAZ+ Ural+ UralRepair+ UralReammo+ UralRefuel+ Scud+ SoldierEB+ SoldierWFakeE+ SoldierEG+ SoldierEMedic+ SoldierECrew+ SoldierEPilot+ SoldierEMG+ SoldierELAW+ SoldierEAT+ SoldierEAA+ SoldierEMiner+ OfficerE+ OfficerENight+ GeneralE+ Angelina+ SoldierESniper+ SoldierESaboteurPipe+ SoldierEFakeW- LaserTarget laser designator dot+ BMP+ BMPAmbul- RussianTank+ T72+ T80+ ZSU+ M2StaticMGE+ Mi24+ Mi17

Page 411 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 412: comref

+ CarrierW+ BoatE+ TruckV3SG+ GJeep+ TruckV3SCivil+ TruckV3SGRefuel+ TruckV3SGRepair+ TruckV3SGReammo+ UAZG+ SGUAZG+ SoldierGB+ SoldierGMedic+ SoldierGCrew+ SoldierGPilot+ SoldierGG+ SoldierGMG+ SoldierGLAW+ SoldierGAT+ SoldierGAA+ OfficerG+ OfficerGNight+ SoldierGFakeE+ SoldierGFakeC+ SoldierGFakeC2+ T55G- Static static object or building+ ReammoBox+ ReammoBoxWest+ ReammoBoxEast+ ReammoBoxGuer+ HeavyReammoBox+ HeavyReammoBoxWest+ HeavyReammoBoxEast+ HeavyReammoBoxRes+ MachineGunBox+ FlagCarrier+ Danger+ Fire+ Target+ TargetE+ Camp+ Fortress1+ Fortress2+ CampEmpty+ CampEast

Page 412 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 413: comref

+ CampEastC+ Grave+ GraveCross1+ GraveCross2+ GraveCrossHelmet+ ACamp+ MASH+ Fence+ FenceWood+ Wire+ WireFence+ Barrels+ Barrel1+ Barrel2+ Barrel3+ Barrel4+ Table+ Tablemap+ Chair+ Phone+ Camera1+ Computer+ ChairHangar+ ChairX+ VideoTable+ TablePub+ Radio+ ChairSmall+ Crawling+ ExcerciseTrack+ ExcerciseTrack2+ ExcerciseTrack3+ Paleta1+ Paleta2+ JeepWreck1+ JeepWreck2+ JeepWreck3+ M113Wreck+ UralWreck+ Body+ Shed+ Office+ Barracks+ Hangar+ Hangar_Hall

Page 413 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 414: comref

Weapons and magazines

Config entry: CfgWeapons

+ Hangar_Office+ ShedSmall+ HeliH+ HeliHEmpty+ TargetTraining+ TargetGrenade+ FuelStation fuel station building

Value Description + Shell73+ Heat73+ Gun73+ Shell105+ Heat105+ Gun105+ Shell120+ Heat120+ Gun120+ Shell125+ Heat125+ Gun125+ MGun+ Riffle+ StrokeFist+ M16+ M4+ AK47+ AK47CZ+ AK74+ AK74SU+ HK+ SniperRiffle+ M21+ SVDDragunov+ Binocular+ NVGoggles+ MachineGun7_6+ MachineGun7_6Manual+ M60+ PK+ MachineGun12_7

Page 414 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html

Page 415: comref

+ Browning+ MachineGun30+ MachineGun30A10+ ZsuCannon+ GrenadeLauncher+ RiffleGrenadeLauncher+ M16GrenadeLauncher+ AK47GrenadeLauncher+ AK74GrenadeLauncher+ Mortar+ Flare+ FlareGreen+ FlareRed+ HandGrenade+ SmokeShell+ SmokeShellRed+ SmokeShellGreen+ Put+ Mine+ MineE+ PipeBomb+ LAWLauncher+ RPGLauncher+ CarlGustavLauncher+ AT4Launcher+ AALauncher+ 9K32Launcher+ AT3Launcher+ HellfireLauncher+ ZuniLauncher38+ Rocket57x64+ Rocket57x192+ HellfireLauncherCobra+ HellfireLauncherHind+ MaverickLauncher+ CarHorn+ TruckHorn+ SportCarHorn

Page 415 of 415BIS Game Engine Scripting Commands

7/11/2010http://www.arma2.com/comref/full.html