Page 1 of 1

minetest.register_decoration -> function

PostPosted: Tue Jul 21, 2015 12:38
by LNJ
If you could tell minetest.register_decoration a function (with position) that will be executed for every for every decoration.
Like this:
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_decoration({
   deco_type = "function",
   place_on = {"default:dirt_with_grass"},
   sidelen = 16,
   noise_params = {
      offset = -0.02,
      scale = 0.03,
      spread = {x=200, y=200, z=200},
      seed = 19822,
      octaves = 3,
      persist = 0.6
   },
   biomes = {"grassland"},
   y_min = 6,
   y_max = 31000,
   decoration = function(pos)
      default.grow_tree(pos)
   end
})

When you use schematics every tree looks like the other!

EDIT:
I need this for trees!

Re: minetest.register_decoration -> function

PostPosted: Wed Aug 05, 2015 18:37
by Glünggi
Use bit asymmetric treemodels (but not too asymmetric) and add
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
rotation = "random",

in register.decoration.. then it looks not so strange similar.
More than one single treemodel for a biom can help too
Its not the solution.. but maybe helpful ;)
Image

Re: minetest.register_decoration -> function

PostPosted: Wed Aug 05, 2015 18:55
by Clouds
That looks really nice, a big pain to navigate but nice.

Re: minetest.register_decoration -> function

PostPosted: Thu Aug 06, 2015 04:20
by Glünggi
hehe...
but its also a benefit, if you want clime some mountains... or at the nigth you can walk over the trees and the mobs on the ground looks stupid from the laundry
It should just show wath is posible with schematictrees...
Is it also mutch faster then L system also lesser shadowfailures (on generate).
The disadvantage its thats the trees al have the same Model.... but that can be counteracted.. a little bit.

Re: minetest.register_decoration -> function

PostPosted: Thu Aug 06, 2015 05:57
by Clouds
With that many trees i really dont think people will notice the same tree issue

Re: minetest.register_decoration -> function

PostPosted: Thu Aug 06, 2015 06:40
by Glünggi
Thats are 3 different giant jungletrees with random rotation placed.
There are also 3 smal trees addet but they dont attract attention.
I think 3 different trees for a biom and random rotation on generate is ideal to bring some variety to the Landscape.
But i fear that is not the solution, cause i think LNJ wants really different trees and not a fake :)

edit:
you can also make 3 different modell of the same tree and add a random on the sapling who let spawn one of the 3 different Modell.

Re: minetest.register_decoration -> function

PostPosted: Thu Aug 06, 2015 14:28
by paramat
Also use 'y-slice probabilities' to randomly remove horizontal slices from the tree schematics, this is used in the latest mgv7 biomes for tree variety and height variation.

Re: minetest.register_decoration -> function

PostPosted: Sat Aug 08, 2015 03:41
by Sokomine
The trees in RealTest don't use random - and still their forrests look good. It doesn't take too many tree models for a good impression. Variety is of course welcome!

Re: minetest.register_decoration -> function

PostPosted: Fri Aug 21, 2015 17:11
by LNJ
Thanks for your answers!