I havent covered in-depth animation myself, but shouldnt you put the animation in a while loop?
I am guessing that is the reason it is only running once. So the part where is has...
if (event_type == EVENT_IMPACT)
{
ent_animate(guard2, "death", death_percentage, 0);
death_percentage += 3 * time_step;
wait (1);
return;
}
maybe it should be...
while(death_percentage <=100)
{
if (event_type == EVENT_IMPACT)
{
ent_animate(guard2, "death", death_percentage, 0);
death_percentage += 3 * time_step;
wait(1);
}
wait (1);
}
}
Also not quite sure why you have a return; at the end? Why do you want to exit the function?