From Bohemia Interactive Community
Hover & click on the images for description
Description
- Description:
- Returns the given or currently selected weapon state for unit or vehicle.
With Syntax 2, if no optional arguments are present, currently selected weapon is queried.
Since Arma 3 v1.70 this command has been improved and extended:
- A vehicle's weapon query doesn't need a weapon operator provided the weapon or muzzle is specified in optional param.
(keep in mind that by default a vehicle has no weapons selected)
- Driver turret can now be accessed as well with turret path [-1].
- Muzzle name is supported as well as weapon name. The command searches for weapon first, then if not found, muzzle is searched for.
- Groups:
- Weapons
Syntax 1
- Syntax:
- weaponState unit
- Parameters:
- unit: Object
- Return Value:
- Array in format [weapon, muzzle, firemode, magazine, ammoCount, roundReloadPhase, magazineReloadPhase], where:
- Syntax:
- weaponState [vehicle, turretPath, weapon, muzzle, firemode]
- Parameters:
- vehicle: Object
- turretPath: Array
- since
1.70 - weapon: String - (Optional, default "") weapon or muzzle name
- since
2.08 - muzzle: String - (Optional, default "") muzzle name
- since
2.08 - firemode: String - (Optional, default "") firemode name
- Return Value:
- Array in format [weapon, muzzle, firemode, magazine, ammoCount, roundReloadPhase, magazineReloadPhase], where:
- Syntax:
- unit weaponState weaponOrMuzzle
- Parameters:
- unit: Object
- weaponOrMuzzle: String
- Return Value:
- Array in format [weapon, muzzle, firemode, magazine, ammoCount, roundReloadPhase, magazineReloadPhase], where:
Examples
- Example 1:
- Example 2:
- Query currently selected gunner weapon:
- Example 3:
- Example 4:
Additional Information
- See also:
- weapons selectWeaponTurret loadMagazine magazinesTurret weaponsTurret weaponReloadingTime.
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here!
Add Note
- AgentRev - c
- Posted on Mar 31, 2022 - 04:08 (UTC)
-
In the case of a GL rifle, if the rifle is currently in GL mode, syntax 3 will return the same result for either muzzle:
In rifle mode, the result is different:
Therefore, in order to gather all states of one multi-muzzle weapon, we have to do some masochistic stuff: