fullCrew: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Some wiki formatting)
 
(31 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command


| arma3 |Game name=
|game1= arma3
|version1= 1.34


|1.34|Game version=
|arg= global


|arg= global|Multiplayer Arguments=
|gr1= Object Manipulation


|gr1= Object Manipulation |GROUP1=
|descr= Returns an array with all crew inside given vehicle, with or without empty seats.


| 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}}).
}}


{{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=
|s1= [[fullCrew]] vehicle


| [[fullCrew]] vehicle |SYNTAX=
|p1= vehicle: [[Object]]


|p1 = vehicle: [[Object]]
|r1= [[Array]] - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret, assignedUnit, positionName]:
 
| [[Array]] - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret]:
* unit: [[Object]]
* unit: [[Object]]
* role: [[String]] - not always lowercase
* role: [[String]] - not always lowercase before {{GVI|arma3|2.04|size= 0.75}}
* cargoIndex: [[Number]]
* cargoIndex: [[Number]]
* turretPath: [[Array]]
* turretPath: [[Array]]
* personTurret: [[Boolean]] |RETURNVALUE=
* 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"


|s2= [[fullCrew]] [vehicle, type, includeEmpty] |SYNTAX2=
|s2= [[fullCrew]] [vehicle, type, includeEmpty]


|p21= vehicle: [[Object]]
|p21= vehicle: [[Object]]
Line 35: Line 39:
* "cargo"
* "cargo"


|p23= {{GVI|arma3|1.56}} includeEmpty: [[Boolean]] - (Optional, default [[false]]) include empty crew seats {{Since|arma3|1.55.133810|y}}
|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]:
|r2= [[Array]] - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret, assignedUnit, positionName]:
* unit: [[Object]]
* unit: [[Object]]
* role: [[String]] - not always lowercase
* role: [[String]] - not always lowercase before {{GVI|arma3|2.04|size= 0.75}}
* cargoIndex: [[Number]]
* cargoIndex: [[Number]]
* turretPath: [[Array]]
* turretPath: [[Array]]
* personTurret: [[Boolean]] |RETURNVALUE2=
* 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= <code>_list = [[fullCrew]] [[vehicle]] [[player]];</code> |EXAMPLE1=
|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= <code>_list = [[fullCrew]] [<nowiki/>[[vehicle]] [[player]], "turret"];</code> |EXAMPLE2=
|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= <code>[[private]] _actionCompatibleCargoIndexes = [[fullCrew]] [heli, "cargo", [[true]]];
|x3= <sqf>
{{codecomment|/*
private _actionCompatibleCargoIndexes = fullCrew [heli, "cargo", true];
returns for example (on an armed WY-55 Hellcat):
/*
returns for example (on an empty armed WY-55 Hellcat):
[
[
[<nowiki/>[[objNull]], "cargo" ,2, [], [[false]]],
[objNull, "cargo", 2, [], false, objNull, "$STR_GETIN_POS_PASSENGER"],
[<nowiki/>[[objNull]], "cargo", 3, [], [[false]]],
[objNull, "cargo", 3, [], false, objNull, "$STR_GETIN_POS_PASSENGER"],
[<nowiki/>[[objNull]], "cargo", 4, [], [[false]]],
[objNull, "cargo", 4, [], false, objNull, "$STR_GETIN_POS_PASSENGER"],
[<nowiki/>[[objNull]], "cargo", 5, [], [[false]]]
[objNull, "cargo", 5, [], false, objNull, "$STR_GETIN_POS_PASSENGER"]
]
]
using the element's index is compatible with action cargo commands - see below
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:}}
// the following commands will put the player in the same seat:
[[player]] [[moveInCargo]] [heli, 2];
player moveInCargo [heli, 2];
[[player]] [[action]] ["GetInCargo", heli, 0];
player action ["GetInCargo", heli, 0];
</code> |EXAMPLE3=
</sqf>


| [[crew]], [[createVehicleCrew]], [[assignedVehicleRole]], [[allTurrets]] |SEEALSO=
|seealso= [[crew]] [[createVehicleCrew]] [[assignedVehicleRole]] [[allTurrets]] [[emptyPositions]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
</dl>
<h3 style="display:none">Bottom Section</h3>

Latest revision as of 18: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