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




Introduced in

Version:1.50

Description

Description:Sets turret alignment, and (optionally) fires the specified number of rounds. Vehicle turrets return to default alignment after firing.

Any defined fire arcs set using setFireArc are only considered for AI gunners.

Syntax

Syntax:[vehicle, turret, [azimuth, elevation], notstabilized, rounds] call fn_vbs_setGunPosition
Parameters:
  • vehicle: Object - The vehicle.
  • turret: Array - Turret path.
  • azimuth: Number - Direction relative to hull.
  • elevation: Number - Elevation above the horizontal.
  • notstabilized: Boolean - Turn off turret stabilization (optional, default: true).
  • rounds: Number - Number of rounds to fire (optional, default: 0).
Return Value:Boolean - Returns true, if firing is successful, or, if the function is called with only the vehicle as a parameter, if the vehicle is currently engaged in a firing sequence.

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:
_fired = [tank1,[0],[270,5],false,2] call fn_vbs_setGunPosition

Additional Information

See also: setWeaponDirection
Multiplayer: 
Problems: 

Notes