Set metadata for schematics on mapgen

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

Set metadata for schematics on mapgen

by Skulls » Mon Dec 31, 2018 17:03

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: 346
Joined: Mon Jul 24, 2017 18:15
GitHub: jastevenson303
IRC: jas_
In-game: jas

Re: Set metadata for schematics on mapgen

by jas » Mon Dec 31, 2018 17:41

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.
201902221552
 

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

User avatar
TumeniNodes
Member
 
Posts: 2622
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Set metadata for schematics on mapgen

by TumeniNodes » Mon Dec 31, 2018 18:30

disregard my comment, I was off in my thought
I'm not your buddy, guy...
 

User avatar
TumeniNodes
Member
 
Posts: 2622
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Set metadata for schematics on mapgen

by TumeniNodes » Mon Dec 31, 2018 19:06

possibly this could help you figure out how to do what you want?
viewtopic.php?p=20306#p20306
I'm not your buddy, guy...
 

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

Re: Set metadata for schematics on mapgen

by Skulls » Mon Dec 31, 2018 19:34

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: 2622
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Set metadata for schematics on mapgen

by TumeniNodes » Mon Dec 31, 2018 19:40

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)
I'm not your buddy, guy...
 

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

Re: Set metadata for schematics on mapgen

by Krock » Tue Jan 01, 2019 12:55

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.
>> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

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


Return to Modding Discussion



Who is online

Users browsing this forum: UltraBloxX and 2 guests