animationPhase: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3>" to "")
m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command


| ofpr
|game1= ofp
|version1= 1.75


|1.75
|game2= ofpe
|version2= 1.00
 
|game3= arma1
|version3= 1.00
 
|game4= arma2
|version4= 1.00
 
|game5= arma2oa
|version5= 1.50
 
|game6= tkoh
|version6= 1.00
 
|game7= arma3
|version7= 0.50


|arg= global
|arg= global
Line 9: Line 26:
|gr1= Animations
|gr1= Animations


| Returns the phase of the given animation on the given object. Animation can be scripted ([[animate]], [[animateSource]], [[animateDoor]]) or engine driven. Animation names for an object could be found out with [[animationNames]] command. When animation is rotation, like with "MainTurret" for example, the output is in radians, to convert to degrees use [[deg]] command.
|descr= Returns the phase of the given animation on the given object. Animation can be scripted ([[animate]], [[animateSource]], [[animateDoor]]) or engine driven. Animation names for an object could be found out with [[animationNames]] command. When animation is rotation, like with "MainTurret" for example, the output is in radians, to convert to degrees use [[deg]] command.


| object '''animationPhase''' animationName
|mp= In {{ofp}}, on dedicated servers, ''animationPhase'' will always return 0, no matter what the actual phase is.


|p1= object: [[Object]] - building eg
|s1= object [[animationPhase]] animationName


|p2= animationName: [[String]] - name of the animation. This is the class-name of the animation defined in the addon's config.cpp.
|p1= object: [[Object]]


| [[Number]] - range 0 (start point of the animation) to 1 (end point of the animation).
|p2= animationName: [[String]] - name of the animation. This is the class-name of the animation defined in the addon's config.cpp
 
|x1= <code>_building [[animate]] ["maindoor",1];
[[sleep]] 1;
_p = _building [[animationPhase]] "maindoor";</code>


returns 1 (if the animation speed is <nowiki><=</nowiki> 2 seconds)
|r1= [[Number]] - range 0 (start point of the animation) to 1 (end point of the animation)


|x2= <code>_flagPole [[animationPhase]] "flag";</code>
|x1= <sqf>
_building animate ["maindoor",1];
sleep 1;
_p = _building animationPhase "maindoor";// Returns 1, if the animation speed is two seconds
</sqf>


|x3= <code>_tank [[animationPhase]] "MainTurret";</code>
|x2= <sqf>_flagPole animationPhase "flag";</sqf>


| mp = In OFP, on dedicated servers, ''animationPhase'' will always return 0, no matter what the actual phase is. |= Multiplayer
|x3= <sqf>_tank animationPhase "MainTurret";</sqf>
| [[animate]], [[moveTime]], [[setFaceAnimation]], [[animateDoor]], [[doorPhase]], [[animateSource]], [[animationSourcePhase]], [[animationNames]]


|seealso= [[animate]] [[moveTime]] [[setFaceAnimation]] [[animateDoor]] [[doorPhase]] [[animateSource]] [[animationSourcePhase]] [[animationNames]]
}}
}}
<dl class="command_description">
</dl>
[[Category:Scripting Commands|ANIMATIONPHASE]]
[[Category:Scripting Commands OFP 1.99|ANIMATIONPHASE]]
[[Category:Scripting Commands OFP 1.96|ANIMATIONPHASE]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}

Latest revision as of 19:43, 3 September 2024

Hover & click on the images for description

Description

Description:
Returns the phase of the given animation on the given object. Animation can be scripted (animate, animateSource, animateDoor) or engine driven. Animation names for an object could be found out with animationNames command. When animation is rotation, like with "MainTurret" for example, the output is in radians, to convert to degrees use deg command.
Multiplayer:
In Operation Flashpoint, on dedicated servers, animationPhase will always return 0, no matter what the actual phase is.
Groups:
Animations

Syntax

Syntax:
object animationPhase animationName
Parameters:
object: Object
animationName: String - name of the animation. This is the class-name of the animation defined in the addon's config.cpp
Return Value:
Number - range 0 (start point of the animation) to 1 (end point of the animation)

Examples

Example 1:
_building animate ["maindoor",1]; sleep 1; _p = _building animationPhase "maindoor";// Returns 1, if the animation speed is two seconds
Example 2:
_flagPole animationPhase "flag";
Example 3:
_tank animationPhase "MainTurret";

Additional Information

See also:
animate moveTime setFaceAnimation animateDoor doorPhase animateSource animationSourcePhase animationNames

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