I want to use a custom heightmap, on top of which the normal generation would happen.
I have looked online, but I am overwhelmed by the different methods. It seems to me that some questions are outdated, and new methods for modifying the map generation have been added. That's why I would appreciate your advice on how to go about this.
pass a heightmap to mapgen.
Re: pass a heightmap to mapgen.
I figured to use a single-node world, do my own terrain generation, and then call core.generate_decorations
See below an example:
See below an example:
Code: Select all
core.register_on_generated(function(minp, maxp, seed)
local vm, emin, emax = core.get_mapgen_object("voxelmanip")
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
local data = vm:get_data()
for z = minp.z, maxp.z do
for x = minp.x, maxp.x do
local h = get_height(x, z)
for y = minp.y, maxp.y do
local vi = area:index(x,y,z)
data[vi] = stone
if y > h then
data[vi] = air
elseif y == h then
data[vi] = grass
elseif y > h - 3 then
data[vi] = dirt
end
end
end
end
end
vm:set_data(data)
-- generate decoration and ores
-- core.generate_ores(vm, minp, maxp)
core.generate_decorations(vm, minp, maxp)
-- Calculate lighting, write data, and update liquids
vm:calc_lighting()
vm:write_to_map()
vm:update_liquids()
end)Re: pass a heightmap to mapgen.
This mod may be with trying at as well: https://content.luanti.org/packages/Gae ... /biomegen/
yes
Who is online
Users browsing this forum: No registered users and 0 guests