Skip to content

Navigation

GenerateLocalPath(map, px, py, pz, x, y, z, errorCallback, smooth)

Request a path table from the NoName local server. Requires that you are running the NnNav.exe and have the mmaps folder with the needed map files. No callback is required.

NOTE: Doing long distances will give less accurate pathing as the path is smoothened a bit. This rounding can accumulate on big paths and we therefore recommend performing intermediate pathing while navigating to a far away location.

errorCallback will be called if you somehow fail to connect to the server

local map = select(8, GetInstanceInfo())
local px,py,pz = ObjectPosition('player') 
local x,y,z = ObjectPosition('target') 

local path = GenerateLocalPath(map,px,py,pz,x,y,z) -- raw path
local path = GenerateLocalPath(map,px,py,pz,x,y,z,function()
    -- handle error connecting to NnNav Server
end)
local path = GenerateLocalPath(map,px,py,pz,x,y,z,nil,true) -- smoothened path

if not (path[1].x == px and path[1].y == py and path[1].z == pz) then
    local diff = Distance(px,py,pz,path[1].x,path[1].y,path[1].z)
    print(format('returned path start position differs from that of player by %.3f yds',diff))
end

GeneratePath(map,x,y,z,x2,y2,z2, Callback, smooth, errorCallback)

Request a path table without using local MMAP files. This requires a callback in order to process the remote request for the pathing server.

NOTE: Doing long distances will give less accurate pathing as the path is smoothened a bit. This rounding can accumulate on big paths and we therefore recommend performing intermediate pathing while navigating to a far away location.

local x,y,z = ObjectPostion('target')
local px,py,pz = ObjectPosition('player')
local map = select(8, GetInstanceInfo())

navCallBack = function(path)
    print('points on the received path', #path)
    DevTools_Dump(path[1]) -- output is {x = 1, y = 2, z = 3}
    DevTools_Dump(path[#path - 1])
end

GeneratePath(map, px,py,pz,x,y,z,navCallBack)

SetNavHost(host)

For Added benefit you can have NnNav server executing in either outside a VM or in the local Network.

You can specify which host to connect to defaults to localhost

NOTE: Currently SetNavHost affects both synchronous GenerateLocalPath and async GeneratePath calls but this may change at a later stage

SetNavHost("192.168.1.1") -- assuming you have NnNav and mmaps running on a separate pc in your network