allTurrets: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("serv...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma3 | | arma3 | ||
|1.34 | |1.34 | ||
|gr1= Turrets | |gr1= Turrets | ||
|Returns array of available turret paths from vehicle object. | |Returns array of available turret paths from vehicle object. | ||
Line 11: | Line 11: | ||
{{Informative | | {{Informative | | ||
* to look up turrets from config, use [[BIS_fnc_allTurrets]] | * to look up turrets from config, use [[BIS_fnc_allTurrets]] | ||
* to get config from turret path use [[BIS_fnc_turretConfig]]}} | * to get config from turret path use [[BIS_fnc_turretConfig]]}} | ||
| [[allTurrets]] vehicle | | [[allTurrets]] vehicle | ||
|p1= vehicle: [[Object]] | |p1= vehicle: [[Object]] | ||
| [[Array]] | | [[Array]] | ||
|s2= [[allTurrets]] [vehicle, includeFFV] | |s2= [[allTurrets]] [vehicle, includeFFV] | ||
|p21= [vehicle, includeFFV]: [[Array]] | PARAMETER21= | |p21= [vehicle, includeFFV]: [[Array]] | PARAMETER21= | ||
Line 26: | Line 26: | ||
|p23= includeFFV: [[Boolean]] - [[true]] to include FFV (Firing From Vehicle) positions, [[false]] to exclude them |PARAMETER23= | |p23= includeFFV: [[Boolean]] - [[true]] to include FFV (Firing From Vehicle) positions, [[false]] to exclude them |PARAMETER23= | ||
|r2= [[Array]] | |r2= [[Array]] | ||
|x1= <code>_turretPaths = [[allTurrets]] _mySlammerUP; {{cc|[<nowiki/>[0],[0,0]]}} | |x1= <code>_turretPaths = [[allTurrets]] _mySlammerUP; {{cc|[<nowiki/>[0],[0,0]]}} | ||
_turretPaths = [[allTurrets]] [_mySlammerUP, [[true]]]; {{cc|[<nowiki/>[0],[0,0]] <- Commander turret is also an FFV turret}} | _turretPaths = [[allTurrets]] [_mySlammerUP, [[true]]]; {{cc|[<nowiki/>[0],[0,0]] <- Commander turret is also an FFV turret}} | ||
_turretPaths = [[allTurrets]] [_mySlammerUP, [[false]]]; {{cc|[<nowiki/>[0]]}}</code> | _turretPaths = [[allTurrets]] [_mySlammerUP, [[false]]]; {{cc|[<nowiki/>[0]]}}</code> | ||
|x2 = Return FFV turrets only: | |x2 = Return FFV turrets only: | ||
<code>_FFVTurrets = [[allTurrets]] [tank, [[true]]] - [[allTurrets]] [tank, [[false]]]; </code> | <code>_FFVTurrets = [[allTurrets]] [tank, [[true]]] - [[allTurrets]] [tank, [[false]]]; </code> | ||
| [[moveInTurret]], [[enablePersonTurret]], [[assignedVehicleRole]], [[fullCrew]], [[turretUnit]], [[turretLocal]], [[turretOwner]], [[BIS_fnc_allTurrets]], [[BIS_fnc_turretConfig]] | | [[moveInTurret]], [[enablePersonTurret]], [[assignedVehicleRole]], [[fullCrew]], [[turretUnit]], [[turretLocal]], [[turretOwner]], [[BIS_fnc_allTurrets]], [[BIS_fnc_turretConfig]] | ||
}} | }} | ||
Revision as of 00:00, 18 January 2021
Description
- Description:
- Returns array of available turret paths from vehicle object.
- Groups:
- Turrets
Syntax
- Syntax:
- allTurrets vehicle
- Parameters:
- vehicle: Object
- Return Value:
- Array
Alternative Syntax
- Syntax:
- allTurrets [vehicle, includeFFV]
- Parameters:
- [vehicle, includeFFV]: Array
- vehicle: Object
- includeFFV: Boolean - true to include FFV (Firing From Vehicle) positions, false to exclude them
- Return Value:
- Array
Examples
- Example 1:
_turretPaths = allTurrets _mySlammerUP; // [[0],[0,0]] _turretPaths = allTurrets [_mySlammerUP, true]; // [[0],[0,0]] <- Commander turret is also an FFV turret _turretPaths = allTurrets [_mySlammerUP, false]; // [[0]]
- Example 2:
- Return FFV turrets only:
_FFVTurrets = allTurrets [tank, true] - allTurrets [tank, false];
Additional Information
- See also:
- moveInTurretenablePersonTurretassignedVehicleRolefullCrewturretUnitturretLocalturretOwnerBIS_fnc_allTurretsBIS_fnc_turretConfig
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
- Posted on April 13, 2016 - 19:13 (UTC)
- AgentRev
-
The first syntax (vehicle only without boolean) will include commander turrets like in the example, and does not include actual FFV turrets like offroad back seats, as expected.
Also, the driver turret [-1] is never included in the results, which can be solved as follows:_paths = [[-1]] + allTurrets _vehicle;