The 'callback' you are talking about is the 'Blocktester' in the MainUnit, right?

this is the way how you get the array (or stringgrid in your case) into the pathfinding method, right?

It is this method I find a bit hard to understand:

Code:
// this function is called when path finder asks you weither it can process coordinate X,Y
// Fx, Fy are the coordinates from where the pathfinder is coming, you can use
// that to make some blocks only passable thru some sides and not all 4.

// you return -1 if you dont allow pathfinder to go to that block - like walls,
// this can be used to limit search area of the pathfinder as well.

// if you allow the pathfinder to go to that specific block, return a positive number,
// returning zero means you want to terminate path finding.

result:= -1; // if it isnt anything else - it is wall
So instead of the stringGrid I just use myArray[x,y] here for the asked tile. I want 0 walkable and >0 not walkable, and <0 is a road it is better walkable if possible.

if myArray[x,y]=0 then result:=:=((ABS(EndPoint.X-X) + ABS(EndPoint.Y - Y)) * 3); //for walkable, right?
else if myArray[x,y]>0 then result:=-1 //not walkable, right?
else result:=result:=((ABS(EndPoint.X-X) + ABS(EndPoint.Y - Y)) * 3)+myarray[x,y]; //for walkable with lower cost, because myArray is below zero, right? Must be cautious that it is>0 right? The lower the better then?


Thanks,
Firle