cancel static jump

White Dragon

New member
It is possible to cancel the static jump?
jumpmove 3 3 is not enough...

if my hero jumps and than I want to move the hero after the jump, it cant move...
How can I solve this problem?

My script doesnt work well:

Code:
int disable_static_jump(void self) {
  float x = getentityproperty(self, "x");
  float z = getentityproperty(self, "z");
  float a = getentityproperty(self, "a");


    if ( getentityproperty(self, "animationid") == openborconstant("ANI_JUMP") ) {
        if ( x == getlocalvar("x") ) {
            setlocalvar("static_jump",1);
        }
            if (getlocalvar("static_jump") == 1) {
                if ( playerkeys(0,0,"moveright") == 8 ) {
                    float dist = getentityproperty(self,"speed");
                    changeentityproperty(self,"position",x+(dist*0.5),z,a);
                } else if ( playerkeys(0,0,"moveleft") == 4 ) {
                    float dist = getentityproperty(self,"speed");
                    changeentityproperty(self,"position",x-(dist*0.5),z,a);
                } else if ( playerkeys(0,0,"moveup") == 16 ) {
                    float dist = getentityproperty(self,"speed");
                    //changeentityproperty(self,"position",x,z-(dist*0.5),a);
                } else if ( playerkeys(0,0,"moveup") == 32 ) {
                    float dist = getentityproperty(self,"speed");
                    //changeentityproperty(self,"position",x,z+(dist*0.5),a);
                }
            }

        setlocalvar("x", x);
    } else setlocalvar("static_jump",0);

}
 
You should use velocity instead of position, use xdir/zdir/tossv instead of x/z/a.

Or you should can use jumpmove 7 7 instead.

 
Thank you utunnels!! Great!! =)
So just i write jumpmove 7 7  on the header of my char...

But if anyone want to use a script I've done one:
Code:
int disable_static_jump_v2(void self) {
  int frames = 30;
  int refresh_time = openborvariant("elapsed_time")%frames;
  float x = getentityproperty(self, "x");
  int p = getentityproperty(self, "playerindex");
  float xdir = getentityproperty(self, "xdir");
  float zdir = getentityproperty(self, "zdir");
  float tossv = getentityproperty(self, "tossv");

        if ( getentityproperty(self, "animationid") == openborconstant("ANI_JUMP") ) {
            if ( refresh_time == 0 && x == getlocalvar("x") ) {
                setlocalvar("static_jump",1);
            }

                if ( xdir > getentityproperty(self,"speed") ) setlocalvar("static_jump",0);
                if (getlocalvar("static_jump") == 1 ) {
                    if ( playerkeys(p,0,"moveright") == 8 ) {
                        float dist = getentityproperty(self,"speed"); //xdir

                        changeentityproperty( self,"velocity",dist,0,-getlocalvar("tossv") );
                    } else if ( playerkeys(p,0,"moveleft") == 4 ) {
                        float dist = getentityproperty(self,"speed");

                        changeentityproperty( self,"velocity",-dist,0,-getlocalvar("tossv") );
                    } else if ( playerkeys(p,0,"moveup") == 16 ) {
                        float dist = getentityproperty(self,"speed")/2; //zdir

                        changeentityproperty( self,"velocity",0,-dist,-getlocalvar("tossv") );
                    } else if ( playerkeys(p,0,"movedown") == 32 ) {
                        float dist = getentityproperty(self,"speed")/2;

                        changeentityproperty( self,"velocity",0,dist,-getlocalvar("tossv") );
                    }
                    setlocalvar("tossv", getlocalvar("tossv")+getlocalvar("tossv") );
                } // fine if static jump

            setlocalvar("x", x);
        } else setlocalvar("static_jump",0);
}

It works good!!
1) You've to write jumpmove 3 3 on the header of you char yet...
2) And you've insert this script in the header with script data/scripts/script.c for ex...

However... utunnels I did not know jumpmove 7 7 or xdir, zdir, tossv...
Where can I read these functions? ( source code? =) ) Is there a thread with all news?
 
Back
Top Bottom