Solved Weapons Fatalities

Question that is answered or resolved.

dantedevil

Well-known member
I'm working in the new Weapons Fatalities and find some problems.

Here the idea:

-The hero perform always the same attack and If the enemy dies by the hit, perform:
the fall with this script
Code:
      @script
    void self = getlocalvar("self");

    changeentityproperty(self, "velocity", 0, 0, 0);
@end_script
an then the anim death.

The problem comes when the hero hit the enemy in the air, obviously it does not look good when perform next the specific falll and death.

So I need avoid the scpecific fall and death, when you hit the enemy in the air.
To solve this I have the idea of use this script:
Code:
void lifeCheck (int iLife, void Ani)
// Check the life and change the animation if the life is higher than given value
// Douglas Baldan - 04/11/2013
{
     void self = getlocalvar("self");
     void Health = getentityproperty(self,"health");

      if(Health>=iLife)
      {
        changeentityproperty(self, "animation", openborconstant(Ani));
      }
     
}

So if the enemy dont dies perfom the normal fall.
@cmd lifeCheck 1 "ANI_FALL"

But this script need an update, to check altitude.
This way if the enemy dies and the altitude is 0, then perform the specific fall and death.
And if the enemy dont die by the attack, or if the enemy dies but the altitude is higher than 0, then perform the normal fall.
 
Last edited:
Solution
Sorry, but after a lot of test I found a new problem, so it was necessary to make a few more changes.

Here the attack of hero updated:
Code:
anim attack1
    loop    0
    delay    10
    offset    82 177
    bbox    57 57 47 122
        sound   data/chars/robocop/atk3.wav
    frame    data/chars/robocop/robocop1/atk01.png
    delay    4
        sound   data/sounds/bat.wav
    frame    data/chars/robocop/robocop1/atk02.png
    frame    data/chars/robocop/robocop1/atk03.png
        hitfx   data/sounds/beatt2.wav
        hitflash  flash2b
    attack13 133 18 18 26 20 1 0 0 15
        nokill  1
    frame    data/chars/robocop/robocop1/atk04.png
    attack91 117 69 67 24 20 1 0 0 15
        nokill  1
        dropv   2 2
    frame...
Well, after some research I make this:
Code:
#BAT DEATH1
anim fall93
@script
    if(frame == 0){
      void self = getlocalvar("self");
      int Alti = getentityproperty(self, "a");

      if(Alti > 0){
        changeentityproperty(self, "animation", openborconstant

("ANI_FALL"));
      }

    }
    @end_script
	loop	0
        delay	1
	offset	84 175
        @cmd    lifeCheck 1 "ANI_FALL"
      @script
    void self = getlocalvar("self");

    changeentityproperty(self, "velocity", 0, 0, 0);
@end_script
	frame	data/chars/gang1/bee/pain.png
        @cmd    defenseAtk4 1
        @cmd    degravity 0
	frame	data/chars/gang1/bee/pain.png
	frame	data/chars/gang1/bee/pain.png

Now if you hit an enemy in the air, the enemy play the normal anim fall.

But the problems comes when you kill the enemy in the air, because he play the normal fall and next play the "anim death93" , instead of normal death.

So I try but can't find a way to fix this.
 
I'm still looking for a way to make this work. After many tests, I think the only way to make this work is to create a script so that the attack with the weapon does not kill the enemy, if it has a height greater than ex: 10.
The idea would be that causes him damage, but do not kill him.
If I'm not mistaken, what is needed is a didhitscript, but I do not have enough knowledge to do this.
Maybe there is a better way to do this, but honestly I have no idea.
 
Thanks to that I never gave up and kept looking for the solution, I finally found it.

Here the attack of hero:
Code:
anim attack1
	loop	0
	delay	10
	offset	82 177
	bbox	57 57 47 122
        sound   data/chars/robocop/atk3.wav
	frame	data/chars/robocop/robocop1/atk01.png
	delay	4
        sound   data/sounds/bat.wav
	frame	data/chars/robocop/robocop1/atk02.png
	frame	data/chars/robocop/robocop1/atk03.png
        hitfx   data/sounds/beatt2.wav
        hitflash  flash2b
	attack13 133 18 18 26 20 1 0 0 15 
        nokill  1
	frame	data/chars/robocop/robocop1/atk04.png
	attack91 117 84 67 16 20 1 0 0 15 
        nokill  1
        dropv   2 2
	frame	data/chars/robocop/robocop1/atk05.png
        attack  0 0 0 0
	delay   30
	frame	data/chars/robocop/robocop1/atk05.png
	delay	6
	frame	data/chars/robocop/robocop1/atk06.png
	frame	data/chars/robocop/robocop1/atk07.png
	frame	data/chars/robocop/robocop1/atk08.png

As you see the attack91 has set nokill 1


And here the fall and death of the enemy:
#BAT DEATH2
anim fall91
@script
    if(frame == 0){
      void self = getlocalvar("self");
      int Alti = getentityproperty(self, "a");

      if(Alti > 10){
        changeentityproperty(self, "animation", openborconstant("ANI_FALL"));
      }

    }
    @end_script

