Jump to content

Recommended Posts

Hi guys,

 

I have been struggling a lot recently getting animation sequences. For some reason they work in the init but not on the triggers, but if one animation works the other one doesnt. This is what I currently have:

bot1 switchMove "Acts_hubTalk_salute1"; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk";  bot1 playMove "Acts_welcomeOnHUB01_AIWalk_1b"; bot1 playMove "Acts_welcomeOnHUB01_AIWalk_1"; bot1 playMove "Acts_welcomeOnHUB01_AIWalk_2"; bot1 playMove "Acts_welcomeOnHUB01_AIWalk_3"; bot1 playMove "Acts_welcomeOnHUB01_AIWalk_4"; bot1 playMove "Acts_welcomeOnHUB01_AIWalk_5"; bot1 playMove "Acts_welcomeOnHUB01_AIWalk_6"

before I had the same but I added bot1 switchMove""; after an annimation command for a pause, however it doesnt work. I have tried everything and nothing seems to work.

Any suggestions? I want to also loop those animations. Thank you!!

Share this post


Link to post
Share on other sites

Hi,

one idea would be to execute all animations using "switchMove" and incorporate an appropriate sleep.
I assume you obtained the animations from the Animations Viewer?
There, in the bottom left corner, you can always see the duration of the animation. You can then use that for the sleeps.
(For example, 2.45 seconds per animation <- please replace with the correct duration):
 

bot1 switchMove "Acts_hubTalk_salute1";
bot1 switchMove "Acts_welcomeOnHUB01_AIWalk";
sleep 2.45;
bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_1b";
sleep 2.45;
bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_1";
sleep 2.45;
bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_2";
sleep 2.45;
bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_3";
sleep 2.45;
bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_4";
sleep 2.45;
bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_5";
sleep 2.45;
bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_6";


 

Although most animations also work with "playMove," in my experience, there are exceptions.
(I think there's a naming convention for the animations that indicates this, but I usually just try things out.)


I am still a beginner in SQF, so please take my statements with a grain of salt.

Share this post


Link to post
Share on other sites

You can then loop all of this in a while loop.

I recommend executing it within a "spawn" to allow the script to continue running afterward. Moreover, a while loop or sleep wouldn't be permissible in a trigger without a spawn.

 

0 spawn {
	while { alive bot1 } do {
		bot1 switchMove "Acts_hubTalk_salute1";
		bot1 switchMove "Acts_welcomeOnHUB01_AIWalk";
		sleep 2.45;
		bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_1b";
		sleep 2.45;
		bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_1";
		sleep 2.45;
		bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_2";
		sleep 2.45;
		bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_3";
		sleep 2.45;
		bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_4";
		sleep 2.45;
		bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_5";
		sleep 2.45;
		bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_6";
		sleep 2.45;
	};
};

 

  • Like 1

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

×