FindPath problem

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Lad
New User
Posts: 23
Joined: Sun Feb 05, 2006 3:48 am

FindPath problem

Post by Lad »

I wrote a script which is looking for the paths:

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;        
endfunction
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.

Code: 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 },(...)
After a few seconds, NPC moves on and passes by that locations with great difficulty. What could be wrong ?
Post Reply