cybers2001 Posted November 7, 2025 Share Posted November 7, 2025 I have my modmain setup to use debug mode: GLOBAL.CHEATS_ENABLED = true GLOBAL.require('debugkeys') GLOBAL.require('debugcommands') GLOBAL.require('maputil') But when I call GLOBAL.DrawWalkableGrid(), nothing happens. What's the simplest way to get this to render on the map? Link to comment https://forums.kleientertainment.com/forums/topic/168701-how-to-use-drawwalkablegrid-and-showwalkablegrid/ Share on other sites More sharing options...
FerniFrenito Posted November 8, 2025 Share Posted November 8, 2025 What do those functions do? It seems they're not used even once in the entire game code. Link to comment https://forums.kleientertainment.com/forums/topic/168701-how-to-use-drawwalkablegrid-and-showwalkablegrid/#findComment-1842321 Share on other sites More sharing options...
cybers2001 Posted November 8, 2025 Author Share Posted November 8, 2025 (edited) 7 hours ago, FerniFrenito said: What do those functions do? It seems they're not used even once in the entire game code. They're debug tools. They look as if they should add a draw layer on top of the map, but it doesn't seem to for me. Edited November 8, 2025 by cybers2001 Link to comment https://forums.kleientertainment.com/forums/topic/168701-how-to-use-drawwalkablegrid-and-showwalkablegrid/#findComment-1842342 Share on other sites More sharing options...
Semind Posted November 8, 2025 Share Posted November 8, 2025 On 11/7/2025 at 12:08 PM, cybers2001 said: I have my modmain setup to use debug mode: GLOBAL.CHEATS_ENABLED = true GLOBAL.require('debugkeys') GLOBAL.require('debugcommands') GLOBAL.require('maputil') Off-topic tangent, but does this allow you to use the functions the devs use on RWP streams, like clicking on the map to teleport? I'd be interested in playing around with these, at least for content testing purposes and I'd like to know more (how to enable, etc.) Link to comment https://forums.kleientertainment.com/forums/topic/168701-how-to-use-drawwalkablegrid-and-showwalkablegrid/#findComment-1842351 Share on other sites More sharing options...
cybers2001 Posted November 9, 2025 Author Share Posted November 9, 2025 (edited) 12 hours ago, Semind said: Off-topic tangent, but does this allow you to use the functions the devs use on RWP streams, like clicking on the map to teleport? I'd be interested in playing around with these, at least for content testing purposes and I'd like to know more (how to enable, etc.) These functions should be just for drawing lines on the map. The code suggests it visualizes the connections between land nodes, which I wanted to play with to see if I can better approximate travel distances between different POIs for a mod I'm working on. The graph functions mainly for worldgen purposes to ensure landdmasses are connected, which is different than pathfinder used for the characters themselves. That being said, I did come up with a pretty nice tool that leverages node neighbors, though not for distance approximation: local NAME_CONVERSIONS = { ["MoonIsland_Mine"] = "MoonIsland", ["MoonIsland_IslandShards"] = "MoonIsland", ["MoonIsland_Beach"] = "MoonIsland", ["MoonIsland_Forest"] = "MoonIsland", ["MoonIsland_Baths"] = "MoonIsland", ["MoonIslandRetrofit"] = "MoonIsland", } local function GetName(topId) local task_name, _, _ = topId:match("(.*):(.*):(.*)") local name = task_name or topId return NAME_CONVERSIONS[name] or name end function GetTopologyInfoAt(pos) local graph = TheWorld.topology local nodes = {} local size = 0 local unmatched = {} local function AddNeighbors(nodeId, matchingName) local node = graph.nodes[nodeId] if node == nil then return end size = size + node.area for _,v in pairs(node.neighbours) do if not nodes[v] then local topId = graph.ids[v] or "" local name = GetName(topId) if name == matchingName then nodes[v] = true AddNeighbors(v, matchingName) else unmatched[name] = true end end end end local id = TheWorld.Map:GetNodeIdAtPoint(pos.x, pos.y, pos.z) local topId = graph.ids[id] or "" local name = GetName(topId) if name ~= "" then AddNeighbors(id, name) end local neighbors = {} for k,_ in pairs(unmatched) do table.insert(neighbors, k) end return { name=name, area=size, neighbors=neighbors } end With this code, you just call GetTopologyInfoAt() and pass in your position, and it will give you the "task type" name, approx biome surface area, and the names of the neighboring biomes. Edited November 9, 2025 by cybers2001 Link to comment https://forums.kleientertainment.com/forums/topic/168701-how-to-use-drawwalkablegrid-and-showwalkablegrid/#findComment-1842407 Share on other sites More sharing options...
Semind Posted November 9, 2025 Share Posted November 9, 2025 I meant about the part I quoted, sorry for not being clearer. Link to comment https://forums.kleientertainment.com/forums/topic/168701-how-to-use-drawwalkablegrid-and-showwalkablegrid/#findComment-1842437 Share on other sites More sharing options...
cybers2001 Posted November 9, 2025 Author Share Posted November 9, 2025 5 hours ago, Semind said: I meant about the part I quoted, sorry for not being clearer. Ah, yep. I use debugkeys so I can press CTRL+R to quick leave/rejoin the server and reload my scripts. Link to comment https://forums.kleientertainment.com/forums/topic/168701-how-to-use-drawwalkablegrid-and-showwalkablegrid/#findComment-1842458 Share on other sites More sharing options...
oregu Posted November 11, 2025 Share Posted November 11, 2025 (edited) Some debug entities only show up clientside, but I don't know if that's related to this. The draw fn renders a yellow line for you, while the show fn reveals an area on the minimap for you (therefore you need to have the map undiscovered). I don't know how to show the lines, but other mods use DebugRender and draw using it, so it must be real. Like for example, DrawLine(ThePlayer:GetPosition(), c_find("evergreen"):GetPosition()) supposedly draws a line using the debug render? But I don't know how to get that to show up. So I can only talk about the show fn. It seems the commands create walkable voronoi connections on the minimap (aka between node cells). This becomes more apparent when you have a voronoi marker mod enabled. No Voronoi Mod: Spoiler Voronoi Mod: Spoiler I did require"maputil" then ShowWalkableGrid() in the command prompt. I'm assuming the player needs to be fully initialized before doing these commands, but I could be wrong. Edited November 11, 2025 by oregu Link to comment https://forums.kleientertainment.com/forums/topic/168701-how-to-use-drawwalkablegrid-and-showwalkablegrid/#findComment-1842679 Share on other sites More sharing options...
cybers2001 Posted November 12, 2025 Author Share Posted November 12, 2025 22 hours ago, oregu said: Some debug entities only show up clientside, but I don't know if that's related to this. The draw fn renders a yellow line for you, while the show fn reveals an area on the minimap for you (therefore you need to have the map undiscovered). I don't know how to show the lines, but other mods use DebugRender and draw using it, so it must be real. Like for example, DrawLine(ThePlayer:GetPosition(), c_find("evergreen"):GetPosition()) supposedly draws a line using the debug render? But I don't know how to get that to show up. So I can only talk about the show fn. It seems the commands create walkable voronoi connections on the minimap (aka between node cells). This becomes more apparent when you have a voronoi marker mod enabled. No Voronoi Mod: Hide contents Voronoi Mod: Hide contents I did require"maputil" then ShowWalkableGrid() in the command prompt. I'm assuming the player needs to be fully initialized before doing these commands, but I could be wrong. Ohh, that is very cool. Thanks! I wrote up some tools that recursively iterate through node neighbors to determine approximate biome sizes and walking distances. If anyone's interested I can throw in some sneak peaks. Link to comment https://forums.kleientertainment.com/forums/topic/168701-how-to-use-drawwalkablegrid-and-showwalkablegrid/#findComment-1842764 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now