turretLocal: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "\{\{GameCategory\|(arma[0123])\|[ _]?New[ _]Scripting[ _]Commands[ _]List\}\}" to "{{GameCategory|$1|New Scripting Commands}}")
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{Command|Comments=
____________________________________________________________________________________________


| arma3 |= Game name
| arma3 |Game name=


|1.32|= Game version
|1.32|Game version=


|arg= global |= Arguments in MP
|arg= global |Multiplayer Arguments=


____________________________________________________________________________________________
|gr1= Turrets |GROUP1=


| Checks if a turret is [[local]].  <br><br>
|mp= A vehicle turret will change locality when player gunner gets in it, just like vehicle changes locality when player driver gets in it. Many commands for turrets work only where turret is [[local]]. When gunner leaves turret it is supposed to change locality to the locality of the vehicle. |MPBEHAVIOUR=  
'''Some info on turrets:''' A vehicle turret will change locality when player gunner gets in it, just like vehicle changes locality when player driver gets in it. Many commands for turrets work only where turret is [[local]]. When gunner leaves turret it is supposed to change locality to the locality of the vehicle. |= Description
____________________________________________________________________________________________


| vehicle '''turretLocal''' turretPath |= Syntax
| Checks if a turret is [[local]]. |DESCRIPTION=


|p1= vehicle: [[Object]]  |= PARAMETER1
| vehicle '''turretLocal''' turretPath |SYNTAX=


|p2= turretPath: [[Array]]  |= PARAMETER2
|p1= vehicle: [[Object]]  |PARAMETER1=  


| [[Boolean]] or [[Nothing]] ([[nil]]) if the turret is non-existent |= RETURNVALUE
|p2= turretPath: [[Array]] |PARAMETER2=  


| [[Boolean]] (or, prior to Arma 3 v1.93.145625, [[Nothing]] if the turret is non-existent)|RETURNVALUE=


|x1= <code>_isLocal = [[vehicle]] [[player]] [[turretLocal]] [0];</code>|= EXAMPLE1


|x2= <code>[[if]] (heli [[turretLocal]] [1]) [[then]] {heli [[setVehicleAmmo]] 1};</code>|= EXAMPLE2
|x1= <code>_isLocal = [[vehicle]] [[player]] [[turretLocal]] [0];</code>|EXAMPLE1=  


|x3= <code>[[if]] ([[isNil]] {heli [[turretLocal]] [5]}) [[then]] {[[hint]] "Turret 5 is non-existent"};</code>|= EXAMPLE2
|x2= <code>[[if]] (heli [[turretLocal]] [1]) [[then]] {heli [[setVehicleAmmo]] 1};</code>|EXAMPLE2=  
____________________________________________________________________________________________


| [[setVehicleAmmo]], [[setVehicleAmmoDef]], [[removeWeaponTurret]], [[addWeaponTurret]], [[addMagazineTurret]], [[magazinesTurret]], [[removeMagazinesTurret]], [[removeMagazineTurret]], [[weaponsTurret]], [[currentMagazineDetailTurret]], [[currentMagazineTurret]], [[currentWeaponTurret]], [[selectWeaponTurret]]|= SEEALSO
|x3= <code>[[if]] ([[isNil]] {heli [[turretLocal]] [5]}) [[then]] {[[hint]] "Turret 5 is non-existent"};</code>|EXAMPLE3=  


| |= MPBEHAVIOUR
| [[turretOwner]], [[setVehicleAmmo]], [[setVehicleAmmoDef]], [[removeWeaponTurret]], [[addWeaponTurret]], [[addMagazineTurret]], [[magazinesTurret]], [[removeMagazinesTurret]], [[removeMagazineTurret]], [[weaponsTurret]], [[currentMagazineDetailTurret]], [[currentMagazineTurret]], [[currentWeaponTurret]], [[selectWeaponTurret]], [[turretUnit]], [[allTurrets]]|SEEALSO=  
____________________________________________________________________________________________
}}
}}


Line 44: Line 39:


<h3 style='display:none'>Bottom Section</h3>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
{{GameCategory|arma3|New Scripting Commands}}
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Revision as of 00:43, 13 January 2021

Hover & click on the images for description

Description

Description:
Checks if a turret is local.
Multiplayer:
A vehicle turret will change locality when player gunner gets in it, just like vehicle changes locality when player driver gets in it. Many commands for turrets work only where turret is local. When gunner leaves turret it is supposed to change locality to the locality of the vehicle.
Groups:
Turrets

Syntax

Syntax:
vehicle turretLocal turretPath
Parameters:
vehicle: Object
turretPath: Array
Return Value:
Boolean (or, prior to Arma 3 v1.93.145625, Nothing if the turret is non-existent)

Examples

Example 1:
_isLocal = vehicle player turretLocal [0];
Example 2:
if (heli turretLocal [1]) then {heli setVehicleAmmo 1};
Example 3:
if (isNil {heli turretLocal [5]}) then {hint "Turret 5 is non-existent"};

Additional Information

See also:
turretOwnersetVehicleAmmosetVehicleAmmoDefremoveWeaponTurretaddWeaponTurretaddMagazineTurretmagazinesTurretremoveMagazinesTurretremoveMagazineTurretweaponsTurretcurrentMagazineDetailTurretcurrentMagazineTurretcurrentWeaponTurretselectWeaponTurretturretUnitallTurrets

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