ArmA 2: Actions

# General Syntax

***unit* action [*"actionType"*, *parameter(s)*]**

 *parameter(s)*: | Various data types, dependant on the action used. The number of required parameters depends on the action type.

# Actions

## AutoHover

 **Example**: | chopperOne action ["autoHover", chopperOne]

## CancelAction

 **Example**: | soldierOne action ["CancelAction", soldierOne]

## CancelLand

 **Example**: | planeOne action ["cancelLand", planeOne]

## CancelTakeFlag

 **Example**: | westSoldierOne action ["cancelTakeFlag", eastFlag]

## DeactivateMine

 **Example**: | soldierOne action ["deactivateMine", soldierOne]

## Eject

 **Example**: | soldierOne action ["Eject", vehicle soldierOne]

## EngineOn

 **Example**: | soldierOne action ["engineOn", vehicle soldierOne]

## EngineOff

 **Example**: | soldierOne action ["engineOff", vehicle soldierOne]

## FireInFlame

 **Example**: | soldierOne action ["fireInFlame", firePlaceOne]

## FirePutDown

 **Example**: | soldierOne action ["firePutDown", firePlaceOne]

## FlapsUp

 **Example**: | harrierOne action ["flapsUp", harrierOne]

## FlapsDown

 **Example**: | harrierOne action ["flapsDown", harrierOne]

## Gear

**unitName action ["Gear",<target unit>]**

**unitName action ["Gear",<target unit>]**

UnitName opens the gear of <target unit> (but only if he is within normal range) and plays the "pick up" animation, allowing transfer of gear between the two units. This works even if <target unit> does not normally have a gear action (for instance between two soldiers). Using "" or ObjNull for <target unit> will drop the gear on the ground, but it will take a little while before the game recognizes the weapon holder.

Example:
`SoldierOne action ["Gear", SoldierTwo]`

## GetInCommander

 **Example**: | soldierOne action ["getInCommmander", tankOne]

## GetInDriver

 **Example**: | soldierOne action ["getInDriver", carOne]

## GetInGunner

 **Example**: | soldierOne action ["getInGunner", mySpotlight]

## GetInPilot

 **Example**: | pilotOne action ["getInPilot", chopperOne]

## GetOut

 **Example**: | soldierOne action ["getOut", carOne]

## HandGunOn

 **Example**: | soldierOne action ["handGunOn", soldierOne]

## HandGunOff

 **Example**: | soldierOne action ["handGunOff", soldierOne]

## Heal

 **Example**: | soldierOne action ["heal", medicOne]

## HideBody

 **Example**: | soldierOne action ["hideBody", soldierTwo]

## LadderDown

 **Example**: | soldierOne action ["ladderDown", (position soldierOne nearestObject 452221), 0, 1]

## LadderUp

 **Example**: | soldierOne action ["ladderUp", (position soldierOne nearestObject 452221), 0, 0]

## LadderOff

 **Example**: | soldierOne action ["ladderOff", (position soldierOne nearestObject 452221)]

## Land

 **Example**: | planeOne action ["Land", planeOne]

## LandGear

 **Example**: | planeOne action ["LandGear", planeOne]

## LandGearUp

 **Example**: | planeOne action ["LandGearUp", planeOne]

## LightOff

 **Example**: | player action ["lightOff", vehicle player]

## LightOn

 **Example**: | player action ["lightOn", spotLight]

## LoadMagazine

 **Example**: | player action ["loadmagazine",player, player, 0, 1 ,"vbs2\_us\_m16a2\_iron\_gla", "vbs2\_us\_m16a2\_iron\_gla"]

## ManualFire

 **Example**: | player action ["ManualFire", vehicle player]

## ManualFireCancel

 **Example**: | player action ["manualFireCancel", vehicle player]

## MoveToCargo

 **Example**: | player action ["moveToCargo", vehicle player, 2]

## MoveToCommander

 **Example**: | player action ["moveToCommander", vehicle player]

## MoveToDriver

 **Example**: | player action ["moveToDriver", vehicle player]

## MoveToGunner

 **Example**: | player action ["moveToGunner", vehicle player]

## NVGoggles

 **Example**: | player action ["nvGoggles", player]

## NVGogglesOff

 **Example**: | player action ["nvGogglesOff", player]

## Refuel

 **Example**: | tankOne action ["refuel", refuelTruckOne]

## Repair

 **Example**: | tankOne action ["refuel", repairTruckOne]

## ReturnFlag

 **Example**: | soldierOne action ["returnFlag", westFlag]

## RepairVehicle

**OA only. Required version 1.54.**

 **Example**: | engineerOne action ["repairVehicle", truckOne]

## Salute

 **Example**: | soldierOne action ["salute", soldierOne]

## SetTimer

**unitOne action ["SetTimer", unitTwo, <bombName>]**

Soldier 'unitOne' plays the action animation. UnitTwo activates and adds thirty seconds to the timer for a satchel charge. Neither unit needs to be near the satchel.
Charge has to be places first using *unitname Fire ["pipebombmuzzle", "pipebombmuzzle", "pipebomb"]* command.

## SitDown

 **Example**: | soldierOne action ["sitDown", soldierOne]

## Surrender

 **Example**: | soldierOne action ["Surrender", soldierTwo]

## SwitchMagazine

**<unit> action ["SwitchMagazine", <target vehicle>, <target unit>, <mode index>]**

Target unit switches to the given firing mode index. This allows selection of any firing mode for any weapon carried by a soldier, or mounted on a weapon. First are the firing modes for the primary weapon (index 0 upwards), then secondary weapon, then optics, then pistol, then thrown and placed weapons. Changing to NVGoggles just plays an animation, not actually setting NV mode. Unfortunately, the list of firing modes seems to only be created when a soldier is initiated; modes are removed from the list when a weapon is dropped and not re-added when a weapon is picked up. Thus, only use this during the initiation phase of the soldier. On vehicles, where the weapons are not likely to be changed, this action might be useful after the vehicle has been initiated.

If the mode index is higher than available indices, it assumes index 0.

If you just want to change the muzzle used, rather than the firing mode, the standard command selectWeapon is generally more useful.

Example:
`gameLogic action ["SwitchMagazine", unit1, unit1, 3];
gameLogic action ["SwitchMagazine", m1a1, gunner m1a1, 1];`

## SwitchWeapon

**unitOne action ["SwitchWeapon", <target unit>, <target unit>, <muzzle index>]**

UnitOne plays the action animation. Target unit switches to the given muzzle/mode index. Target unit can also be a vehicle. The weapons array is a list of all weapon modes specific to each weapon, muzzle and firing mode combination.

Example:
`unit2 action ["SwitchWeapon",unit1,unit1,7]
player action ["SwitchWeapon", vehicle player, vehicle player, 3]`

## TakeFlag

**unitname action ["TakeFlag", flag1]**

Soldier 'unitname' takes control of 'flag1'. He must be close to the flagpole and it must belong to an enemy side.

Example:
`SoldierOne action ["TakeFlag", FlagOne]`

## TakeMagazine / TakeWeapon

**unitname action ["TakeMagazine", (vehiclename or unitname), "MAGAZINENAME"]**

**unitname action ["TakeWeapon", (vehiclename or unitname), "WEAPONNAME"]**

Soldier 'unitname' takes one magazine/weapon of specified type (see list) from the ground (Weaponholder) or from named vehicle (ammo box, car, etc.).

Transfer happens immediately and via teleportation. Unit1 plays pickup animation at its current position, no matter where 'weapon or magazine' is.

Example:
`SoldierOne action ["TakeMagazine", SoldierTwo, "RPGLauncher"]`

## TakeMine

**unitName action ["TakeMine", <target unit>]**

UnitName will perform the action animation. The closest mine that is within two meters of the target unit will be placed into the target unit's inventory.

Example:
`unit1 action ["takeMine",unit2]`

## TeamSwitch

**<current unit> action ["TeamSwitch ", <unit>]**

Opens the normal team-switch dialog. <current unit> will be greyed out in the list and thus unselectable. The effect of the second array element is unknown, but it must be a unit.
Works in single-player game only (in MP games, will just momentarily show the mouse cursor without the team-switch window being shown).

Example:
`player action ["TeamSwitch", player]`

