Set metadata for schematics on mapgen
Set metadata for schematics on mapgen
Is there a way to set the metadata of schematic nodes placed during map generation? As an example, I wanted to give all of a tree's nodes a group ID so that the entire thing could be removed without walking up the trunk nodes.
Re: Set metadata for schematics on mapgen
I don't know, but doesn't on_construct = function(pos), allowing for minetest.get_meta():set_int("id", i) do the trick?
I also don't know if NodeMeta allows for ints.
I also don't know if NodeMeta allows for ints.
Re: Set metadata for schematics on mapgen
Unfortunately that doesn't work for schematics placed during map generation: https://github.com/minetest/minetest/bl ... .txt#L6019
- TumeniNodes
- Member
- Posts: 2943
- Joined: Fri Feb 26, 2016 19:49
- GitHub: TumeniNodes
- IRC: tumeninodes
- In-game: TumeniNodes
- Location: in the dark recesses of the mind
- Contact:
Re: Set metadata for schematics on mapgen
disregard my comment, I was off in my thought
A Wonderful World
- TumeniNodes
- Member
- Posts: 2943
- Joined: Fri Feb 26, 2016 19:49
- GitHub: TumeniNodes
- IRC: tumeninodes
- In-game: TumeniNodes
- Location: in the dark recesses of the mind
- Contact:
Re: Set metadata for schematics on mapgen
possibly this could help you figure out how to do what you want?
viewtopic.php?p=20306#p20306
viewtopic.php?p=20306#p20306
A Wonderful World
Re: Set metadata for schematics on mapgen
Unfortunately, no. As mentioned in that thread the Timber mod walks up the trunk from the dig node and this can cause issues with non 1x1 column tree trunks. Not to mention leaves. You would have to place the schematic then re-interpret the nodes in that schematic later. But if you could set some metadata when the schematic was first placed you would be able to do it a lot better.TumeniNodes wrote:possibly this could help you figure out how to do what you want?
viewtopic.php?p=20306#p20306
My question really isn't about chopping down trees though. It is about how to do something extra to schematic nodes as they are being generated.
- TumeniNodes
- Member
- Posts: 2943
- Joined: Fri Feb 26, 2016 19:49
- GitHub: TumeniNodes
- IRC: tumeninodes
- In-game: TumeniNodes
- Location: in the dark recesses of the mind
- Contact:
Re: Set metadata for schematics on mapgen
ahhhh, now I get it. sorry for the misunderstanding.
perhaps paramat or sofar will be able to offer some solution or ideas
on a side note, further down in that thread cornernote added leaves into the code as well. (not that it helps your situation)
perhaps paramat or sofar will be able to offer some solution or ideas
on a side note, further down in that thread cornernote added leaves into the code as well. (not that it helps your situation)
A Wonderful World
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Set metadata for schematics on mapgen
You could try to put the ID into param2 of the node -> use the bits 1110'0000 so you don't mess up the rotation. That value can be changed easily using the VManip functions.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Re: Set metadata for schematics on mapgen
Nice! Thank you
Who is online
Users browsing this forum: No registered users and 4 guests