Slam Script for the beginning

Yes,  here is all the update in my script file:

Code:
void finish(int Damage, int Type, int x, int y, int z, int Face, int Stay, int Landdamage)
    { // Damage as slam or 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, Damage, 1, openborconstant("ATK_NORMAL")); // 1st Finisher
         }

         if(Type==2)
         {
           damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL9")); // 2nd Finisher
         }

         if(Type==3)
         {
           damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL10")); // 3rd Finisher
         }

         if(Type==4)
         {
           damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL11")); // 4th Finisher
         }

         tossentity(target, y, x, z); // Toss opponent ;)
         changeentityproperty(target, "staydown", "rise", Stay);
         changeentityproperty(target, "damage_on_landing", Landdamage);
         changeentityproperty(target, "direction", MDir);
       }
    }

    void throw(int Damage, int Type, int x, int y, int z, int Face, int Stay)
    { // 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, 0, 1, openborconstant("ATK_NORMAL")); // 1st throw type
         }

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

         if(Type==3)
         {
           damageentity(target, self, 0, 1, openborconstant("ATK_NORMAL2")); // 3rd throw type, enemies can autoland here
         }

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

        void cancelgrab()
        {// Check grabbed opponent's name
        // If it's forbidden to grab him/her, revert to IDLE
           void self = getlocalvar("self");
           void target = getlocalvar("Target" + self);

           if(target==NULL())
           {
             target = getentityproperty(self, "opponent");
             setlocalvar("Target" + self, target);
           }
           if(target!=NULL())
           {
             char Tname = getentityproperty(target, "defaultname");

             if(Tname == "Goro" || Tname == "Kintaro" || Tname == "Motaro" || Tname == "Kimokahn")
             {
               setidle(self);
             }
           }
        }

Can you show how set the two features via script (damageonlanding, staydown)?

How be set in this finish if i want make a:
staydown 300 300 and damageonlanding 15 1?

@cmd    finish 0 3 0 -2 0 0 ? ?
 
Hmmm... looks like both finish and throw need some modification cause they are missing some features

Well for now, just set this:

@cmd finish 0 3 0 -2 0 0 300 15
 
Bloodbane said:
Hmmm... looks like both finish and throw need some modification cause they are missing some features

Well for now, just set this:

@cmd finish 0 3 0 -2 0 0 300 15

Well, with this settings @cmd finish 0 3 0 -2 0 0 300 15 the OpenBor not crash anymore.
But the staydown feature dont work, the damageonlanding works perfect.

The throw have problems too, i set        @cmd    throw 25 2 -3 -0.2 0 1 15
If i dont set the last number, the OpenBor crashes.
The last number is for staydown, but dont work.

Here my complete grabscript.c:
Code:
void limiter(int Limit)
{// Prevents hero from performing the animation if his/her health is less than Limit
    void self = getlocalvar("self");
    void Health = getentityproperty(self,"health"); //Get entity's HP.

   if(Health<=Limit) // Don't have enough HP?
   {
     setidle(self); //Don't play the animation.
   }
}

void norun()
{// Turns off running status
    void self = getlocalvar("self");
    changeentityproperty(self, "aiflag", "running", 0);
}

void block(int Flag)
{// Turns blocking status
    void self = getlocalvar("self");
    changeentityproperty(self, "aiflag", "blocking", Flag);
}

void looper(int Frame, int Limit)
{// Loops current animation
    void self = getlocalvar("self");
    void loop = getlocalvar("Loop" + self);

    if(loop==NULL()){ // Localvar empty?
      setlocalvar("Loop" + self, 0);
      loop = 0;
    } 
   
    if(loop < Limit){ // loops reach limit?
      updateframe(self, Frame); //Change frame
      setlocalvar("Loop" + self, loop+1); // Increment number of loops
    }
}

void grabcheck()
{// Prevents hero from performing the slam if he/she's not grabbing anyone
   void self = getlocalvar("self");
   void target = getentityproperty(self, "grabbing");

   if(target==NULL())
   {
     setidle(self); //Don't perform the slam.
   }
}

void dethrown()
{// Disables thrown status
    void self = getlocalvar("self");

    changeentityproperty(self, "attacking", 0);
    changeentityproperty(self, "damage_on_landing", 0);
    changeentityproperty(self, "projectile", 0);
}

void beidle()
{// Go to IDLE animation!
    void self = getlocalvar("self");

    setidle(self);
}

void anti()
{ // Makes grabbed opponent slighty lifted to air
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "grabbing");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     tossentity(target, 1, 0, 0); // Toss opponent a little ;)
   }
}

void anti2()
{ // Makes opponent slighty lifted to air
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "opponent");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     int Check = checkgrab(target);
     if(Check == 1)
     {
       tossentity(target, 1, 0, 0); // Toss opponent a little ;)
     } else if(Check == 0)
     {
       beidle();
     }
   }
}

void anichange(void Ani)
{// Animation changer
    void self = getlocalvar("self");

    changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
}

void slamstart()
{ // 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, 0, 1, openborconstant("ATK_NORMAL7")); // Slam Starter
   }
}

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, 0, 1, openborconstant("ATK_NORMAL7")); // Slam Starter
   }
}

void position(int Frame, float dx, float dy, float dz, int face)
{ // Modify grabbed entity's position relative to grabber
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "grabbing");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     updateframe(target, Frame);
     bindentity(target, self, dx, dz, dy, face, 0);
   }
}

void depost(int Gr)
{// Release grabbed entity
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "grabbing");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     bindentity(target, NULL());

     if(Gr == 1)
     {
       int x = getentityproperty(target, "x");
       int z = getentityproperty(target, "z");
       changeentityproperty(target, "position", x, z, 0);
     }
   }
}

void antiwall(int Dist, int Move, int Distz)
{// Checks if there is wall at defined distance
// If there is wall, entity will be moved away with defined movement
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   int x = getentityproperty(self, "x");
   int z = getentityproperty(self, "z");
   float H;
   float Hz;

   if (Direction == 0){ //Is entity facing left?                  
      Dist = -Dist; //Reverse Dist to match facing
      Move = -Move; //Reverse Move to match facing
   }

   H = checkwall(x+Dist,z);
   Hz = checkwall(x+Dist,z+Distz);

   if(Hz > 0)
   {
     changeentityproperty(self, "position", x, z-Distz);
   }

   if(H > 0)
   {
     changeentityproperty(self, "position", x+Move);
   }
}

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);
     }
   }
}

void finish(int Damage, int Type, int x, int y, int z, int Face, int Stay, int Landdamage)
{ // Damage as slam or 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, Damage, 1, openborconstant("ATK_NORMAL")); // 1st Finisher
     }

     if(Type==2)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL9")); // 2nd Finisher
     }

     if(Type==3)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL10")); // 3rd Finisher
     }

     if(Type==4)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL11")); // 4th Finisher
     }

     tossentity(target, y, x, z); // Toss opponent ;)
     changeentityproperty(target, "staydown", "rise", Stay); 
     changeentityproperty(target, "damage_on_landing", Landdamage);
     changeentityproperty(target, "direction", MDir);
   }
}

void throw(int Damage, int Type, int x, int y, int z, int Face, int Stay)
{ // 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, 0, 1, openborconstant("ATK_NORMAL")); // 1st throw type
     }

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

     if(Type==3)
     {
       damageentity(target, self, 0, 1, openborconstant("ATK_NORMAL2")); // 3rd throw type, enemies can autoland here
     }

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

void degravity(int Ratio)
{// Changes antigravity effect
    void self = getlocalvar("self");
    changeentityproperty(self, "antigravity", Ratio);
}

