spawn at death animation

Die_In_Fire

Well-known member
Basically I want an entity to be spawned when an enemy dies, before blinking.

this is the enemy txt
Code:
nodieblink	1
anim death
	loop       0
	spawnframe 2 0 244 1 1
	subentity texto1d
	offset     36 81
	 delay      50
         frame      data/chars/abobo/13.png
	 frame      data/chars/abobo/13.png
	 frame      data/chars/abobo/13.png

the entity I want to spawn is "load"ed on models.txt
:-X
 
spawn it by script

this is how I do:
anim death
nodieblink 2
offset 92 115
delay 5
quakeframe 0 1 -6
drawmethod 256 256 0 0 0 0 0 121
frame data/chars/enemies/riot/fall2.png
nodrawmethod
frame data/chars/enemies/riot/fall2.png
drawmethod 256 256 0 0 0 0 0 121
frame data/chars/enemies/riot/fall2.png
nodrawmethod
frame data/chars/enemies/riot/fall2.png
@cmd spawn000 "sboom" 0 20 0
drawmethod 256 256 0 0 0 0 0 121
frame data/sprites/0empty.gif

Spawn000 is a custom script I modifed from DC's spawn001. It spawns an entity without changing the direction.

void spawn000(void vName, float fX, float fY, float fZ)
{
//spawn01 (Generic spawner) without direction
//Damon Vaughn Caskey
//07/06/2007
//
//Spawns entity next to caller.
//
//vName: Model name of entity to be spawned in.
//fX: X location adjustment.
//fZ: Y location adjustment.
      //fY: Z location adjustment.

void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
int  iDirection = getentityproperty(self, "direction");

clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.

vSpawn = spawn(); //Spawn in entity.

changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
   
return vSpawn; //Return spawn.
}
 
Thanks! on the entity header I put

animationscript data/scripts/spawn000.c

but still it doesnt spawn anthing...

Code:
anim death
	loop       0
	offset     36 81
	 delay      50
         frame      data/chars/abobo/13.png
	 frame      data/chars/abobo/13.png
	@cmd   spawn000 "texto1d" 0 20 0
	 frame      data/chars/abobo/13.png

I created a spawn000.c of course

anim  death
  nodieblink  2
  offset  92 115
  delay  5
ohh I thought nodieblink had to be declared on the header, didnt know its also posible to declare it inside an animation

 
yeah, use this code in your animation:
Code:
@script
    void parent = getlocalvar("self");
    int frame = getlocalvar("frame");
    
    if ( frame == 0 ) { // <------ TO CHANGE
        void subent;
        float x, z, a, base;
        char ent = "ENTITY_NAME"; // <------ TO CHANGE
        float rx = 0, rz = 0, ra = 0;  // <------ TO CHANGE // shift relative to parent

          clearspawnentry();
          setspawnentry("name", ent);
          subent = spawn();

          if ( getentityproperty(parent,"exists") ) {
              int p_dir = getentityproperty(parent,"direction");

              if (!p_dir) rx *= -1;
              changeentityproperty(subent, "parent", parent);
              x = getentityproperty(parent, "x");
              z = getentityproperty(parent, "z");
              a = getentityproperty(parent, "a");
              base = getentityproperty(parent, "base");
              changeentityproperty(subent, "direction", p_dir);
          } else {
              x = 0;
              z = 0;
              a = 0;
          }

          if ( ra != NULL() ) {
            changeentityproperty(subent, "position", x+rx, z+rz, a+ra);
            changeentityproperty(subent, "base", a+ra);
          } else {
            changeentityproperty(subent, "position", x+rx, z+rz, base);
            changeentityproperty(subent, "base", base);
          }

        return subent;
    }
@end_script


write it in the line after "ANIM DEATH" for example
 
thanks, but nothing happens:

Code:
anim death
	@script
    void parent = getlocalvar("self");
    int frame = getlocalvar("frame");
    
    if ( frame == 1 ) { // <------ TO CHANGE
        void subent;
        float x, z, a, base;
        char ent = "texto1d"; // <------ TO CHANGE
        float rx = 0, rz = 0, ra = 0;  // <------ TO CHANGE // shift relative to parent

          clearspawnentry();
          setspawnentry("name", ent);
          subent = spawn();

          if ( getentityproperty(parent,"exists") ) {
              int p_dir = getentityproperty(parent,"direction");

              if (!p_dir) rx *= -1;
              changeentityproperty(subent, "parent", parent);
              x = getentityproperty(parent, "x");
              z = getentityproperty(parent, "z");
              a = getentityproperty(parent, "a");
              base = getentityproperty(parent, "base");
              changeentityproperty(subent, "direction", p_dir);
          } else {
              x = 0;
              z = 0;
              a = 0;
          }

          if ( ra != NULL() ) {
            changeentityproperty(subent, "position", x+rx, z+rz, a+ra);
            changeentityproperty(subent, "base", a+ra);
          } else {
            changeentityproperty(subent, "position", x+rx, z+rz, base);
            changeentityproperty(subent, "base", base);
          }

        return subent;
    }
