Killing Off SpawnBind Entity When Parent Entity Gets Attacked

maxman

Well-known member
I use spawnBind and terminate animation scripts for killing off the spawnBind effect. But the problem I have now is when the player gets attacked with spawnBind being active, it stays. How can I terminate that when he gets attacked?

Code:
anim freespecial2 #BURNING KNUCKLE
    offset 140 188
    delay 6
    load burnknuc
    loop 1 2 4
    jumpframe 1 2 4 0 # 3 0.5 1.2 0
    landframe 4 #5
    sound data/sounds/heroes/terry/06_terry_00011.wav
    bbox 118 108 51 79
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/162_3.png
    bbox 122 103 44 64
    @cmd spawnBind2 "burnknuc" 0 1 1 0 0 1
    attack 161 104 51 31 11 1 0 0 0 0
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/162_4.png
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/162_6.png
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/162_6.png
    attack 0
    delay 12
    @cmd terminate "burnknuc"
    bbox 130 123 44 64
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/162_2.png
 
I use spawnBind and terminate animation scripts for killing off the spawnBind effect. But the problem I have now is when the player gets attacked with spawnBind being active, it stays. How can I terminate that when he gets attacked?

Code:
anim freespecial2 #BURNING KNUCKLE
    offset 140 188
    delay 6
    load burnknuc
    loop 1 2 4
    jumpframe 1 2 4 0 # 3 0.5 1.2 0
    landframe 4 #5
    sound data/sounds/heroes/terry/06_terry_00011.wav
    bbox 118 108 51 79
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/162_3.png
    bbox 122 103 44 64
    @cmd spawnBind2 "burnknuc" 0 1 1 0 0 1
    attack 161 104 51 31 11 1 0 0 0 0
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/162_4.png
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/162_6.png
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/162_6.png
    attack 0
    delay 12
    @cmd terminate "burnknuc"
    bbox 130 123 44 64
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/162_2.png
C-like:
void main()
{
  void self = getlocalvar("self");
  void parent = getentityproperty(self, "parent");
  void vAniID = getentityproperty(parent,"animationID");

  if(vAniID != openborconstant("ANI_freespecial2")){
     killentity(self);
  }
}
Put the script into the "burnknuc" entity
script data/scripts/killeffect.c
The parent is not in freespecial2 and is killed
 
C-like:
void main()
{
  void self = getlocalvar("self");
  void parent = getentityproperty(self, "parent");
  void vAniID = getentityproperty(parent,"animationID");

  if(vAniID != openborconstant("ANI_freespecial2")){
     killentity(self);
  }
}
Put the script into the "burnknuc" entity
script data/scripts/killeffect.c
The parent is not in freespecial2 and is killed
Tried it, but its spawnbind doesn't appear, so I changed it to this one.

C:
  if(!vAniID == openborconstant("ANI_freespecial2")){
     killentity(self);
  }

However, yours and mine don't work for killing off the effect when a player gets knocked down/out.

Code:
name burnknuc #Burning Knuckle
type none
animationscript data/scripts/animation/default.c
script data/scripts/entity/killeffect.c

anim idle
    delay 3
    offset 140 188
    loop 1
    frame data/chars/heroes/kof_2k3_terry_sprite.7z/effects/915_0.png
    frame data/chars/heroes/kof_2k3_terry_sprite.7z/effects/915_0.png
 
Tried it, but its spawnbind doesn't appear, so I changed it to this one.

C:
  if(!vAniID == openborconstant("ANI_freespecial2")){
     killentity(self);
  }

However, yours and mine don't work for killing off the effect when a player gets knocked down/out.

Code:
name burnknuc #Burning Knuckle
type none
animationscript data/scripts/animation/default.c
script data/scripts/entity/killeffect.c

anim idle
    delay 3
    offset 140 188
    loop 1
    frame data/chars/heroes/kof_2k3_terry_sprite.7z/effects/915_0.png
    frame data/chars/heroes/kof_2k3_terry_sprite.7z/effects/915_0.png
You can add an anim follow1 to the summon body and then the player will play anim follow1 when he is not in freespecial2.
C-like:
void main()
{
  void self = getlocalvar("self");
  void parent = getentityproperty(self, "parent");
  void vAniID = getentityproperty(parent,"animationID");

  if(!vAniID == openborconstant("ANI_freespecial2")){
     changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
 }
}
 
Thank you for trying your best to help with cancelling the summon one.

This works well when I use @cmd terminate animation function in anim fall, but I don't like it. That's because every time he does jumpframe and gets damaged off the ground, it stays when I don't use it. It disappears when I use it. If I have no other choice, then I'll use terminate.
 
Back
Top Bottom