damageentity x knockdowncount / defense

O Ilusionista

Captain 100K
Hi guys, I am having an issue here.
I am using scripted slams (BB's method) but the throw/slam/finish aren't working thanks to a conflict with defense.

My enemy has this at defense:
defense all 0.45 25 1 25 25
knockdowncount 5
So he will just go to pain animation if the damage is 25 or more, and you need a power of 5 or more to be able to knock it down.

After some tests, I figures that BB's code doesn't care for knockdowncount, and if you grab someone they won't do the custom animations unless the damage is enough, which bugs everything.  So I modified it to be able to do it, and its works.

But...when you try to use slam/throw/finish, the target won't go to the desired animation, getting stuck on previous animation. The move starts with fall7 animation and should go to a specific animation (see bellow), but that animation is been ignored.

This is my code:
void throw(int Damage, int Type, int x, int y, int z, int Face)
{ // Damage as throw finisher
  void self = getlocalvar("self");
  void target = getlocalvar("Target" + self);
  int SDir = getentityproperty(target,"direction");
  int MDir;

  if(Face==0){ // Same facing?
      MDir = SDir;
  }

  if(Face==1){ // Opposite facing?

    if(SDir==0){ // Facing left?
      MDir = 1;
    } else { MDir = 0;}
  }

  if(target==NULL())
  {
    target = getentityproperty(self, "grabbing");
    setlocalvar("Target" + self, target);
  }
  if(target!=NULL())
  {
    int dir = getentityproperty(target,"direction"); //Get opponent's facing direction
    if(dir==0){ // Facing left?
      x = -x;
    }

    if(Type==1)
    {
      damageentity(target, self, 100, 100, openborconstant("ATK_NORMAL")); // 1st throw type
    }

    if(Type==2)
    {
      damageentity(target, self, 100, 100, openborconstant("ATK_NORMAL9")); // 2nd throw type
    }

    if(Type==3)
    {
      damageentity(target, self, 100, 100, openborconstant("ATK_NORMAL2")); // 3rd throw type
    }

if(Type==4)
    {
      damageentity(target, self, 100, 100, openborconstant("ATK_SHOCK")); // 4rd throw type
    }

  if(Type==5)
    {
      damageentity(target, self, 100, 100, openborconstant("ATK_NORMAL11")); // 4rd throw type
    }

    changeentityproperty(target, "attacking", 1);
    changeentityproperty(target, "damage_on_landing", Damage);
    changeentityproperty(target, "projectile", 1);
    changeentityproperty(target, "direction", MDir);
    tossentity(target, y, x, z); // Toss opponent ;)
  }
}

damageentity(entity, other, force, drop, type)
By the way, Drop is the knockdown power, but what Force means?

Any ideas?
 
I solved this, but I have no clue how  ???
I was using Zvitor's sentinel text as a base, but something was clashing with my codes. Now I build the character from scratch and it works.
 
O Ilusionista said:
I solved this, but I have no clue how  ???
I was using Zvitor's sentinel text as a base, but something was clashing with my codes. Now I build the character from scratch and it works.

Maybe bindentity(opp,NULL()); + bindentity(self,NULL()); was the problem I think...
 
I understand your problem. This slam scripts was made before defense was implemented so they need to be updated for opponents with defense set.

when you try to use slam/throw/finish, the target won't go to the desired animation, getting stuck on previous animation.

Have you tried to add a line to change opponent's animation after the damageentity function?

By the way, Drop is the knockdown power, but what Force means?

Force is the damage inflicted on entity
 
The bug was caused by some error in the character header, I dunno what, but its fixed now.

This is the slamstart() I've updated many time ago to choose if the move knockdown the target (so it will use fall7) or not (so it would use pain7 if you want), and now it works perfectly for what I need:

Code:
void slamstart(int iDrop)
{ // Slam Starter
// Use finish after using this
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "grabbing");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     damageentity(target, self, 1, iDrop, openborconstant("ATK_NORMAL7")); // Slam Starter
   }
}

So the usage is:
@cmd slamstart 10
(10 is the knockdown power. Any number greater than 0 will trigger fall7)

For slamstart2(), I just set the knockdown power directly:
Code:
void slamstart2()
{ // Slam Starter for nongrab slams
// Use finish or throw after using this
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "opponent");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     damageentity(target, self, 1, 100, openborconstant("ATK_NORMAL7")); // Slam Starter
   }
}
 
Back
Top Bottom