Jump to content
Sign in to follow this  
caosaovang

How can I put an end to animation loops ?

Recommended Posts

Hi all,

I have the following problem : I'm editing a mission on Iron Front, and using anim-loops. The scenario is : some german troops are camping, and a russian commando attacks them by surprise. I've put some idling animations to the Germans, and what I would like to get is that these anims stop when the first russian gun fires. For the moment, the software seems to "understand" that the Germans are getting killed, as I hear fight orders and casualties reports being given, but as the loops keep working, I only get "idling german zombies". Quite scary by the way:D. Does somebody know what is to be done ? As I'm new to editing, I'll also accept with much pleasure a link to a complete IF editing tutorial and/or a list of working anims.

Thanks in advance,

Cao Sao Vang.

Share this post


Link to post
Share on other sites

The most simple would be to put a trigger covering the area, WEST detected by EAST, with this in the "on activation" line of the trigger :

{_x switchmove ""} foreach [german1, german2 etc..]

Share this post


Link to post
Share on other sites
The most simple would be to put a trigger covering the area, WEST detected by EAST, with this in the "on activation" line of the trigger :

{_x switchmove ""} foreach [german1, german2 etc..]

Merci pour la réponse, j'y avais pensé, mais ça ne fonctionne pas pour toutes les unités : pour celles qui sont animées simplement par switchmove, c'est bon, mais pour certaines anims, il faut exécuter un script .sqf, et pas moyen de désactiver celui-là. Je vais essayer autrement. Quoiqu'il en soit, merci encore.

Cao Sao Vang.

Share this post


Link to post
Share on other sites
Merci pour la réponse, j'y avais pensé, mais ça ne fonctionne pas pour toutes les unités : pour celles qui sont animées simplement par switchmove, c'est bon, mais pour certaines anims, il faut exécuter un script .sqf, et pas moyen de désactiver celui-là. Je vais essayer autrement. Quoiqu'il en soit, merci encore.

Cao Sao Vang.

Yep (please post in english, that's the rule), post the sqf script here, it shouldn't be hard to stop it.

Share this post


Link to post
Share on other sites

Oh, sorry for the french, I'll speak english. I understand a little better what I'm doing (ha ha), and I know now what the sqf script is about : it allows some very short anims to loop, but it prevents me from stopping them. I'll copy it just after the post, with its activation code, so you can have a look at it. Anyway, my animated units quit their anims too "brutally" if I just switchmove "", so I'm trying to make them do another one. As they aren't supposed to fight very long, I'm trying to find some ARMA2 death scripts that would fit to the situation. Not that easy, Iron Front doesn't recognize much of the A2 original anims. Very interesting, but I'm really burning my brains right now, as the newbie I am ! Anyway, here's the loop script "animationLoop.sqf" :

_unit = _this select 0;

_animation = _this select 1;

_unit setVariable ["BIS_noCoreConversations", true];

if (_noWeapons) then {removeAllWeapons _unit};

while {true} do {

_unit switchMove _animation;

waitUntil {!(animationState _unit == _animation)};

};

And here's the code to be put in a trigger (AN1 is the unit's name, LHD_midDeck is an example of animation) :

AN1 switchmove "LHD_midDeck"; nil = [AN1,"LHD_midDeck",true] execVM "animationLoop.sqf";

The scripts were posted by KBourne on this forum.

So, thanks again for the time you take, answering to me. I'm going back to it, hoping I'll manage to get a nice video editing !

Cao Sao Vang.

Share this post


Link to post
Share on other sites

the "while {true} do blablabla" loop will go on as long as the variable "true" will be "true", which is obviously always the case. To break the loop, use another variable, for example named "enemy_not_detected" and set it to "true" :

_unit = _this select 0;
_animation = _this select 1;
enemy_not_detected = true

_unit setVariable ["BIS_noCoreConversations", true];
if (_noWeapons) then {removeAllWeapons _unit};

while {enemy_not_detected} do {
_unit switchMove _animation;
waitUntil {!(animationState _unit == _animation)};
};

and in the famous "detected by" trigger, set the variable to false to break the loop, in the "on activation" part of it :

enemy_not_detected = false

Share this post


Link to post
Share on other sites

This gives some good results, thanks. I really need to learn the game's synthax, because I have the ideas, but I just don't know how to turn them into a script... Anyway, it's interesting to chat with someone who "speaks fluently IF" !

Have a good night,

CSV.

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  

×