weaponsItems – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "Killzone Kid" to "Killzone_Kid")
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== no magazine in weapon ==
== no magazine in weapon ==


<!-- CONTINUE Notes -->
<dl class="command_description">
<dl class="command_description">
<dt></dt>
<dd class="notedate">Posted on October 25, 2014 - 01:45 (UTC)</dd>
<dd class="notedate">Posted on October 25, 2014 - 01:45 (UTC)</dd>
<dt class="note">[[User:DreadedEntity|DreadedEntity]]</dt>
<dt class="note">[[User:DreadedEntity|DreadedEntity]]</dt>
<dd class="note">
<dd class="note">
If you use this command on a unit that does not have a magazine loaded, the array containing magazine info is not included (_this select 4). Sample output with running "hint str weaponsItems player;" '''after''' manually removing the magazines from the weapons.<br>Tested with "B_Soldier_F".
If you use this command on a unit that does not have a magazine loaded, the array containing magazine info is not included (_this select 4). Sample output with running "hint str weaponsItems player;" '''after''' manually removing the magazines from the weapons.<br>Tested with "B_Soldier_F".
<code>[
<code style="display: block">[
[
[
"arifle_MX_ACO_pointer_F",
"arifle_MX_ACO_pointer_F",
Line 22: Line 22:
]</code>
]</code>
You can use this code to easily check if an array element exists (note the curly brackets):
You can use this code to easily check if an array element exists (note the curly brackets):
<code>if (isNil {_weaponsItemsOutput select 4}) then {hint "No magazine is loaded";}</code>
<code style="display: block">if (isNil {_weaponsItemsOutput select 4}) then {hint "No magazine is loaded";}</code>
The output does not follow a specific weapon order, weapons will be listed in the order they were picked up or added through script.<br>
The output does not follow a specific weapon order, weapons will be listed in the order they were picked up or added through script.<br>
This command returns an empty array if the unit has no weapons equipped.<br>
This command returns an empty array if the unit has no weapons equipped.<br>
Line 28: Line 28:
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->


Fixed on dev [[User:Killzone Kid|Killzone Kid]] ([[User talk:Killzone Kid|talk]]) 13:48, 11 September 2015 (CEST)
Fixed on dev [[User:Killzone_Kid|Killzone_Kid]] ([[User talk:Killzone_Kid|talk]]) 13:48, 11 September 2015 (CEST)
 
== bipod ==
 
 
<dl class="command_description">
<dt></dt>
<dd class="notedate">Posted on March 16, 2015 - 12:07 (UTC)</dd>
<dt class="note">[[User:Jezuro|Jezuro]]</dt>
<dd class="note">
Since revision 129742, this command also returns an attached bipod.
</dd>
</dl>
 
== old notes need updating ==
 
<dl class="command_description">
<dt></dt>
<dd class="notedate">Posted on October 25, 2014 - 01:45 (UTC)</dd>
<dt class="note">[[User:DreadedEntity|DreadedEntity]]</dt>
<dd class="note">
The output of this command is an array of arrays and is as follows: (If the unit only has 1 weapon, output is an array within an array.)
<code style="display: block">[
[
((_arr select 0) select 0) //STRING - The weapon's classname
((_arr select 0) select 1) //STRING - Classname of the unit's equipped 'Muzzle/Barrel Accessory'
((_arr select 0) select 2) //STRING - Classname of the unit's equipped 'Side Accessory'
((_arr select 0) select 3) //STRING - Classname of the unit's equipped 'Top/Optic Accessory'
((_arr select 0) select 4) //ARRAY - Magazine information
[
(((_arr select 0) select 4) select 0) //STRING - Classname of the loaded magazine
(((_arr select 0) select 4) select 1) //SCALAR(Number) - Amount of bullets in the mag
]
] //If unit has more than one weapon, the output will follow the same pattern as above except with a new element
]</code>
</dd>
</dl>

Latest revision as of 14:48, 12 March 2024

no magazine in weapon

Posted on October 25, 2014 - 01:45 (UTC)
DreadedEntity
If you use this command on a unit that does not have a magazine loaded, the array containing magazine info is not included (_this select 4). Sample output with running "hint str weaponsItems player;" after manually removing the magazines from the weapons.
Tested with "B_Soldier_F". [ [ "arifle_MX_ACO_pointer_F", "", "acc_pointer_IR", "optic_Aco" ], [ "hgun_P07_F", "", "", "" ] ] You can use this code to easily check if an array element exists (note the curly brackets): if (isNil {_weaponsItemsOutput select 4}) then {hint "No magazine is loaded";} The output does not follow a specific weapon order, weapons will be listed in the order they were picked up or added through script.
This command returns an empty array if the unit has no weapons equipped.
All of this was tested in A3 1.32.127785

Fixed on dev Killzone_Kid (talk) 13:48, 11 September 2015 (CEST)

bipod

Posted on March 16, 2015 - 12:07 (UTC)
Jezuro
Since revision 129742, this command also returns an attached bipod.

old notes need updating

Posted on October 25, 2014 - 01:45 (UTC)
DreadedEntity
The output of this command is an array of arrays and is as follows: (If the unit only has 1 weapon, output is an array within an array.) [ [ ((_arr select 0) select 0) //STRING - The weapon's classname ((_arr select 0) select 1) //STRING - Classname of the unit's equipped 'Muzzle/Barrel Accessory' ((_arr select 0) select 2) //STRING - Classname of the unit's equipped 'Side Accessory' ((_arr select 0) select 3) //STRING - Classname of the unit's equipped 'Top/Optic Accessory' ((_arr select 0) select 4) //ARRAY - Magazine information [ (((_arr select 0) select 4) select 0) //STRING - Classname of the loaded magazine (((_arr select 0) select 4) select 1) //SCALAR(Number) - Amount of bullets in the mag ] ] //If unit has more than one weapon, the output will follow the same pattern as above except with a new element ]