Set metadata for schematics on mapgen

Post Reply
Skulls
Member
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Set metadata for schematics on mapgen

by Skulls » Post

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.

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: Set metadata for schematics on mapgen

by jas » Post

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.

Skulls
Member
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: Set metadata for schematics on mapgen

by Skulls » Post

Unfortunately that doesn't work for schematics placed during map generation: https://github.com/minetest/minetest/bl ... .txt#L6019

User avatar
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

by TumeniNodes » Post

disregard my comment, I was off in my thought
A Wonderful World

User avatar
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

by TumeniNodes » Post

possibly this could help you figure out how to do what you want?
viewtopic.php?p=20306#p20306
A Wonderful World

Skulls
Member
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: Set metadata for schematics on mapgen

by Skulls » Post

TumeniNodes wrote:possibly this could help you figure out how to do what you want?
viewtopic.php?p=20306#p20306
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.

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.

User avatar
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

by TumeniNodes » Post

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)
A Wonderful World

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Set metadata for schematics on mapgen

by Krock » Post

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>

Skulls
Member
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: Set metadata for schematics on mapgen

by Skulls » Post

Nice! Thank you

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests