Page 1 of 1

Node material

PostPosted: Fri Jan 06, 2012 18:02
by neko259
How to get node flammability? node.material.flammability says that 'material' in a nil value. The node exists, its name gets right.

PostPosted: Fri Jan 06, 2012 20:59
by randomproof
You could use a nodes furnace_burntime. That is would I did in my fire mod. (Mine was not released because I used entities instead of nodes and it used too much CPU time to be really useable and entities can't give off light)

Also material.flammability is only in the Node's definition. You would have to find the node in minetest.registered_nodes. When you get a node from a function, such as get_node(pos) you get a table with 'name', 'param1', 'param2'. See scriptapi.cpp line 289.

PostPosted: Fri Jan 06, 2012 21:08
by neko259
How do I check furnace_burntime?

PostPosted: Fri Jan 06, 2012 22:21
by sfan5
You must find the node in minetest.registered_nodes and read the furnace_burntime

PostPosted: Fri Jan 06, 2012 23:00
by neko259
sfan5 wrote:You must find the node in minetest.registered_nodes and read the furnace_burntime

Rrr. For now I don't like this idea because jungle is not burning in the furnace if default mod.

PostPosted: Fri Jan 06, 2012 23:08
by Hackeridze
neko259 wrote:
sfan5 wrote:You must find the node in minetest.registered_nodes and read the furnace_burntime

Rrr. For now I don't like this idea because jungle is not burning in the furnace if default mod.

ReDefine jungle_tree

PostPosted: Fri Jan 06, 2012 23:09
by neko259
No, I'll better maintain my own list of flammable nodes :P

PostPosted: Fri Jan 06, 2012 23:18
by Hackeridze
neko259 wrote:No, I'll better maintain my own list of flammable nodes :P

And flammable things from other mods will not burn. And it will it more CPU, 'cos it should to see if this node in your list.

PostPosted: Sat Jan 07, 2012 00:09
by randomproof
neko259 wrote:
sfan5 wrote:You must find the node in minetest.registered_nodes and read the furnace_burntime

Rrr. For now I don't like this idea because jungle is not burning in the furnace if default mod.


You can look at the abm for the experimental:luafurnace in the experimental mod for how to find the furnace_burntime:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.registered_nodes[node.name].furnace_burntime


Also default:jungletree has a furnace_burntime of 30 in the default mod. The only node that looks to be a problem would be the lava nodes, as it doesn't really make sense to burn lava.

PostPosted: Sat Jan 07, 2012 09:23
by sfan5
randomproof wrote:
neko259 wrote:
sfan5 wrote:You must find the node in minetest.registered_nodes and read the furnace_burntime

Rrr. For now I don't like this idea because jungle is not burning in the furnace if default mod.


You can look at the abm for the experimental:luafurnace in the experimental mod for how to find the furnace_burntime:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.registered_nodes[node.name].furnace_burntime


Also default:jungletree has a furnace_burntime of 30 in the default mod. The only node that looks to be a problem would be the lava nodes, as it doesn't really make sense to burn lava.

Like this Idea!

PostPosted: Sat Jan 07, 2012 09:39
by neko259
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.registered_nodes[node.name].furnace_burntime

Doesn't work for me. It says that this parameter is a nil value.

PostPosted: Sat Jan 07, 2012 09:56
by neko259
Oh, thanks. nil works too, it indicated that the node is not flammable :)