Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.20

Description

Description:Returns all vehicle turrets.

Syntax

Syntax:[vehicle, path] call fn_vbs_listTurrets
Parameters:
  • vehicle: Object - Object to test.
  • path: Boolean - If true, then returns turret paths (array); if false, then return configuration entries (optional, default: true).
Return Value:Array - Either turret paths or configuration entries (depending on the path parameter).

Alternative Syntax

Syntax:vehicle call fn_vbs_listTurrets (v1.31+)
Parameters:
  • vehicle: Object, Config-2 or String - Vehicle to test, in either object form, configuration path, or class name. Does not have to be nested within an array.
Return Value:Array - Turret paths.

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:
_turrets = [tank1] call fn_vbs_listTurrets // Might return: [[0],[0,0],[0,1]]
_turrets = [car1,false] call fn_vbs_listTurrets; // Might return: [CfgVehicles/LandroverMG/Turrets/MainTurret]
_turrets = ("mytankclass") call fn_vbs_listTurrets; // Might return: [[0,0]]

Additional Information

See also: listAllTurrets
Multiplayer: 
Problems: 

Notes