-- LEVELGEN for BotNavMeshZone -- use /dzones to see it while in game Pt1 = Point(100,0) Pt2 = Point(99,1) logprint(levelgen:pointCanSeePoint(Pt1,Pt2) ) -- THE ABOVE IS A TEST function output1(str1) -- logprint(str1) levelgen:addLevelLine(str1) end size=tonumber(arg[1]) or 16 minsize=tonumber(arg[2]) or 0.2 -- GRID SIZE - problem can be caused by comparing while not the grid size. gridsize=tonumber(arg[3]) or 255 function CalcBot(n,w,s,e) local nw = Point(n*gridsize,w*gridsize) local ne = Point(n*gridsize,e*gridsize) local sw = Point(s*gridsize,w*gridsize) local se = Point(s*gridsize,e*gridsize) if(levelgen:pointCanSeePoint(nw,se) == true and levelgen:pointCanSeePoint(ne,sw) == true and levelgen:pointCanSeePoint(nw,sw) == true and levelgen:pointCanSeePoint(ne,se) == true and levelgen:pointCanSeePoint(nw,ne) == true and levelgen:pointCanSeePoint(sw,se) == true) then output1("BotNavMeshZone " .. n .. " " .. w .. " " .. n .. " " .. e .. " " .. s .. " " .. e .. " " .. s .. " " .. w); else if(e > w+minsize and s > n+minsize) then local midx = (n + s) * 0.5 local midy = (w + e) * 0.5 CalcBot(n,w,midx,midy) CalcBot(n,midy,midx,e) CalcBot(midx,w,s,midy) CalcBot(midx,midy,s,e) end end end CalcBot(-size,-size,size,size)