Thread: NPC baddy
View Single Post
  #3  
Old 01-04-2007, 06:59 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
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)
__________________
Deep into the Darkness peering...
Reply With Quote