No pain 1 not enough for slamstart scripts

Mr.Q!

Well-known member
I have been using the nopain 1 feature for making contra-like bosses in one of my projects. So far so good, BUT, i have some @cmd slamstart attacks that can still trigger their corresponding anim follow and these bosses are getting custom slammed, so what should I need for that not to happen?
 
I have multiple functions to detect different type of enemies, but this function can work for you.

This function needs to be added in your animationscript and you need to call it on the follow animation you use for slam.
It will check 2 things:

- If the antigrab of the target is 9999
- if the target is a obstacle/item/npc

Honestly, you won't need to use the type check if you set the "hostile" setting right on your character and it won't try to grab obstacles and such
But I changed this function over the years so there are some old stuff there.

Usage:

@cmd cancelgrab openborconstant("ANI_FOLLOW3")

C-like:
void cancelgrab(int 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 iType = getentityproperty(target, "type");
             int tGrab = getentityproperty(target, "antigrab");
          
             if (tGrab==9999)
             {
                 changeentityproperty(self, "animation", Ani);
             }

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

You have to make a "whiff" animation (in this case, FOLLOW3), which the attacker will be using
 
So:

I put this in the attacker's command grab that I want to be whiffing?, and then i set the enemy to have the Antigrab 9999 on its header info?
 
Enemy:
Put "antigrab 9999" on its header

Attacker:
- add that function to your animationscript
- call that function on the very first frame of the follow animation triggered by the attack, BEFORE the @cmd slamstart and choose a follow animation
- Create that follow animation of the attacker whiffing the attack.

For example, on my Avengers game, some characters can't grab a Sentinel, and Iron Fist uses a hyper where he runs towards the target, unleash a dozen of punches, launch the enemy into the air and finishes with a dragon punch. On this case, I make him go directly to the dragon punch once connects.

Another case: Iron First can jump and grab an enemy (kinda like you do on some Double Dragon games). But if he hits a Sentinel with that move, he just change his animation to a flying kick, not grabing the enemy.

ps: Remember to use @cmd clearL on that follow animation
 
Back
Top Bottom