void move(int dx, int dz,int da)
{ // Moves entity freely and ignores obstacles
    void self = getlocalvar("self");
    int x = getentityproperty(self,"x"); //Get character's x coordinate
    int z = getentityproperty(self,"z"); //Get character's z coordinate
    int a = getentityproperty(self,"a"); //Get character's a coordinate
    int dir = getentityproperty(self,"direction"); //Get character's facing direction

     if(dir==0){ // Facing left?
      changeentityproperty(self, "position", x-dx, z+dz, a+da); //Move
     }
     else if(dir==1){ // Facing right?
      changeentityproperty(self, "position", x+dx, z+dz, a+da); //Move
     }
}

void dasher( float Vx, float Vy, float Vz )
{// Dash with desired speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

    if(dir==0){ // Facing left?
      Vx = -Vx ;
    }

    changeentityproperty(self, "velocity", Vx, Vz, Vy); //Move!
}

void leaper( float Vx, float Vy, float Vz )
{// Leap with desired speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

    if(dir==0){ // Facing left?
      Vx = -Vx ;
    }

    tossentity(self, Vy, Vx, Vz); //Leap!
}

void stop()
{// Stop hero's movement!
    void self = getlocalvar("self");
    changeentityproperty(self, "velocity", 0, 0, 0); //Stop moving!
}

void clearL()
{// Clears all local variables
     clearlocalvar();
}

void slammed(int Damage)
{
   // Hurt self
    void self = getlocalvar("self");
    damageentity(self, self, Damage, 1, openborconstant("ATK_NORMAL9")); // Slam damage is inserted here
    tossentity(self, 2, 0, 0);
}

void keyint(void Ani, int Frame, void Key, int Hflag, int Limit)
{// Change current animation if proper key is pressed or released provided HP is more than limit
    void self = getlocalvar("self");
    void Health = getentityproperty(self,"health");    
    int iPIndex = getentityproperty(self,"playerindex"); //Get player index
    void iRKey;

      if (Key=="U"){ //Up Required?
       iRKey = playerkeys(iPIndex, 0, "moveup"); // "Up"
	}

      if (Key=="D"){ //Down Required?
        iRKey = playerkeys(iPIndex, 0, "movedown"); // "Down"
	}

      if (Key=="J"){ //Jump Required?
        iRKey = playerkeys(iPIndex, 0, "jump"); // "Jump"
	}

      if (Key=="A"){ //Attack Required?
        iRKey = playerkeys(iPIndex, 0, "attack"); // "Attack"
	}

      if (Key=="S"){ //Special Required?
        iRKey = playerkeys(iPIndex, 0, "special"); // "Special"
	}

      if (Key=="A2"){ //Attack2 Required?
        iRKey = playerkeys(iPIndex, 0, "attack2"); // "Attack2"
	}

      if (Key=="UJ"){ //Up and Jump Required?
        iRKey = playerkeys(iPIndex, 0, "moveup", "jump"); // "Up" + "Jump"
	}

      if (Hflag==1){ //Not holding the button case?
        iRKey = !iRKey; //Take the opposite condition
	}

      if ((Health > Limit)&&iRKey){
        changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
        changeentityproperty(self, "animpos", Frame);

        if (Key=="UJ"){ 
          // This is copy of dethrown
          changeentityproperty(self, "attacking", 0);
          changeentityproperty(self, "damage_on_landing", 0);
          changeentityproperty(self, "projectile", 0);
        }
      }
}
continue...
 
Sorry, continues here...
Code:
void keyflip()
{// Change hero's facing direction if left or right is pressed
    void self = getlocalvar("self");
    int iPIndex = getentityproperty(self,"playerindex"); //Get player index

    if (playerkeys(iPIndex, 0, "moveleft")){ // Left is pressed?
      changeentityproperty(self, "direction", 0); //Face left
    } else if (playerkeys(iPIndex, 0, "moveright")){ // Right is pressed?
      changeentityproperty(self, "direction", 1); //Face right
    }
}

void keymove(float V)
{// Move hero if direction button is pressed
      void self = getlocalvar("self");
      int iPIndex = getentityproperty(self,"playerindex"); //Get player index
	float xdir = 0;
	float zdir = 0;

      if (playerkeys(iPIndex, 0, "moveleft")){// Left is pressed?
	  xdir = -V;
	} else if(playerkeys(iPIndex, 0, "moveright")){// Right is pressed?
	  xdir = V;
      }

	if(playerkeys(iPIndex, 0, "moveup")){// Up is pressed?
	  zdir = -V/2;
	} else if(playerkeys(iPIndex, 0, "movedown")){// Down is pressed?
	  zdir = V/2;
      }

	changeentityproperty(self, "velocity", xdir, zdir);
}

void spawn01(void vName, float fX, float fY, float fZ)
{
	//spawn01 (Generic spawner)
	//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.

	if (iDirection == 0){ //Is entity facing left?                  
          fX = -fX; //Reverse X direction to match facing.
	}

      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.
	changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
    
	return vSpawn; //Return spawn.
}

void spawner(void vName, float fX, float fY, float fZ)
{	//Spawns entity next to caller and set them as child.
	//
	//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.
	
	vSpawn = spawn01(vName, fX, fY, fZ); //Spawn in entity.

	changeentityproperty(vSpawn, "parent", self); //Set caller as parent.
    
	return vSpawn; //Return spawn.
}

void shoot(void Shot, float dx, float dy, float dz)
{ // Shooting projectile
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   int x = getentityproperty(self, "x");
   int y = getentityproperty(self, "a");
   int z = getentityproperty(self, "z");

   if (Direction == 0){ //Is entity facing left?                  
      dx = -dx; //Reverse X direction to match facing
   }

   projectile(Shot, x+dx, z+dz, y+dy, Direction, 0, 0, 0);
}

void toss(void Bomb, float dx, float dy, float dz)
{ // Tossing bomb
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   int x = getentityproperty(self, "x");
   int y = getentityproperty(self, "a");
   int z = getentityproperty(self, "z");

   if (Direction == 0){ //Is entity facing left?                  
      dx = -dx; //Reverse X direction to match facing
   }

   projectile(Bomb, x+dx, z+dz, y+dy, Direction, 0, 1, 0);
}

void adjustX()
{// Special script for Bao's Air Pressure
// It moves Bao right to enemy's head
    void self = getlocalvar("self");
    void target = getlocalvar("Target" + self);

    if(target==NULL())
    {
      target = getentityproperty(self, "opponent");
      setlocalvar("Target" + self, target);
    }

    if(target!=NULL())
    {
      int x = getentityproperty(target,"x"); //Get target's x coordinate
      int z = getentityproperty(target,"z"); //Get target's z coordinate

      changeentityproperty(self, "position", x, z, 0); //Grounding
    }
}

void entergrab()
{// Script to change jumping state to grabattacking state
// Used in air grabs
    void self = getlocalvar("self");

    changeentityproperty(self, "aiflag", "jumping", 0); // Disable jumping status
    changeentityproperty(self, "aiflag", "attacking", 1); // Enable attacking status

    changeentityproperty(self, "takeaction", "common_grabattack"); // Enters grabattack
}

void grabcheckA(void Ani1, void Ani2, void Ani3)
{ // Hero's airgrab checker
// This script prevents hero from grabbing ground enemies, bikers, jetpacks, special enemies and non-enemy entities
//  Ani1 = Grab animation to play
//  Ani2 = Animation to play if hit enemy are bikers or jetpacks
//  Ani3 = Animation to play if hit opponent are not airborne enemies

    void self = getlocalvar("self");
    void target = getentityproperty(self, "opponent");

    if(target!=NULL()){

      if(getentityproperty(target, "a") > 0){
        int Check = checkgrab(target);

        if(Check == 0)
        { 
          changeentityproperty(self, "animation", openborconstant(Ani2));
        } else if(Check == 1){
          setlocalvar("Target" + self, target);
          changeentityproperty(self, "animation", openborconstant(Ani1));
        }
      } else {
        changeentityproperty(self, "animation", openborconstant(Ani3));
      }

    }
}

