New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add node texture variants #13811
base: master
Are you sure you want to change the base?
Add node texture variants #13811
Conversation
According to this: https://irc.minetest.net/minetest-dev/2023-01-08#i_6046142 it seems that there is nothing left to be done. Am I right? |
Would it be possible to add weights for each variant? |
What do you mean by it? |
So that one texture is more likely to appear than another, for example. Like, |
So, I understand now. This uses the node param2 value to choose the texture. So if the mod author wants to make some texture more common, he only needs to reflect in on_construct callback or/and in the mapgen generation code. |
a7e1b70
to
e1375ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here Github frustrates me again, as it refuses to expand the C++ diffs. :(
I left comments in the code.
Maybe it should be made clear if you need to override the same set of properties in each variant, or if it is allowed to e. g. add an overlay tile only to variants 3 and 6.
So, It should be documented now as well. There is probably a bug in |
Documentation updates are satisfying.
I wonder if item metadata needs to have both palette_index and variant.
Probably yes, because in non-nodes they can be independent.
I got the whole patch now, and have no further comments.
…---
I don’t want to put a requirement on this pull request—but I got the idea that
`description` should be variant-able.
Then you can use one node definition for all colors of wool, with each color
having the appropriate description, without manually creating item drops.
(And with the configurable bitfield, it also works with colorfacedir. :) )
|
Yeah, the per-player-per-nodedef variant offset is a cool idea.
Finally allows to make nodes visible only to certain players, like
ParticleSource.playername can do it for particles.
The “barriers” of Minecraft, which are only visible while wielding a barrier,
can be implemented this way.
Honestly I do not think it _needs_ to be included in this pull request.
But if it is included, it seems the documentation in lua_api.md is still
missing.
(I would also like this on the clientside modding API, for responsiveness.)
|
*lightbulbgoeson* Ah, the variant offset explains why the API currently allows
to define a higher variant count than can be accessed from the param2
bitfield. :)
|
@doxygen-spammer |
Nice!
|
It would indeed fix the first issue but not the second one. ABMs and LBMs do more stuff than simply swapping textures. Sometimes you want to remove the node completely, move the nodes or maybe spawn a structure. Not being able to change ABMs/LBMs after they are created makes them inflexible while hitting performance. |
@sfence rebase needed |
57936a5
to
330536b
Compare
(just in case: rebase still needed, one file conflicting) |
…nd needed logic around it to allow game to set variant_offset
@Zughy Yeah... some conflict PR has been merged during rebasing... :D |
This is the adoption of #12928. Closes #9193
I have rebased the original @TurkeyMcMac code and tested it.
It looks to be working without some artifact on my Linux.
To do
This PR is Ready for Review.
How to test
There are test nodes in the developer test game. They can be used to test.
There is also the command
/node_visual
which allows to changevariant_offset
for the wanted node.Example of command:
/node_visual testnodes:variant_color variant_offset 2