allTurrets: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]3(\|.*)]]" to "{{GameCategory|arma3|Scripting Commands}}") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Command|Comments= | {{Command|Comments= | ||
| arma3 |Game name= | | arma3 |Game name= | ||
Line 7: | Line 6: | ||
|gr1= Turrets |GROUP1= | |gr1= Turrets |GROUP1= | ||
|Returns array of available turret paths from vehicle object. | |Returns array of available turret paths from vehicle object. | ||
Line 14: | Line 12: | ||
* 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]]}} |DESCRIPTION= | * to get config from turret path use [[BIS_fnc_turretConfig]]}} |DESCRIPTION= | ||
| [[allTurrets]] vehicle |SYNTAX= | | [[allTurrets]] vehicle |SYNTAX= | ||
Line 21: | Line 18: | ||
| [[Array]] |RETURNVALUE= | | [[Array]] |RETURNVALUE= | ||
|s2= [[allTurrets]] [vehicle, includeFFV] |SYNTAX2= | |s2= [[allTurrets]] [vehicle, includeFFV] |SYNTAX2= | ||
Line 31: | Line 27: | ||
|r2= [[Array]] |RETURNVALUE2= | |r2= [[Array]] |RETURNVALUE2= | ||
|x1= <code>_turretPaths = [[allTurrets]] _mySlammerUP; {{cc|[<nowiki/>[0],[0,0]]}} | |x1= <code>_turretPaths = [[allTurrets]] _mySlammerUP; {{cc|[<nowiki/>[0],[0,0]]}} |
Revision as of 00:05, 17 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;