void grabcheckG(void Ani1, void Ani2, void Ani3)
{ // Hero's groundgrab checker
// This script prevents hero from grabbing airborne enemies, bikers, jetpacks, special enemies and non-enemy entities
//  Ani1 = Grab animation to play
//  Ani2 = Animation to play if hit enemy are bikers or jetpacks
//  Ani3 = Animation to play if hit opponent are not ground enemies

    void self = getlocalvar("self");
    void target = getentityproperty(self, "opponent");

    if(target!=NULL()){

      if(getentityproperty(target, "a") == 0){
        int Check = checkgrab(target);

        if(Check == 0)
        { 
          changeentityproperty(self, "animation", openborconstant(Ani2));
        } else if(Check == 1){
          setlocalvar("Target" + self, target);
          changeentityproperty(self, "animation", openborconstant(Ani1));
        }
      } else {
        changeentityproperty(self, "animation", openborconstant(Ani3));
      }

    }
}

void checkgrab(void target)
{ // Opponent Checker
// This script checks hero's current opponent. If he/she/it is biker, jetpack, special enemy or non-enemy entity this function returns 0
// Otherwise it returns 1.

    if(getentityproperty(target, "type") == openborconstant("TYPE_ENEMY")){
      char Tname = getentityproperty(target, "defaultname");

      if(Tname == "Badai" || Tname == "BikerL" || Tname == "BikerL1" || Tname == "BikerT" || Tname == "Rider" || Tname == "Rider2" )
      { // Normal Bikers
        return 0;
      } else if(Tname == "BikerS" || Tname == "Storm" || Tname == "BikerAT" || Tname == "Bikeman" || Tname == "BikeBoss" )
      { // Special Bikers
        return 0;
      } else if(Tname == "Biker" || Tname == "RiderB" || Tname == "BikerB" || Tname == "Rover" || Tname == "Candy" || Tname == "Button")
      { // Bonus Bikers, Candy & Dog
        return 0;
      } else if(Tname == "Skystar" || Tname == "Aerial" || Tname == "Raidi" || Tname == "Rockette" || Tname == "Jetpac" || Tname == "Rocket")
      { // Jetpacks
        return 0;
      } else {
        return 1;
      }
    } else {
      return 0;
    }
}
    void cancelgrab()
    {// Check grabbed opponent's name
    // If it's forbidden to grab him/her, revert to IDLE
       void self = getlocalvar("self");
       void target = getlocalvar("Target" + self);

       if(target==NULL())
       {
         target = getentityproperty(self, "opponent");
         setlocalvar("Target" + self, target);
       }
       if(target!=NULL())
       {
         char Tname = getentityproperty(target, "defaultname");

         if(Tname == "Goro" || Tname == "Kintaro" || Tname == "Motaro" || Tname == "Kimokahn")
         {
           setidle(self);
         }
       }
    }

Can you help me with the modifications needed?

Thanks!
 
The throw have problems too, i set        @cmd    throw 25 2 -3 -0.2 0 1 15
If i dont set the last number, the OpenBor crashes.
The last number is for staydown, but dont work.

hum, look for a reply I gave you some time ago, where I explained about how much values the function should have. There is a bugged version with 6 values, but the right one must have SEVEN values.

http://www.chronocrash.com/forum/index.php?topic=1077.msg10873#msg10873
 
This is the first time i use the staydown and damageonlanding scripts.
And yes, in the throw i set seven values. But the staydown not work anyway.
 
Hmmm..... just for testing, try setting 0 like this:

@cmd finish 0 3 0 -2 0 0 300 0

See if staydown effect works.

