animationState: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|s([0-9])\= '''([^' ]+)'''([^ ]+) " to "|s$1= $2$3 ")
m (Add gestureState seealso link)
Line 20: Line 20:
|gr1= Animations
|gr1= Animations


|descr= Returns the name of a unit's current primary animation. Seems to be forced to lower case in Arma 3.<br>
|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.}}
{{Feature|Informative|This command is only for a man unit, other units such as animals cannot use this command.}}


Line 30: Line 30:


|x1= <code>_state = [[animationState]] [[player]];</code>
|x1= <code>_state = [[animationState]] [[player]];</code>
|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.
|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= [[switchMove]], [[playMove]], [[BIS_fnc_ambientAnimGetParams]]
 
|seealso= [[gestureState]] [[switchMove]] [[playMove]] [[BIS_fnc_ambientAnimGetParams]]
}}
}}
<dl class="command_description">
<dt></dt>
<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.
</dl>


<dl class="command_description">
<dl class="command_description">
Line 53: Line 43:
<dd class="note">
<dd class="note">
In case you need to get the animation name including upper cases:
In case you need to get the animation name including upper cases:
<code>[[configName]] ([[configFile]] >> [[getText]] ([[configFile]] >> "CfgVehicles" >> [[typeOf]] _unit >> "moves") >> "States" >> ([[animationState]] _unit)) //e.g. "AmovPercMstpSrasWrflDnon"</code>
<code>[[configName]] ([[configFile]] >> [[getText]] ([[configFile]] >> "CfgVehicles" >> [[typeOf]] _unit >> "moves") >> "States" >> ([[animationState]] _unit)) {{cc|e.g. "AmovPercMstpSrasWrflDnon"}}</code>
Opposite to regular animationState return value:
Opposite to regular animationState return value:
<code>[[animationState]] _unit //e.g. "amovpercmstpsraswrfldnon"</code>
<code>[[animationState]] _unit {{cc|e.g. "amovpercmstpsraswrfldnon"}}</code>
</dd>
</dd>


</dl>
</dl>

Revision as of 18:51, 13 July 2021

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 BIS_fnc_ambientAnimGetParams

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 13, 2019 - 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"