## TouchOff

**unitOne action ["TouchOff", unitTwo]**

Soldier 'unitOne' plays the action animation. UnitTwo's satchels are "touched off". UnitTwo must be within range (300m) of his satchels to touch them off.

Example:
`unitname action ["TouchOff", unitname]`

## TurnIn / TurnOut

**unitName action ["TurnIn", vehicleName]**

**unitName action ["TurnOut", vehicleName]**

Crew of 'vehiclename' turns in/out (gets in and out of hatches). UnitName must be a player in effective commander of vehicleName. AI will automatically turn in/out based on their current behaviour mode.

Examples:
`TankOne action ["TurnIn", TankOne]
player action ["TurnOut,vehicle player]`

## UseMagazine

**["UseMagazine", <target>, <magazine creator>, <number>, <number>]**

This makes the target bend down, like he's using an ammo crate. I don't notice anything else happening. I don't know what the number values at the end do.

Example:
`player action["UseMagazine", player, player, 0, 0]`

## User

**unitName ["User", <target unit>, <action index>]**

Soldier 'unitName' does nothing. Executes the custom action with the given index of the the target unit. Indexes are based upon the order in which the actions are added to the unit. See addAction.

Example:
`gameLogic action ["User", player, 3]`

## UserType

**["UserType", <target>, <action index>]**

As of ArmA version 1.08, using this action type will cause ArmA to crash to desktop.

## UseWeapon

**unitOne ["UseWeapon", <target vehicle>, <target unit>, <weapon index>]**

Soldier 'unitOne' will play the action animation. Target unit will fire the specified unit's position in the target vehicle's (can be the unit itself) weapon mode index. The indexes seem to be based upon the order in which weapons are added to the unit/vehicle, with each weapon's muzzle's fire mode having an unique index. Weapons can be fired in this way from a not-readied position (eg, firing a rifle on a soldiers back). Pistols will fire from the current weapon's proxy. It can also be used to sound the horn on AI controlled vehicles.

Examples:
`gameLogic action ["useWeapon",unit1,unit1,16]
gameLogic action ["useWeapon",vehicle unit1,unit1,0]
gameLogic action ["useWeapon",myTank,gunner myTank,1]
gameLogic action ["useWeapon",myTank,commander myTank,0]`

## WeaponInHand / WeaponOnBack

**unitName action ["WeaponInHand",<target unit>]**

**unitName action ["WeaponOnBack",<target unit>]**

Soldier 'unitName' does nothing, 'target unit' moves his weapon from/to the safety position (gun held across chest pointing at the ground).
Change is persistent with player, but AI units will change back to suit their current behaviour mode. AI generally keep their rifles safe unless moving or targeting.

(*VBS2 calls this action "PutWeaponOnBack"*)

Example:
`SoldierOne action ["WeaponOnBack", SoldierTwo]`

# Unsorted actions found in UI.pbo/config.bin

## PutMagazine

is synonym for DropMagazine (same syntax)?

## HideWeapon

unit action ["hideWeapon",<object>,<object>,<Number>]

## ArtilleryComputer

OA only. Required version 1.54.

 **Example**: | soldierOne action ["ArtilleryComputer", mortarOne]

## Assemble

OA only.

Example :
\_unit action ["Assemble", (nearestObject [\_unit, "Tripod\_Bag"])];

## AutoHoverCancel

 **Example**: | chopperOne action ["autoHover", chopperOne]

## Disassemble

OA only.

 **Example**: | soldierOne action ["Disassemble", mortarOne]

## DropBag

Works the same as dropWeapon and dropMagazine, but with backpacks. Syntax:

unit1 action ["dropbag", unit2, (typeOf unitBackPack unit1)];

unit1 will perform the 'gear' action, and unit1's backpack will be moved to unit2, IF unit2 has free backpack space. Will actually transfer backpack + content (if applicable). Units do not need to be close for this to work. Note: if unit2 already has a backpack, unit1's backpack will drop to the ground at unit2's feet, and be unavailable (for picking up/using).

OA only.

## PutBag

OA only.

\_unit action ["putbag", \_unit];

\_unit will bend down and place his backpack on the ground.