[solved] Define Y position for schematic on worlddecoration?

User avatar
Milan*
Member
 
Posts: 203
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant

[solved] Define Y position for schematic on worlddecoration?

by Milan* » Thu Nov 24, 2016 19:56

I wonder if it is possible to let register_decoration place a schematic with a negative Y.

Background: i would like to give roots to specific and huge trees. I noticed that default trees have something rootlike but i was somewhat unable to reproduce this with my schematic files... maybe because they're way bigger. :S

PS: I really hope ths is not the wrong categorie. :o
Last edited by Milan* on Sun Nov 27, 2016 17:00, edited 1 time in total.
 

User avatar
Milan*
Member
 
Posts: 203
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant

Re: How to define Y position for schematic on worlddecoratio

by Milan* » Thu Nov 24, 2016 22:48

Update:

Paramat told me a way.

The current code looks 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 = "schematic",
    place_on = {"mystical:mystical_dirt"},
    sidelen = 80,
   noise_params = {
      --offset = 0.0018,
      --scale = 0.0021,
      spread = {x = 250, y = 250, z = 250},
      --octaves = 3,
      --persist = 0.66
   },
    fill_ratio = 0.0025,
    biomes = mesa,
    rotation = "random",
    y_min = 1,
    y_max = 100,
    schematic = path .. "mystical.mts",
    flags = "place_center_y",
})


So i created a new mts file with a height around of 62 blocks.
It basicly works but has an odd sideeffect:

Image
 

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

Re: How to define Y position for schematic on worlddecoratio

by paramat » Fri Nov 25, 2016 05:23

How did you create the schematic? By saving a volume with Worldedit?
To create trees use the saveschems mod https://github.com/minetest-mods/saveschems and use Lua tables.
You'll need to use {name = "air", prob = 0} for all underground nodes that are not roots, otherwise you end up force-placing nodes.

What's the Y of the top and base of that floating stuff?
My guess is this is because you have a very tall schematic and you are placing it so that it passes beyond the border of the core voxelmanip.
If you use {name = "air", prob = 0} those nodes will never be placed so this floaty stuff will hopefully not appear.

Your roots must be <= 16 nodes tall to not pass beyond the base of the core voxelmanip.
 

User avatar
Milan*
Member
 
Posts: 203
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant

Re: How to define Y position for schematic on worlddecoratio

by Milan* » Fri Nov 25, 2016 11:26

How did you create the schematic? By saving a volume with Worldedit?

Yes, i created a .mts file using Worldedit.

To create trees use the saveschems mod https://github.com/minetest-mods/saveschems and use Lua tables.

Whoa, doesn't look simple but i'll give it a try. :o

What's the Y of the top and base of that floating stuff?

The top is 143, the base is inconsistent but seems to be +81 above the ground.

Your roots must be <= 16 nodes tall to not pass beyond the base of the core voxelmanip.

Ouh ... the tree is meant to hit the ground at 31 nodes. This means due the lacking of better options i need to make the whole thing 62 nodes height. :S
 

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

Re: How to define Y position for schematic on worlddecoratio

by paramat » Fri Nov 25, 2016 22:35

y = 143 = 127 + 16. This is the top of the core voxelmanip at mapchunk top + 16 nodes.

Your schematics placed at y = 48 to y = 64 have 16 nodes of roots below, then up to 16 nodes of schematic below which is passing beyond the base of the core voxelmanip (at mapchunk base - 16 nodes) and therefore (due to an unintended behaviour) appear at the top of the core voxelmanip.

You'll find that floaty stuff is above a tree below placed between y = 48 and y = 64.

So you will be fine as long as your schematic has, from top to base, 32 nodes of tree, then 16 nodes of root, then 16 nodes of "air" prob = 0.
The Lua tables are separated into vertical slices of trees, you can see the tree structure in the tables upside down.
 

User avatar
Milan*
Member
 
Posts: 203
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant

Re: How to define Y position for schematic on worlddecoratio

by Milan* » Sun Nov 27, 2016 16:58

Okey, the trees are now reworked with the saveschems mod.
Everything feels just fine, wonderful. <3

Thank you very much!
And thanks to iska, who helped me since this huge thing was a big time killer. :D
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 61 guests

cron