fullCrew: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
(Fix description)
Line 2: Line 2:
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma 3 |Game name=
| arma3 |Game name=
 
|1.34|Game version=
|1.34|Game version=
|arg= global|Multiplayer Arguments=
|arg= global|Multiplayer Arguments=


Line 9: Line 11:
____________________________________________________________________________________________
____________________________________________________________________________________________


|Returns array with all crew inside given vehicle. Since Arma 3 v1.55.133810 it is possible to return empty seats as well.<br><br>
| Returns an array with all crew inside given vehicle, with or without empty seats.
'''NOTE''' that with introduction of person turrets, the cargo indexes listed in the return are true for [[moveInCargo]] command but incompatible with [[action]]s such as "GetInCargo" and "MoveToCargo". To find out seats compatible with cargo action commands, execute command with "cargo" filter:
 
<code>[[fullCrew]] [heli, "cargo", [[true]]];</code>
{{Important | With the introduction of person turrets (FFV), the returned ''cargoIndex'' works with [[moveInCargo]] but does not with [[action]]s such as "GetInCargo" and "MoveToCargo". To find out indexes for actions, use the "cargo" filter (See [[#Examples|Example 3]]).}} |DESCRIPTION=
The return array is ordered according to cargo index compatible with action cargo commands, i.e. 1st element has index 0, second - index 1, etc. For example armed WY-55 Hellcat reports:
* <tt>[[<NULL-object>,"cargo",2,[],false],[<NULL-object>,"cargo",3,[],false],[<NULL-object>,"cargo",4,[],false],[<NULL-object>,"cargo",5,[],false]]</tt>
for cargo positions. The following commands will put player in the same seat:
<code>[[player]] [[moveInCargo]] [heli, 2];
[[player]] [[action]] ["GetInCargo", heli, 0];</code>|DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


|'''fullCrew''' vehicle|SYNTAX=
| [[fullCrew]] vehicle |SYNTAX=
 
|p1 = vehicle: [[Object]]
|p1 = vehicle: [[Object]]
| [[Array]] - format <nowiki>[[</nowiki><[[Object]]>unit,<[[String]]>role,<[[Number]]>cargoIndex  (see note in description),<[[Array]]>turretPath,<[[Boolean]]>personTurret], ...] |RETURNVALUE=
 
| [[Array]] - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret]:
* unit: [[Object]]
* role: [[String]] - not always lowercase
* cargoIndex: [[Number]]
* turretPath: [[Array]]
* personTurret: [[Boolean]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________
|s2='''fullCrew''' [vehicle, type, includeEmpty]|SYNTAX2=
 
|p21 = [vehicle, type, includeEmpty]: [[Array]]
|s2= [[fullCrew]] [vehicle, type, includeEmpty] |SYNTAX2=
|p22 = vehicle: [[Object]]
 
|p23 = type: [[String]] - filter (role) available values are "driver", "commander", "gunner", "turret", "cargo"
|p21= vehicle: [[Object]]
|p24 = includeEmpty (Optional): [[Boolean]] - (''since Arma 3 v1.55.133810'') include empty crew seats too
 
|r2= [[Array]] - format <nowiki>[[</nowiki><[[Object]]>unit,<[[String]]>role,<[[Number]]>cargoIndex (see note in description),<[[Array]]>turretPath,<[[Boolean]]>personTurret], ...] |RETURNVALUE2=
|p22= type: [[String]] - role filter (case-insensitive). An invalid value (e.g "") will return all positions. Available values:
* "driver"
* "commander"
* "gunner"
* "turret"
* "cargo"
 
|p23= {{GVI|arma3|1.56}} includeEmpty: [[Boolean]] - (Optional, default [[false]]) include empty crew seats {{since|arma3|1.55.133810|y}}
 
|r2= [[Array]] - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret]:
* unit: [[Object]]
* role: [[String]] - not always lowercase
* cargoIndex: [[Number]]
* turretPath: [[Array]]
* personTurret: [[Boolean]] |RETURNVALUE2=
____________________________________________________________________________________________
____________________________________________________________________________________________
|x1 = <code>_list = [[fullCrew]] [[vehicle]] [[player]];</code> |EXAMPLE1=
 
|x2 = <code>_list = [[fullCrew]] [<nowiki/>[[vehicle]] [[player]], "turret"];</code> |EXAMPLE2=
|x1= <code>_list = [[fullCrew]] [[vehicle]] [[player]];</code> |EXAMPLE1=
 
|x2= <code>_list = [[fullCrew]] [<nowiki/>[[vehicle]] [[player]], "turret"];</code> |EXAMPLE2=
 
|x3= <code>[[private]] _actionCompatibleCargoIndexes = [[fullCrew]] [heli, "cargo", [[true]]];
{{codecomment|/*
returns for example (on an armed WY-55 Hellcat):
[
[<nowiki/>[[objNull]], "cargo" ,2, [], [[false]]],
[<nowiki/>[[objNull]], "cargo", 3, [], [[false]]],
[<nowiki/>[[objNull]], "cargo", 4, [], [[false]]],
[<nowiki/>[[objNull]], "cargo", 5, [], [[false]]]
]
using the element's index is compatible with action cargo commands - see below
<nowiki/>*/}}
 
{{cc|the following commands will put the player in the same seat:}}
[[player]] [[moveInCargo]] [heli, 2];
[[player]] [[action]] ["GetInCargo", heli, 0];
</code> |EXAMPLE3=


| [[crew]], [[createVehicleCrew]], [[assignedVehicleRole]], [[allTurrets]] |SEEALSO=
| [[crew]], [[createVehicleCrew]], [[assignedVehicleRole]], [[allTurrets]] |SEEALSO=
Line 42: Line 79:


<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on December 13, 2014 - 22:54 (UTC)</dd>
<dt class="note">[[User:Commy2|Commy2]]</dt>
<dd class="note">
Be aware that the returned role may or may not be in lowercase. E.g. it is "driver" for the driver, but "Turret" for turret units.<br>
<br>
As of Arma 3 version 1.36, the alternative syntax of this command returns all crew members if the filter is anything except "driver", "commander", "gunner", "turret" or "cargo"<br>
The filter is not case sensitive.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 23:39, 9 December 2020

Hover & click on the images for description

Description

Description:
Returns an array with all crew inside given vehicle, with or without empty seats.
With the introduction of person turrets (FFV), the returned cargoIndex works with moveInCargo but does not with actions such as "GetInCargo" and "MoveToCargo". To find out indexes for actions, use the "cargo" filter (See Example 3).
Groups:
Object Manipulation

Syntax

Syntax:
fullCrew vehicle
Parameters:
vehicle: Object
Return Value:
Array - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret]:

Alternative Syntax

Syntax:
fullCrew [vehicle, type, includeEmpty]
Parameters:
vehicle: Object
type: String - role filter (case-insensitive). An invalid value (e.g "") will return all positions. Available values:
  • "driver"
  • "commander"
  • "gunner"
  • "turret"
  • "cargo"
Arma 3 logo black.png1.56 includeEmpty: Boolean - (Optional, default false) include empty crew seats Template:since
Return Value:
Array - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret]:

Examples

Example 1:
_list = fullCrew vehicle player;
Example 2:
_list = fullCrew [vehicle player, "turret"];
Example 3:
private _actionCompatibleCargoIndexes = fullCrew [heli, "cargo", true]; /* returns for example (on an armed WY-55 Hellcat): [ [objNull, "cargo" ,2, [], false], [objNull, "cargo", 3, [], false], [objNull, "cargo", 4, [], false], [objNull, "cargo", 5, [], false] ] using the element's index is compatible with action cargo commands - see below */ // the following commands will put the player in the same seat: player moveInCargo [heli, 2]; player action ["GetInCargo", heli, 0];

Additional Information

See also:
crewcreateVehicleCrewassignedVehicleRoleallTurrets

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