move(x,y,time,options);
x = move how far from current position horizontally
y = move how far from current position vertically
time = time it takes to get from starting point to ending point
options = cachtype(0,1,2) blockcheck(4) eventwhendone(8) applydir(16)
blockcheck = test to see if the tile is blocking or not
eventwhendone = stops moving after one movement. other wise the NPC
will move forever in that direction.
applydir = if the the char current gani has 4 dir it will apply it when it moves
Here's a NPC I use for a townsfolk randomly move
PHP Code:
//#CLIENTSIDE
function onCreated() {
onTimeOut();
}
function onTimeOut() {
temp.rx = random(-3,3);
temp.ry = random(-3,3);
temp.r = random(3,5);
temp.rr = random(0,5);
setcharani("walk",NULL);
move(rx,ry,r,4+8+16);
sleep(r);
setcharani("idle",NULL);
setTimer(rr);
}
I have more stuff in the script of course but there is the movement part. Also remember the movement is still in the Quadrent IV (Grid Wise)