How to add water to micro world?

I’m testing a few things related with water, and having to load a world (even the tiny size) is very time consuming. There is also all those unnecessary screens between starting the game and the working testing ground.

All I need is a small pound in the micro world. How do I add it?

MicroWorld has a remove_cube_from_terrain() method. You can use it with hydrology:create_water_body_with_region() like this:

local WaterTest = class(MicroWorld)

function WaterTest:_create_lake(x, z, width, length, height, depth)
   local cube = self:remove_cube_from_terrain(x, z, width, length, height)
   cube.max.y = cube.min.y + math.floor(depth) + 1
   local water_region = Region3(cube)
   stonehearth.hydrology:create_water_body_with_region(water_region, depth)
end
4 Likes