I seem to recall there's a bug related to setting damageonlanding and this one probably related to this.
 
Staydown still dont work.
I try changing the script and remove in @cmd finish the damageonlading feature
Here the result and working perfect without damageonlading.
Code:
void finish(int Damage, int Type, int x, int y, int z, int Face, int Stay)
{ // Damage as slam or 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, Damage, 1, openborconstant("ATK_NORMAL")); // 1st Finisher
     }

     if(Type==2)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL9")); // 2nd Finisher
     }

     if(Type==3)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL10")); // 3rd Finisher
     }

     if(Type==4)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL11")); // 4th Finisher
     }

     tossentity(target, y, x, z); // Toss opponent ;)
     changeentityproperty(target, "staydown", "rise", Stay); 
     changeentityproperty(target, "direction", MDir);

In the @cmd thrown i cant find a solution for staydown, this feature not working.

See the previous post here and you can see all the test i make.

 
Sorry, I tried making attackbox with staydown and damageonlanding combined but staydown effect is ignored :(.

So until this bug is solved, you can't mix these 2.
 
Oh that one, staydown script is declared in enemy's text NOT in player's that's why it works.
For slam, it's not that simple cause one function sets damageonlanding and staydown at same time.
 
Sorry, like I said above, that solution is set in enemy's text not inside throw/finish or any functions.
Moreover for throws, player is more likely to have ended the animation before thrown enemy landed so the former can't apply anything including staydown when the latter does land. Player could be doing something else also that time.
 
Bloodbane said:
It says, you are missing addScore function
Since you get the scripts from Itsuchi, you either ask him about the function or remove that function.

This slam script has the score function tied to it like this #include "data/scripts/common/score.c

And this is the script:

void addScore(void ent,void score)
{
if(getentityproperty(ent,"TYPE")==openborconstant("TYPE_PLAYER")){
int  PIndex = getentityproperty(ent,"playerindex");
int  PScore = getplayerproperty(PIndex, "score");
changeplayerproperty(PIndex, "score", PScore+score);
}
}
 
#include "data/scripts/common/score.c"
void lock()
{
  lockEntity(1);
}
void lockEntity(void noair)
{
  void self = getlocalvar("self");
  void target = getentityproperty(self, "grabbing");
  if (!target){
      target = getentityproperty(self, "opponent");
      if(!target){
        setentityvar(self,0,0);
        setidle(self,openborconstant("ANI_IDLE"));
        return;
      }
  }
  if(getentityproperty(target,"type")==openborconstant("TYPE_OBSTACLE")
      ||getentityproperty(target,"dead")
      ||getentityproperty(target,"antigrab")
      ){
      setidle(self,openborconstant("ANI_IDLE"));
  }else{
      if(noair)
      {
        if(getentityproperty(target,"a")!=getentityproperty(target,"base"))
        {
            setidle(self,openborconstant("ANI_IDLE"));
            return;
        }
      }
      setentityvar(self,0,target);
      setentityvar(target,0,1);
  }
}
void slamStart()
{
  void self = getlocalvar("self");
  if(!self){return;}else{}
  void target = getentityvar(self,0);
  if(target)
  {
      changeentityproperty(target,"noaicontrol",1);
      performattack(target,openborconstant("ANI_FALL7"));
  }else{
      setidle(self,openborconstant("ANI_IDLE"));
  }
}
void position(int Frame, float dx, float dy, float dz, int face)
{
  void self = getlocalvar("self");
  if(!self){return;}else{}
  void target = getentityvar(self,0);
  if(target)
  {
      updateframe(target, Frame);
      bindentity(target, self, dx, dz, dy, face, 0);
      //changeentityproperty(target,"nextthink",openborvariant("elapsed_time")+250);
      //changeentityproperty(target,"nextanim",openborvariant("elapsed_time")+250);
  }
}
void depost()
{
  depost01(0);
}
void depost01(void bounce)
{
  void self = getlocalvar("self");
  void target = getentityvar(self,0);
  if(target)
  {
      bindentity(target, NULL());
      if(bounce)
      {
        changeentityproperty(target,"velocity",0,0,0);

      }
  }
}
void slamHurt()
{
  //void self = getlocalvar("self");
  //void target = getentityvar(self,0);
  //void model;
  //if(target){
  //  model=getentityproperty(target,"model");
  //  if  (model=="Hugo"
  //      ||model=="Andore"
  //      ||model=="Raiden"
  //      ||model=="Chang"
  //      ||model=="Alex"
  //      ||model=="Zankuro"
  //      )
  //  {
  //      depost();
  //      clearSlam();
  //      damageentity(self,target,15,1,openborconstant("ATK_NORMAL"));
  //      damageentity(target,self,0,1,openborconstant("ATK_NORMAL"));
  //      tossentity(target,-1,0.01, 0);
  //  }
  //}
}
void clearSlam()
{
  void self = getlocalvar("self");
  void target = getentityvar(self,0);
  void x,zself,xself,offset,wall,i;
  void base=getentityproperty(self,"base");
  if(target)
  {
      setentityvar(self,0,NULL());
      setentityvar(target,0,NULL());
      x=getentityproperty(target,"x");
      xself=getentityproperty(self,"x");
      zself=getentityproperty(self,"z");
      changeentityproperty(target,"noaicontrol",0);
      if (xself>x){
        offset=2;
      }else{
        offset=-2;
      }
      for (i=0;i<200;i++)
      {
        wall=checkwall(x,zself);
        if (wall<=base){
            changeentityproperty(target,"position",x,zself);
            return;
        }
        x+=offset;
      }
  }
}
void finish(int Damage, int x, int y, int z, int faceOpposite)
{
  void self = getlocalvar("self");
  void target = getentityvar(self,0);
  int SDir = getentityproperty(target,"direction");
  int MDir;

  if(faceOpposite){
      MDir=!SDir;
  }else{
      MDir=SDir;
  }
  if(target)
  {
      int dir = getentityproperty(target,"direction");
      if(!dir)x = -x;
      damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL"));
      tossentity(target, y, x, z);
      changeentityproperty(target, "direction", MDir);
  }
}
void throw(int Damage, int x, int y, int z, int faceOpposite)
{
  void self = getlocalvar("self");
  void target = getentityvar(self,0);
  int SDir = getentityproperty(target,"direction");
  int MDir;

  if(faceOpposite){
      MDir=!SDir;
  }else{
      MDir=SDir;
  }

  if(target)
  {
      int dir = getentityproperty(target,"direction");
      if(!dir){
        x = -x;
      }
      bindentity(target, NULL());
      damageentity(target, self, 0, 1, openborconstant("ATK_NORMAL4"));
      changeentityproperty(target, "attacking", 1);
      changeentityproperty(target, "damage_on_landing", Damage);
      changeentityproperty(target, "projectile", 1);
      changeentityproperty(target, "direction", MDir);
      tossentity(target, y, x, z);
      clearSlam();
     
  }
}

void hurt(int aamage)
{
  hurt2(aamage,0);
}
void hurt2(int damage,int is_live)
{
  hurt3(damage,is_live,7,1);
}
void hurt3(int Damage,int is_live,int type,int keepframe)
{
  void self = getlocalvar("self");
  void target = getentityvar(self,0);
  if(!target){return;}else{}
  int TAniPos = getentityproperty(target,"animpos");
 
  if (is_live){
      void hp=getentityproperty(target,"health");
      void thp = hp;
      thp -=Damage;
      if(thp<1)thp=1;
      changeentityproperty(target,"health",thp);
      addScore(self,Damage*5);
  }else{
      if(!type)
        damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL"));
      else
        damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL"+type));
  }
  if (keepframe)updateframe(target, TAniPos);
}
 
Back
Top Bottom