Does anyone know of any mod or subgame that uses node_box.type = 'leveled'?
I need to test my pathfinding algorithm with an actual implementation of this.
'Leveled' nodebox type used anywhere?
Re: 'Leveled' nodebox type used anywhere?
The "Snow Biomes" mod uses levelled nodes to have different height snowblocks on the ground which can pile up when the snow is falling or placed by player: viewtopic.php?t=2290
Re: 'Leveled' nodebox type used anywhere?
Thanks! This will do nicely.
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: 'Leveled' nodebox type used anywhere?
I've also added leveled nodeboxes very recently for the hay generated in my cottages mod.
Leveled nodes seem to have a strange and intresting effect. When I was experimenting with them, I added a small function that let each punch to the node increase its level metadata by one. After some standing on the node and happily punching, I noticed that my character moved upwards.
This makes for an entertaining - but very slow - lift:
Leveled nodes seem to have a strange and intresting effect. When I was experimenting with them, I added a small function that let each punch to the node increase its level metadata by one. After some standing on the node and happily punching, I noticed that my character moved upwards.
This makes for an entertaining - but very slow - lift:
Code: Select all
minetest.register_node("leveled:lift", {
drawtype = "nodebox",
paramtype2 = "leveled",
description = "lift",
tiles = {"default_stone.png"},
groups = {cracky=3,snappy=3,choppy=3,oddly_breakable_by_hand=3,flammable=3},
is_ground_content = false,
node_box = {
type = "leveled", --"fixed",
fixed = {
{-0.5,-0.5,-0.5, 0.5, 0.5, 0.5},
}
},
after_place_node = function(pos, placer, itemstack, pointed_thing)
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
timer:start(1)
end
end,
on_punch = function(pos, node, puncher, pointed_thing)
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name=node.name, param2=(node.param2+1)})
end,
on_timer = function(pos, elapsed)
local node = minetest.get_node(pos)
if( node.param2 > 64 ) then
minetest.swap_node( pos, {name="default:glass"})
pos.y = pos.y + 1
minetest.set_node(pos, {name=node.name, param2=0})
else
minetest.swap_node(pos, {name=node.name, param2=(node.param2+2)})
end
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
timer:start(1)
end
end,
})
A list of my mods can be found here.
Re: 'Leveled' nodebox type used anywhere?
This may be a more general issue, I noticed my mobs when walking on nodes adjacent to nodes with snow on top of them sometimes do small jumps for no reason, even though in MTG snow is fixed rather than leveled. Strange that this doesn't occur near slabs which are very similar nodedef.
Why swap nodes instead of calling add_node_level?
Why swap nodes instead of calling add_node_level?
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: 'Leveled' nodebox type used anywhere?
I wasn't aware of that function.Termos wrote: Why swap nodes instead of calling add_node_level?
A list of my mods can be found here.
Who is online
Users browsing this forum: No registered users and 12 guests