Jump to content
Sign in to follow this  
K120

Need help with animations through script

Recommended Posts

Hey,i'm working on my first mission and ran to a small problem with animations as i don't know anything about scripting and this isn't working with trigger only as it needs "sleep". Searched a lot but didn't get it working.

As mission starts player needs to drive to base and meet major to get mission details. Major is in his room inside military office.

What i want to do is when player enters majors room he (player) salutes until major says "at ease" (other script) and player makes ease animation and stays in it about 25 seconds until major have finished talking.

I've made trigger to majors office which has this in its on act. "[this] exec "office.sqf"

I've tried to put these in the script:

Same result as when i put it in trigger on act. , sleep makes it not work.

player playmove "AmovPercMstpSnonWnonDnon_SaluteIn";

sleep 3;

player playmove "AmovPercMstpSnonWnonDnon_SaluteOut";

sleep 1;

player playmove "name of ease animation";

sleep 25;

This one does nothing except error text.

player action ["salute", player];

sleep 3;

player action ["salute", player];

sleep 1;

player action ["ease", player];

sleep 25;

Edited by K120

Share this post


Link to post
Share on other sites
I've made trigger to majors office which has this in its init. "[this] exec "office.sqf"

You can’t run .sqf scripts with exec command, you need to use execVM. Try this:

_handle = player execVM "office.sqf"

Also, I’m not sure that such action as “ease†exists, so office.sqf then will be looking like this:

_this action ["salute",_this];
sleep 3;
_this action ["salute",_this];

Edited by RegEdit

Share this post


Link to post
Share on other sites

Thanks,that worked partly.

Now it comes with quite of latency and player is free to move during saluting.

Is there some other way to use "AmovPercMstpSnonWnonDnon_SaluteIn" and "AmovPercMstpSnonWnonDnon_SaluteOut" in the script?

I apogolize if this seems stupid question but it's only a week since i opened arma editor for first time and i'm yet learning the basic things.

Share this post


Link to post
Share on other sites

try switchMove

player switchMove "AmovPercMstpSnonWnonDnon_SaluteIn";
player playMove "AmovPercMstpSnonWnonDnon_Salute";

Though, since these are players just tell them to press \

Edited by kylania

Share this post


Link to post
Share on other sites

That worked,thanks!

But is there something similiar to disableAI "MOVE" but for player? I tried "disableUserInput true" but it leaves last moving directions on and "enablesimulation false" freezes the player in middle of running animation. :confused:

Share this post


Link to post
Share on other sites

I think for players usually you'd teleport them somewhere quiet, replace them with AI and switchCamera to make them look at/as the AI for whatever cutscene. Locking up player's controls seems like a great idea in the mission makers mind when they are playing the cinematic vision but in practice it's infuriating for the player not being able to control their game. They might even think it's a bug and stop playing.

Share this post


Link to post
Share on other sites

Reason for this was that player and major are having a conversation about the mission in sidechat. I didn't want player to be able to leave majors office until the chat is over. Animations are just for the atmosphere.

Anyway,i got it working. Thanks for help,here's how i did it if anyone is struggling with similiar.

player enablesimulation false;

sleep 0.1;

player enablesimulation true;

disableUserInput true;

player switchmove "AmovPercMstpSnonWnonDnon_SaluteIn";

sleep 1;

player enablesimulation false;

sleep 3;

player enablesimulation true;

player switchmove "AmovPercMstpSnonWnonDnon_SaluteOut";

sleep 1;

player switchmove "AmovPercMstpSnonWnonDnon_EaseIn";

sleep 0.7;

player enablesimulation false;

sleep 25;

player enablesimulation true;

player switchmove "AmovPercMstpSnonWnonDnon_EaseOut";

disableUserInput false;

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  

×