Alternate Grabattack and Grabforward (Holding Forward) With Attack2 Button

maxman

Well-known member
First of all, I have this anim grab which I can normally use attack button to either grabattack or grabforward with either holding or pressing forward. But when I tried to use attack2 with cancel in anim grab, I can't make the enemy react with anim grabbed after attacking with attack2 button like anim grab.

Code:
anim grab
    offset 140 188
    delay 24
    cancel 0 0 0 a2 freespecial18 #Alternate Grab attack with attack2
    cancel 0 0 0 f a2 freespecial24 #Attempt to alternate grabforward with holding forward and attack2
    bbox 142 97 41 88
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/131_4.png

This also works when I only press forward and then attack2 quickly for performing an alternate grabforward animation.

I'm trying to press attack2 to perform an alternate grabattack like anim grab and grabattack while having the enemy return to anim grabbed after getting hurt. I can't hold forward and attack2 for alternate anim grabforward.

How does it work? Does it have to be set in keyall.c for this?

EDIT:
Code:
anim freespecial18
    delay 9
    offset 140 188
    bbox 124 91 49 99
    cancel 3 4 2 a2 freespecial20 #H
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/130_1.png
    attack 152 100 47 37 9 0 0 0 0 0
    #delay 6
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/130_2.png
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/130_3.png
    bbox 134 99 46 90
    attack 0
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/131_5.png
    bbox 124 90 46 98
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/131_6.png

Code:
anim freespecial24 #Alternate grabforward
    offset 140 188
    delay 8
    @cmd slamstart2
    @cmd position 0 -39 4 0 1
    @cmd antiwall -15 55 0
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/209_1.png
    @cmd position 1 -20 17 0 1
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/209_2.png
    @cmd position 2 12 12 1 1
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/209_3.png
    @cmd position 3 13 21 1 1
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/209_4.png
    @cmd position 4 42 22 1 1
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/209_4.png
    @cmd depost 0
    @cmd throw 10 2 3 2.2 0 0 #throw {damage}{type} {x} {y} {z} {direction}
    frame data/chars/heroes/KOF_2K3_Terry_Sprite.7z/209_4.png
 
Last edited:
I've tried it and you'd need keyscript if you want to use attack2 key for alternate grabattack.
C:
void main()
{
    int iPlIndex = getlocalvar("player"); //                 Get calling player
    void vSelf = getplayerproperty(iPlIndex , "entity"); //  Get calling entity
    void vAniID = getentityproperty(vSelf,"animationID"); // Get current animation ID
    void vAniPos = getentityproperty(vSelf, "animpos"); //   Get current animation frame

    void iAttack2 = playerkeys(iPlIndex, 1, "attack2"); //New key status of "Attack2"

//Alternate action while grabbing
    if(vAniID == openborconstant("ANI_GRAB")){ // Grabbing?
      if(iAttack2){ //Attack2 pressed?
    changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW2"));
      }
    }
}

Although this works, it has two issues:
1. There's no attack/action counter = no 2 grabattacks then grabattack2 next = FOLLOW2 could be performed over n over by clicking attack2 key repeatedly. You'd need to code counter + limiter if you don't want player to abuse this.
2. For some reason, player can't return to GRAB animation after FOLLOW2 ends. So I had to fix it by declaring this script:
C:
@script
  if(frame==11){
    void self = getlocalvar("self");

    changeentityproperty(self, "animation", openborconstant("ANI_GRAB"));
  }
@end_script

12th frame is the last frame of FOLLOW2 of the character with this keyscript.
 
I've tried it and you'd need keyscript if you want to use attack2 key for alternate grabattack.
C:
void main()
{
    int iPlIndex = getlocalvar("player"); //                 Get calling player
    void vSelf = getplayerproperty(iPlIndex , "entity"); //  Get calling entity
    void vAniID = getentityproperty(vSelf,"animationID"); // Get current animation ID
    void vAniPos = getentityproperty(vSelf, "animpos"); //   Get current animation frame

    void iAttack2 = playerkeys(iPlIndex, 1, "attack2"); //New key status of "Attack2"

//Alternate action while grabbing
    if(vAniID == openborconstant("ANI_GRAB")){ // Grabbing?
      if(iAttack2){ //Attack2 pressed?
    changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW2"));
      }
    }
}

Although this works, it has two issues:
1. There's no attack/action counter = no 2 grabattacks then grabattack2 next = FOLLOW2 could be performed over n over by clicking attack2 key repeatedly. You'd need to code counter + limiter if you don't want player to abuse this.
2. For some reason, player can't return to GRAB animation after FOLLOW2 ends. So I had to fix it by declaring this script:
C:
@script
  if(frame==11){
    void self = getlocalvar("self");

    changeentityproperty(self, "animation", openborconstant("ANI_GRAB"));
  }
@end_script

12th frame is the last frame of FOLLOW2 of the character with this keyscript.
Thank you, Bloodbane. How can I limit this alternate grabattack with a counter from repeating infinitely? Do I need to have localvar and animpos/frame together? Does it need to have entityvar for this?
 
Back
Top Bottom