View Single Post
  #25  
Old 01-06-2011, 03:25 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
move doesn't work like that.

TServerNPC.move(float, float, float, int)
- moves the npc smoothly
- parameters:
delta x,
delta y,
time
options: cache type (0, 1-cache, 2-append) + blockcheck(4) + eventwhendone(8) + applydir(16)

move(dx, dy, time, flags);

I.e:

PHP Code:
//#CLIENTSIDE
function moveTo(txty) {
  
// Delta = Final - Initial
  
temp.dx tx this.x;
  
temp.dy ty this.y;
  
temp.speed 1// Tiles per second
  
temp.time getDistance(this.xthis.ytxty) / temp.speed;
  
move(temp.dxtemp.dytemp.time8); 
}

function 
onMovementFinished() {
  
// Your other code..
}

function 
GetDistance(temp.x1temp.y1temp.x2temp.y2) {
  
temp.toreturn = (temp.x2 temp.x1) ^ + (temp.y2 temp.y1) ^ 2;
  return (
temp.toreturn) ^ .5;

__________________
Quote:
Reply With Quote