Arma 3 Scripting

Command in Animations

switchGesture

Also available as Markdown and JSON, or read the original wiki page.

Description

When used on a person,the given move is started immediately (without transition).

Note

Arma 3: Since Arma 3 v2.18 it is possible to play gesture states (define in config under "CfgGesturesMale" >> "states" for male soldiers). In addition, it is also possible to play move states (define in config under "CfgMovesMaleSdr" >> "states" for male soldiers) as gestures if they have a valid mask defined in their configs (for example, weapon switching animations have a "WeaponSwitching" mask that only affects the upper body, so they work correctly with this command).

Syntax

Syntax 1

soldier switchGesture moveName

Parameters:

Returns: Nothing

Syntax 2

since arma3 2.18

soldier switchGesture [moveName, time, blendFactor, resetAim]

Parameters:

Returns: Nothing

Examples

Example 1

soldierOne switchGesture "Wave";

Example 2

// Create a dummy agent that copies your moves
ai1 = createAgent [typeOf player, getPosATL player, [], 0, "NONE"];
ai1 disableAI "ALL";

onEachFrame
{
    ai1 setAnimSpeedCoef getAnimSpeedCoef player;
    ai1 setVectorDir vectorDir player;
    private _m = animationState player;
    private _g = gestureState player;
    private _i = getUnitMovesInfo player;
    private _a = getUnitMovesInfo ai1;

    if (animationState ai1 != _m || abs(_i # 1 - _a # 1) > 0.1) then
    {
        ai1 switchMove [_m, _i # 0, _i # 3, false];
    };

    if ((gestureState ai1 != _g || abs(_i # 6 - _a # 6) > 0.1) && (_g != "<none>" && _g find "_player" < 0)) then
    {
        ai1 switchGesture [_g, _i # 5, _i # 8, false];
    };
}

See also

playGesture · getUnitMovesInfo · switchMove

Community notes

.kju

Rpt says "Not implemented" as of OA 1.54.