Page 1 of 1

Change some node properties in metadata

PostPosted: Wed Jan 20, 2016 19:47
by Gael de Sailly
Hi,

I have this idea that may be hard to code but I'm sure that could be interesting: making able to change some properties of a node, by node metadata, but only for this node.

What could we change?

I'm mainly referring to textures, nodebox and light emission, but we can imagine changing other parameters. That could be some special string fields like "tiles_1"..."tiles_6", "light_source" like "infotext" and "formspec" that already exists.
That would be a great improve for some mods that registers hundreds of nodes that are nearly the same, for different color shades, different node boxes (mesecons)… when we can do it with only 1 node that is sometimes changed by metadata.
We can imagine that it could be good for the signs mod also. This avoids placing an entity to get the text displayed.

I say it but I don't know whether that's technically possible or not. What do you think about it?

Re: Change some node properties in metadata

PostPosted: Sat Jan 23, 2016 00:40
by sofar
Realbadangel and me have been contemplating switchable tiles based on unused bits in param2.

As for signs, all we need to do is use the in-game font code to render the text on the node surface, and that just means reimplementing NDT_SIGNLIKE, which is on my wishlist/worklist, but I could use help ;)

Re: Change some node properties in metadata

PostPosted: Sat Jan 23, 2016 11:35
by Gael de Sailly
sofar wrote:Realbadangel and me have been contemplating switchable tiles based on unused bits in param2.

Excellent idea :)
That was one of my old ideas, but I thought is would not be possible because many nodes have facedir or wallmounted param2. But facedir is from 0 to 23, and wallmounted from 0 to 5, if the max is 255 we can use 10 different tiles, and 42 for wallmounted (modulo 24 or 6 is the facedir/wallmounted value)
But I think (I may be wrong) that it needs to define several additional drawtypes, we have already numerous ones.