weaponState: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (since ver) |
Killzone Kid (talk | contribs) No edit summary |
||
Line 11: | Line 11: | ||
* It is now possible to query any weapon of a vehicle without the need to place a weapon operator first, provided the weapon or muzzle is specified in optional param. By default a vehicle has no weapons selected, so querying currently selected weapon returns no weapon, unless weapon is specified. | * It is now possible to query any weapon of a vehicle without the need to place a weapon operator first, provided the weapon or muzzle is specified in optional param. By default a vehicle has no weapons selected, so querying currently selected weapon returns no weapon, unless weapon is specified. | ||
* Driver turret can now be accessed as well with turret path [-1]. | * Driver turret can now be accessed as well with turret path [-1]. | ||
* Muzzle name is supported as well as weapon name. Weapon search gets priority, but if there is no weapon with | * Muzzle name is supported as well as weapon name. Weapon search gets priority, but if there is no weapon with given name, the muzzle will be selected. |= Description | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Revision as of 23:07, 13 February 2017
Description
- Description:
- Returns the currently selected weapon state for unit or vehicle.
Since Arma 3 v1.69.140397 this command has been improved and extended:- It is now possible to query any weapon of a vehicle without the need to place a weapon operator first, provided the weapon or muzzle is specified in optional param. By default a vehicle has no weapons selected, so querying currently selected weapon returns no weapon, unless weapon is specified.
- Driver turret can now be accessed as well with turret path [-1].
- Muzzle name is supported as well as weapon name. Weapon search gets priority, but if there is no weapon with given name, the muzzle will be selected.
- Groups:
- Uncategorised
Syntax
- Syntax:
- weaponState unit
- Parameters:
- unit: Object
- Return Value:
- Array - in format [weapon, muzzle, firemode, magazine, ammoCount], where:
Alternative Syntax
- Syntax:
- weaponState [vehicle, turretPath, weapon]
- Parameters:
- [vehicle, turretPath, weapon]: Array
- vehicle: Object
- turretPath: Array
- weapon (Optional): String (since Arma 3 v1.69.140397) - weapon or muzzle name
- Return Value:
- Array - in format [weapon, muzzle, firemode, magazine, ammoCount], where:
Examples
- Example 1:
_wsPlayer = weaponState player; // ["arifle_MXC_ACO_F","arifle_MXC_ACO_F","Single","30Rnd_65x39_caseless_mag",30]
- Example 2:
_wsVehicle = weaponState [_apc, [0]]; // ["autocannon_40mm_CTWS","HE","player","60Rnd_40mm_GPR_Tracer_Red_shells",60]
- Example 3:
_wsVehicle = weaponState [_apc, [0], "AP"]; // ["autocannon_40mm_CTWS","AP","player","40Rnd_40mm_APFSDS_Tracer_Red_shells",40]
Additional Information
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
Notes
Bottom Section
Categories:
- Scripting Commands
- Introduced with Arma 2: Operation Arrowhead version 1.60
- Arma 2: Operation Arrowhead: New Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Command Group: Uncategorised
- Scripting Commands ArmA2
- Scripting Commands Arma 3
- Scripting Commands Take On Helicopters
- ArmA 2 OA: New Scripting Commands List