FindPath problem
Posted: Fri Jul 28, 2006 7:41 am
I wrote a script which is looking for the paths:
Exactly in Trinsic's bank (the map wasn't be modifying in this place) NPC couldn't pass walk to the next finded square, I don't know why, and the script is looking for next paths, middling about 30 and all of them are the same.
After a few seconds, NPC moves on and passes by that locations with great difficulty. What could be wrong ?
Code: Select all
function GoByPath(path)
var pom;
var j;
me.use_adjustments := 0;
for(j:= 1; j<= path.size(); j := j+1)
while(pom := RunTowardLocation(path[j].x, path[j].y))
if (me.x == path[j].x && me.y == path[j].y)
break;
endif
endwhile
if(!pom)
path := FindPath(me.x, me.y, me.z, path[path.size()].x,path[path.size()].y, path[path.size()].z, me.realm, FP_IGNORE_DOORS);
if(!path)
return;
endif
j:=0;
endif
endfor
me.use_adjustments := 1;
endfunctionCode: Select all
{ struct{ x = 1811, y = 2827, z = 0 }, struct{ x = 1811, y = 2826, z = 0 }, stru
ct{ x = 1811, y = 2825, z = 0 }, struct{ x = 1811, y = 2824, z = 0 }, (...)
{ struct{ x = 1811, y = 2827, z = 0 }, struct{ x = 1811, y = 2826, z = 0 }, stru
ct{ x = 1811, y = 2825, z = 0 }, struct{ x = 1811, y = 2824, z = 0 },(...)