Problem with add_node

Gatharoth
Member
 
Posts: 196
Joined: Thu Dec 22, 2011 02:54

Problem with add_node

by Gatharoth » Tue Jan 03, 2012 02:53

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.

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.
Last edited by Gatharoth on Tue Jan 03, 2012 02:57, edited 1 time in total.
 

sapier
Developer
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Tue Jan 03, 2012 03:18

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"})
DON'T mention coding style!
(c) sapier all rights reserved
 

Gatharoth
Member
 
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Tue Jan 03, 2012 04:20

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.
 

Gatharoth
Member
 
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Tue Jan 03, 2012 04:53

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"}).
 

kahrl
Member
 
Posts: 236
Joined: Fri Sep 02, 2011 07:51
Location: Rös̓̇chenhof

by kahrl » Tue Jan 03, 2012 07:29

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).
Last edited by kahrl on Tue Jan 03, 2012 07:30, edited 1 time in total.
 


Return to Problems



Who is online

Users browsing this forum: EnthLojeek and 6 guests