Ok, I've done as I've described above, but its not working here. I've got a search working and an object moving along the path, but it just takes the shortest route ignoring obstructions. So for the Astar8 search, it just goes diagonally straight there. This is how I'm filling the searchmap with data:
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1
data 1,1,1,1,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1
data 1,1,1,1,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1
data 1,0,0,0,1,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1
data 1,0,0,0,1,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1
data 1,0,0,0,1,0,0,0,1,0,0,1,0,0,1,3,0,0,0,1
data 1,0,0,0,1,0,0,0,1,0,0,1,0,0,2,1,3,0,0,1
data 1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,2,1,3,0,1
data 1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,2,1,3,1
data 1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,2,1,1
data 1,0,0,0,0,0,0,0,1,1,1,1,0,0,1,3,0,0,2,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,2,1,3,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,2,1,3,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,1,3,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
CreateSearchMap(19,19)
CreateSearchPathLists(1)
for z=20 to 1
for x=1 to 20
read TempMapData
World(x,z).object = TempMapData
SetSearchMap(x-1,z-1,TempMapData)
next x
next z
Does work though. Seems like the code is working fine - i.e. It's finding the shortest route, but ignoring the obstructions. So I imagine there's something wrong with the SearchMap.
Can anyone help?
Insiiiiiiiiiiiiiiiiiiiiiiiide!