Make things quieter - remove debugging info or move to infostream
parent
26146c84e7
commit
c75e110d82
|
@ -45,8 +45,8 @@
|
|||
if (not empty_book) and (not book_written) then
|
||||
return
|
||||
end
|
||||
print("fields1:"..dump(fields))
|
||||
print("data1:"..dump(data))
|
||||
--print("fields1:"..dump(fields))
|
||||
--print("data1:"..dump(data))
|
||||
local data = minetest.deserialize(stack:get_metadata())
|
||||
if not data then data = {} end
|
||||
data.title, data.text, data.owner =
|
||||
|
@ -71,8 +71,8 @@
|
|||
end
|
||||
|
||||
else
|
||||
print("fields:"..dump(fields))
|
||||
print("data:"..dump(data))
|
||||
--print("fields:"..dump(fields))
|
||||
--print("data:"..dump(data))
|
||||
|
||||
if fields.title=="" and fields.text=="" then
|
||||
if minetest.get_item_group(stack:get_name(), "locked_book") == 1 then
|
||||
|
|
|
@ -62,7 +62,7 @@ minetest.register_node("campfire:campfire", {
|
|||
return 0
|
||||
end
|
||||
elseif listname == "src" then
|
||||
print(player:get_player_name().." put item into campfire")
|
||||
--print(player:get_player_name().." put item into campfire")
|
||||
meta:set_string("owner",player:get_player_name())
|
||||
return stack:get_count()
|
||||
elseif listname == "dst" then
|
||||
|
@ -132,7 +132,7 @@ minetest.register_node("campfire:campfire_burning", {
|
|||
return 0
|
||||
end
|
||||
elseif listname == "src" then
|
||||
print(player:get_player_name().." put item into campfire")
|
||||
--print(player:get_player_name().." put item into campfire")
|
||||
meta:set_string("owner",player:get_player_name())
|
||||
return stack:get_count()
|
||||
elseif listname == "dst" then
|
||||
|
|
|
@ -967,7 +967,7 @@ end
|
|||
|
||||
function default.furnace_available(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
print("Furnace in_use: "..tostring(meta:get_int("in_use")))
|
||||
--print("Furnace in_use: "..tostring(meta:get_int("in_use")))
|
||||
if meta:get_int("in_use") == 1 then
|
||||
return false
|
||||
else
|
||||
|
@ -1022,7 +1022,7 @@ minetest.register_node("default:furnace", {
|
|||
return 0
|
||||
end
|
||||
elseif listname == "src" then
|
||||
print(player:get_player_name().." put item into furnace")
|
||||
--print(player:get_player_name().." put item into furnace")
|
||||
meta:set_string("owner",player:get_player_name())
|
||||
return stack:get_count()
|
||||
elseif listname == "dst" then
|
||||
|
@ -1115,7 +1115,7 @@ minetest.register_node("default:furnace_active", {
|
|||
return 0
|
||||
end
|
||||
elseif listname == "src" then
|
||||
print(player:get_player_name().." put item into furnace")
|
||||
--print(player:get_player_name().." put item into furnace")
|
||||
meta:set_string("owner",player:get_player_name())
|
||||
return stack:get_count()
|
||||
elseif listname == "dst" then
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
-- basic foods
|
||||
-- =====================================
|
||||
|
||||
print("Food Mod - Version 2.2")
|
||||
minetest.log("action","Food Mod - Version 2.2")
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
|
@ -31,14 +31,14 @@ function food.support(group,mod,item)
|
|||
food.atsup[group] = true
|
||||
if not minetest.get_modpath(mod) then
|
||||
if food.debug then
|
||||
print("[FOOD MOD DEBUG] mod '"..mod.."' is not installed")
|
||||
minetest.log("info","[FOOD MOD DEBUG] mod '"..mod.."' is not installed")
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local data = minetest.registered_items[item]
|
||||
if not data then
|
||||
print("[FOOD MOD WARNING] item '"..item.."' not found")
|
||||
minetest.log("info","[FOOD MOD WARNING] item '"..item.."' not found")
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -71,7 +71,7 @@ function food.asupport(group,add)
|
|||
end
|
||||
|
||||
if food.debug then
|
||||
print("registering "..group.." inbuilt definition")
|
||||
minetest.log("info","registering "..group.." inbuilt definition")
|
||||
end
|
||||
|
||||
add()
|
||||
|
@ -126,14 +126,14 @@ if food.debug then
|
|||
minetest.after(0, function()
|
||||
for name, val in pairs(food.atsup) do
|
||||
if not food.df[name] then
|
||||
print("[FOOD MOD DEBUG] Ingredient "..name.." has no built in equiv")
|
||||
minetest.log("info","[FOOD MOD DEBUG] Ingredient "..name.." has no built in equiv")
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
for name, val in pairs(food.df) do
|
||||
if not food.atsup[name] then
|
||||
print("[FOOD MOD DEBUG] Inbuilt ingredient "..name.." has no supported external equiv")
|
||||
minetest.log("info","[FOOD MOD DEBUG] Inbuilt ingredient "..name.." has no supported external equiv")
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -144,7 +144,7 @@ handle_schematics.analyze_mc_schematic_file = function( path )
|
|||
local compressed_data = file:read( "*all" );
|
||||
--local data_string = minetest.decompress(compressed_data, "deflate" );
|
||||
local data_string = compressed_data; -- TODO
|
||||
print('FILE SIZE: '..tostring( string.len( data_string ))); -- TODO
|
||||
--print('FILE SIZE: '..tostring( string.len( data_string ))); -- TODO
|
||||
file.close(file)
|
||||
|
||||
|
||||
|
@ -161,7 +161,7 @@ print('FILE SIZE: '..tostring( string.len( data_string ))); -- TODO
|
|||
or not( mc_schematic_data.Length )
|
||||
or not( mc_schematic_data.Blocks )
|
||||
or not( mc_schematic_data.Data )) then
|
||||
print('[analyze_mc_schematic_file] ERROR: Failed to analyze '..tostring( path..'.schematic'));
|
||||
minetest.log('error','[analyze_mc_schematic_file] ERROR: Failed to analyze '..tostring( path..'.schematic'));
|
||||
return nil;
|
||||
end
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ handle_schematics.store_mts_file = function( path, data )
|
|||
local compressed_data = minetest.compress( node_data, "deflate" );
|
||||
file:write( compressed_data );
|
||||
file.close(file);
|
||||
print('SAVING '..path..'.mts (converted from .we).');
|
||||
--print('SAVING '..path..'.mts (converted from .we).');
|
||||
end
|
||||
|
||||
|
||||
|
@ -269,7 +269,7 @@ handle_schematics.analyze_file = function( file_name, origin_offset, store_as_mt
|
|||
end
|
||||
-- print error message only if all import methods failed
|
||||
if( not( res )) then
|
||||
print('[handle_schematics] ERROR: Failed to import file \"'..tostring( file_name )..'\"[.mts|.we|.wem|.schematic]');
|
||||
minetest.log('error','[handle_schematics] ERROR: Failed to import file \"'..tostring( file_name )..'\"[.mts|.we|.wem|.schematic]');
|
||||
-- convert to .mts for later usage
|
||||
elseif( store_as_mts ) then
|
||||
handle_schematics.store_mts_file( store_as_mts, res );
|
||||
|
|
|
@ -54,7 +54,7 @@ local handle_schematics_get_meta_table = function( pos, all_meta, start_pos )
|
|||
and m.fields.infotext == "\"\"") then
|
||||
-- also consider signs empty if their text has been set once and deleted afterwards
|
||||
if( not( m.fields.text ) or m.fields.text == "" ) then
|
||||
print('SKIPPING empty sign AT '..minetest.pos_to_string( pos)..' while saving metadata.');
|
||||
--print('SKIPPING empty sign AT '..minetest.pos_to_string( pos)..' while saving metadata.');
|
||||
empty_meta = true;
|
||||
end
|
||||
|
||||
|
@ -66,7 +66,7 @@ print('SKIPPING empty sign AT '..minetest.pos_to_string( pos)..' while saving me
|
|||
and (n.name=='default:chest' or n.name=='default:chest_locked' or n.name=='default:bookshelf'
|
||||
or n.name=='default:furnace' or n.name=='default:furnace_active'
|
||||
or n.name=='cottages:shelf' or n.name=='cottages:anvil' or n.name=='cottages:threshing_floor' )) then
|
||||
print('SKIPPING empty '..tostring(n.name)..' AT '..minetest.pos_to_string( pos )..' while saving metadata.');
|
||||
--print('SKIPPING empty '..tostring(n.name)..' AT '..minetest.pos_to_string( pos )..' while saving metadata.');
|
||||
empty_meta = true;
|
||||
end
|
||||
end
|
||||
|
|
|
@ -248,7 +248,7 @@ local function generate_building_translate_nodenames( nodenames, replacements, c
|
|||
if( mg_villages and mg_villages.print ) then
|
||||
mg_villages.print( mg_villages.DEBUG_LEVEL_WARNING, msg );
|
||||
else
|
||||
print( msg );
|
||||
minetest.log('info', msg );
|
||||
end
|
||||
msg = nil;
|
||||
new_nodes[ i ].ignore = 1; -- keep the old content
|
||||
|
@ -307,7 +307,7 @@ local function generate_building(pos, minp, maxp, data, param2_data, a, extranod
|
|||
mg_villages.print( mg_villages.DEBUG_LEVEL_WARNING,
|
||||
'ERROR: This village was created using diffrent buildings than those known know. Cannot place unknown building.');
|
||||
else
|
||||
print( 'ERROR: Size information about this building differs. Cannot place building.');
|
||||
minetest.log('error', 'ERROR: Size information about this building differs. Cannot place building.');
|
||||
end
|
||||
return;
|
||||
end
|
||||
|
|
|
@ -15,7 +15,7 @@ save_restore.save_data = function( filename, data )
|
|||
file:write( minetest.serialize( data ));
|
||||
file:close();
|
||||
else
|
||||
print("[save_restore] Error: Savefile '"..tostring( path ).."' could not be written.");
|
||||
minetest.log("error","[save_restore] Error: Savefile '"..tostring( path ).."' could not be written.");
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -28,7 +28,7 @@ save_restore.restore_data = function( filename )
|
|||
file:close();
|
||||
return minetest.deserialize( data );
|
||||
else
|
||||
print("[save_restore] Error: Savefile '"..tostring( path ).."' not found.");
|
||||
minetest.log("error","[save_restore] Error: Savefile '"..tostring( path ).."' not found.");
|
||||
return {}; -- return empty table
|
||||
end
|
||||
end
|
||||
|
|
|
@ -87,7 +87,6 @@ minetest.register_chatcommand("cast",{
|
|||
desc = "Casts a spell at an optional target",
|
||||
privs = {},
|
||||
func = function(name, param)
|
||||
print(param)
|
||||
local id, target = string.match(param, "([^ ]+) (.+)")
|
||||
if id == nil and target == nil then
|
||||
id = param
|
||||
|
|
|
@ -172,9 +172,9 @@ minetest.register_on_generated( function (minp, maxp, blockseed)
|
|||
end
|
||||
|
||||
if notify.temple ~= nil then
|
||||
print("Temple generated")
|
||||
minetest.log("info","Temple generated")
|
||||
for k,v in ipairs(notify.temple) do
|
||||
print(minetest.pos_to_string(v))
|
||||
minetest.log("info",minetest.pos_to_string(v))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,7 +17,7 @@ mg_villages.DEBUG_LEVEL_TIMING = 3 -- 3: detailled performance information
|
|||
|
||||
mg_villages.print = function( level, msg )
|
||||
if( level <= mg_villages.DEBUG_LEVEL ) then
|
||||
print( "[mg_villages] "..msg );
|
||||
--print( "[mg_villages] "..msg );
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ end
|
|||
zcg.need_load_all = true
|
||||
|
||||
zcg.load_all = function()
|
||||
print("Loading all crafts, this may take some time...")
|
||||
minetest.log("action","Loading all crafts, this may take some time...")
|
||||
local i = 0
|
||||
for name, item in pairs(minetest.registered_items) do
|
||||
if (name and name ~= "") then
|
||||
|
@ -95,7 +95,7 @@ zcg.load_all = function()
|
|||
end
|
||||
table.sort(zcg.itemlist)
|
||||
zcg.need_load_all = false
|
||||
print("All crafts loaded !")
|
||||
minetest.log("action","All crafts loaded !")
|
||||
end
|
||||
|
||||
zcg.formspec = function(pn)
|
||||
|
|
|
@ -202,8 +202,8 @@ function mobs:register_mob(name, def)
|
|||
yaw = yaw - 360
|
||||
end
|
||||
|
||||
print("Yaw: "..tostring(yaw))
|
||||
print("FOV: "..tostring(self.fov))
|
||||
--print("Yaw: "..tostring(yaw))
|
||||
--print("FOV: "..tostring(self.fov))
|
||||
local vx = math.sin(yaw)
|
||||
local vz = math.cos(yaw)
|
||||
local ds = math.sqrt(vx^2 + vz^2)
|
||||
|
@ -211,15 +211,15 @@ function mobs:register_mob(name, def)
|
|||
local d = { x = vx / ds, z = vz / ds }
|
||||
local p = { x = pos.x / ps, z = pos.z / ps }
|
||||
|
||||
print("DS "..tostring(ds))
|
||||
print("PS "..tostring(ps))
|
||||
print("D: x="..tostring(d.x)..", z="..tostring(d.z))
|
||||
print("P: x="..tostring(p.x)..", z="..tostring(p.z))
|
||||
--print("DS "..tostring(ds))
|
||||
--print("PS "..tostring(ps))
|
||||
--print("D: x="..tostring(d.x)..", z="..tostring(d.z))
|
||||
--print("P: x="..tostring(p.x)..", z="..tostring(p.z))
|
||||
|
||||
local an = ( d.x * p.x ) + ( d.z * p.z )
|
||||
print("AN: "..tostring(an))
|
||||
--print("AN: "..tostring(an))
|
||||
local a = math.deg ( math.acos( an ) )
|
||||
print("A: "..tostring(a))
|
||||
--print("A: "..tostring(a))
|
||||
if a > ( self.fov / 2 ) then
|
||||
return false
|
||||
else
|
||||
|
@ -527,7 +527,7 @@ end
|
|||
function mobs:spawn_mob(pos,name)
|
||||
-- make sure the nodes above are walkable
|
||||
|
||||
minetest.log("action","Attempting to spawn "..name)
|
||||
minetest.log("info","Attempting to spawn "..name)
|
||||
local nodename = minetest.get_node(pos).name
|
||||
if minetest.registered_nodes[nodename] ~= nil then
|
||||
if minetest.registered_nodes[nodename].walkable == true or minetest.registered_nodes[nodename].walkable == nil or nodename == "default:water_source" then
|
||||
|
@ -547,7 +547,7 @@ function mobs:spawn_mob(pos,name)
|
|||
if mob ~= nil then
|
||||
mob = mob:get_luaentity()
|
||||
if mob ~= nil then
|
||||
minetest.log("action",name.." spawned at "..minetest.pos_to_string(pos))
|
||||
minetest.log("info",name.." spawned at "..minetest.pos_to_string(pos))
|
||||
local newHP = mob.hp_min + math.floor( mob.hp_max * distance_rating )
|
||||
mob.object:set_hp( newHP )
|
||||
mob.state = "walk" -- make them walk when they spawn so they walk away from their original spawn position
|
||||
|
|
|
@ -56,7 +56,6 @@ mobs:register_arrow("mobs:fireball", {
|
|||
textures = {"mobs_fireball.png"},
|
||||
velocity = 5,
|
||||
hit_player = function(self, player)
|
||||
print("hit player")
|
||||
local s = self.object:getpos()
|
||||
local p = player:getpos()
|
||||
local vec = {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z}
|
||||
|
@ -81,7 +80,6 @@ mobs:register_arrow("mobs:fireball", {
|
|||
end
|
||||
end,
|
||||
hit_node = function(self, pos, node)
|
||||
print("hit node")
|
||||
for dx=-1,1 do
|
||||
for dy=-2,1 do
|
||||
for dz=-1,1 do
|
||||
|
|
|
@ -188,7 +188,7 @@ function blacksmith_globalstep(dtime)
|
|||
if inv:is_empty("src") then
|
||||
-- empty the fuel
|
||||
inv:set_stack("fuel",1,nil)
|
||||
print("smelting done")
|
||||
--print("smelting done")
|
||||
-- they are done smelting
|
||||
local dlist = inv:get_list("dst")
|
||||
-- TODO return smelted items to the player
|
||||
|
|
|
@ -31,7 +31,6 @@ end,
|
|||
return minetest.check_player_privs(player:get_player_name(),{ immortal=true })
|
||||
end,
|
||||
on_punch = function (pos, node, puncher, pointed_thing)
|
||||
print("punched")
|
||||
if minetest.check_player_privs(puncher:get_player_name(),{ immortal=true }) then
|
||||
local meta = minetest.get_meta(pos)
|
||||
local entity = meta:get_string("entity")
|
||||
|
@ -45,7 +44,7 @@ end,
|
|||
end
|
||||
local spawnpos = pos
|
||||
spawnpos.y = spawnpos.y + 4
|
||||
minetest.log("action","Spawn block spawning "..tostring(entity).." at "..minetest.pos_to_string(spawnpos))
|
||||
minetest.log("info","Spawn block spawning "..tostring(entity).." at "..minetest.pos_to_string(spawnpos))
|
||||
mobs:spawn_mob(spawnpos,entity)
|
||||
else
|
||||
minetest.log("action","No entity set in spawner block at "..minetest.pos_to_string(pos))
|
||||
|
@ -86,7 +85,7 @@ minetest.register_abm({
|
|||
|
||||
local spawnpos = { x=pos.x, y=pos.y, z=pos.z }
|
||||
spawnpos.y = spawnpos.y + 6
|
||||
minetest.log("action","Spawn block spawning "..tostring(entity).." at "..minetest.pos_to_string(spawnpos))
|
||||
minetest.log("info","Spawn block spawning "..tostring(entity).." at "..minetest.pos_to_string(spawnpos))
|
||||
local r = mobs:spawn_mob(spawnpos,entity)
|
||||
if r == -1 then
|
||||
-- they are spawning in a block, remove this spawner
|
||||
|
@ -136,7 +135,7 @@ local numNPCs = math.random(0,1)
|
|||
|
||||
if barbarian_village == true then
|
||||
local barbarian = mobs:get_random('barbarian')
|
||||
minetest.log("action","Spawning "..barbarian.." at "..minetest.pos_to_string(npos))
|
||||
minetest.log("info","Spawning "..barbarian.." at "..minetest.pos_to_string(npos))
|
||||
local mob = minetest.add_entity(npos, barbarian)
|
||||
if mob then
|
||||
local distance_rating = ( ( get_distance(game_origin,npos) ) / 15000 )
|
||||
|
@ -155,7 +154,7 @@ local numNPCs = math.random(0,1)
|
|||
else
|
||||
|
||||
local npc = mobs:get_random('npc')
|
||||
minetest.log("action","Spawning "..npc.." at "..minetest.pos_to_string(npos))
|
||||
minetest.log("info","Spawning "..npc.." at "..minetest.pos_to_string(npos))
|
||||
local mob = minetest.add_entity(npos, npc)
|
||||
if mob then
|
||||
mob = mob:get_luaentity()
|
||||
|
|
|
@ -14,7 +14,7 @@ function mobs.on_step(self,dtime)
|
|||
end
|
||||
end
|
||||
if player_count == 0 and self.state ~= "attack" then
|
||||
minetest.log("action","lifetimer expired, removed mob "..self.name)
|
||||
minetest.log("info","lifetimer expired, removed mob "..self.name)
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
|
|
|
@ -17,9 +17,9 @@ quests.chest.go = function(npc,player)
|
|||
default.drop_item(pos,"default:chest_locked",vec,acc)
|
||||
end
|
||||
if npc.rewards ~= nil then
|
||||
print("Get rewards")
|
||||
--print("Get rewards")
|
||||
for _, r in pairs(npc.rewards) do
|
||||
print(r.item)
|
||||
--print(r.item)
|
||||
if math.random(0,100) < r.chance then
|
||||
default.drop_item(pos,r.item, vec, acc)
|
||||
end
|
||||
|
|
|
@ -15,15 +15,14 @@ function skills.set_default_skills ( name )
|
|||
local pskills = pd.get(name,"skills")
|
||||
if pskills == nil then pskills = {} end
|
||||
for k,v in pairs(skills.available_skills) do
|
||||
print(name.." checking for skill "..v.desc)
|
||||
minetest.log("info",name.." checking for skill "..v.desc)
|
||||
if pskills[k] == nil then
|
||||
print("Doesn't have skill "..tostring(k))
|
||||
minetest.log("info","Doesn't have skill "..tostring(k))
|
||||
pskills[k] = { level = 1, exp = 0 }
|
||||
else
|
||||
print("Has skill "..tostring(k))
|
||||
minetest.log("info","Has skill "..tostring(k))
|
||||
end
|
||||
end
|
||||
print("Result!")
|
||||
default.tprint(pskills,4)
|
||||
pd.set(name,"skills",pskills)
|
||||
end
|
||||
|
@ -173,7 +172,6 @@ function skills_on_dieplayer (player)
|
|||
local name = player:get_player_name()
|
||||
local level = skills.get_player_level(name)
|
||||
local decrease = level.exp * -0.1
|
||||
print(tostring(decrease))
|
||||
skills.add_exp(name,decrease)
|
||||
end
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ minetest.register_node( 'vendor:signal_vendor_off', {
|
|||
paramtype2 = 'facedir',
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||
after_place_node = function( pos, placer )
|
||||
print( 'Placed a new signal vendor')
|
||||
--print( 'Placed a new signal vendor')
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
meta:set_int("cost", 0)
|
||||
meta:set_int("limit", 0)
|
||||
|
|
Loading…
Reference in New Issue