Jump to content
Sign in to follow this  
SOSyourself

Execution script?

Recommended Posts

I need some help trying to get an execution going...

Main issue is, I don't know how to have the soldiers fire. I tried changing their ROE to open fire and placed invisible targets behind the civilians but they did not stop shooting when the civilians had died.

Also, I tried to make the civilians put their hands behind their head but if I loop that animation it makes them invincible for some reason? (animloop.sqs)

Thanks in advance

Share this post


Link to post
Share on other sites

shooter doTarget victim;

shooter doFire victim;

Of course they keep shooting on the invisible targets because they are the real targets and not the civilians.

And the content of that animloop.sqs we shall guess now I presume?

Share this post


Link to post
Share on other sites

I assume do fire will either fire once, or fire until the victim is killed?

and here is the .sqf

_unit = _this select 0;

_animation = _this select 1;

_switchMove = _this select 2;

_unit setVariable ["BIS_noCoreConversations", true];

if (_switchMove) then {

while {true} do {

_unit switchMove _animation;

waitUntil {animationState _unit != _animation};

};

} else {

while {true} do {

_unit playMove _animation;

waitUntil {animationState _unit != _animation};

};

};

EDIT: Yeah the script works perfectly, now I just need to address the issue with the hands on the head and being invincible.

Edited by SOSyourself

Share this post


Link to post
Share on other sites

It's not that they're invincible, but rather they stuck in the animation. I use one of two methods, depending on the situation. The easiest for a hands-on-head animation is to call disable movement:

dude playMove "AmovPercMstpSsurWnonDnon";
sleep 1;
dude disableAI "Anim";

The dude will keep that animation state until you do:

dude enableAI "Anim";

At which point he will usually come right out of the hands-on-head animation. If not, you could try these:

dude switchMove "";
dude playMoveNow "AmovPercMstpSlowWrflDnon";

One or the other, you don't need both. Sometimes one won't work, that's why I listed both.

As for *when* to come out of the animation state, I use event handlers.

_ehEvent = _unit addEventHandler ["killed", {_this execVM "stopAnimation.sqf"}];

where stopAnimation.sqf has the code to enableAI "anim". There is also "firednear" and "hit". You could use all 3, or 2 of them, whatever suits you.

I'm just throwing different techniques that I employ at you. Maybe something will help.

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  

×