OK, thanks. I will look into this. Also, wiki is fixed.
Paramat, you really should get a wiki account. I think Calinou is the one to ask. It is absolutely unacceptable that core developers are not allowed to edit the wiki (not your fault, of course).
What is on_mapgen_init and why isn't it documented in lua_api.txt?
Why does this code not remove dungeons?:
Code: Select all
minetest.register_on_mapgen_init(function()
minetest.set_mapgen_setting("mg_flags", "nodungeons")
end)
Or this code? (Called on “top Lua level”, not inside of any function, in a brand new world)
Code: Select all
minetest.set_mapgen_setting("mg_flags", "nodungeons")
I have checked map_meta.txt. Mg_flags is untouched. There is only one place in the subgame + all active mods where minetest.set_mapgen_setting is called. No over mod tampers with the mapgen settings. Weird. Tested in 0.4.15. Bug or user failure? ;-)
Why does your previous decoration example have so many air? It looks like there is an entire row which is completely unused (probability of 0). Why has the schematic a height of 3 when it only needs 2?
Why doesn't this schematic decoration spawn any grass?:
Code: Select all
minetest.register_decoration({
deco_type = "schematic",
schematic = {
size = { x=1, y=1, z=1 },
data = {
{ name = "default:grass_5", param1=255, },
},
},
place_on = {"default:dirt_with_grass"},
sidelen = 8,
noise_params = {
offset = -0.01,
scale = 0.03,
spread = {x = 500, y = 500, z = 500},
seed = 420,
octaves = 2,
persist = 0.6,
},
y_min = 1,
y_max = 40,
flags = "",
})
But this one does?:
Code: Select all
minetest.register_decoration({
deco_type = "schematic",
schematic = {
size = { x=1, y=2, z=1 },
data = {
{ name = "air", prob = 0 },
{ name = "default:grass_5", param1=255, },
},
},
place_on = {"default:dirt_with_grass"},
sidelen = 8,
noise_params = {
offset = -0.01,
scale = 0.03,
spread = {x = 500, y = 500, z = 500},
seed = 420,
octaves = 2,
persist = 0.6,
},
y_min = 1,
y_max = 40,
flags = "",
})
EDIT: Final decoration question (in this post): Why is this even possible?:
https://i.imgur.com/LAqTiKz.png
The purple flowered plant is a peony. It is supposed to be made out of 2 nodes at all times, a top part and a bottom part (like a door). It must never be seperated.
The peony to the right is the expected plant.
But the mapgen generated this “half peony” in the middle, on jungle wood. Which is wrong. It also happened to me that the top part of the peony spawned on fern (=jungle grass in Minetest Game) or tall grass (=grass in Minetest Game). Note that most peonies generated by the mapgen are correct, the seperation happens rarely.
Why did this happen and how can I prevent this?
Decorations code:
Code: Select all
-- Large flowers
local register_large_flower = function(name, seed, offset)
minetest.register_decoration({
deco_type = "schematic",
schematic = {
size = { x=1, y=3, z=1 },
data = {
{ name = "air", prob = 0 },
{ name = "mcl_flowers:"..name, param1=255, },
{ name = "mcl_flowers:"..name.."_top", param1=255, },
},
},
place_on = {"mcl_core:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = offset,
scale = 0.01,
spread = {x = 300, y = 300, z = 300},
seed = seed,
octaves = 5,
persist = 0.62,
},
y_min = 1,
y_max = 30,
flags = "",
})
end
register_large_flower("rose_bush", 9350, -0.008)
register_large_flower("peony", 10450, -0.008)
register_large_flower("lilac", 10600, -0.007)
register_large_flower("sunflower", 2940, -0.005)
Mapgen used: v6. You see a v6 jungle here.
EDIT 2: Hooray! The schematic rotation trick suggested by you previously worked! Thanks a bunch! :-)