Page 1 of 1

Problem with add_node

PostPosted: Tue Jan 03, 2012 02:53
by Gatharoth
Alright, so I'm testing a few things for a new mod/addition to another mod. How ever, as apart of the test, I am removing a node and adding another one in it's place. But minetest keeps telling me that it is expecting a string, when there is now. However, there is a string.

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.env:add_node(pos, "delayer:light_on_set")


Above is the line of code that minetest is having a problem with. Also, since it is having a problem with it, it just crashes completely. So this is also a bug report(?).

Do any of you see a problem with the line of code above? Because I do not.

Note: I have tried the code with { and } around the string, as well as with-out it, same error & crash.

PostPosted: Tue Jan 03, 2012 03:18
by sapier
I'm not sure but by now add_node() required a node as second argument eg

add_node(pos,{type="node",name="delayer:light_on_set"})

PostPosted: Tue Jan 03, 2012 04:20
by Gatharoth
sapier wrote:I'm not sure but by now add_node() required a node as second argument eg

add_node(pos,{type="node",name="delayer:light_on_set"})


Tried, and still same error + crash.

PostPosted: Tue Jan 03, 2012 04:53
by Gatharoth
Alright, for what ever reason it is working now. I do not know why. But alright. Nothing has changed (since adding "{type="node, name="delayer:light_on_set"}).

PostPosted: Tue Jan 03, 2012 07:29
by kahrl
You can leave out the type="node", it does nothing. But yeah, it has to be a table with up to three fields: name, param1 and param2 (the latter two are byte values that default to 0 if not given).