weaponDirection: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<dd class="notedate">Posted on ([^<>]+) " to "<dd class="notedate">Posted on $1</dd> ")
m (Text replacement - "<dt class="note">([^<>]+) " to "<dt class="note">$1</dt> ")
Line 42: Line 42:
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on August 18, 2007 - 12:18</dd>
<dd class="notedate">Posted on August 18, 2007 - 12:18</dd>
<dt class="note">[[User:HAC_mainframe|HWM mainframe]]
<dt class="note">[[User:HAC_mainframe|HWM mainframe]]</dt>
<dd class="note">
<dd class="note">
Works great in multiplayer.
Works great in multiplayer.
Line 53: Line 53:


<dd class="notedate">Posted on November 11, 2007 - 01:41</dd>
<dd class="notedate">Posted on November 11, 2007 - 01:41</dd>
<dt class="note">[[User:Messiah2|MessiahUA]]
<dt class="note">[[User:Messiah2|MessiahUA]]</dt>
<dd class="note">
<dd class="note">
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.
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.
Line 59: Line 59:


<dd class="notedate">Posted on November 13, 2007 - 15:54</dd>
<dd class="notedate">Posted on November 13, 2007 - 15:54</dd>
<dt class="note">[[User:UNN|UNN]]
<dt class="note">[[User:UNN|UNN]]</dt>
<dd class="note">
<dd class="note">
For an alternative to the weaponDirection command, see the following post on the official forums. On how to obtain the direction of multiple turrets on vehicles.  
For an alternative to the weaponDirection command, see the following post on the official forums. On how to obtain the direction of multiple turrets on vehicles.  
Line 66: Line 66:


<dd class="notedate">Posted on December 9, 2014 - 18:25 (UTC)</dd>
<dd class="notedate">Posted on December 9, 2014 - 18:25 (UTC)</dd>
<dt class="note">[[User:Mechariuswh|Mechariuswh]]
<dt class="note">[[User:Mechariuswh|Mechariuswh]]</dt>
<dd class="note">
<dd class="note">
The suggestion above using atan2 and weaponDirection get the direction the barrel of a weapon is pointing, but this is not the same as the direction a shell will be fired (verify this by getting in an M4 Scorcher, parking it on a slope, elevating the barrel "across" the slope and watching the shell come out in third person).  
The suggestion above using atan2 and weaponDirection get the direction the barrel of a weapon is pointing, but this is not the same as the direction a shell will be fired (verify this by getting in an M4 Scorcher, parking it on a slope, elevating the barrel "across" the slope and watching the shell come out in third person).  

Revision as of 02:24, 30 January 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
WeaponsUnit Control

Syntax

Syntax:
Syntax needed
Parameters:
vehicleName: Object
weaponName: String
Return Value:
Return value needed

Examples

Example 1:
_weaponVectorDir = player weaponDirection currentWeapon player;
Example 2:
Draw AI eye direction (green) and weapon direction (red) in 3D: bob = createGroup east createUnit ["O_Soldier_F", [0,0,0], [], 0, "NONE"]; bob setVehiclePosition [player modelToWorld [0,100,0], [], 0, "NONE"]; onEachFrame { _beg = ASLToAGL eyePos bob; _endE = (_beg vectorAdd (eyeDirection bob vectorMultiply 100)); drawLine3D [ _beg, _endE, [0,1,0,1]]; _endW = (_beg vectorAdd (bob weaponDirection currentWeapon bob vectorMultiply 100)); drawLine3D [_beg, _endW, [1,0,0,1]]; };

Additional Information

See also:
See also needed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Posted on August 18, 2007 - 12:18
HWM mainframe
Works great in multiplayer. The numbers are representing offset as follows : [X axis,Y axis,Z 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 official forums. On how to obtain the direction of multiple turrets on vehicles. Turret Animations - new forum
Posted on December 9, 2014 - 18:25 (UTC)
Mechariuswh
The suggestion above using atan2 and weaponDirection get the direction the barrel of a weapon is pointing, but this is not the same as the direction a shell will be fired (verify this by getting in an M4 Scorcher, parking it on a slope, elevating the barrel "across" the slope and watching the shell come out in third person).