I want to have a function that registers a node with the same properties as the previous one but with the addition of:
paramtype = "light",
light_source = 4,
on_construct = function(pos)
minetest.after(0.1, function()
--change to original node
end)
end,
Register a node based off a another node with an altered Def
Register a node based off a another node with an altered Def
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP
Re: Register a node based off a another node with an altered
If you are saying you want two nodes with different properties, and one replaces the other, check out farming or farming redo or plantlife or moretrees or anything where a seedling or sapling is replaced by a mature or more mature version. To define those nodes, check out any of the crops in farming redo. (I'd stick with farming redo for the whole thing -- not only is everything (except corn?) exactly one node big, it's very easy to follow how you add a new property to the previous node.)
Re: Register a node based off a another node with an altered
No not like that here I'll give it to you in pseudocode
Make a function with an argument labeled `name`
Get block with the name of `name`
If it's a valid name then
Declare a table with the properties of the node
Add paramtype = "light" and light_source = 4
Register a node with the new Def with an altered name
end function
Make a function with an argument labeled `name`
Get block with the name of `name`
If it's a valid name then
Declare a table with the properties of the node
Add paramtype = "light" and light_source = 4
Register a node with the new Def with an altered name
end function
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP
- duane
- Member
- Posts: 1715
- Joined: Wed Aug 19, 2015 19:11
- GitHub: duane-r
- Location: Oklahoma City
- Contact:
Re: Register a node based off a another node with an altered
This is what I use. You can see it in use here.Extex wrote:Register a node with the new Def with an altered name
Believe in people and you don't need to believe anything else.
Who is online
Users browsing this forum: No registered users and 14 guests