Jump to content
Sign in to follow this  
BadHabitz

Animations in bis_fnc_holdActionAdd

Recommended Posts

I'm running into a problem trying to get the player to start an animation while using a bis_fnc_holdActionAdd. Should be specifically line 6 and line 9 in my code in the spoiler. I did try player switchMove "Acts_millerDisarming_deskCrouch_loop" and it didn't work. So I'm at a loss. Any help would be appreciated. Thanks.

 






[
/* 0 object */                _object,
/* 1 action title */            "DOWNLOAD INFORMATION",
/* 2 idle icon */            "wipe.paa",
/* 3 progress icon */            "wipe.paa",
/* 4 condition to show */        "true",
/* 5 condition for action */        "true",
/* 6 code executed on start */        "player switchMove 'Acts_millerDisarming_deskCrouch_loop'",
/* 7 code executed per tick */        {["Computer", "Downloading in progress"] call BIS_fnc_showSubtitle},
/* 8 code executed on completion */    {null = [] execVM "briefingCrash.sqf";},
/* 9 code executed on interruption */    "player switchMove ''",
/* 10 arguments */            [""],
/* 11 action duration */        10,
/* 12 priority */            0,
/* 13 remove on completion */        false,
/* 14 show unconscious */        false
] call bis_fnc_holdActionAdd;

Share this post


Link to post
Share on other sites

I think you need to do it like this:

 

[
/* 0 object */                _object,
/* 1 action title */            "DOWNLOAD INFORMATION",
/* 2 idle icon */            "wipe.paa",
/* 3 progress icon */            "wipe.paa",
/* 4 condition to show */        "true",
/* 5 condition for action */        "true",
/* 6 code executed on start */        {player switchMove "Acts_millerDisarming_deskCrouch_loop"},
/* 7 code executed per tick */        {["Computer", "Downloading in progress"] call BIS_fnc_showSubtitle},
/* 8 code executed on completion */    {null = [] execVM "briefingCrash.sqf";},
/* 9 code executed on interruption */    {player switchMove ""},
/* 10 arguments */            [],
/* 11 action duration */        10,
/* 12 priority */            0,
/* 13 remove on completion */        false,
/* 14 show unconscious */        false
] call bis_fnc_holdActionAdd;

If switchMove isn't working, try playMove or playMoveNow. I've run into situations where only one of those 3 can be used for certain animations.

 

If you want an example of one that worked for me, I used this in one of my recent missions to play an animation while the player is holding the action button:

[
this,
"Disable Gun",
"\a3\ui_f\data\IGUI\Cfg\actions\repair_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\actions\repair_ca.paa",
"_this distance _target < 3",
"_caller distance _target < 3",
{_caller playMove "Acts_carFixingWheel"},
{},
{mnk_aadisable1 = true},
{},
[],
15,
10,
true,
false
] call BIS_fnc_holdActionAdd;

^that one does not use anything to stop the animation because I was having issues getting the animations to transition smoothly upon interruption, so I abandoned giving the player the option of doing so because I didn't like the way it looked.

  • Like 1

Share this post


Link to post
Share on other sites

It works. I'm using playMove for the starting animation, and switchMove for anything that alters that. Thanks!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×