[solved] register biome problem

User avatar
AiTechEye
Member
 
Posts: 651
Joined: Fri May 29, 2015 21:14
Location: Sweden
GitHub: AiTechEye

[solved] register biome problem

by AiTechEye » Sun Mar 17, 2019 12:10

Image

after months of thinking I made the decision to try to create a game from scratch, but now when I adds the first biome, stone covers all grass, why?
using mt 5, newest build

Code: Select all
minetest.register_biome({
   name = "grassland",
   node_top = "default:dirt_with_grass",
   depth_top = 1,
   node_filler = "default:dirt",
   depth_filler = 5,
   node_stone = "default:stone",
--   node_water_top = "",
--   depth_water_top =0 ,
--   node_water = "",
--   node_river_water = "",
   y_min = -31000,
   y_max = 31000,
   heat_point = 50,
   humidity_point = 50,
})


EDIT:
i solved it, by adding minetest.register_alias to each of the nodes, but still why is this required?
minetest.register_alias("mapgen_stone","default:stone")
minetest.register_alias("mapgen_dirt","default:dirt")
minetest.register_alias("mapgen_dirt_with_grass","default:dirt_with_grass")
Attachments
screenshot_20190317_125933.png
(410.2 KiB) Not downloaded yet
 

User avatar
paramat
Developer
 
Posts: 3371
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: [solved] register biome problem

by paramat » Mon Mar 18, 2019 06:32

I don't think this is solved.

> minetest.register_alias("mapgen_dirt","default:dirt")
> minetest.register_alias("mapgen_dirt_with_grass","default:dirt_with_grass")

Those 2 aliases shouldn't be necessary, biome surface nodes like grass and dirt only need to be added to a biome registration (unless you use mapgen v6, which i recommend you don't as it doesn't use the Biome API).

When you make a game you need to add a certain number of mapgen aliases, as explained here https://github.com/minetest/minetest/blob/77cfc4fcd1d10d088e8a56e38bc195a5d6fe5e57/doc/lua_api.txt#L282
 

User avatar
AiTechEye
Member
 
Posts: 651
Joined: Fri May 29, 2015 21:14
Location: Sweden
GitHub: AiTechEye

Re: [solved] register biome problem

by AiTechEye » Mon Mar 18, 2019 11:10

got it, thanks

as you told, only mapgen_stone is needed in this case, without it, it wont work

Image
Attachments
screenshot_20190318_120727.png
(484.61 KiB) Not downloaded yet
 

ShadMOrdre
Member
 
Posts: 288
Joined: Mon Dec 29, 2014 08:07
Location: USA
GitHub: ShadMOrdre
In-game: shadmordre

Re: [solved] register biome problem

by ShadMOrdre » Fri Apr 12, 2019 00:27

@AiTechEye,

The format for the register_biome function looks like this:
Code: Select all
   minetest.register_biome({
      name = "grassland",
      node_dust = nil,
      node_top = "default:dirt_with_grass",
      depth_top = 1,
      node_filler = "default:dirt",
      depth_filler = 4,
      node_stone = "default:stone",    -- or nil
      node_water_top = nil,
      depth_water_top = nil,
      node_water = nil,
      node_river_water = nil,
      y_min = -31000,
      y_max = 31000,
      vertical_blend = 4,
      heat_point =50,
      humidity_point = 50,
   })


You can omit the any of the parameters, as long as they equal nil. I created biomes with and without a defined stone, only defining one if I use a custom stone, otherwise "default:stone" is placed anyway.

The above definition should be copied for each biome you create, changing whatever values you wish, as long as the entire definition is passed to register_biome.
MY MODS: lib_ecology lib_materials lib_clouds lib_node_shapes ---- Inspired By: Open Source Virtual World Simulator Opensimulator.
 


Return to Game Discussion



Who is online

Users browsing this forum: No registered users and 0 guests