Page 1 of 1

Generate some dirt underground

PostPosted: Sat Jul 06, 2013 03:34
by londumas
Hello,

I have some idea for maps, but for that I need to know how to generate a map that has "dirt" nodes underground.

Thank you

PostPosted: Sat Jul 06, 2013 06:57
by sfan5
You could use WorldEdit to replace the stone with dirt

PostPosted: Sat Jul 06, 2013 07:00
by londumas
Thank you @sfan5 for your answer. But I don't want to replace all the stone, only to have some random "dirt" node underground along with stone, iron...

PostPosted: Sat Jul 06, 2013 07:09
by Dan Duncombe
I guess you could make dirt generate like an ore... don't ask me how though :)

PostPosted: Sat Jul 06, 2013 07:14
by sfan5
Change worldedit/manipulations.lua:37(for //set) or worldedit/manipulations.lua:65(for //replace)
from
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
env:add_node(pos, node)

to this, where 0.75(=75%) is the probability
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if math.random() < 0.75 then env:add_node(pos, node) end


Then you can simply use //set or //replace and it will only randomly set 75% of the nodes

PostPosted: Sat Jul 06, 2013 07:17
by londumas
Cool, can I do that in a mod for a map?

PostPosted: Sat Jul 06, 2013 07:18
by sfan5
You mean that it auto-generates the dirt nodes?
That'd be possible, but using the worldedit method would be easier for you I think.

PostPosted: Sat Jul 06, 2013 10:04
by Zeg9
Untested.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_ore({
    ore_type = "scatter",
    ore = "default:dirt",
    wherein = "default:stone",
    clust_scarcity = 8*8*8,
    clust_num_ores = 100,
--  ^ Number of ores in a cluster
    clust_size = 5,
    height_min = -31000,
    height_max = 0,
})

PostPosted: Sat Jul 06, 2013 10:58
by PilzAdam
Hybrid Dog wrote:Dirt as ore is already default. I saw it very often.

Its not exactly an ore, its hardcoded in the v6 mapgen.

Zeg9 wrote:Untested.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_ore({
    ore_type = "scatter",
    ore = "default:dirt",
    wherein = "default:stone",
    clust_scarcity = 8*8*8,
    clust_num_ores = 100,
--  ^ Number of ores in a cluster
    clust_size = 5,
    height_min = -31000,
    height_max = 0,
})

This should work.