loop 0
        delay 1
offset 84 175
@cmd damageentity getlocalvar("self") getlocalvar("self ") 2 1 openborconstant("ATK_NORMAL91")
        @cmd    lifeCheck 1 "ANI_FALL"
        @cmd    stop
frame data/chars/gang1/bee/pain.png
        @cmd    defenseAtk4 1
        @cmd    degravity 0
frame data/chars/gang1/bee/pain.png
frame data/chars/gang1/bee/pain.png


anim death91
loop 0
delay 4
offset 84 175
        sound  data/sounds/rip.wav
@cmd spawn01 "bloody3" 0 110 2
        @cmd    spawnAni "bloodexp"  -10 110 1 "ANI_FOLLOW2" 0 0 0
frame data/chars/gang1/bee/f4jag01.png
        @cmd    spawn01 "bloodfl" 0 0 -1
frame data/chars/gang1/bee/f4jag01.png
delay 30
frame data/chars/gang1/bee/f4jag01.png
delay 40
@cmd spawn01 "bloody3" -10 80 2
frame data/chars/gang1/bee/f4jag01.png
delay 7
offset 82 177
        @cmd    dasher -0.1 -6 0
frame data/chars/gang1/bee/f4jag02.png
frame data/chars/gang1/bee/f4jag03.png
frame data/chars/gang1/bee/f4jag04.png
delay  1
        sound  data/sounds/fall1.wav
frame data/chars/gang1/bee/f4jag05.png
        @cmd    stop
delay 40
frame data/chars/gang1/bee/f4jag05.png

The scripts marked in blue send the enemy to fall animation and the scripts marked in red, kill the enemy with attack91. This way the enemy never can be killed in the air by the attack91.
Set in this order, all works perfect!
 
Sorry, but after a lot of test I found a new problem, so it was necessary to make a few more changes.

Here the attack of hero updated:
Code:
anim attack1
    loop    0
    delay    10
    offset    82 177
    bbox    57 57 47 122
        sound   data/chars/robocop/atk3.wav
    frame    data/chars/robocop/robocop1/atk01.png
    delay    4
        sound   data/sounds/bat.wav
    frame    data/chars/robocop/robocop1/atk02.png
    frame    data/chars/robocop/robocop1/atk03.png
        hitfx   data/sounds/beatt2.wav
        hitflash  flash2b
    attack13 133 18 18 26 20 1 0 0 15
        nokill  1
    frame    data/chars/robocop/robocop1/atk04.png
    attack91 117 69 67 24 20 1 0 0 15
        nokill  1
        dropv   2 2
    frame    data/chars/robocop/robocop1/atk05.png
        attack  0 0 0 0
    delay   30
    frame    data/chars/robocop/robocop1/atk05.png
    delay    6
    frame    data/chars/robocop/robocop1/atk06.png
    frame    data/chars/robocop/robocop1/atk07.png
    frame    data/chars/robocop/robocop1/atk08.png

And here the fall and death of the enemy updated:
Code:
#BAT DEATH2
anim fall91
@script
    if(frame == 0){
      void self = getlocalvar("self");
      int Alti = getentityproperty(self, "a");

      if(Alti > 10){
        changeentityproperty(self, "animation", openborconstant("ANI_FALL"));
      }

    }
    @end_script
    loop    0
        delay    1
    offset    84 175
@script
    void self = getlocalvar("self");
    int  Health = getentityproperty(self, "health");

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

("ATK_NORMAL91"));
      }
    }
    @end_script
        @cmd    lifeCheck 1 "ANI_FALL"
        @cmd    altitude0
        @cmd    stop
        @cmd    degravity 0
        @cmd    defenseAtk4 1
    frame    data/chars/gang1/bee/pain.png
    frame    data/chars/gang1/bee/pain.png


anim death91
    loop    0
    delay    4
    offset    84 175
        @cmd    stop
        sound   data/sounds/rip.wav
    @cmd    spawn01 "bloody3" -10 110 2
        @cmd    spawnAni "bloodexp"  -10 110 1 "ANI_FOLLOW2" 0 0 0
    frame    data/chars/gang1/bee/f4jag01.png
        @cmd    spawn01 "bloodfl" 0 0 -1
    frame    data/chars/gang1/bee/f4jag01.png
    delay    30
    frame    data/chars/gang1/bee/f4jag01.png
    delay    40
    @cmd    spawn01 "bloody3" -10 80 2
    frame    data/chars/gang1/bee/f4jag01.png
    delay    7
    offset    82 177
        @cmd    dasher -0.1 -6 0
    frame    data/chars/gang1/bee/f4jag02.png
    frame    data/chars/gang1/bee/f4jag03.png
    frame    data/chars/gang1/bee/f4jag04.png
    delay   1
        sound   data/sounds/fall1.wav
    frame    data/chars/gang1/bee/f4jag05.png
        @cmd    stop
    delay    40
    frame    data/chars/gang1/bee/f4jag05.png

Thanks to @Bloodbane for the script to change altitude, all works perfect now.
 
Last edited:
Solution
Back
Top Bottom