Solved Stop in the air mid-jump

Question that is answered or resolved.

Toranks

Active member
Is there a non-scripted way, using engine commands, to stop a character in midair mid-jump to the end of the animation? Move 0/ movea 0/ movez 0 does not work for me
 
Last edited:
Hmmmm doesn't work. It keeps falling off. Any jump must have a property that forces all subsequent movements to fall to the ground. How can this be avoided?

C#:
anim    follow3
    loop    0
    delay    5
    offset    145 211
    bbox    0 0 0 0
    fastattack    1
    movea 0
    antigravity 100
    hitfx    data/sounds/beat5.wav
    sound    data/sounds/xchoi01.wav
    attack2    0 0 0 0
    frame    data/chars/xchoi/upper12.png
    attack2    140 105 47 67 2 0 1 0 5 15
    frame    data/chars/xchoi/upper11.png #1
    attack2    0 0 0 0
    frame    data/chars/xchoi/upper12.png
    attack2    140 105 47 67 2 0 1 0 5 15
    frame    data/chars/xchoi/upper13.png
    attack2    0 0 0 0
    frame    data/chars/xchoi/upper12.png
    @cmd    looper 1 12
    forcedirection    -1
    attack2    140 105 47 67 20 1 1 0 25 15
    dropv    2 4
    frame    data/chars/xchoi/upper11.png
    attack2    0 0 0 0
    delay    5
    frame    data/chars/xchoi/upper12.png
    antigravity 0
    @cmd    anichange "ANI_FOLLOW5"
    frame    data/chars/xchoi/upper12.png
 
Last edited:
antigravity is header command so declaring it there won't work. Even if it works, it's unstable and could lead to a new problem.

To stop in the air after jumping, I usually use combination of two functions: dasher and floater.
C:
void dasher( float Vx, float Vy, float Vz, int Flip)
{// Dash with desired speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

    if(dir==0 && Flip==1){ // Facing left?
      Vx = -Vx ;
    }

    changeentityproperty(self, "velocity", Vx, Vz, Vy); //Move!
}

void floater( int Time )
{// Floats in Time centiseconds
    void self = getlocalvar("self");
    int eTime = openborvariant("elapsed_time");

    changeentityproperty(self, "tosstime", eTime + 2*Time);
}

Example:
@cmd dasher 0 0 0
@cmd floater 50

These combination stops entity and make it floats for 50 centiseconds.
 
Yes, I'm using 'leaper' now, I thought there would be some other easier way, but with scripts I know a couple of ways, thanks!

C#:
void leaper( float Vx, float Vy, float Vz )
{// Leap with desired speed!
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");


    if(dir==0){ // Facing left?
      Vx = -Vx ;
    }


    tossentity(self, Vy, Vx, Vz); //Leap!
}
 
@Toranks

Bloodbane's scripts are perfect for this case, but if you really need to avoid scripts, I suggest you try the "seta" command.

seta {a}
~Changes the entity's altitude off the ground to {a}.
~The entity will remain at this altitude until changed again with 'seta' or the animation ends.
~If the animation ends and the entity is off the ground, they will fall back down while playing their IDLE animation.
~ Setting a>0, allows the entity to fly above holes or simply not fall to holes.

If you want to take a look, I'm using it on the Jet character in SOR2X. Did a quick test and if you are using "seta" with scripted jumps (like "leaper"), the seta will work fine.

In case you are using together with default jump system, you will need to use some tricks with "walkoff" and "jumpland" animations by declaring "seta" in these animations too, because as soon it is declared in any frame of the "jump" animation, the "jumpland" animation will be played automatically.
 
@machok

This is an example of how I'm using the seta on the Jet character. I will replace it with "tossv" and "tosstime" futurely, but this method works too.
Code:
anim spawn
    loop    0
    delay    1
    offset    158 181
        seta     40
    frame    data/chars/bosses/jet/idle00.gif

anim idle #STATIC FLY
    loop    1
    delay    4
    offset    158 181
    bbox     144 106 24 77
        seta     40
    @cmd clearL
    frame    data/chars/bosses/jet/idle00.gif
        seta     42
    frame    data/chars/bosses/jet/idle01.gif
        seta     44
    frame    data/chars/bosses/jet/idle02.gif
        seta     46
    frame    data/chars/bosses/jet/idle03.gif
        seta     48
    frame    data/chars/bosses/jet/idle00.gif
        seta     46
    frame    data/chars/bosses/jet/idle01.gif
        seta     44
    frame    data/chars/bosses/jet/idle02.gif
        seta     42
    frame    data/chars/bosses/jet/idle03.gif
        seta     40
    frame    data/chars/bosses/jet/idle00.gif
        seta     38
    frame    data/chars/bosses/jet/idle01.gif
        seta     36
    frame    data/chars/bosses/jet/idle02.gif
        seta     34
    frame    data/chars/bosses/jet/idle03.gif
        seta     32
    frame    data/chars/bosses/jet/idle00.gif
        seta     34
    frame    data/chars/bosses/jet/idle01.gif
        seta     36
    frame    data/chars/bosses/jet/idle02.gif
        seta     38
    frame    data/chars/bosses/jet/idle03.gif
 
Back
Top Bottom