Previous anim detect

NED

Well-known member
Hello,
For my grab evasion system I need to find some way to detect previous anim.
Is this possible? And how?

Let me explain in detail (don't hesitate to point some complicated system that can be simplified / or made in another way)

-Player is grabbed.
-Normally Attack+Jump would make Special move
-But in this situation (when grabbed) I would like to have a custom evasion move.
-Since I can't make it happen from grabbed anim (with A+J or any other command), I'm asking if there is a way to make the new move happening by cancel from special anim with this condition : "If previous anim was grabbed"
-This way it sends player to a follow anim.

I propose this solution for grab escape.
Any advice about it?

thanks

(Basically this is something similar to "prevstateno" from Mugen.)
 
Wow!
Thanks a lot Magggas and Piccolo!!
This is exactly what I need.

I would like to ask for some precision about the use.

I already have a Keyscript declared in player for wall jumps. "edgejump.c"
How can I delare "billkey.c" too?
Looks like I can't mke both in the same text file (?) Like animationscripts...

I may be mistaken.
 
nedflandeurse said:
I already have a Keyscript declared in player for wall jumps. "edgejump.c"
How can I delare "billkey.c" too?
Looks like I can't mke both in the same text file (?) Like animationscripts...

Of course you can, but you'll need to transform "edgejump.c"'s main function as an external function (renaming it as edgeJump for example) and import/include it in character key script ("bilkey.c").

Code:
#import "data/scripts/edgejump.c"

void main()
{
    edgeJump();

    int  plIndex = getlocalvar("player");
    void vEnt = getplayerproperty(plIndex, "entity");
    void vAniID = getentityproperty(vEnt,"animationID"); //Get current animation ID
	
    int attack = playerkeys(plIndex, 1, "attack");
    int attackH = playerkeys(plIndex, 0, "attack");
	
    int jump = playerkeys(plIndex, 0, "jump");
    int jumpH = playerkeys(plIndex, 1, "jump");
	
    if((jumpH && attack) || (attackH && jump)){
      if (vAniID == openborconstant("ANI_GRABBED")){ //In valid animations?
	performattack(vEnt, openborconstant("ANI_freespecial21"));
      }
    }
}

Also, note thas this code does not involve previous animation but only current animation. Getting previous animation requires more scripting, but is only needed for specific cases.
 
here my genereal functions to detect prev anim:
Code:
int set_prev_anim(void player) {
    int anim_id = getentityproperty(player, "animationid");

    if ( getlocalvar("temp_anim") != anim_id ) {
        int prev_anim = get_prev_anim(player);

        setentityvar(player,"prev_anim",getlocalvar("temp_anim"));
        setlocalvar("temp_anim",anim_id);
    }
}

int get_prev_anim(void player) {
    return getentityvar(player, 14);
}

int set_prev_animpos(void player) {
    int anim_pos = getentityproperty(player, "animpos");

    if ( getlocalvar("temp_animpos") != anim_pos ) {
        setentityvar(player,"prev_animpos",getlocalvar("temp_animpos"));
        setlocalvar("temp_animpos",anim_pos);
    }
}

int get_prev_animpos(void player) {
    return getentityvar(player, "prev_animpos");
}

USAGE:
use set_prev_anim(self); in your script event (script ora animationscript or ondrawscript)

than when you want, call get_prev_anim(self);
 
Thanks to all of you.
I will need this "previous anim detect" too for a future move I have in mind. (I'll work on it later)


After testing a bit the grabbed cancel script.
It works well, but I think this is not easy to use it because of the very short moment you are grabbed.
Also, my enemies uses few grab starters

-regular grab (for grab attacks)
-follow20 (a scripted multi slam starter)
-follow21 (same)
-follow22 (same)

(for follows anims, the escape must be during first frame)

All enemies will use simillar numbers not always all of the numbers, but no other extra numbers.

Is it still possible to counter these "custom grabs" too by doing A+J imput?


I think the problem would be to detect them on enemy who is "grabbing" you.
 
It works well, but I think this is not easy to use it because of the very short moment you are grabbed.

Well, you could set some delay in enemy's slam/grab in first frames to allow player to escape

Is it still possible to counter these "custom grabs" too by doing A+J imput?

It's possible, but the main concern is that Rachel might be in wrong position when she counters

I think the problem would be to detect them on enemy who is "grabbing" you.

That's doable but the script would be inefficient if you have many enemies since you have to type all names in function  :-[
 
Bloodbane said:
It works well, but I think this is not easy to use it because of the very short moment you are grabbed.

Well, you could set some delay in enemy's slam/grab in first frames to allow player to escape

I tried with 500 as a delay and with the "grabfinish" value to "1" (for debug/test purpose)
But, the problem is more that regular grabs happens really few few times.
So, to be more defensive against all type of grabs, the escape system should be possible from custom grab starters

Bloodbane said:
Is it still possible to counter these "custom grabs" too by doing A+J imput?

It's possible, but the main concern is that Rachel might be in wrong position when she counters

If the escape is done during her first frame (of custom grabbed) she's at this position:
Code:
      @cmd    position 38 50 5 -1 -1
But, it can be fixed on the custom escape by using some landframe.


Bloodbane said:
I think the problem would be to detect them on enemy who is "grabbing" you.

That's doable but the script would be inefficient if you have many enemies since you have to type all names in function  :-[

Oh sh** ???
Then the script cannot detect the type "enemy" itself? All entities of this type have to be declared in the script?


Also, I'm thinking to something different.
Can the escape move be simulated? Let me explain.

Enemy grabs/custom grabs player
In enemy's escapable frames (first frame), he detects if player do A+J/J+A imput.
If the imput is done at the right moment, HE CANCELS to a move that send player in the escape anim.
I such a code possible?
Thanks
 
Back
Top Bottom