minetest.register_decoration -> function

User avatar
LNJ
Member
 
Posts: 200
Joined: Tue Sep 23, 2014 16:02
GitHub: LNJ2
IRC: LNJ2GO
In-game: LNJ

minetest.register_decoration -> function

by LNJ » Tue Jul 21, 2015 12:38

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!
My Minetest Modding Tutorials (German) | Minetest TNG - My survival subgame! (OUTDATED... :() | #ComeToTheDuckSide - we have privacy! | diaspora* - The free and decentralized alternative to facebook and twitter!
 

Glünggi
Member
 
Posts: 126
Joined: Wed Apr 16, 2014 08:13

Re: minetest.register_decoration -> function

by Glünggi » Wed Aug 05, 2015 18:37

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
 

User avatar
Clouds
Member
 
Posts: 102
Joined: Sat Aug 01, 2015 01:58
In-game: Cloud

Re: minetest.register_decoration -> function

by Clouds » Wed Aug 05, 2015 18:55

That looks really nice, a big pain to navigate but nice.
 

Glünggi
Member
 
Posts: 126
Joined: Wed Apr 16, 2014 08:13

Re: minetest.register_decoration -> function

by Glünggi » Thu Aug 06, 2015 04:20

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.
 

User avatar
Clouds
Member
 
Posts: 102
Joined: Sat Aug 01, 2015 01:58
In-game: Cloud

Re: minetest.register_decoration -> function

by Clouds » Thu Aug 06, 2015 05:57

With that many trees i really dont think people will notice the same tree issue
 

Glünggi
Member
 
Posts: 126
Joined: Wed Apr 16, 2014 08:13

Re: minetest.register_decoration -> function

by Glünggi » Thu Aug 06, 2015 06:40

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.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: minetest.register_decoration -> function

by paramat » Thu Aug 06, 2015 14:28

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.
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: minetest.register_decoration -> function

by Sokomine » Sat Aug 08, 2015 03:41

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!
A list of my mods can be found here.
 

User avatar
LNJ
Member
 
Posts: 200
Joined: Tue Sep 23, 2014 16:02
GitHub: LNJ2
IRC: LNJ2GO
In-game: LNJ

Re: minetest.register_decoration -> function

by LNJ » Fri Aug 21, 2015 17:11

Thanks for your answers!
My Minetest Modding Tutorials (German) | Minetest TNG - My survival subgame! (OUTDATED... :() | #ComeToTheDuckSide - we have privacy! | diaspora* - The free and decentralized alternative to facebook and twitter!
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 7 guests

cron