Solved Follow depend of enemy

Question that is answered or resolved.

dantedevil

Well-known member
It's possible create a follow depend of the enemy?
I have problem with my double grab.
When Midas walk with an amazon grabed, he can grab Goro (boss) and smash to the amazon, Goro cant be grabed, only with a special grab of Midas, but no for the double grab.
My double grab start with an attack, for this i need a way to check the enemy in the attack to perform o cancel the double grab.
 
Last edited:
You can't do it with the default followup system, but it's another easy script. All you need to do is look for something about the the target - name, HP, height, antigravity, whatever... that you want to identify it and take action accordingly.

Like say, you could give Goro antigravity -10 to make him heavy (this is what antigravity is really for), then in your initial grab, only do the double follow up if the both targets' antigravity is >10. Or however you want really. You could just check for the model name, but I'm not a fan of doing that because it's not reusable code.

DC
 
I use this:

Code:
void cancelgrab(void Ani)
        {// 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");
             char iType = getentityproperty(target, "type");

             if(Tname == "Drum" || Tname == "Crate" || Tname == "golem" || Tname == "msentinel" || iType == openborconstant("TYPE_OBSTACLE") || iType ==openborconstant("TYPE_ITEM") || iType ==openborconstant("TYPE_NPC"))
             {
                 //clearlocalvar();
				 changeentityproperty(self, "animation", openborconstant(Ani));
             }
           }
        }

Usage:
@cmd cancelgrab "ANI_FOLLOW5"
Will make the character goes to ANI_FOLLOW5 if the triggers are valid.
You can adapt to your need.
 
Thank you both.
Actually i use the cancelgrab script  (names) in some script without problem.
But in this case dont work,  because in my double grab one enemy is grabed for the hero and the other for an invisible object spawn by player.
When the double grab start, the player have grabed a simple enemy. Then walking touch other enemy (in this case Goro) and go to the follow# and spawn the object to grab the other enemy.
If i put cancelgrab in the slam object, the player continues making the slam to the enemy, not cancel. Only cancel the invisible objet.
This means look rare making a double grab with only one enemy.
The best is create a attack check, like DC say.
I dont understand much how create the attack check,  but i see how make it.
The other alternative for me is use ani0020 an create a specific animation for the simply enemies to cancel the double grab.
 
You mean like this?
Code:
void cancelgrab(void Ani)
        {// 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");
             char iType = getentityproperty(target, "type");

             if(Tname == "Drum" || Tname == "Crate" || Tname == "golem" || Tname == "msentinel" || iType == openborconstant("TYPE_OBSTACLE") || iType ==openborconstant("TYPE_ITEM") || iType ==openborconstant("TYPE_NPC"))
             {
                 //clearlocalvar();
				 changeentityproperty( bind NULL());
             }
           }
        }
Then wath next?
I see the link of unbind, but i dont understand how works with this.
 
Back
Top Bottom