@end_script
	loop       0
	offset     36 81
	 delay      50
	quakeframe   0 1 -6
         frame      data/chars/abobo/13.png
	 frame      data/chars/abobo/13.png
	 frame      data/chars/abobo/13.png
:-X
 
yeap I have know" on models.txt and "load" on the char header...

it works when I put the scrip on another animation, but doesn't work when I put it on death animation.

tried with nodieblink 0, 1 and 2 and nothing...  :'(
 
Die_In_Fire said:
yeap I have know" on models.txt and "load" on the char header...

it works when I put the scrip on another animation, but doesn't work when I put it on death animation.

tried with nodieblink 0, 1 and 2 and nothing...  :'(

it has to work!! I tested it in my game!!
Verify your entity name:
Is it texto1d or textold?

than verify if entity name is right when your load it:
load texto1d
or
load textold?

verify if in models.txt the entity name is right
know texto1d
or
know textold?
 
White Dragon said:
Die_In_Fire said:
yeap I have know" on models.txt and "load" on the char header...

it works when I put the scrip on another animation, but doesn't work when I put it on death animation.

tried with nodieblink 0, 1 and 2 and nothing...  :'(

it has to work!! I tested it in my game!!
Verify your entity name:
Is it texto1d or textold?

than verify if entity name is right when your load it:
load texto1d
or
load textold?

verify if in models.txt the entity name is right
know texto1d
or
know textold?

Yeap I verified, on everyplace I have "texto1d" (texto one d)...

DIE, have you tried to use the script I gave you but with ANY other entity?
yeah, but it doesn't spawn anything at death animation.
When I put those scripts on for example, an attack animation, it works...

I'm clueless...  :-X
 
wow that was a noob mistake  :P, I thought that when you use nodieblink, falldie wasn't neccesary...

Now the entity is spawned, but I have some secondary effects:

-In this video, the first segment show Abobo's normal death animation (falldie/death 2 and nodieblink 1)
-the second segment show the death animatio spawning Roper, the death animation is correctly played.
-but on the 3rd segment, when spawns the desired entity, it show the entity, but doesn't display the rest of the death animation, AND spawns an Abobo which cannot move and cannot be hit...
abobo's death glitch

I want to emulate this death:
Double Dragon III NES Boss 3 - Ranzou Yagyu (Perfect, No Hits)
 
Are you using script from White Dragon to spawn Roper and this text?
I'm not sure what caused Abobo to rise again, something must have cause this.

[After watching both videos]

You know, if you just want to spawn text like Ranzou's, you can just spawn a text entity after him :). Hiruko can be spawned later.
 
Bloodbane said:
Are you using script from White Dragon to spawn Roper and this text?
I'm not sure what caused Abobo to rise again, something must have cause this.

I tried with WD script nd with O' script, both give the same results: Aboghost

Bloodbane said:
You know, if you just want to spawn text like Ranzou's, you can just spawn a text entity after him :). Hiruko can be spawned later.
Yeah but I like the "moving text" more  :P
I'm not using Hiruko (not for now)

edit: my first attempt was to spawn the entity after Abobo, but the stage finish before all the text is displayed:
Code:
spawn   abobo2
map 1
health  300
coords	320 190
at	590

#spawn texto1
#coords 200 100
#at 590

group 1 1
at 590

spawn texto1d
coords 200 100
at 590

spawn delay
health  500
coords 330 190
at   590

spawn delay
health  500
coords 330 190
at   590

spawn  complet1
	coords  1  1
	at  590
 
Hmmm...... now that confuses me.... alright, why don't you just use suicide function to remove Abobo at last frame of his DEATH animation? this should solve this glitch.

This is suicide function:
Code:
void suicide()
{ // Suicide!!
    void self = getlocalvar("self");

    killentity(self); //Suicide!
}

Add this function to Abobo's animation script if it's not available yet.
Then declare it like this:

...
offset    36 81
delay      50
quakeframe  0 1 -6
        frame      data/chars/abobo/13.png
frame      data/chars/abobo/13.png
        @cmd    suicide
frame      data/chars/abobo/13.png
 
Back
Top Bottom