Jump to content
Sign in to follow this  
Oglesbee

How do I Kill an AI in the Middle of Animation Sequence

Recommended Posts

I am having an issue with a helicopter mission I am creating.

I have emplaced an IED cel and gave them animations to appear as if they are working on an ied. I used a repair animation in a trigger with this

code in the

act field

ied1 playMove "RepairingKneel";ied2 playMove"ReparingKneel";

condition field

alive ied1

I shoot the enemy and they are still performing the animation.

How do i get them to die when they are shot before finishing the animation or is this impossible?

Share this post


Link to post
Share on other sites

Hi,

You can add a killed Event Handler and once they are dead, switch the animation to a normal one (Where they will fall and die).

{
  _x playMove "ReparingKneel";
  _x addEventHandler ["Killed", { (_this select 0) switchMove "" }];
} forEach [ied1, ied2];

_neo_

Share this post


Link to post
Share on other sites

what do i make the variable in _X just one of the ied guys?

Share this post


Link to post
Share on other sites
what do i make the variable in _X just one of the ied guys?

The local variable _x is already one of the IED guys, related to the forEach loop.

You can either have that or:

ied1 playMove "ReparingKneel";
ied1 addEventHandler ["Killed", { (_this select 0) switchMove "" }];

ied2 playMove "ReparingKneel";
ied2 addEventHandler ["Killed", { (_this select 0) switchMove "" }];

Share this post


Link to post
Share on other sites

thanks. I got it to work and now I have another tool in my toolbox

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  

×