fullCrew: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Some wiki formatting)
 
(48 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma 3 |= Game name
|game1= arma3
|1.34|= Game version
|version1= 1.34
|arg= global|= Arguments in MP
____________________________________________________________________________________________


|Returns array with all crew inside given vehicle. Since Arma 3 v1.55.133810 it is possible to return empty seats as well.|= Description
|arg= global
____________________________________________________________________________________________


|'''fullCrew''' vehicle|= Syntax
|gr1= Object Manipulation
|p1 = vehicle: [[Object]]
| [[Array]] - format <nowiki>[[</nowiki><[[Object]]>unit,<[[String]]>role,<[[Number]]>cargoIndex,<[[Array]]>turretPath,<[[Boolean]]>personTurret], ...] |= Return value
____________________________________________________________________________________________
|s2='''fullCrew''' [vehicle, type, includeEmpty]|= Syntax
|p21 = [vehicle, type]: [[Array]]|=
|p22 = vehicle: [[Object]]|=
|p23 = type: [[String]] - filter (role) available values are "driver", "commander", "gunner", "turret", "cargo"|=
|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,<[[Array]]>turretPath,<[[Boolean]]>personTurret], ...] |= Return value
____________________________________________________________________________________________
|x1 = <code>_list = [[fullCrew]] [[vehicle]] [[player]];</code> |= Example1
|x2 = <code>_list = [[fullCrew]] <nowiki>[</nowiki>[[vehicle]] [[player]], "turret"];</code> |= Example2


| [[crew]], [[createVehicleCrew]], [[assignedVehicleRole]], [[allTurrets]] |= See also
|descr= Returns an array with all crew inside given vehicle, with or without empty seats.


{{Feature|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 {{Link|#Example 3}}).
}}
}}


<h3 style="display:none">Notes</h3>
|s1= [[fullCrew]] vehicle
<dl class="command_description">


</dl>
|p1= vehicle: [[Object]]


<h3 style="display:none">Bottom Section</h3>
|r1= [[Array]] - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret, assignedUnit, positionName]:
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
* unit: [[Object]]
* role: [[String]] - not always lowercase before {{GVI|arma3|2.04|size= 0.75}}
* cargoIndex: [[Number]]
* turretPath: [[Array]]
* personTurret: [[Boolean]]
* {{GVI|arma3|2.12|size= 0.75}} assignedUnit: [[Object]] - see ''assignAsXXX'' commands, [[assignAsDriver]] for example
* {{GVI|arma3|2.12|size= 0.75}} positionName: [[String]] - un[[localize]]d entry for turret's `gunnerName`, for example "$STR_A3_TURRETS_CARGOTURRET_R2"


<!-- CONTINUE Notes -->
|s2= [[fullCrew]] [vehicle, type, includeEmpty]
<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's "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 -->


<!-- CONTINUE Notes -->
|p21= vehicle: [[Object]]
<dl class="command_description">
 
<dd class="notedate">Posted on March 8, 2017 - 12:03 (UTC)</dd>
|p22= type: [[String]] - role filter (case-insensitive). An invalid value (e.g "") will return all positions. Available values:
<dt class="note">[[User:Commy2|Commy2]]</dt>
* "driver"
<dd class="note">
* "commander"
Be careful when using the cargoIndex reported by this command together with [[action]] "moveToCargo". The indices do no match up and are shifted by the number of person turret slots (firing from vehicle positions).
* "gunner"
</dd>
* "turret"
</dl>
* "cargo"
<!-- DISCONTINUE Notes -->
 
|p23= includeEmpty: [[Boolean]] - (Optional, default [[false]]) include empty crew seats
|p23since= arma3 1.56
 
|r2= [[Array]] - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret, assignedUnit, positionName]:
* unit: [[Object]]
* role: [[String]] - not always lowercase before {{GVI|arma3|2.04|size= 0.75}}
* cargoIndex: [[Number]]
* turretPath: [[Array]]
* personTurret: [[Boolean]]
* {{GVI|arma3|2.12|size= 0.75}} assignedUnit: [[Object]] - see ''assignAsXXX'' commands, [[assignAsDriver]] for example
* {{GVI|arma3|2.12|size= 0.75}} positionName: [[String]] - un[[localize]]d entry for turret's `gunnerName`, for example "$STR_A3_TURRETS_CARGOTURRET_R2"
 
|x1= <sqf>
_list = fullCrew vehicle player;
/*
returns for example (on an armed WY-55 Hellcat):
[
[R Alpha 1-1:1, "driver", -1, [], false, R Alpha 1-1:1, "$STR_POSITION_DRIVER"],
[R Alpha 1-1:2, "turret", -1, [0], false, R Alpha 1-1:2, "$STR_A3_COPILOT"]
]
*/
</sqf>
 
|x2= <sqf>
_list = fullCrew [vehicle player, "turret"];
/*
returns for example (on an armed WY-55 Hellcat):
[
[R Alpha 1-1:2, "turret", -1, [0], false, R Alpha 1-1:2, "$STR_A3_COPILOT"]
]
*/
</sqf>
 
|x3= <sqf>
private _actionCompatibleCargoIndexes = fullCrew [heli, "cargo", true];
/*
returns for example (on an empty armed WY-55 Hellcat):
[
[objNull, "cargo", 2, [], false, objNull, "$STR_GETIN_POS_PASSENGER"],
[objNull, "cargo", 3, [], false, objNull, "$STR_GETIN_POS_PASSENGER"],
[objNull, "cargo", 4, [], false, objNull, "$STR_GETIN_POS_PASSENGER"],
[objNull, "cargo", 5, [], false, objNull, "$STR_GETIN_POS_PASSENGER"]
]
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];
</sqf>
 
|seealso= [[crew]] [[createVehicleCrew]] [[assignedVehicleRole]] [[allTurrets]] [[emptyPositions]]
}}

Latest revision as of 17:05, 29 April 2023

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, assignedUnit, positionName]:

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"
since Arma 3 logo black.png1.56
includeEmpty: Boolean - (Optional, default false) include empty crew seats
Return Value:
Array - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret, assignedUnit, positionName]:

Examples

Example 1:
_list = fullCrew vehicle player; /* returns for example (on an armed WY-55 Hellcat): [ [R Alpha 1-1:1, "driver", -1, [], false, R Alpha 1-1:1, "$STR_POSITION_DRIVER"], [R Alpha 1-1:2, "turret", -1, [0], false, R Alpha 1-1:2, "$STR_A3_COPILOT"] ] */
Example 2:
_list = fullCrew [vehicle player, "turret"]; /* returns for example (on an armed WY-55 Hellcat): [ [R Alpha 1-1:2, "turret", -1, [0], false, R Alpha 1-1:2, "$STR_A3_COPILOT"] ] */
Example 3:
private _actionCompatibleCargoIndexes = fullCrew [heli, "cargo", true]; /* returns for example (on an empty armed WY-55 Hellcat): [ [objNull, "cargo", 2, [], false, objNull, "$STR_GETIN_POS_PASSENGER"], [objNull, "cargo", 3, [], false, objNull, "$STR_GETIN_POS_PASSENGER"], [objNull, "cargo", 4, [], false, objNull, "$STR_GETIN_POS_PASSENGER"], [objNull, "cargo", 5, [], false, objNull, "$STR_GETIN_POS_PASSENGER"] ] 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:
crew createVehicleCrew assignedVehicleRole allTurrets emptyPositions

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