[Solved] minetest.find_path error

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

[Solved] minetest.find_path error

by BrandonReese » Wed Jul 02, 2014 02:06

I am trying to use the engine's pathfinding and I get this error message:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Furnace found
(-1577.7611083984,14.5,-1452.7353515625)   # entity position - starting position
(-1582,15,-1457)     # destination position
20:52:28: INFO[ServerThread]: pathfinder: Pathfinder build costmap: (-1587,-1462) (-1573,-1448)
20:52:28: VERBOSE[ServerThread]: pathfinder: invalid startposIndex: (9,5,9)Realpos: (-1578,15,-1453)


This is a snippet of the code that has the error

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local furnace = minetest.find_node_near(player:getpos(),35,{"default:furnace"})
-- blacksmith is a simple mobs entity
if furnace ~= nil then
   furnace.y = furnace.y + 1
   print("Furnace found")
   print(minetest.pos_to_string(blacksmith.object:getpos()))
   print(minetest.pos_to_string(furnace))            
   -- find a path to the furnace
   local path = minetest.find_path(blacksmith.object:getpos(),furnace,5,1,1,"A*_noprefetch")
   print(type(path)) --results in nil            


Any help would be appreciated
Last edited by BrandonReese on Wed Jul 02, 2014 02:40, edited 1 time in total.
 

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

Re: minetest.find_path error

by BrandonReese » Wed Jul 02, 2014 02:39

It looks like invalid startpos means your start position is in a node or too high in the air.
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 12 guests