allTurrets: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Bot: Reverted to revision 108914 by killzone_kid on 2018-07-22T19:20:34Z)
m (Some wiki formatting)
 
(55 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


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


|1.34|= Game version
|gr1= Turrets


____________________________________________________________________________________________
|descr= Returns array of available turret paths from vehicle object.


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


|'''allTurrets''' vehicle|= Syntax
|s1= [[allTurrets]] vehicle
|p1 = vehicle: [[Object]]
| [[Array]] |= Return value |= Return value
____________________________________________________________________________________________
|s2='''allTurrets''' [vehicle, personTurrets]|= Syntax
|p21 = [vehicle, personTurrets]: [[Array]]
|p22 = vehicle: [[Object]]
|p23 = personTurrets: [[Boolean]]
* [[true]] - include person (cargo) FFV (firing from vehicle) turrets
* [[false]] - exclude person (cargo) FFV turrets
|r2= [[Array]]  |= Return value
____________________________________________________________________________________________


|x1 = <code>_turretPaths = [[allTurrets]] SlammerUP; //<nowiki>[</nowiki>[0],[0,0]]
|p1= vehicle: [[Object]]
_turretPaths = [[allTurrets]] [SlammerUP, [[true]]]; //<nowiki>[</nowiki>[0],[0,0]] <- Commander turret is also FFV turret
_turretPaths = [[allTurrets]] [SlammerUP, [[false]]]; //<nowiki>[</nowiki>[0]]</code> |= Example1


|r1= [[Array]] of [[Array]]s format [[Turret Path]]


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


| [[moveInTurret]], [[enablePersonTurret]], [[assignedVehicleRole]], [[fullCrew]], [[turretUnit]], [[turretLocal]], [[turretOwner]], [[BIS_fnc_allTurrets]] |= See also
|p21= vehicle: [[Object]]


}}
|p22= includeFFV: [[Boolean]] - [[true]] to include FFV (Firing From Vehicle) positions, [[false]] to exclude them


<h3 style="display:none">Notes</h3>
|r2= [[Array]] of [[Array]]s format [[Turret Path]]
<dl class="command_description">


</dl>
|x1= <sqf>
_turretPaths = allTurrets _mySlammerUP; // [[0],[0,0]]
_turretPaths = allTurrets [_mySlammerUP, true]; // [[0],[0,0]] <- commander turret is also an FFV turret
_turretPaths = allTurrets [_mySlammerUP, false]; // [<nowiki/>[0]]
</sqf>


<h3 style="display:none">Bottom Section</h3>
|x2= Return FFV turrets only:
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
<sqf>_FFVTurrets = allTurrets [tank, true] - allTurrets [tank, false];</sqf>


<!-- CONTINUE Notes -->
|seealso= [[moveInTurret]] [[enablePersonTurret]] [[assignedVehicleRole]] [[fullCrew]] [[turretUnit]] [[turretLocal]] [[turretOwner]] [[BIS_fnc_allTurrets]] [[BIS_fnc_turretConfig]]
<dl class="command_description">
}}
<dd class="notedate">Posted on April 13, 2016 - 19:13 (UTC)</dd>
 
<dt class="note">[[User:AgentRevolution|AgentRev]]</dt>
{{Note
<dd class="note">
|user= 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.<br/>
|timestamp= 20160413191300
<br/>
|text= 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.<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>
<sqf>_paths = [[-1]] + allTurrets _vehicle;</sqf>
</dd>
}}
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 20:15, 7 April 2024

Hover & click on the images for description

Description

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

Syntax

Syntax:
allTurrets vehicle
Parameters:
vehicle: Object
Return Value:
Array of Arrays format Turret Path

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 of Arrays format Turret Path

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:
moveInTurret enablePersonTurret assignedVehicleRole fullCrew turretUnit turretLocal turretOwner BIS_fnc_allTurrets BIS_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
AgentRev - c
Posted on Apr 13, 2016 - 19:13 (UTC)
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;