move script help

Gurtag

Active member
hey guys i have been using script to replace move command as it is unreliable at the times.. but say script lacks some control.. wantedt to ask how can i mod it so it afects more than one frame at the time and also set at what frame stop if needed.....

this is the code..

Code:
void mover(int dx, int dz,int da)
{ // Moves entity freely and ignores obstacles
    void self = getlocalvar("self");
    int x = getentityproperty(self,"x"); //Get character's x coordinate
    int z = getentityproperty(self,"z"); //Get character's z coordinate
    int a = getentityproperty(self,"a"); //Get character's a coordinate
    int dir = getentityproperty(self,"direction"); //Get character's facing direction

     if(dir==0){ // Facing left?
      changeentityproperty(self, "position", x-dx, z+dz, a+da); //Move
     }
     else if(dir==1){ // Facing right?
      changeentityproperty(self, "position", x+dx, z+dz, a+da); //Move
     }
}

currently i use it like this

Code:
anim    pain5
    loop    0
    delay    8
    @cmd    mover -6 0 0
    bbox    12 1 35 111
    offset    31 129
    frame    data/chars/monk3/5000-20.gif
    @cmd    mover -6 0 0
    frame    data/chars/monk3/5000-20.gif
    @cmd    mover -6 0 0
    offset    29 136
    frame    data/chars/monk3/5000-0.gif
    @cmd    mover -6 0 0
    frame    data/chars/monk3/5000-0.gif

have to put it in every frame i want to move wich is a pita in larger animations...
 
Back
Top Bottom