emptyPositions: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 20: Line 20:
|gr2= Unit Control
|gr2= Unit Control


|descr= Returns the number of given positions in the vehicle.
|descr= Returns the number of given empty positions in the vehicle.
{{Feature | Informative | To return the actual units in the vehicle use [[fullCrew]]. However if only the number is desired, use '''emptyPositions''' because it is faster.}}
{{Feature|informative|To return the actual units in the vehicle use [[fullCrew]]. However if only the number is desired, use [[emptyPositions]] because it is faster.}}


|s1= vehicle [[emptyPositions ]] position
|s1= vehicle [[emptyPositions]] position


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


|p2= position: [[String]] - can be one of:
|p2= position: [[String]] - can be one of:
{{Columns|2|
* {{hl|"Commander"}}
* {{hl|"Commander"}}
* {{hl|"Driver"}}
* {{hl|"Driver"}}
* {{hl|"Gunner"}}
* {{hl|"Gunner"}}
* {{hl|"Cargo"}} - Cargo + FFV
* {{hl|"Cargo"}} - all cargo positions, FFV or not
* {{hl|""}} - all empty position (since 2.10)
* {{GVI|arma3|2.10|size= 0.75}} {{hl|""}} - all empty positions
* {{GVI|arma3|2.10|size= 0.75}} {{hl|"CargoNoFFV"}} - non-FFV cargo
* {{GVI|arma3|2.10|size= 0.75}} {{hl|"CargoFFV"}} - FFV cargo
* {{GVI|arma3|2.14|size= 0.75}} {{hl|"Turret"}} - empty turrets (no FFV turrets, they are included in "CargoFFV")
}}


|r1= [[Number]]
|r1= [[Number]]


|s2= vehicle [[emptyPositions ]] [position, filter]
|x1= <sqf>_freeCargoAndFFVPositions = vehicle player emptyPositions "Cargo";</sqf>
|s2since= Arma3 2.10


|p21= vehicle: [[Object]]
|x2= <sqf>_freeCargoOnlyPositions = vehicle player emptyPositions "CargoNoFFV";</sqf>
 
|p22= position: [[String]] - can be one of:
 
* {{hl|"Commander"}}
* {{hl|"Driver"}}
* {{hl|"Gunner"}}
* {{hl|"Cargo"}} - Cargo/FFV/Cargo+FFV (depends on 'filter' value)
* {{hl|""}} - all empty position (depends on 'filter' value)
 
|p22= filter: [[Boolean]] - [[true]]: Cargo only, [[false]]: FFV only, ommited: Cargo+FFV (Default)
 
|r2= [[Number]]
 
|x1= <sqf>_freeCargoAndFFVPositions = vehicle player emptyPositions "cargo";</sqf>
|x2= <sqf>_freeCargoOnlyPositions = vehicle player emptyPositions ["cargo", true];</sqf>


|seealso= [[moveInDriver]] [[moveInTurret]] [[moveInCommander]] [[moveInGunner]] [[moveInCargo]] [[getCargoIndex]]
|seealso= [[moveInDriver]] [[moveInTurret]] [[moveInCommander]] [[moveInGunner]] [[moveInCargo]] [[getCargoIndex]]

Latest revision as of 19:16, 12 February 2023

Hover & click on the images for description

Description

Description:
Returns the number of given empty positions in the vehicle.
To return the actual units in the vehicle use fullCrew. However if only the number is desired, use emptyPositions because it is faster.
Groups:
Object ManipulationUnit Control

Syntax

Syntax:
vehicle emptyPositions position
Parameters:
vehicle: Object
position: String - can be one of:
  • "Commander"
  • "Driver"
  • "Gunner"
  • "Cargo" - all cargo positions, FFV or not
  • Arma 3 logo black.png2.10 "" - all empty positions
  • Arma 3 logo black.png2.10 "CargoNoFFV" - non-FFV cargo
  • Arma 3 logo black.png2.10 "CargoFFV" - FFV cargo
  • Arma 3 logo black.png2.14 "Turret" - empty turrets (no FFV turrets, they are included in "CargoFFV")
Return Value:
Number

Examples

Example 1:
_freeCargoAndFFVPositions = vehicle player emptyPositions "Cargo";
Example 2:
_freeCargoOnlyPositions = vehicle player emptyPositions "CargoNoFFV";

Additional Information

See also:
moveInDriver moveInTurret moveInCommander moveInGunner moveInCargo getCargoIndex

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
DreadedEntity - c
Posted on Mar 20, 2022 - 00:08 (UTC)
emptyPositions combines both turret and cargo in its output. If you must know the true count of either, you will have to use fullCrew (tested on several vehicles)
I have not found a way to test for copilot in helicopters