Page 1 of 1

how do you add ores and biomes

PostPosted: Sun Apr 12, 2015 05:28
by Christian9
ive seen mods do it but i dont know how

Re: how do you add ores and biomes

PostPosted: Sun Apr 12, 2015 07:05
by Krock
You can't add biomes in mgv6 but mgv5/7 allow the register_biome function

For ores, see http://dev.minetest.net/minetest.register_ore .

Re: how do you add ores and biomes

PostPosted: Sun Apr 12, 2015 07:07
by Calinou
Just look at their code.

Ores are added with minetest.register_ore:

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:stone_with_gold",
      wherein        = "default:stone",
      clust_scarcity = 15*15*15,
      clust_num_ores = 3,
      clust_size     = 2,
      y_min          = -255,
      y_max          = -64,
      flags          = "absheight",
   })


As for biomes, you probably want to clear existing biome definitions first:

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
-- Clear mgv5/mgv7 biomes and decorations
minetest.clear_registered_biomes()
minetest.clear_registered_decorations()


Then look at the bottom of this file: https://github.com/paramat/paragenv7/bl ... r/init.lua

Note that only v5 and v7 map generations support proper biomes, in v6 biomes are a hack (you basically overwrite the already-present biomes).

Re: how do you add ores and biomes

PostPosted: Sun Apr 12, 2015 08:02
by prestidigitator
In other words, at least you aren't alone. NOBODY knows what they are, what they do, or how you use them. Proven by the sparsity of examples and documentation (including the forums, the developer wiki, and lua_api.txt). For now, probably better just to roll your own using noise in Lua, interpret it, and splat the results in using VoxelManip. I'm sure it's slower than the nebulous thing nobody can describe at doing whatever it is it does, but....

Re: how do you add ores and biomes

PostPosted: Sun Apr 12, 2015 18:03
by rubenwardy
Don't make your own system to do the same thing.

http://dev.minetest.net/register_ore
http://rubenwardy.com/minetest_modding_ ... gister_ore
http://rubenwardy.com/minetest_modding_ ... #ore-types

I don't think biomes are officially supported yet (they weren't last time i checked) but jordach made a nice tutorial on them. See the Dropbox link in his signature.

Re: how do you add ores and biomes

PostPosted: Sun Apr 12, 2015 19:08
by prestidigitator
rubenwardy wrote:Don't make your own system to do the same thing.

Ah. Yeah. Sorry. I should have qualified that. I was mostly referring to biomes. Ores are a little better documented at this point.

rubenwardy wrote:I don't think biomes are officially supported yet (they weren't last time i checked) but jordach made a nice tutorial on them. See the Dropbox link in his signature.

Of course, I'd be happy to be proven wrong about there being some documentation on biomes somewhere (I'd even be happy to—with permission and any caveats about lack of official support—help copy it to the developer wiki). However, there don't seem to be any links in Jordach's signature at the moment, so such documentation still has yet to materialize.

Re: how do you add ores and biomes

PostPosted: Sun Apr 12, 2015 19:47
by rubenwardy

Re: how do you add ores and biomes

PostPosted: Sun Apr 12, 2015 20:57
by bdjnk
Another possibility is to take a look at recent "register_biome" activity on github. See what others are doing.

Re: how do you add ores and biomes

PostPosted: Sun Apr 12, 2015 23:46
by prestidigitator

Cool. I see it may be a bit, "opinionated," too. Should be a good read. Thank you.