Introduced in

Version:1.22

Description

Description:Returns the turret path of a given unit. Alternately, it can be used to find the path to a turret with a given class name.

Syntax

Syntax:[vehicle, unit] call fn_vbs_getTurret
Parameters:
  • vehicle: Object - The vehicle of the unit.
  • unit: Object - The unit in the turret.
Return Value:Array - Path to turret used by unit. If the unit is not in a turret of that vehicle, then:

In v1.30+: Returns an empty array

Before v1.30: The function has a bug, returns the last turret of the vehicle.

Alternative Syntax

Syntax:[vehicle, turretName] call fn_vbs_getTurret (v1.30+)
Parameters:
  • vehicle: Object or String - The vehicle to test, or class name of vehicle to test.
  • turretName: String - Class name of turret to search for.
Return Value:Array - Path to turret. If the turret does not exist, then returns an empty array.

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
_path = [tank1, player] call fn_vbs_getTurret
_path = ["VBS2_GB_Mastiff_W_HMG", "Turret_1"] call fn_vbs_getTurret

Additional Information

See also: listAllTurrets, fn vbs getTurretCfg
Multiplayer: 
Problems: 

Notes