Counterrange question?

Liu-Kang

Member
Hi! I'm trying to use counterrange in a way that only normal attack type attacks can be countered, that way energy attacks will just knock you over. Is there any way to rig such an idea/
 
Oh I getcha, basically right now I have a character with a block animation, and for frame 2 to 5 via counterrange I have them activate anim follow2 if they are hit, I'm trying to rig it with defense that attack types burn, shock, and a variety of normal#'s will not activate the counter but instead cause pain animation or knockdown. Right now basically everything will cause the counter to go off no matter what, when instead I would like the counter to only work on basic attacks or a few others, while most all would hit through and the counter would not go off. Is there a better way to set up this sort of move?
 
I've made a script for this purpose and it works well :)
However, before I could share it, I need to see your block animation to adjust script setting with the animation
BTW I made this on regular animation (i.e non block animation) so you might need to change that block animation to FREESPECIAL animation later for this to work
 
Sweet bloodbane thanks a bunch! Le anim:

anim block
energycost 0 1
followanim 2
counterrange 2 4 3 0
loop 0
delay 6
offset 106 124
bbox 94 58 31 67
frame data/chars/Ultraman/crouch07.gif
        delay 12
frame data/chars/Ultraman/crouch08.gif
frame data/chars/Ultraman/crouch08.gif
frame data/chars/Ultraman/crouch08.gif
        delay 8
        frame data/chars/Ultraman/crouch07.gif
        frame data/chars/Ultraman/crouch07.gif
frame data/chars/Ultraman/stand02.gif
frame data/chars/Ultraman/stand02.gif
 
Thanks,
Now, I changed your block animation into FREESPECIAL like this:
Code:
anim	freespecial
@script
    void self = getlocalvar("self");

    if(frame==0){
      changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), 0, 200, 0);

      setentityvar(self, 1, NULL());
    }
    if(frame>=2 && frame<=4){
      void Hit = getentityvar(self, 1);

      if(Hit=="Balas"){
        setentityvar(self, 1, NULL());
        changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), 1, 0, 1);
        changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"));
      }
    }
    if(frame==6){
      changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), 1, 0, 1);
    }
@end_script
   delay   6
   offset   106 124
   bbox   94 58 31 67
   frame   data/chars/Ultraman/crouch07.gif
        delay   12
   frame   data/chars/Ultraman/crouch08.gif
   frame   data/chars/Ultraman/crouch08.gif
   frame   data/chars/Ultraman/crouch08.gif
        delay   8
        frame   data/chars/Ultraman/crouch07.gif
        frame   data/chars/Ultraman/crouch07.gif
   frame   data/chars/Ultraman/stand02.gif
   frame   data/chars/Ultraman/stand02.gif

then you need this script:
react.c
Code:
void main(){
    void self = getlocalvar("self");
    void vAniID = getentityproperty(self,"animationID");
    void atype = getlocalvar("attacktype"); // Get received attacktype

    if(vAniID == openborconstant("ANI_FREESPECIAL") && atype == openborconstant("ATK_NORMAL")){
      setentityvar(self, 1, "Balas");
    } else {
      changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), 1, 0, 1);
    }
}

Save it to data/scripts folder
Declare it on Ultraman's header with this:

takedamagescript data/scripts/react.c

When Ultraman is attacked in this animation, he will counter with FOLLOW2 only if the attack is normal type. Other attack types will not be countered

I chose to use FREESPECIAL instead of BLOCK cause with the latter, other attack types will be blocked instead
 
Back
Top Bottom