how do you add ores and biomes

User avatar
Christian9
Member
 
Posts: 273
Joined: Fri Sep 19, 2014 20:29
In-game: Christian9

how do you add ores and biomes

by Christian9 » Sun Apr 12, 2015 05:28

ive seen mods do it but i dont know how
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: how do you add ores and biomes

by Krock » Sun Apr 12, 2015 07:05

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 .
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

Re: how do you add ores and biomes

by Calinou » Sun Apr 12, 2015 07:07

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

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: how do you add ores and biomes

by prestidigitator » Sun Apr 12, 2015 08:02

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

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: how do you add ores and biomes

by rubenwardy » Sun Apr 12, 2015 18:03

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.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: how do you add ores and biomes

by prestidigitator » Sun Apr 12, 2015 19:08

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.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: how do you add ores and biomes

by rubenwardy » Sun Apr 12, 2015 19:47

 

User avatar
bdjnk
Member
 
Posts: 104
Joined: Wed Mar 20, 2013 21:03
GitHub: bdjnk

Re: how do you add ores and biomes

by bdjnk » Sun Apr 12, 2015 20:57

Another possibility is to take a look at recent "register_biome" activity on github. See what others are doing.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: how do you add ores and biomes

by prestidigitator » Sun Apr 12, 2015 23:46


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


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron