getUnitMovesInfo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "↵|version1= 2.18" to " |version1= 2.18 |branch= dev")
 
(10 intermediate revisions by 2 users not shown)
Line 3: Line 3:
|game1= arma3
|game1= arma3
|version1= 2.18
|version1= 2.18
|branch= dev


|arg= global
|arg= global
Line 8: Line 10:
|gr1= Animations
|gr1= Animations


|descr= Returns various information about the unit animations and gestures
|descr= Returns various information about the unit moves (primary animation) and gestures (masked animation)


|s1= [[getUnitMovesInfo]] unit
|s1= [[getUnitMovesInfo]] unit
Line 15: Line 17:


|r1= [[Array]] in format:
|r1= [[Array]] in format:
* 0 - [[Scalar]] - move progress in range 0-1
* 0 - moveProgress: [[Number]] - move progress in range 0-1
* 1 - [[Scalar]] - move elapsed time ({{hl|move progress * move duration}})
* 1 - moveTime: [[Number]] - move elapsed time ({{hl|move progress * move duration}})
* 2 - [[Scalar]] - move duration
* 2 - moveDuration: [[Number]] - move duration
* 3 - [[Scalar]] - move blend factor
* 3 - moveFactor: [[Number]] - move blend factor
* 4 - [[Vector3D]] - move rtm step
* 4 - rtmStep: [[Vector3D]] - rtm step (how many meters the unit will move after finishing the animation)
* 5 - [[Scalar]] - gesture progress in range 0-1
* 5 - gestureProgress: [[Number]] - gesture progress in range 0-1
* 6 - [[Scalar]] - gesture elapsed time ({{hl|gesture progress * gesture duration}})
* 6 - gestureTime: [[Number]] - gesture elapsed time ({{hl|gesture progress * gesture duration}})
* 7 - [[Scalar]] - gesture duration
* 7 - gestureDuration: [[Number]] - gesture duration
* 8 - [[Scalar]] - gesture blend factor
* 8 - gestureFactor: [[Number]] - gesture blend factor


|s2= unit [[getUnitMovesInfo]] index
|s2= unit [[getUnitMovesInfo]] index


|p21= unit: [[Object]]
|p21= unit: [[Object]]
|p22= index: [[Number]] - index of property from the main syntax
|p22= index: [[Number]] - index of property from the main syntax


|r2= [[Anything]] - Value of the requested property, or [[Nothing]] if index is invalid. See the main syntax.
|r2= [[Anything]] - Value of the requested property, or [[Nothing]] if index is invalid. See the main syntax.


|seealso= [[switchMove]] [[switchGesture]] [[moveTime]]
|x1= <sqf>
// Getting the move velocity of the animation
private _animInfo = getUnitMovesInfo player;
// velocity = displacement / time
private _animVelocity = _animInfo # 4 vectorMultiply -1 / _animInfo # 2; // -1 is because man model is reversed, so the rtm animation moves "backwards"
</sqf>
 
|seealso= [[switchMove]] [[switchGesture]] [[moveTime]] [[gestureState]] [[animationState]]
}}
}}

Latest revision as of 22:50, 17 April 2024

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.18.

Description

Description:
Returns various information about the unit moves (primary animation) and gestures (masked animation)
Groups:
Animations

Syntax

Syntax:
getUnitMovesInfo unit
Parameters:
unit: Object
Return Value:
Array in format:
  • 0 - moveProgress: Number - move progress in range 0-1
  • 1 - moveTime: Number - move elapsed time (move progress * move duration)
  • 2 - moveDuration: Number - move duration
  • 3 - moveFactor: Number - move blend factor
  • 4 - rtmStep: Vector3D - rtm step (how many meters the unit will move after finishing the animation)
  • 5 - gestureProgress: Number - gesture progress in range 0-1
  • 6 - gestureTime: Number - gesture elapsed time (gesture progress * gesture duration)
  • 7 - gestureDuration: Number - gesture duration
  • 8 - gestureFactor: Number - gesture blend factor

Alternative Syntax

Syntax:
unit getUnitMovesInfo index
Parameters:
unit: Object
index: Number - index of property from the main syntax
Return Value:
Anything - Value of the requested property, or Nothing if index is invalid. See the main syntax.

Examples

Example 1:
// Getting the move velocity of the animation private _animInfo = getUnitMovesInfo player; // velocity = displacement / time private _animVelocity = _animInfo # 4 vectorMultiply -1 / _animInfo # 2; // -1 is because man model is reversed, so the rtm animation moves "backwards"

Additional Information

See also:
switchMove switchGesture moveTime gestureState animationState

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