weaponDirection: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 9: | Line 9: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Returns | | Returns a direction vector in [[Position]] format for the given weapon (attached to vehicle) . | ||
Note the weapon name must be an entry in CfgWeapons for the addon|= Description | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | [[Position]]Vector <nowiki>=</nowiki>[[Object#Vehicle|Vehicle]] '''weaponDirection''' "WeaponClass" |= Syntax | ||
|p1= | |p1= [[Object#Vehicle|Vehicle]]: [[Object]] |= Parameter 1 | ||
|p2= | |p2= WeaponClass: [[String]] |= Parameter 2 | ||
| [[Array]] |= Return value | | [[Position]]Vector: [[Array]] |= Return value | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Revision as of 03:59, 1 September 2007
Description
- Description:
- Returns a direction vector in Position format for the given weapon (attached to vehicle) . Note the weapon name must be an entry in CfgWeapons for the addon
- Groups:
- Uncategorised
Syntax
- Syntax:
- PositionVector =Vehicle weaponDirection "WeaponClass"
- Parameters:
- Vehicle: Object
- WeaponClass: String
- Return Value:
- PositionVector: Array
Examples
- Example 1:
_dir = _vehicle weaponDirection "M16"
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
Notes
-
Returned direction is an array holding a direction vector, see vectorDir, with 3 components, each with values between -1 and 1.
- 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);"