Lifespan + anim death question

PS_VITA

Active member
Hi, whenever I try using anim spawn in anim death it normally works.  However, since I've added a lifespan option it's not really working as intended.

Lifespan 20 btw.

What could I be doing wrong?



 
Here you go kimono

Code:
name	slug
health	1
nolife        1
type	none
shadow	1
falldie 1
nodieblink      2
offscreenkill 70000
lifespan  15
#setlayer 0
facing 1
#subject_to_hole 0
#subject_to_wall 1
#subject_to_gravity 0
antigravity 100
candamage player enemy npc

palette   data/levels/st3c/slug2.png

animationscript data/scripts/ani0020.h

load slug2


anim spawn
     loop 0
     offset 0 0
     delay 50
frame	data/chars/misc/empty.gif



anim idle
     loop 1
     offset 0 0
     delay 7
@cmd	dasher -1 0 0
     frame data/levels/st3c/slug1.png
     nokill 1
     attack   50   0   1064    744      20        1      0        1           0      50
     dropv 2.3 -10.5
     frame data/levels/st3c/slug2.png
     attack 0 0 0 0 0 0 0 0 0 0
     frame data/levels/st3c/slug3.png
     frame data/levels/st3c/slug1.png
     attack   50   0   1064    744      20        1      0        1           0      50
     dropv 2.3 -10.5
     frame data/levels/st3c/slug2.png
     attack 0 0 0 0 0 0 0 0 0 0
     frame data/levels/st3c/slug3.png


anim death
	loop	0
     offset 0 0
	delay	7
        spawnframe 0 0 0 0
        custentity slug2
  	 frame data/levels/st3c/slug3.png
         frame data/levels/st3c/slug3.png
         frame data/levels/st3c/slug3.png
 
That would be why. None types don't have a death routine, so the engine just kills them instantly (remember death and kill are two different things).

From the source code. Takedamage refers to the logic that makes entity react to hits, fall over, and so on.

- If the entity has a damage routine, it receives its current health in ATK_LIFESPAN damage. There's no set of animations for ATK_LIFESPAN, so it defaults back to Attack Type 1 reactions. "Blargh I'm dropping dead for no reason!"
- If the entity doesn't have a takedamage routine (like None types), they are killed on the spot. *Poof*, gone.

Code:
...
else if(self->lifespancountdown < 0) //Lifespan expired.
    {
        if(!self->takedamage)
        {
            kill_entity(self);
        }
        else
        {
            attack          = emptyattack;
	    attack.dropv	= default_model_dropv;
            attack.attack_force = self->energy_state.health_current;
            attack.attack_type  = ATK_LIFESPAN;
            self->takedamage(self, &attack, 0);
        }
        return 1;
    }
...

DC
 
Back
Top Bottom