animationState: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<dd class="note">([^}]*)<code>([^<]*)<\/code>" to "<dd class="note">$1<sqf>$2</sqf>")
m (Text replacement - "<dd class="note">([^}]*)<code>([^<]*)<\/code>" to "<dd class="note">$1<sqf>$2</sqf>")
Line 45: Line 45:
<sqf>configName (configFile >> getText (configFile >> "CfgVehicles" >> typeOf _unit >> "moves") >> "States" >> (animationState _unit)) // e.g. "AmovPercMstpSrasWrflDnon"</sqf>
<sqf>configName (configFile >> getText (configFile >> "CfgVehicles" >> typeOf _unit >> "moves") >> "States" >> (animationState _unit)) // e.g. "AmovPercMstpSrasWrflDnon"</sqf>
Opposite to regular animationState return value:
Opposite to regular animationState return value:
<code>animationState _unit // e.g. "amovpercmstpsraswrfldnon"</code>
<sqf>animationState _unit // e.g. "amovpercmstpsraswrfldnon"</sqf>
</dd>
</dd>


</dl>
</dl>

Revision as of 11:58, 13 May 2022

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

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"