allTurrets: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \|(x[0-9]|p[0-9]{1,2}|descr|game[0-9]|version[0-9]|s[0-9]|exec|r[0-9]|arg|eff|branch|serverExec|gr[0-9]|mp|pr|seealso) +=" to " |$1=") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(31 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| arma3 | |game1= arma3 | ||
|version1= 1.34 | |||
|1.34 | |||
|gr1= Turrets | |gr1= Turrets | ||
|Returns array of available turret paths from vehicle object. | |descr= Returns array of available turret paths from vehicle object. | ||
{{Feature | | {{Feature|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 | |s1= [[allTurrets]] vehicle | ||
|p1= vehicle: [[Object]] | |p1= vehicle: [[Object]] | ||
|r1= [[Array]] | |r1= [[Array]] of [[Array]]s format [[Turret Path]] | ||
|s2= [[allTurrets]] [vehicle, includeFFV] | |s2= [[allTurrets]] [vehicle, includeFFV] | ||
| | |p21= vehicle: [[Object]] | ||
| | |p22= includeFFV: [[Boolean]] - [[true]] to include FFV (Firing From Vehicle) positions, [[false]] to exclude them | ||
|r2= [[Array]] | |r2= [[Array]] of [[Array]]s format [[Turret Path]] | ||
|x1= < | |x1= <sqf> | ||
_turretPaths = | _turretPaths = allTurrets _mySlammerUP; // [[0],[0,0]] | ||
_turretPaths = | _turretPaths = allTurrets [_mySlammerUP, true]; // [[0],[0,0]] <- commander turret is also an FFV turret | ||
_turretPaths = allTurrets [_mySlammerUP, false]; // [<nowiki/>[0]] | |||
</sqf> | |||
|x2= Return FFV turrets only: | |x2= Return FFV turrets only: | ||
< | <sqf>_FFVTurrets = allTurrets [tank, true] - allTurrets [tank, false];</sqf> | ||
|seealso= [[moveInTurret]] | |seealso= [[moveInTurret]] [[enablePersonTurret]] [[assignedVehicleRole]] [[fullCrew]] [[turretUnit]] [[turretLocal]] [[turretOwner]] [[BIS_fnc_allTurrets]] [[BIS_fnc_turretConfig]] | ||
}} | }} | ||
{{ | {{Note | ||
|user= AgentRev | |||
|timestamp= 20160413191300 | |||
|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> | |||
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: | ||
< | <sqf>_paths = [[-1]] + allTurrets _vehicle;</sqf> | ||
}} | |||
Latest revision as of 20:15, 7 April 2024
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:
- Example 2:
- Return FFV turrets only:
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
- 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: