Slam script in death animation

dantedevil

Well-known member
Hello!

It's possible use in some way the script slam in a death animation?

My character perform a fatality taken the enemy and smashing on the floor several times until the enemy explodes.
For this i need use a @cmd position,  to make the animation more perfect.

Thanks.
 
But why you would use slam script on death animation? its a fall animation and, at the desired frame, you just kill the entity.
Explain me better what you want to do, so I can help you.
 
Ok my friend, i try  explain better.

When my character kill a enemy with ATTACK25 (during grab, for the perfect distance), the enemy perform DEATH25.
In the first  frame of DEATH25 the enemy make a invisible fast ATTACK20 to the hero start rhe animation fatality.
After thath i try to coordinate the two animations, not easy without @cmd position script.

In the fatality the hero grab the enemy for the bottom and smashing several times on the floor,  until finally the enemy explodes in pieces.

I hope you can understand now.
 
Oh you actually want player to followup with fatality finisher IF certain grabattack kills enemy right?
If that's the case, what you actually need is script to check enemy's HP during grabattack. If it's dead, change to finisher, otherwise just let go.
 
Well... i try make a script  myself but  i cant.

Honestly i m' lost in this...

A fatality script be very useful for the users, and must be in "script index" i think.

Thanks.
 
Sorry, I am so busy lately  :'(
Anyways, about this fatality, do you want player to :
1. Continue to fatality immediately after current slam drops enemy's HP low enough
OR
2. Let go of enemy after the slam then immediately continue to fatality ?
 
In think 2 is the best option.
The grabattack is a classic uppercut of mortal kombat with a setting dropv to make the enemy fall high, but close to the hero.
If enemy dies for the uppercut,  he rises and start the fatality.

Thanks.
 
I know this not a simple fatality, for that need a particular script.
In other fatalities exist a basic script to use?

I search in the forum, but nothing found.
 
Its not hard, but I am like BB - no time :(
Just check, at the HURT function, if the target has no life (or life like 1 since that script doesn't kills the target) and change to the desired animation.

Do you have this code, right?
void hurt2(int Damage)
{ // Damage without altering opponent's animation + less damage if opponent has less health
// Mainly used for slams
  void self = getlocalvar("self");
  void target = getlocalvar("Target" + self);

  if(target==NULL())
  {
    target = getentityproperty(self, "grabbing");
    setlocalvar("Target" + self, target);
  }
  if(target!=NULL())
  {
    int THealth = getentityproperty(target,"health"); //Get target's health
    int TAniPos = getentityproperty(target,"animpos"); //Get target's animation frame
    if(THealth > Damage)
    {
      damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL7")); // Damage target with desired damage
      updateframe(target, TAniPos);
    } else {
      int Damage2 = THealth - 1;
      damageentity(target, self, Damage2, 1, openborconstant("ATK_NORMAL7")); //Damage target with less damage
      updateframe(target, TAniPos);
    }
  }
}

I modified this function to be able to change target's animation to the fatality. But you will need to kill the entity by code.

void hurt3(int Damage, void ani)
{ // Damage without altering opponent's animation + less damage if opponent has less health
// and will kill the target if the life is 1
// Mainly used for slams
  void self = getlocalvar("self");
  void target = getlocalvar("Target" + self);

  if(target==NULL())
  {
    target = getentityproperty(self, "grabbing");
    setlocalvar("Target" + self, target);
  }
  if(target!=NULL())
  {
    int THealth = getentityproperty(target,"health"); //Get target's health
    int TAniPos = getentityproperty(target,"animpos"); //Get target's animation frame
    if(THealth > Damage)
    {
      damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL7")); // Damage target with desired damage
      updateframe(target, TAniPos);
  } else if(THealth == 1)
    {
      changeentityproperty(target, "animation", openborconstant(Ani)); //Change the animation
    } else {

      int Damage2 = THealth - 1;
      damageentity(target, self, Damage2, 1, openborconstant("ATK_NORMAL7")); //Damage target with less damage
      updateframe(target, TAniPos);
    }
  }
}

usage:
Code:
@cmd hurt3 20 "ANI_FOLLOW10"

20 is the damage taken, and "ANI_FOLLOW10" is the animation which target will use if it has just 1 of life.

I haven't tested it yet, but it should work.


OR, you can use this:

void hurtkill(int Damage)
{ // Damage without altering opponent's animation + less damage if opponent has less health
// and will kill the target if the life is 1
// Mainly used for slams
  void self = getlocalvar("self");
  void target = getlocalvar("Target" + self);

  if(target==NULL())
  {
    target = getentityproperty(self, "grabbing");
    setlocalvar("Target" + self, target);
  }
  if(target!=NULL())
  {
    int THealth = getentityproperty(target,"health"); //Get target's health
    int TAniPos = getentityproperty(target,"animpos"); //Get target's animation frame
    if(THealth > Damage)
    {
      damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL7")); // Damage target with desired damage
      updateframe(target, TAniPos);
  } else if(THealth == 1)
    {
      damageentity(target, self, 0, 0, openborconstant("ATK_NORMAL10")); //Damage target with attack10, triggering PAIN10
    } else {

      int Damage2 = THealth - 1;
      damageentity(target, self, Damage2, 1, openborconstant("ATK_NORMAL7")); //Damage target with less damage
      updateframe(target, TAniPos);
    }
  }
}

This will trigger PAIN10 anim, which could be your fatality animation. If you need to change which PAIN animation you will use, change the "ATK_NORMAL10" to whatever you want.

Remember, you will still need to kill the entity manually with this:
Code:
@cmd killentity getlocalvar("self")
 
Sorry for the late!

Finally i test the two solutions.

The first:
Code:
void hurt3(int Damage, void ani)
{ // Damage without altering opponent's animation + less damage if opponent has less health
// and will kill the target if the life is 1
// Mainly used for slams
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "grabbing");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     int THealth = getentityproperty(target,"health"); //Get target's health
     int TAniPos = getentityproperty(target,"animpos"); //Get target's animation frame
     if(THealth > Damage)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL7")); // Damage target with desired damage
       updateframe(target, TAniPos);
     } else if(THealth == 1)
     {
       changeentityproperty(target, "animation", openborconstant(Ani)); //Change the animation
     } else {
   
       int Damage2 = THealth - 1;
       damageentity(target, self, Damage2, 1, openborconstant("ATK_NORMAL7")); //Damage target with less damage
       updateframe(target, TAniPos);
     }
   }
}

Give me error.
Code:
Script compile error in 'animationscript': Ani line 409, column 65

********** An Error Occurred **********
*            Shutting Down            *

Can't compile script!
Total Ram: 1002434560 Bytes
 Free Ram: 393879552 Bytes
 Used Ram: 16068608 Bytes

Release level data...........	Done!
Release graphics data........	Done!
Release game data............


Release game data............	Done!
Release timer................	Done!
Release input hardware.......	Done!
Release sound system.........	Done!
Release FileCaching System...	Done!

**************** Done *****************

Can't compile script!

And the second:
Code:
void hurtkill(int Damage)
{ // Damage without altering opponent's animation + less damage if opponent has less health
// and will kill the target if the life is 1
// Mainly used for slams
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "grabbing");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     int THealth = getentityproperty(target,"health"); //Get target's health
     int TAniPos = getentityproperty(target,"animpos"); //Get target's animation frame
     if(THealth > Damage)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL7")); // Damage target with desired damage
       updateframe(target, TAniPos);
     } else if(THealth == 1)
     {
       damageentity(target, self, 0, 0, openborconstant("ATK_NORMAL10")); //Damage target with attack10, triggering PAIN10
     } else {
   
       int Damage2 = THealth - 1;
       damageentity(target, self, Damage2, 1, openborconstant("ATK_NORMAL7")); //Damage target with less damage
       updateframe(target, TAniPos);
     }
   }
}

Never trigger PAIN10 anim, only take the energy of the enemy-
Ex: with this line                    @cmd  hurtkill 20
only take the 20 or die if the opponent has less health.


Sorry, but nothing works.
 
hum, try this instead:

Code:
void hurtkill(int Damage)
{ // Damage without altering opponent's animation + less damage if opponent has less health
// and will kill the target if the life is 1
// Mainly used for slams
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "grabbing");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     int THealth = getentityproperty(target,"health"); //Get target's health
     int TAniPos = getentityproperty(target,"animpos"); //Get target's animation frame
     if(THealth > Damage)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL7")); // Damage target with desired damage
       updateframe(target, TAniPos);
     } else {
   
       damageentity(target, self, 0, 0, openborconstant("ATK_NORMAL10")); //Damage target with attack10, triggering PAIN10
     }
   }
}

The code will hurt the enemy (triggering FALL7) only if the Damage value is greater than the enemy life. If not (IOW the damage is greater than the enemy life remain), it will trigger PAIN10 (not FALL10).

Try and see if it works. It was my mistake, sorry.
 
Back
Top Bottom