allTurrets: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Game name" to "|Game name=")
Line 5: Line 5:


|1.34|Game version=
|1.34|Game version=
____________________________________________________________________________________________


|Returns array of available turret paths from vehicle object.
{{Informative |
* to look up turrets from config, use [[BIS_fnc_allTurrets]]
* to get config from turret path use [[BIS_fnc_turretConfig]]}} |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


|Returns array of available turret paths from vehicle object. To look up turrets from config, use [[BIS_fnc_allTurrets]], to get config from turret path use [[BIS_fnc_turretConfig]]|DESCRIPTION=
| [[allTurrets]] vehicle |SYNTAX=
 
|p1= vehicle: [[Object]] |PARAMETER1=
 
| [[Array]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________


|'''allTurrets''' vehicle|SYNTAX=
|s2= [[allTurrets]] [vehicle, includeFFV] |SYNTAX2=
|p1 = vehicle: [[Object]]
 
| [[Array]] |RETURNVALUE= |RETURNVALUE=
|p21= vehicle: [[Object]] | PARAMETER21=
____________________________________________________________________________________________
 
|s2='''allTurrets''' [vehicle, personTurrets]|SYNTAX=
|p22= includeFFV: [[Boolean]] - [[true]] to include FFV (Firing From Vehicle) positions, [[false]] to exclude them |PARAMETER22=
|p21 = [vehicle, personTurrets]: [[Array]]  
 
|p22 = vehicle: [[Object]]
|r2= [[Array]] |RETURNVALUE2=
|p23 = personTurrets: [[Boolean]]
* [[true]] - include person (cargo) FFV (firing from vehicle) turrets
* [[false]] - exclude person (cargo) FFV turrets
|r2= [[Array]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1 = <code>_turretPaths = [[allTurrets]] SlammerUP; //<nowiki>[</nowiki>[0],[0,0]]
|x1= <code>_turretPaths = [[allTurrets]] _mySlammerUP; {{cc|[<nowiki/>[0],[0,0]]}}
_turretPaths = [[allTurrets]] [SlammerUP, [[true]]]; //<nowiki>[</nowiki>[0],[0,0]] <- Commander turret is also FFV turret
_turretPaths = [[allTurrets]] [_mySlammerUP, [[true]]]; {{cc|[<nowiki/>[0],[0,0]] <- Commander turret is also an FFV turret}}
_turretPaths = [[allTurrets]] [SlammerUP, [[false]]]; //<nowiki>[</nowiki>[0]]</code> |EXAMPLE1=
_turretPaths = [[allTurrets]] [_mySlammerUP, [[false]]]; {{cc|[<nowiki/>[0]]}}</code> |EXAMPLE1=


 
|x2 = Return FFV turrets only:
|x2 = Return FFV turrets only: <code>_FFVTurrets = [[allTurrets]] [tank, [[true]]] - [[allTurrets]] [tank, [[false]]]; </code> |EXAMPLE2=
<code>_FFVTurrets = [[allTurrets]] [tank, [[true]]] - [[allTurrets]] [tank, [[false]]]; </code> |EXAMPLE2=


| [[moveInTurret]], [[enablePersonTurret]], [[assignedVehicleRole]], [[fullCrew]], [[turretUnit]], [[turretLocal]], [[turretOwner]], [[BIS_fnc_allTurrets]], [[BIS_fnc_turretConfig]] |SEEALSO=
| [[moveInTurret]], [[enablePersonTurret]], [[assignedVehicleRole]], [[fullCrew]], [[turretUnit]], [[turretLocal]], [[turretOwner]], [[BIS_fnc_allTurrets]], [[BIS_fnc_turretConfig]] |SEEALSO=
}}
}}


Line 51: Line 56:
<br/>
<br/>
Also, the driver turret [-1] is never included in the results, which can be solved as follows:
Also, the driver turret [-1] is never included in the results, which can be solved as follows:
<code>_paths = <nowiki>[[-1]]</nowiki> + [[allTurrets]] _vehicle;</code>
<code>_paths = [<nowiki/>[-1]] + [[allTurrets]] _vehicle;</code>
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 01:33, 1 October 2019

Hover & click on the images for description

Description

Description:
Returns array of available turret paths from vehicle object.
Groups:
Uncategorised

Syntax

Syntax:
allTurrets vehicle
Parameters:
vehicle: Object
Return Value:
Array

Alternative Syntax

Syntax:
allTurrets [vehicle, includeFFV]
Parameters:
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;