Solved A follow-up question about jumping.

Question that is answered or resolved.

DD Tokki

Well-known member
jump2.PNG

Another question about jumping.

noaircancel 2
jumpmove 3
By applying , it is possible to change direction while jumping, and it is impossible to attack while in the air.

However, if you dash (freespecial) in a jump, you can change the direction during a dash like a jump.

The dash I think is a dash that cannot change direction. I'd like to resolve this.
 
Last edited:
You need to add @cmd jump 1 script in freespecial
Code:
void jump(int flag)
{//Turns jumping status
    void self = getlocalvar("self");

    if(flag == 1){
        changeentityproperty(self, "aiflag", "jumping", 1);
        changeentityproperty(self, "takeaction", "common_jump");
    }else{
        changeentityproperty(self, "aiflag", "jumping", 0);
    }
}
Script from SOR2X by @Kratus
 
thank you. It is okay to change direction in a jump, but I wanted to prevent the change during an air dash, so I set @cmd jump to 0 and the movement I wanted came out.
You can use mobile scripts like this
Code:
@script
    void V = 0.7;
    void self = getlocalvar("self");
    int iPIndex = getentityproperty(self,"playerindex");
    float xdir = 0;
    float zdir = 0;

    if (playerkeys(iPIndex, 0, "moveleft")){
        xdir = -V;
    } else if(playerkeys(iPIndex, 0, "moveright")){
        xdir = V;
    }
    if (playerkeys(iPIndex, 0, "moveup")){
        zdir = -V/1.6;
    } else if(playerkeys(iPIndex, 0, "movedown")){
        zdir = V/1.6;
    }
    changeentityproperty(self, "velocity", xdir, zdir);
@end_script
Don't use jump script
 
You can use mobile scripts like this
Code:
@script
    void V = 0.7;
    void self = getlocalvar("self");
    int iPIndex = getentityproperty(self,"playerindex");
    float xdir = 0;
    float zdir = 0;

    if (playerkeys(iPIndex, 0, "moveleft")){
        xdir = -V;
    } else if(playerkeys(iPIndex, 0, "moveright")){
        xdir = V;
    }
    if (playerkeys(iPIndex, 0, "moveup")){
        zdir = -V/1.6;
    } else if(playerkeys(iPIndex, 0, "movedown")){
        zdir = V/1.6;
    }
    changeentityproperty(self, "velocity", xdir, zdir);
@end_script
Don't use jump script
The direction can change left and right or move while jumping, but I wanted the direction to be fixed during air dashes. Why are jump scripts not recommended?
 
You can use mobile scripts like this
Code:
@script
    void V = 0.7;
    void self = getlocalvar("self");
    int iPIndex = getentityproperty(self,"playerindex");
    float xdir = 0;
    float zdir = 0;

    if (playerkeys(iPIndex, 0, "moveleft")){
        xdir = -V;
    } else if(playerkeys(iPIndex, 0, "moveright")){
        xdir = V;
    }
    if (playerkeys(iPIndex, 0, "moveup")){
        zdir = -V/1.6;
    } else if(playerkeys(iPIndex, 0, "movedown")){
        zdir = V/1.6;
    }
    changeentityproperty(self, "velocity", xdir, zdir);
@end_script
Don't use jump script
You my friend are a legend. Exactly the coding I was looking for. Many thanks!
 
Back
Top Bottom