Kill entity with specific animation

dantedevil

Well-known member
I want kill an entity via script,  with a specific animation of death and I don't wat the entity dissapear.
I want the body stay like nodieblink 3.

I have this script:
Code:
@script
    void self = getlocalvar("self");
    int  Health = getentityproperty(self, "health");

    if(frame==47){
      changeentityproperty(self, "health", Health-30);
      if (Health <= 0){
        killentity(self);
      }
    }
    @end_script

I want this script kill the entity, doing
the enity play death48.
 
Code:
Now if you want to change the "falldie" too for this specific death, then i have an solution for this too. I mean in case your character is using "falldie 2" but you want it like "falldie 1" only for this death.
Just tale me then.

Yes, my enemies have falldie 2, and I want change to falldie 1 only for a specific death.
 
Good trick my friend,  thanks.  :)

Now here my problem:

I have the stage fatality in the train station. This stage have Z coords 233 270. The tracks with electricity they are at the bottom of the stage, above the Z 233, obviously.
So when kill an enemy with the stage fatality,  I need the enemy fall over the track, to do this real, I need the enemy don't touch the floor,  to avoid the dust and the sprite fall shows in the bottom of the level, instead of on the tracks.

With this fall with "degravity" the animation looks perfect:
Code:
#-----------------------Stage Fatal 2--------------------#


anim fall48
	loop	0
@script
void self = getlocalvar("self");

if(frame == 1){
  changeentityproperty(self, "setlayer", -1);
}

@end_script
	offset	82 177
	delay   16
        jumpframe 0 -0.1 0 -0.1
        dropframe  1
        fshadow 0
	drawmethod	scale 0.9 0.9
	sound   data/chars/vipers/fall.wav
	frame	data/chars/vipers/fall3.png
	frame	data/chars/vipers/fall3.png
	frame	data/chars/vipers/fall3.png
	frame	data/chars/vipers/fall3.png
	delay   8
        @cmd    degravity 1
        @cmd    stop       
	frame	data/chars/vipers/fall4.png
        @cmd    spawn01 "gbody" 0 0 1
	frame	data/chars/vipers/pain8.png
	frame	data/chars/vipers/fall4.png
	sound   data/sounds/ladydie.wav
	frame	data/chars/vipers/pain8.png
	delay   4
        drawmethod remap 3
	frame	data/chars/vipers/fall4.png
        nodrawmethod
	frame	data/chars/vipers/fall4.png
	delay   8
	frame	data/chars/vipers/pain8.png
	frame	data/chars/vipers/fall4.png
	frame	data/chars/vipers/pain8.png
        @cmd    spawn01 "gbody" 0 0 1
	frame	data/chars/vipers/fall4.png
	frame	data/chars/vipers/pain8.png
	frame	data/chars/vipers/fall4.png
	delay   4
        drawmethod remap 3
	frame	data/chars/vipers/pain8.png
        nodrawmethod
	frame	data/chars/vipers/pain8.png
	delay   8
	frame	data/chars/vipers/fall4.png
	frame	data/chars/vipers/pain8.png
	frame	data/chars/vipers/fall4.png
        @cmd    spawn01 "gbody" 0 0 1
	frame	data/chars/vipers/pain8.png
	frame	data/chars/vipers/fall4.png
	frame	data/chars/vipers/pain8.png
	delay   4
        drawmethod remap 3
	frame	data/chars/vipers/fall4.png
        nodrawmethod
	frame	data/chars/vipers/fall4.png
	delay   8
	frame	data/chars/vipers/pain8.png
	frame	data/chars/vipers/fall4.png
	frame	data/chars/vipers/pain8.png
	delay   4
        @cmd    spawn01 "gbodyfat" 0 0 1
	frame	data/chars/vipers/fall4.png
        drawmethod remap 3
	frame	data/chars/vipers/fall4.png
        nodrawmethod
	frame	data/chars/vipers/pain8.png
        drawmethod remap 5
	frame	data/chars/vipers/mapsh1.png
        drawmethod remap 3
	frame	data/chars/vipers/fall4.png
        nodrawmethod
	frame	data/chars/vipers/fall4.png
	frame	data/chars/vipers/pain8.png
        drawmethod remap 5
	frame	data/chars/vipers/mapsh1.png
        nodrawmethod
	frame	data/chars/vipers/fall4.png
	frame	data/chars/vipers/fall4.png
	frame	data/chars/vipers/pain8.png
        drawmethod remap 5
	frame	data/chars/vipers/mapsh1.png
        nodrawmethod
	frame	data/chars/vipers/pain8.png
        drawmethod remap 5
	frame	data/chars/vipers/mapsh1.png
	delay	70
        @cmd    spawn01 "smoky2" 0 8 1
	frame	data/chars/vipers/mapsh2.png
        @cmd    spawn01 "smoky2" 0 8 1
	frame	data/chars/vipers/mapsh2.png
        @cmd    spawn01 "smoky2" 0 8 1
	frame	data/chars/vipers/mapsh2.png
	delay	1
	frame	data/chars/vipers/mapsh2.png
@script
    void self = getlocalvar("self");
    int  Health = getentityproperty(self, "health");

    if(frame==47){
      changeentityproperty(self, "health", Health-30);
      if (Health <= 0){
        damageentity(self, self, 500, 1, openborconstant("ATK_NORMAL48"));
      }
    }
    @end_script
	frame	data/chars/vipers/mapsh2.png

But for some reason the fall at the end never goes to the death animation.
And the stage  get stuck if kill an enemy with the stage fatality.

So it's any way to make a forced ANICHANGE to anim death?

PD: I don't want use the killentity and spawn another entity to play death.
Because that was my previous method,  works well, but in the end use the same entity for all enemies to avoid make a new entity for every enemy.
With the new method all enemies have their personal sprites for the death and only need create a new pallete for this sprites. 
 
Sorry my friend, but not work.

Still get stucked in the last frame of ANIM FALL48.
I don't understand, because the FALL48 only is performed when stage attack touch the enemy, and this attack have high points to kill the enemy always.
I set like this and create the fall55 and death55, but never shows.

Code:
@script
    void self = getlocalvar("self");
    int  Health = getentityproperty(self, "health");

    if(frame==47){
      changeentityproperty(self, "health", Health-30);
      if (Health <= 0){
        damageentity(self, self, 500, 1, openborconstant

("ATK_NORMAL55"));
      }
    }
    @end_script
 
I think the solution ca be  make a forced ANICHANGE to anim death, or set a script to change the "type enemy"  to  "type none" .
Maybe this way the scroll ignore the enemies.
 
Again:
Sorry my friend, but not work.

Still get stucked in the last frame of ANIM FALL48.
I don't understand, because the FALL48 only is performed when stage attack touch the enemy, and this attack have high points to kill the enemy always.
I set like this and create the fall55 and death55, but never shows.

Thanks for all your help my friend.
 
I know that method my friend, I used before:
PD: I don't want use the killentity and spawn another entity to play death.
Because that was my previous method,  works well, but in the end use the same entity for all enemies to avoid make a new entity for every enemy.
With the new method all enemies have their personal sprites for the death and only need create a new pallete for this sprites. 

But it seems that I will have to continue using this method, since it is the only one that works. Thank you very much for all your help my friend, I appreciate your efforts to help.
 
Back
Top Bottom