weaponDirection

From Bohemia Interactive Community

Jump to: navigation, search
Editors, please check Policy: Scripting Command Page Syntax.
Introduced in Armed Assault version 1.00Effects of this scripting command are broadcasted over the network and happen on every computer in the network

Click on the images for descriptions

Introduced in

Game:
Armed Assault
Version:
1.00

Description

Description:
Returns a 3D vector for the given weapon (attached to vehicle).
For addons the weapon name must be an entry in CfgWeapons.

Syntax

Syntax:
_weapondir = Vehicle weaponDirection "WeaponClass"
Parameters:
Vehicle: Object
WeaponClass: String
Return Value:
Vector3D

Examples

Example 1:
_dir = _vehicle weaponDirection "M16"

Additional Information

Multiplayer:
Behaviour unknown.

Notes

Notes

+ Add Note

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

Notes

Posted on August 18, 2007 - 12:18
HWM mainframe
Works great in multiplayer. The numbers are representing offset as follows : [X axis,Z axis,Y axis]

The return array can be processed-converted into degrees as follows:

_array = _this weaponDirection "weapon class" ;
_dir_degrees = (_array select 0) atan2 (_array select 1);

Posted on November 11, 2007 - 01:41
MessiahUA
WeaponClass can only be the primary turret of the vehicle. For example it is not possible to get direction of commander's M2 on M1Abrams.

Posted on November 13, 2007 - 15:54
UNN
For an alternative to the weaponDirection command, see the following post on the offical forums. On how to obtain the direction of multiple turrets on vehicles.

Turret Animations

Bottom Section

Personal tools
Buy ArmA now!