23:00:46: ERROR[main]: ========== ERROR FROM LUA ===========
23:00:46: ERROR[main]: Failed to load and run script from
23:00:46: ERROR[main]: C:\Users\Matt and Betty\Downloads\minetest-0.4.5\minetest-0.4.5\bin\..\worlds\test\worldmods\sits\init.lua:
23:00:46: ERROR[main]: ....4.5\minetest-0.4.5\bin\..\builtin/misc_register.lua:170: attempt to index local 'tooldef' (a nil value)
23:00:46: ERROR[main]: stack traceback:
23:00:46: ERROR[main]: ....4.5\minetest-0.4.5\bin\..\builtin/misc_register.lua:170: in function 'register_tool'
23:00:46: ERROR[main]: ...est-0.4.5\bin\..\worlds\test\worldmods\sits\init.lua:6: in main chunk
23:00:46: ERROR[main]: =======END OF ERROR FROM LUA ========
23:00:46: ERROR[main]: Server: Failed to load and run C:\Users\Matt and Betty\Downloads\minetest-0.4.5\minetest-0.4.5\bin\..\worlds\test\worldmods\sits\init.lua
23:00:46: ERROR[main]: ModError: Failed to load and run C:\Users\Matt and Betty\Downloads\minetest-0.4.5\minetest-0.4.5\bin\..\worlds\test\worldmods\sits\init.lua
--Sword In The Stone Mod By Tedypig. --Licence: Not sure, You can use/modify/redistribute how you want,
--but please give me credit for the original mod in the supplied readme.
-- Sword in the stone - SWORD
minetest.register_tool("sits:sword_of_ultimate_power"){
description "Adds a sword that can cut/chop/dig/kill anything in one hit, and lights up like the sun.",
inventory_image="sword_of_ultimate_power.png",
light_source='LIGHT_MAX',
tool_capabilities={
full_punch_interval=0.1,
max_drop_level=1,
groupcaps={
fleshy={times={[1]=100.00}, uses=0, maxlevel=2},
snappy={times={[1]=100.00}, uses=0, maxlevel=1},
choppy={times={[1]=100.00}, uses=0, maxlevel=0},
}
}
}
--Crafting
--No crafting. You must find the "Sword In The Stone" to obtain this sword.
--Sword in the stone - NODE
minetest.register_node ("sits:swordinthestone"){
description "The stone you must find to get the sword of ultimate power.",
drawtype = 'draw',
tiles = 'swordinthestone.png',
inventory_image = 'swordinthestone.png',
paramtype = 'light',
walkable = false,
sunlight_propagates = true,
drop = 'sits:sword_of_ultimate_power',
groups ={
{crumbly=10}
}
}
--Crafting
--No crafting, Must be placed by the server owner in creative mode.Menche wrote:It looks like you forgot the equals sign for "description" in the tool definition.
-- This is what you have:
minetest.register_tool("sits:sword_of_ultimate_power") { ... }
-- This is what you need:
minetest.register_tool("sits:sword_of_ultimate_power", { ... })
prestidigitator wrote:For making a tool light up, you really can't. The walking light mod is a really dirty hack that replaces nodes around a moving character with invisible lit up nodes (basically invisible torches). This doesn't work very well in water or if the player is moving past a real torch or something; the mod will actually replace other nodes as you move past them. That's not a dig at the mod creator; it's just unfortunately the only way to fudge a moving light in the game right now.
--Sword In The Stone Mod By Tedypig. --Licence: Not sure, You can use/modify/redistribute how you want,
--but please give me credit for the original mod in the supplied readme.
-- Sword in the stone - SWORD
minetest.register_tool("sits:sword_of_ultimate_power", {
description = "Adds a sword that can cut/chop/dig/kill anything in one hit.",
inventory_image="sword_of_ultimate_power.png",
tool_capabilities={
full_punch_interval=0,
max_drop_level=1,
groupcaps={
fleshy={times={[1]=100.00}, uses=0, maxlevel=1},
snappy={times={[1]=100.00}, uses=0, maxlevel=1},
choppy={times={[1]=100.00}, uses=0, maxlevel=1},
crumbly={times={[1]=100.00}, uses=0, maxlevel=1},
cracky={times={[1]=100.00}, uses=0, maxlevel=1},
}
}
})
--Crafting
--No crafting. You must find the "Sword In The Stone" to obtain this sword.
--Sword in the stone - NODE
minetest.register_node ("sits:swordinthestone", {
description = "The stone you must find to get the sword of ultimate power.",
drawtype = 'draw',
tiles = 'swordinthestone.png',
inventory_image = 'swordinthestone.png',
paramtype = 'light',
walkable = false,
sunlight_propagates = true,
drop = 'sits:sword_of_ultimate_power',
groups ={crumbly=1},
}
)
--Crafting
--No crafting, Must be placed by the server owner in creative mode.


