Page 1 of 1

Modify node definition after registration

PostPosted: Fri Jan 11, 2013 18:50
by Nore
Is it possible to modify the definition a node after it has been registered (for example, modifying a chest without having to change the default mod code) ?

PostPosted: Fri Jan 11, 2013 18:54
by LorenzoVulcan
Yes,override.

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.register_node("default:chest",...)


in ... node properties.

Just overwrite the registration.

PostPosted: Fri Jan 11, 2013 18:56
by rubenwardy
LorenzoVulcan wrote:Yes,override.

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.register_node("default:chest",...)


in ... node properties.

Just overwrite the registration.


minetest.register_node(" : default:chest",...)

remember the :

PostPosted: Fri Jan 11, 2013 19:21
by LorenzoVulcan
rubenwardy wrote:
minetest.register_node(" : default:chest",...)

remember the :

If you want to overwrite the node you must give a name that's equal to original node,so you need "default:chest",

PostPosted: Fri Jan 11, 2013 19:23
by rubenwardy
LorenzoVulcan wrote:
rubenwardy wrote:
minetest.register_node(" : default:chest",...)

remember the :

If you want to overwrite the node you must give a name that's equal to original node,so you need "default:chest",


:default:chest

and

default:chest

are the same names, ":" is the override character.

PostPosted: Fri Jan 11, 2013 19:24
by LorenzoVulcan
rubenwardy wrote:
LorenzoVulcan wrote:
rubenwardy wrote:
minetest.register_node(" : default:chest",...)

remember the :

If you want to overwrite the node you must give a name that's equal to original node,so you need "default:chest",


:default:chest

and

default:chest

are the same names, ":" is the override character.

You don't need to put ":" to override them.

PostPosted: Fri Jan 11, 2013 19:25
by rubenwardy
He is accessing it from another mod.

Surely he needs it?

PostPosted: Fri Jan 11, 2013 19:55
by LorenzoVulcan
rubenwardy wrote:He is accessing it from another mod.

Surely he needs it?

I already tried with functions,i think that nodes are the same.
Anyway,modname is a problem but i don't know if ":" will solve it.I never tried with nodes.

PostPosted: Fri Jan 11, 2013 20:26
by kaeza
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["default:chest"].blahblah = blahblahblah;

Just sayin' :)

LorenzoVulcan wrote:
rubenwardy wrote:
LorenzoVulcan wrote:If you want to overwrite the node you must give a name that's equal to original node,so you need "default:chest",


:default:chest

and

default:chest

are the same names, ":" is the override character.

You don't need to put ":" to override them.

Yes you do if you want to override or otherwise add a node in a different namespace.