custom grabcheck

dantedevil

Well-known member
Based on this script:
Code:
  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") > getentityproperty(target, "base")){
        int Check = checkgrab(target);

        if(Check == 0)

Its possible create a new custom grabchek?

Something like:
In ani1: grab animation to play
In ani2: animation to play if enemie is RALF, MARY, GEORGE
IN ani3: animation to play if enemie is kusare, gideon, tusare.
In ani4: animation to play of enemie is not anyone on the mentioned characters.

Thanks.
 
That's doable except that your list should be like this:

In ani1: animation to play if enemie is RALF, MARY, GEORGE
IN ani2: animation to play if enemie is kusare, gideon, tusare.
In ani3: animation to play of enemie is not anyone on the mentioned characters.

I'm busy ATM so I can't help you making this function now :)
 
I try this and dont work:

Code:
  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 = Animation to play if enemie is RALF, MARY, GEORGE
//  Ani2 = Animation to play if enemie is KUSARE
//  Ani3 = Animation to play of enemie is not anyone on the mentioned characters
    void self = getlocalvar("self");
    void target = getentityproperty(self, "opponent");

    if(target!=NULL()){

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


        if(Check == 0)

Any idea?
 
I dont know how modify this script to works.
I simply try a few ways without news. I have some scripts with personal modifications with good results, but with this one i dont have idea.
 
You've just cut off the end of the script by accident,

This is the whole script.

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

    }
}
 
Sorry for the post error,  my script is like you show me in my mod. I post from a movil and between copy and paste i lost a part.
Anyway the script dont work.
When the  characters using the animation stop and not follow with the moves set in the script.
The OpenBor not crash,  but dont work.
 
Please post the solutions in the thread too for other users, so we don't have threads with questions and no answers.
 
Ahh sorry.
Using your last post i found an error on my script.
The solution is the script you posted:

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

    }
}

Thanks!
 
Well... i dont know wath happend, but this script stop work now.

Here the script:
Code:
void grabcheckM(void Ani1, void Ani2, void Ani3)
{ // Hero's grab checker
// This script prevents hero from grabbing Bosses with the incorrect animation.
//  Ani1 = Animation to play if enemie is GORO, KINTARO, MOTARO
//  Ani2 = Animation to play if enemie is KIMOKAHN
//  Ani3 = Animation to play if not anyone on the mentioned characters

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

    }
}

No matter the enemy in front, the hero always make the " void Ani3".

Ex: When hero attacks GORO, he perform  void Ani3 not the  void Ani1 like said in the checker.

 
Sorry,  but you mean this script need other to work? .
I dont know thath.
Is this? :
Code:
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;
    }
}
 
Well, try again with some modifications:
Code:
void checkgrab(void target)
{ // Opponent Checker
// This script checks hero's current opponent. If he/she/it is Special Boss, or Final Boss entity this function returns 0
// Otherwise it returns 1.

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

      if(Tname == "KIMOKAHN" )
      { // Final Boss
        return 0;
      } else if(Tname == "GORO" || Tname == "KINTARO" || Tname == "MOTARO" )
      { // Special Bosses
        return 0;
      } else {
        return 1;
      }
    } else {
      return 0;
    }
}

void grabcheckG(void Ani1, void Ani2, void Ani3)
{ // Hero's groundgrab checker
// This script prevents hero from grabbing Bosses with the incorrect animation.
//  Ani1 = Animation to play if enemie is GORO, KINTARO, MOTARO
//  Ani2 = Animation to play if enemie is KIMOKAHN
//  Ani3 = Animation to play if not anyone on the mentioned characters

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

    }
}

Set like this not work like i need.
When grab GORO, KINTARO, MOTARO make animation 2, the correct is animation 1.
When grab KIMOKHAN make animation 2, this is correct.
And when grab not anyone of the mentioned characters make animation 1, the correct is animation 3.

I try with some modifications in the script but still fail the correct animation from each one.
 
Ah you only need to set return values to solve your problem

So it should be like this:

Code:
void checkgrab(void target)
{ // Opponent Checker
// This script checks hero's current opponent. If he/she/it is Special Boss, returns 1, if he's Final Boss entity this function returns 0
// Otherwise it returns 2.

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

      if(Tname == "KIMOKAHN" )
      { // Final Boss
        return 0;
      } else if(Tname == "GORO" || Tname == "KINTARO" || Tname == "MOTARO" )
      { // Special Bosses
        return 1;
      } else {
        return 2;
      }
    } else {
      return 2;
    }
}

HTH
 
Bloodbane said:
Ah you only need to set return values to solve your problem

So it should be like this:

Code:
void checkgrab(void target)
{ // Opponent Checker
// This script checks hero's current opponent. If he/she/it is Special Boss, returns 1, if he's Final Boss entity this function returns 0
// Otherwise it returns 2.

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

      if(Tname == "KIMOKAHN" )
      { // Final Boss
        return 0;
      } else if(Tname == "GORO" || Tname == "KINTARO" || Tname == "MOTARO" )
      { // Special Bosses
        return 1;
      } else {
        return 2;
      }
    } else {
      return 2;
    }
}

HTH

Well, with your checkgrab script and this grabcheckG
Code:
void grabcheckG(void Ani1, void Ani2, void Ani3)
{ // Hero's groundgrab checker
// This script prevents hero from grabbing Bosses with the incorrect animation.
//  Ani1 = Animation to play if enemie is GORO, KINTARO, MOTARO
//  Ani2 = Animation to play if enemie is KIMOKAHN
//  Ani3 = Animation to play if not anyone on the mentioned characters

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

    }
}
All works ok except the animation 3.
When grab not anyone of the mentioned characters he goes to the idle animation, the correct is animation 3.
 
Hmm.... I think I need to confirm couple things first
- Are these functions for preventing player from grabbing certain enemies OR to set special response against certain enemies?
- Can Kimokahn, Goro, Kintaro or Motaro be grabbed?
 
Back
Top Bottom