Generate some dirt underground

londumas
New member
 
Posts: 6
Joined: Tue Jun 04, 2013 11:06

Generate some dirt underground

by londumas » Sat Jul 06, 2013 03:34

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
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Sat Jul 06, 2013 06:57

You could use WorldEdit to replace the stone with dirt
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

londumas
New member
 
Posts: 6
Joined: Tue Jun 04, 2013 11:06

by londumas » Sat Jul 06, 2013 07:00

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...
 

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11

by Dan Duncombe » Sat Jul 06, 2013 07:09

I guess you could make dirt generate like an ore... don't ask me how though :)
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Sat Jul 06, 2013 07:14

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
Last edited by sfan5 on Sat Jul 06, 2013 07:19, edited 1 time in total.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

londumas
New member
 
Posts: 6
Joined: Tue Jun 04, 2013 11:06

by londumas » Sat Jul 06, 2013 07:17

Cool, can I do that in a mod for a map?
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Sat Jul 06, 2013 07:18

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.
Last edited by sfan5 on Sat Jul 06, 2013 07:20, edited 1 time in total.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
Zeg9
Member
 
Posts: 608
Joined: Fri Sep 21, 2012 11:02

by Zeg9 » Sat Jul 06, 2013 10:04

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,
})
Last edited by sfan5 on Sat Jul 06, 2013 10:20, edited 1 time in total.
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Jul 06, 2013 10:58

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.
 


Return to Minetest-Related

Who is online

Users browsing this forum: No registered users and 17 guests

cron