turretWeaponDirection (VBS2)

From Bohemia Interactive Community

Jump to: navigation, search
Editors, please check Policy: Scripting Command Page Syntax.
Introduced in Virtual Battlespace 2 version 1.00

Click on the images for descriptions

Introduced in

Game:
Virtual Battlespace 2
Version:
1.00

Description

Description:
Returns direction turret is aiming at.

Syntax

Syntax:
vehicle turretWeaponDirection [weaponpath, weaponname]
Parameters:
vehicle: Object -
weaponpath: Number -
weaponname: String - optional
Return Value:
Vector3D

Examples

Example 1:
_dir = _vehicle turretWeaponDirection [[0]]

Additional Information

Multiplayer:
Behaviour unknown.
See also:
setWeaponDirection

Notes

Notes

+ Add Note

Only post proven facts here. Use the talk page or the forums for discussions.

Notes

  • Available weaponnames can be found in weapon_mag_classnames.pdf delivered with VBS2.
  • The given direction vector is in world coordinates, so it is independent of the vehicle orientation.
  • To find out which turrets are available on a vehicle, and what the syntax is, you can use this script.
  • To convert the returned array into a degree value, use this formula:
    _dir = (_vect select 0) atan2 (_vect select 1);

Bottom Section

Personal tools
Buy ArmA now!