fullCrew: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{HashLink" to "{{Link")
(Fix return value)
Line 16: Line 16:
|p1= vehicle: [[Object]]
|p1= vehicle: [[Object]]


|r1= [[Array]] - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret, assignedUnit]:
|r1= [[Array]] - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret, assignedUnit, positionName]:
* unit: [[Object]]
* unit: [[Object]]
* role: [[String]] - not always lowercase (from 2.03 always lower case)
* role: [[String]] - not always lowercase before {{GVI|arma3|2.04|size= 0.75}}
* cargoIndex: [[Number]]
* cargoIndex: [[Number]]
* turretPath: [[Array]]
* turretPath: [[Array]]
* personTurret: [[Boolean]]
* personTurret: [[Boolean]]
* {{GVI|arma3|2.12}} assignedUnit: [[Object]] - see ''assignAsXXX'' commands, [[assignAsDriver]] for example
* {{GVI|arma3|2.12|size= 0.75}} assignedUnit: [[Object]] - see ''assignAsXXX'' commands, [[assignAsDriver]] for example
* {{GVI|arma3|2.12}} positionName: [[String]] - un[[localize]]d entry for turret's `gunnerName`, for example "$STR_A3_TURRETS_CARGOTURRET_R2"
* {{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]
|s2= [[fullCrew]] [vehicle, type, includeEmpty]
Line 39: Line 39:
|p23since= arma3 1.56
|p23since= arma3 1.56


|r2= [[Array]] - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret, assignedUnit]:
|r2= [[Array]] - list of arrays in format [unit, role, cargoIndex, turretPath, personTurret, assignedUnit, positionName]:
* unit: [[Object]]
* unit: [[Object]]
* role: [[String]] - not always lowercase (from 2.03 always lower case)
* role: [[String]] - not always lowercase before {{GVI|arma3|2.04|size= 0.75}}
* cargoIndex: [[Number]]
* cargoIndex: [[Number]]
* turretPath: [[Array]]
* turretPath: [[Array]]
* personTurret: [[Boolean]]
* personTurret: [[Boolean]]
* {{GVI|arma3|2.12}} assignedUnit: [[Object]] - see ''assignAsXXX'' commands, [[assignAsDriver]] for example
* {{GVI|arma3|2.12|size= 0.75}} assignedUnit: [[Object]] - see ''assignAsXXX'' commands, [[assignAsDriver]] for example
* {{GVI|arma3|2.12}} positionName: [[String]] - un[[localize]]d entry for turret's `gunnerName`, for example "$STR_A3_TURRETS_CARGOTURRET_R2"
* {{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;</sqf>
|x1= <sqf>_list = fullCrew vehicle player;</sqf>

Revision as of 21:22, 24 March 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;
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:
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