Alternative Rise Attack

Aerisetta

Active member
Sorry for reviving old thread, but I have a question that is similar

Currently the way to riseattack is to press up+attack. I would like to make any button press (attack 1, 2, 3. Special, etc) let the player get back up. Where would I script this?

(Reason UP+Attack probably too hard for mobile players)
 
Moved to a new thread. This is dissimilar enough to the original, and it is a solved thread.

@Aerisetta,

Just about anything you want to do with alt commands is a keyscript. The basic principle is the same no matter what action you want. Capture the key state, check the game conditions (eg. fallen), then if the keys match your intended command, trigger actions.

I can’t write the code from my phone, but I recently provided several samples to @maxman and @Kratus, so I'm sure they can share.

DC
 
Sorry for reviving old thread, but I have a question that is similar

Currently the way to riseattack is to press up+attack. I would like to make any button press (attack 1, 2, 3. Special, etc) let the player get back up. Where would I script this?

(Reason UP+Attack probably too hard for mobile players)
@Aerisetta
In SOR2X I use a lot of key scripts to cancel some animations in others, maybe some of them can fit for this purpose.
 
Wow. I don't know which old topic you posted from. But there is anybutton key available besides the other buttons we usually use. I did mine for both continue screen and the versus mode post-battle menu, which I showed an example of text printing in your thread. Notice I used anybutton key there. You can press any of the 6 action keys if you use it.

I don't know how this one is gonna work since I've never tried doing alternate riseattacks. But here's my theory of how it could work. Probably.

C:
void main()
{
    int index = getlocalvar("player");
    void self = getplayerproperty(index, "entity");
    int keyHold = getplayerproperty(self, "keys");
    int keyPress = getplayerproperty(self, "newkeys");
    void anim = getentityproperty(self, "animationid");

    if(anim == openborconstant("ANI_RISE"))
    {
        if(keyHold & openborconstant("FLAG_MOVEUP") && keyPress & openborconstant("FLAG_ANYBUTTON"))
        {
            performattack(self, openborconstant("ANI_FOLLOW43"));
        }
    }
}

You can use which animation changer such as changeentityproperty, performattack, or the recent executeanimation.

If keyscript doesn't work, you can use entity script.

Code:
script data/scripts/blablabla.c

Another alternative is animation script. I made this modified version based on keyint, but I don't know what your input ideas for this are.

C:
void keyintA(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=="UK"){ //Up and Anybutton Required?
       iRKey = playerkeys(iPIndex, 0, "moveup", "anybutton"); // "Up" + "Anybutton"
    }

      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);
        }
      }
}
 
Back
Top Bottom