- Code: Select all
-- ...
on_use = function(...)
local idx = player:get_wield_index() + 1
if idx < 8 then
local inv = player:get_inventory()
local stack = inv:get_stack("main", idx)
-- do something with stack
end
end,
-- ...
-- ...
on_use = function(...)
local idx = player:get_wield_index() + 1
if idx < 8 then
local inv = player:get_inventory()
local stack = inv:get_stack("main", idx)
-- do something with stack
end
end,
-- ...
on_rightclick = function(pos, node, clicker)
local inv = clicker:get_inventory()
inv:add_item("main", "pots:pot")
end,
I think it is a bug with the engine. The default hand is actually a tool that is named ":"Casimir wrote:Don't know if this is a bug in the engine or if I'm doing something wrong.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
on_rightclick = function(pos, node, clicker)
local inv = clicker:get_inventory()
inv:add_item("main", "pots:pot")
end,
This should place the item in the players inventory. It works unless the first free slot in the inventory is the players bare hand, then nothing gets added.
Casimir wrote:This should place the item in the players inventory. It works unless the first free slot in the inventory is the players bare hand, then nothing gets added.
Kilarin wrote:Thank you Casimir and Krock. That helps. At first I found Pointed_Thing.above and below VERY confusing because I was interpreting "above" as actually UP and I couldn't figure out how the code knew which face you were pointing at from that information. This makes much more sense.
Daven wrote:Does anyone know the mod where you break the bottom of the tree block and the whole thing falls. Do you know where that is and if you do can you put a link down?
DeepGaze wrote:how to control the movement of an entity
DeepGaze wrote:how to teleport a player after touching a node(to a controlled location)
minetest.register_node("foo:bar", {
-- ...
on_punch = function(pos, node, puncher, pointed_thing)
puncher:setpos({x = 0, y = 0, z = 0})
end,
-- ...
})
DeepGaze wrote:how to be lord and ruler of all creation
su rootlocal admin = minetest.setting_get("name")
local locked = minetest.setting_get("lockdown")
minetest.register_on_prejoinplayer(function(name, ip)
if name ~= admin or locked == true then
return "This server is in maintenance mode"
end
end)
ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGNORE while trying to replace "traps:acid" at (0,2,-6) (block (0,0,-1))minetest.register_node("traps:quicksand", {
description = "Quicksand",
tiles = {"default_desert_sand.png"},
walkable = false,
disable_jump = true,
drowning = 1,
liquidtype = "source",
liquid_viscosity = 10,
liquid_range = 0,
liquid_renewable = false,
groups = {liquid=2, crumbly=1,oddly_breakable_by_hand=2},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("traps:acid", {
description = "Acid",
tiles = {
{name="acid.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}},
walkable = false,
disable_jump = true,
drowning = 1,
liquidtype = "source",
liquid_viscosity = 3,
liquid_range = 0,
liquid_renewable = false,
groups = {liquid=2, crumbly=1,oddly_breakable_by_hand=2},
damage_per_second = 6,
})
Topywo wrote:tiles = {
{name="acid.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}},
A } too much?
minetest.register_node("aniwool:ani1", {
tile_images = {
{
image="ani1.png",
backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}
},
{
image="ani1.png",
backface_culling=true,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}
},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=h1},
description = "animated wool type one",
groups={snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1},
})RHR wrote:Hi everyone!
While creating a new mod following problem occurred: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
ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGNORE while trying to replace "traps:acid" at (0,2,-6) (block (0,0,-1))
AFAIK this message appears if a node is not defined or not correctly, but I've no idea what I've done wrong, so please help me! [^_^]
Here is the part of node definition where I think the code is wrong: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("traps:quicksand", {
description = "Quicksand",
tiles = {"default_desert_sand.png"},
walkable = false,
disable_jump = true,
drowning = 1,
liquidtype = "source",
liquid_viscosity = 10,
liquid_range = 0,
liquid_renewable = false,
groups = {liquid=2, crumbly=1,oddly_breakable_by_hand=2},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("traps:acid", {
description = "Acid",
tiles = {
{name="acid.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}},
walkable = false,
disable_jump = true,
drowning = 1,
liquidtype = "source",
liquid_viscosity = 3,
liquid_range = 0,
liquid_renewable = false,
groups = {liquid=2, crumbly=1,oddly_breakable_by_hand=2},
damage_per_second = 6,
})
15:49:57: ACTION[main]: .__ __ __
15:49:57: ACTION[main]: _____ |__| ____ _____/ |_ ____ _______/ |_
15:49:57: ACTION[main]: / \| |/ \_/ __ \ __\/ __ \ / ___/\ __\
15:49:57: ACTION[main]: | Y Y \ | | \ ___/| | \ ___/ \___ \ | |
15:49:57: ACTION[main]: |__|_| /__|___| /\___ >__| \___ >____ > |__|
15:49:57: ACTION[main]: \/ \/ \/ \/ \/
15:49:57: ACTION[main]: World at [D:\minetest-0.4.9-dev\bin\..\worlds\8]
15:49:57: ACTION[main]: Server for gameid="minetest" listening on 0.0.0.0:49845.
PNG warning: Interlace handling should be turned on when using png_read_image
PNG warning: Interlace handling should be turned on when using png_read_image
15:50:00: ACTION[ServerThread]: singleplayer joins game.
Font size: 15:50:01: ACTION[ServerThread]: singleplayer joins game. List of play
ers:
8 17
Could not open file of texture: character.png
Loaded mesh: character.x
Loaded mesh: character.x
15:50:08: ACTION[ServerThread]: singleplayer takes "traps:acid" from creative in
ventory
15:50:09: ACTION[ServerThread]: singleplayer takes "traps:quicksand" from creati
ve inventory
15:50:12: ACTION[ServerThread]: singleplayer places node traps:acid at (-17,8,-1
8)
15:50:15: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "traps:acid" at (-17,8,-18) (block (-2,0,-2))
15:50:15: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "air" at (-17,8,-17) (block (-2,0,-2))
15:50:15: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "air" at (-16,8,-18) (block (-1,0,-2))
15:50:19: ACTION[ServerThread]: singleplayer places node traps:quicksand at (-17
,8,-17)
15:50:27: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "traps:quicksand" at (-17,8,-17) (block (-2,0,-2))
15:50:27: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "air" at (-17,8,-16) (block (-2,0,-1))
15:50:27: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "air" at (-16,8,-17) (block (-1,0,-2))
15:50:27: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "traps:acid" at (-17,8,-18) (block (-2,0,-2))
15:50:33: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "air" at (-16,8,-18) (block (-1,0,-2))Krock wrote:@RHR,
PilzAdam meant the set_node calls in the codes
RHR wrote:Krock wrote:@RHR,
PilzAdam meant the set_node calls in the codes
I havn't used any set_node calls in the codes. You can find the source code here:
https://github.com/RHRhino/Traps
PilzAdam wrote:You define liquids without liquid_source and liquid_flowing fields.
rubenwardy wrote:By the way, the namespace 'traps' is used.
viewtopic.php?f=11&t=2838
Users browsing this forum: No registered users and 8 guests