weaponState: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "[[Category:ArmA 2 OA: New Scripting Commands List" to "[[Category:Arma 2: Operation Arrowhead: New Scripting Commands List") |
Lou Montana (talk | contribs) m (Fix Category:Pages using duplicate arguments in template calls and description) |
||
Line 7: | Line 7: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Returns the currently selected weapon state for unit or vehicle. | | Returns the currently selected weapon state for unit or vehicle.<br><br> | ||
<br><br>Since | {{Feature arma3 | | ||
* | Since {{arma3}} v1.69.140397 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.<br>(keep in mind that by default a vehicle has no weapons selected) | |||
* 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. | * Muzzle name is supported as well as weapon name. The command searches for weapon first, then if not found, muzzle is searched for. }}|DESCRIPTION= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | [[weaponState]] unit |SYNTAX= | ||
|p1= unit: [[Object]] |PARAMETER1= | |p1= unit: [[Object]] |PARAMETER1= | ||
Line 26: | Line 27: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|s2= | |s2= [[weaponState]] [vehicle, turretPath, weapon] |SYNTAX2= | ||
|p21 = [vehicle, turretPath, weapon]: [[Array]] |PARAMETER21= | |p21= [vehicle, turretPath, weapon]: [[Array]] |PARAMETER21= | ||
|p22= vehicle: [[Object]] | | |p22= vehicle: [[Object]] |PARAMETER22= | ||
|p23= turretPath: [[Array]] | | |||
|p24= weapon (Optional): [[String]] (since Arma 3 v1.69.140397) - weapon or muzzle name |= | |p23= turretPath: [[Array]] |PARAMETER23= | ||
|p24= weapon (Optional): [[String]] (since Arma 3 v1.69.140397) - weapon or muzzle name |PARAMETER24= | |||
|r2= [[Array]] - in format [weapon, muzzle, firemode, magazine, ammoCount], where: | |r2= [[Array]] - in format [weapon, muzzle, firemode, magazine, ammoCount], where: | ||
Line 39: | Line 42: | ||
* firemode: [[String]] | * firemode: [[String]] | ||
* magazine: [[String]] | * magazine: [[String]] | ||
* ammoCount: [[Number]] | | * ammoCount: [[Number]] |RETURNVALUE2= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[ | |x1= <code>_wsPlayer = [[weaponState]] [[player]]; {{cc|["arifle_MXC_ACO_F","arifle_MXC_ACO_F","Single","30Rnd_65x39_caseless_mag",30]}}</code> |EXAMPLE1= | ||
|x2= <code>_wsVehicle = [[weaponState]] [_apc, [0]]; {{cc|["autocannon_40mm_CTWS","HE","player","60Rnd_40mm_GPR_Tracer_Red_shells",60]}}</code> |EXAMPLE2= | |||
|x3= <code>_wsVehicle = [[weaponState]] [_apc, [0], "AP"]; {{cc|["autocannon_40mm_CTWS","AP","player","40Rnd_40mm_APFSDS_Tracer_Red_shells",40]}}</code> |EXAMPLE3= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[weapons]], [[selectWeaponTurret]], [[loadMagazine]], [[magazinesTurret]], [[weaponsTurret]] |SEEALSO= | |||
}} | }} | ||
Line 64: | Line 63: | ||
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]] | ||
Revision as of 10:57, 1 October 2019
Description
- Description:
- Returns the currently selected weapon state for unit or vehicle.
- 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