Multiple landframes

Mr.Q!

Well-known member
Is it possible to have multiple landframe values in a single animation by now?
Thinking on making something similar to SSF2X Claw's Super Combo, where he does 3 jumping back slams.
 
Is it possible to have multiple landframe values in a single animation by now?
Thinking on making something similar to SSF2X Claw's Super Combo, where he does 3 jumping back slams.
I coded a scripted landframe, it needs some improvements but may fit the purpose. It's similar to the looper script but used to "landing" purpose.

Here's the animation script.
C:
void landFrame(int add)
{//Alternative landframe with scripts
 //Loops previous frames until lands
    void self    = getlocalvar("self");
    void anim    = getentityproperty(self, "animationID");
    int frame    = getentityproperty(self, "animpos");
    int height    = getentityproperty(self, "y");
    int base    = getentityproperty(self, "base");

    //THIS CONTROLS HOW MANY FRAMES THE ANIMATION WILL BACK, DEFAULT TO 1
    if(add == NULL()){add = 1;}

    //THIS PART CHANGES THE CURRENT FRAME IF THE ENTITY IS NOT ON THE GROUND AND PROVIDE THE VARIABLE REGISTRATION
    if(height > base){
        setentityvar(self, "landAni", anim);
        setentityvar(self, "landFrame", frame);
        updateframe(self, frame-add);
    }
    else
    {
        setentityvar(self, "landAni", NULL());
        setentityvar(self, "landFrame", NULL());
    }
}

And below is how I used in the video.
C:
anim attack1
    fastattack 1
    jugglecost 4
    forcedirection -1
    otg 1
    loop    0
    delay    4
    offset    62 125
    bbox    50 55 23 74
    @cmd hitfx "data/sounds/sor3_hit.wav"
    @cmd sound "data/sounds/sor3_attack.wav"

    #attack 62 61 9999 999 2000 1 1 0 5 999 #DEBUG TEST
    @cmd leaper 0 3 0
    frame    data/chars/heroes/axel/a100.png
    frame    data/chars/heroes/axel/a100.png
    @cmd landFrame
    frame    data/chars/heroes/axel/a100.png
    
    attack 62 61 42 13 2 0 0 0 5 12
    @cmd leaper 0 3 0
    frame    data/chars/heroes/axel/a101.png
    frame    data/chars/heroes/axel/a101.png
    @cmd landFrame
    frame    data/chars/heroes/axel/a101.png
    
    attack 0 0 0 0 0 0 0 0 0 0
    frame    data/chars/heroes/axel/a100.png

I recommend to call this update script in your character too just for safe, in case the entity lands but the frame was not changed yet. This code makes the landing frame to be instantly changed preventing wrong visual issues.
C:
void frameLand()
{//Works together with "landFrame" script, changes the frame if defined conditions are met
    void self            = getlocalvar("self");
    void savedAni        = getentityvar(self, "landAni");
    void currentAni        = getentityproperty(self, "animationID");
    int savedFrame        = getentityvar(self, "landFrame");
    int currentFrame    = getentityproperty(self, "animpos");
    int height            = getentityproperty(self, "y");
    int base            = getentityproperty(self, "base");

    //COMPARE PREVIOUS SAVED FRAME WITH CURRENT FRAME BEFORE ANY OPERATION
    if(savedAni != NULL()){
        if(currentAni == savedAni){
            if(savedFrame != NULL() && savedFrame != currentFrame){
                if(height <= base){
                    updateframe(self, savedFrame);
                    setentityvar(self, "landAni", NULL());
                    setentityvar(self, "landFrame", NULL());
                }
            }
        }
        else
        {
            setentityvar(self, "landAni", NULL());
            setentityvar(self, "landFrame", NULL());
        }
    }
}

 
Back
Top Bottom