I needed to be able to do this some time ago. Came across this thread:
http://forums.bistudio.com/showthread.php?t=81801
where Big Dawg KS explains how to figure it out. From that I produced the following function:
Code:
/*
UP DOWN OR MIDDLE, defaults to UP
*/
getStance = {
private ["_result","_unit","_animState","_animStateChars","_animP"];
_unit = _this;
_animState = animationState _unit;
_animStateChars = toArray _animState;
_animP = toUpper (toString [_animStateChars select 5,_animStateChars select 6,_aniMStateChars select 7]);
_result = "UP";
switch (_animP) do {
case "ERC": {_result = "UP"};
case "KNL": {_result = "MIDDLE"};
case "PNE": {_result = "DOWN"};
default {_result = "UP"};
};
_result
};
You may want to change the default or do something else instead. I just needed a stance for a less...... volatile setting