rarkenin wrote:Is there a way to make an entity light up? Or to make it so the player is bound to an entity, but the player moves the entity(not the entity moves the player)?
prestidigitator wrote:To hurt players you need the "fleshy" group in the tool capabilities.
The callback should be relatively simple. Just call minetest.chat_send_player() or minetest.chat_send_all() in the after_dig_node() callback on the node.
fleshy={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=1},
snappy={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=1},
choppy={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=1},
crumbly={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=1},
cracky={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=1},prestidigitator wrote:Huh. And PVP is enabled? Do other weapons hurt other players?
minetest.register_tool("default:sword_steel", {
description = "Steel Sword",
inventory_image = "default_tool_steelsword.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=40, maxlevel=1},
choppy={times={[3]=0.65}, uses=40, maxlevel=0}
}
}
})Likwid H-Craft wrote:Q:How Many Players can be on one server?
Calinou wrote:This is how the damage system works: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_tool("default:sword_steel", {
description = "Steel Sword",
inventory_image = "default_tool_steelsword.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=40, maxlevel=1},
choppy={times={[3]=0.65}, uses=40, maxlevel=0}
}
}
})
You can have up to 0.8 of "punch time" (silly self-invented term). You'll deal 2 damage (= 1 heart) to entities with fleshy=3, 1 damage to entities with fleshy=2 and no damage to entities with fleshy=1.
minetest.register_tool(
"...",
{
...,
on_use = function(stack, player, pointedThing)
local pos = pointedThing.under
local obj = pointedThing.ref
if pointedThing.type == "object" and obj then
obj:set_hp(0)
if not obj:get_player_name() then
-- Non-player entities have to be removed explicitly
obj:remove()
end
elseif pointedThing.type == "node" and pos then
minetest.node_dig(pos, minetest.env:get_node(pos), player)
end
end
})
prestidigitator wrote:With THAT code? Erm.... Maybe throw some debug statements in then and see what branches of the code you are reaching with various uses. I don't know what else to tell you.
minetest.register_tool("sits:sword_of_ultimate_power", {
description = "Sword Of Ultimate Power",
inventory_image="sword_of_ultimate_power.png",
tool_capabilities={
full_punch_interval=0,
max_drop_level=1,
on_use = function(stack, player, pointedThing)
local pos = pointedThing.under
local obj = pointedThing.ref
if pointedThing.type == "object" and obj then
obj:set_hp(0)
if not obj:get_player_name() then
-- Non-player entities have to be removed explicitly
obj:remove()
end
elseif pointedThing.type == "node" and pos then
minetest.node_dig(pos, minetest.env:get_node(pos), player)
end
end
}
})
print("DEBUG sword.on_use: pointedThing.type = "..(pointedThing.type or "nil")..", pos = "..(pos and minetest.pos_to_string(pos) or "nil")..", obj = "..(obj and (obj:get_player_name() or "(NP entity)") or "nil"))
18:29:30: ACTION[ServerThread]: Teddypig joins game. List of players: Teddypig
Font size: 8 17
18:29:39: ACTION[ServerThread]: Teddypig uses sits:sword_of_ultimate_power, pointing at [node under=36,19,-192 above=36,20,-192]
DEBUG sword.on_use: pointedThing.type = node, pos = (36,19,-192), obj = nil
node_dig
18:29:39: ACTION[ServerThread]: Teddypig digs default:dirt_with_grass at (36,19,-192)
18:29:40: ACTION[ServerThread]: Teddypig uses sits:sword_of_ultimate_power, pointing at [node under=36,19,-191 above=36,20,-191]
DEBUG sword.on_use: pointedThing.type = node, pos = (36,19,-191), obj = nil
node_dig
18:29:40: ACTION[ServerThread]: Teddypig digs default:dirt_with_grass at (36,19,-191)
18:29:44: ACTION[ServerThread]: Teddypig uses sits:sword_of_ultimate_power, pointing at [object 5]
DEBUG sword.on_use: pointedThing.type = object, pos = nil, obj =
18:29:45: ACTION[ServerThread]: Teddypig uses sits:sword_of_ultimate_power, pointing at [object 5]
DEBUG sword.on_use: pointedThing.type = object, pos = nil, obj =
18:29:46: ACTION[ServerThread]: Teddypig uses sits:sword_of_ultimate_power, pointing at [object 5]
DEBUG sword.on_use: pointedThing.type = object, pos = nil, obj =
18:29:50: ACTION[ServerThread]: Teddypig uses sits:sword_of_ultimate_power, pointing at [object 5]
DEBUG sword.on_use: pointedThing.type = object, pos = nil, obj =
18:29:59: ACTION[ServerThread]: Teddypig uses sits:sword_of_ultimate_power, pointing at [node under=22,23,-185 above=23,23,-185]
DEBUG sword.on_use: pointedThing.type = node, pos = (22,23,-185), obj = nil
node_dig
18:29:59: ACTION[ServerThread]: Teddypig digs default:stone at (22,23,-185)
18:30:00: ACTION[ServerThread]: Teddypig uses sits:sword_of_ultimate_power, pointing at [node under=22,23,-186 above=23,23,-186]
DEBUG sword.on_use: pointedThing.type = node, pos = (22,23,-186), obj = nil
node_dig
18:30:00: ACTION[ServerThread]: Teddypig digs default:stone at (22,23,-186)
18:30:00: ACTION[ServerThread]: Teddypig uses sits:sword_of_ultimate_power, pointing at [node under=22,23,-187 above=23,23,-187]
DEBUG sword.on_use: pointedThing.type = node, pos = (22,23,-187), obj = nil
node_dig
18:30:00: ACTION[ServerThread]: Teddypig digs default:stone at (22,23,-187)
18:30:41: ACTION[ServerThread]: MOBF: Your mob table: 20871680 dropt into water moving to (2.4217445850372,3.2999999523163,-162.2046661377) state: drop
18:30:43: ERROR[main]: ServerEnvironment::deactivateFarObjects(): id=5 m_static_exists=true but static data doesn't actually exist in (4,0,-12)
WARNING: StaticObjectList::remove(): id=5 not found
local pName = obj:get_player_name()
if not pName or pName == "" then ....
minetest.register_tool("sits:sword_of_ultimate_power", {
description = "Sword Of Ultimate Power",
inventory_image="sword_of_ultimate_power.png",
on_use = function(stack, player, pointedThing)
local pos = pointedThing.under
local obj = pointedThing.ref
if pointedThing.type == "object" and obj then
obj:set_hp(0)
if not obj:get_player_name() then
-- Non-player entities have to be removed explicitly
obj:remove()
end
elseif pointedThing.type == "node" and pos then
minetest.node_dig(pos, minetest.env:get_node(pos), player)
end
end
})Users browsing this forum: No registered users and 8 guests