animationState: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
No edit summary
 
(64 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= arma1
|version1= 1.00


|1.00|= Game version
|game2= arma2
|version2= 1.00


|arg= global |= Arguments in MP
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


| Returns the name of a unit's current primary animation. Seems to be forced to lower case in Arma 3. |DESCRIPTION=
|game4= tkoh
____________________________________________________________________________________________
|version4= 1.00


| '''animationState''' unitName |SYNTAX=
|game5= arma3
|version5= 0.50


|p1= unitName: [[Object]] |= Parameter 1
|arg= global


| [[String]] |RETURNVALUE=
|gr1= Animations
____________________________________________________________________________________________


|x1= <code>_state = [[animationState]] [[player]];</code> |= Example 1
|descr= Returns the name of a unit's current primary animation. Seems to be forced to lower case in {{arma3}}.
____________________________________________________________________________________________
{{Feature|informative|This command is only for a man unit, other units such as animals cannot use this command.}}
| mp = When executed on a client, this command only returns accurate results when the target unit is within sight of the client. When executed on a dedicated server, the returned value is accurate. |= Multiplayer


| [[switchMove]], [[playMove]], [[BIS_fnc_ambientAnimGetParams]] |SEEALSO=
|s1= [[animationState]] unitName


|p1= unitName: [[Object]]
|r1= [[String]]
|x1= <sqf>_state = animationState player;</sqf>
|mp= When executed on a client, this command only returns accurate results when the target unit is within sight of the client. When executed on a dedicated server, the returned value is accurate.
|seealso= [[gestureState]] [[switchMove]] [[playMove]] [[pose]] [[BIS_fnc_ambientAnimGetParams]] [[getUnitMovesInfo]]
}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on August 22, 2014 - 23:30</dd>
<dt class="note">[[User:ffur2007slx2_5| ffur2007slx2_5]]</dt>
<dd class="note">(A3 1.26) To sort animation state by keyword, use [[BIS_fnc_ambientAnimGetParams]]
<code> ("KNEEL" [[call]] [[BIS_fnc_ambientAnimGetParams]]) [[select]] 0;
//return: ["amovpknlmstpslowwrfldnon"…]</code>
Useful keywords are: "STAND", "WATCH", "GUARD", "LISTEN_BRIEFING", "LEAN_ON_TABLE", "LEAN", "SIT_AT_TABLE", "KNEEL", "PRONE_INJURED", "BRIEFING" ect.
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
<dt></dt>
<dd class="notedate">Posted on 2019-08-13 - 07:44 (UTC)</dd>
<dt class="note">[[User:POLPOX|POLPOX]]</dt>
<dd class="note">
In case you need to get the animation name including upper cases:
<sqf>configName (configFile >> getText (configFile >> "CfgVehicles" >> typeOf _unit >> "moves") >> "States" >> (animationState _unit)) // e.g. "AmovPercMstpSrasWrflDnon"</sqf>
Opposite to regular animationState return value:
<sqf>animationState _unit // e.g. "amovpercmstpsraswrfldnon"</sqf>
</dd>


[[Category:Scripting Commands|ANIMATIONSTATE]]
</dl>
[[Category:Scripting Commands ArmA|ANIMATIONSTATE]]
[[Category:Command_Group:_System_Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 12:36, 26 February 2024

Hover & click on the images for description

Description

Description:
Returns the name of a unit's current primary animation. Seems to be forced to lower case in Arma 3.
This command is only for a man unit, other units such as animals cannot use this command.
Multiplayer:
When executed on a client, this command only returns accurate results when the target unit is within sight of the client. When executed on a dedicated server, the returned value is accurate.
Groups:
Animations

Syntax

Syntax:
animationState unitName
Parameters:
unitName: Object
Return Value:
String

Examples

Example 1:
_state = animationState player;

Additional Information

See also:
gestureState switchMove playMove pose BIS_fnc_ambientAnimGetParams getUnitMovesInfo

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 2019-08-13 - 07:44 (UTC)
POLPOX
In case you need to get the animation name including upper cases:
configName (configFile >> getText (configFile >> "CfgVehicles" >> typeOf _unit >> "moves") >> "States" >> (animationState _unit)) // e.g. "AmovPercMstpSrasWrflDnon"
Opposite to regular animationState return value:
animationState _unit // e.g. "amovpercmstpsraswrfldnon"