Changing textures of a node

super_tnt
Member
 
Posts: 22
Joined: Mon Sep 02, 2013 17:56

Changing textures of a node

by super_tnt » Thu Sep 05, 2013 20:32

I haven't seen this listed in any documentation so I'm assuming it doesn't exist.

Shouldn't there be a method in the lua api to select the texture we want to use rather than just setting it in the register function. I understand this can cause some lag due to IO operations so the should be some customizations such as use another node's texture or store multiple textures and select later. We could use this and the metadata to make a node contain different types of itself rather than creating separate nodes, for example technic's battery box which uses 8 nodes just to display power level. I believe this will be very beneficial to many modders and open up more modding potential.

To summarise, I believe there should be a way to change textures of a node outside of the register command.
To actually change the texture the following options could be used - use another nodes textures/load from File system/have a table of textures to use.

Now if want to take it further maybe some way of creating textures on the fly, such as editing loaded ones or fully creating them.
Last edited by super_tnt on Thu Sep 05, 2013 20:33, edited 1 time in total.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Thu Sep 05, 2013 21:20

There is currently no way to change the nodedef at runtime, thats due to the design of Minetest.

There are some old branches about changing the nodedef in meta, but there were some problems and it needs further development.
 

super_tnt
Member
 
Posts: 22
Joined: Mon Sep 02, 2013 17:56

by super_tnt » Thu Sep 05, 2013 21:43

I don't fully understand.
When a node is in the world is it a reference to a node object which is created when the world is opened. And for different textures the nodes in the world would have to store separate data about the texture to use?
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Fri Sep 06, 2013 14:57

The way I understand it:
On position x,y,z there is a node called default:dirt, minetest looks up what texture is registered for default:dirt and uses it. What Adam says is that on position x,y,z there is a node called default:dirt and metadata. The metadata is independent from the used node and saved per position. And with that branch the metadata is able to say: don't use the texture you read from the node, use default_cobble.png.

If that's right than this would be a very interesting feature and would make many more and better mods possible.
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Fri Sep 06, 2013 15:56

Yeah, it's a feature I would have liked to have about a month ago with my negabomb. :)
 

super_tnt
Member
 
Posts: 22
Joined: Mon Sep 02, 2013 17:56

by super_tnt » Fri Sep 06, 2013 16:25

I don't want to sound like a know it all but it seems so simple to use a different texture.
What went wrong when it was tried?
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 5 guests

cron