Node material

User avatar
neko259
Member
 
Posts: 769
Joined: Sun Jun 19, 2011 06:51

Node material

by neko259 » Fri Jan 06, 2012 18:02

How to get node flammability? node.material.flammability says that 'material' in a nil value. The node exists, its name gets right.
Bitcoin donations: 18r66dJmUjwTmWRTFnorpGMzs8d4B8jzbw
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Fri Jan 06, 2012 20:59

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.
 

User avatar
neko259
Member
 
Posts: 769
Joined: Sun Jun 19, 2011 06:51

by neko259 » Fri Jan 06, 2012 21:08

How do I check furnace_burntime?
Bitcoin donations: 18r66dJmUjwTmWRTFnorpGMzs8d4B8jzbw
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Fri Jan 06, 2012 22:21

You must find the node in minetest.registered_nodes and read the furnace_burntime
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
neko259
Member
 
Posts: 769
Joined: Sun Jun 19, 2011 06:51

by neko259 » Fri Jan 06, 2012 23:00

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.
Bitcoin donations: 18r66dJmUjwTmWRTFnorpGMzs8d4B8jzbw
 

User avatar
Hackeridze
Member
 
Posts: 310
Joined: Thu Nov 03, 2011 13:35

by Hackeridze » Fri Jan 06, 2012 23:08

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
My game: RTMG
GENTOO USER
 

User avatar
neko259
Member
 
Posts: 769
Joined: Sun Jun 19, 2011 06:51

by neko259 » Fri Jan 06, 2012 23:09

No, I'll better maintain my own list of flammable nodes :P
Bitcoin donations: 18r66dJmUjwTmWRTFnorpGMzs8d4B8jzbw
 

User avatar
Hackeridze
Member
 
Posts: 310
Joined: Thu Nov 03, 2011 13:35

by Hackeridze » Fri Jan 06, 2012 23:18

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.
My game: RTMG
GENTOO USER
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Sat Jan 07, 2012 00:09

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.
Last edited by randomproof on Sat Jan 07, 2012 00:11, edited 1 time in total.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Sat Jan 07, 2012 09:23

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!
Last edited by sfan5 on Sat Jan 07, 2012 09:23, edited 1 time in total.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
neko259
Member
 
Posts: 769
Joined: Sun Jun 19, 2011 06:51

by neko259 » Sat Jan 07, 2012 09:39

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.
Bitcoin donations: 18r66dJmUjwTmWRTFnorpGMzs8d4B8jzbw
 

User avatar
neko259
Member
 
Posts: 769
Joined: Sun Jun 19, 2011 06:51

by neko259 » Sat Jan 07, 2012 09:56

Oh, thanks. nil works too, it indicated that the node is not flammable :)
Bitcoin donations: 18r66dJmUjwTmWRTFnorpGMzs8d4B8jzbw
 


Return to Minetest Engine

Who is online

Users browsing this forum: No registered users and 9 guests

cron