Page 1 of 1

Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Fri May 20, 2016 15:04
by Lejo
I show you short a part of my mod:
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
blood.tools = {}

minetest.register_tool("blood:victimknife", {
   description = "Victimknife",
   inventory_image = "Victimknife.png",
   on_use = function(user)
      local player = user:get_name()
         player:set_hp(player:get_hp--[[this get_hp is the problem]]()-2)
         player:set_blood(player:get_blood()+20)
   end,
})

minetest.register_craft({
   output = 'blood:victimknife',
   recipe = {
      {'',   'default:glass',   'default:glass'},
      {'',   'default:gold_ingot',   'default:glass'},
      {'default:steel_ingot',   '',   ''},
   }
})


I allways get this Error:
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
2016-05-28 11:53:11: ERROR[Main]: ServerError: Lua: Runtime error from mod 'blood' in callback item_OnUse(): /home/user/minetest/bin/../mods/blood/tools.lua:8: attempt to call method 'get_hp' (a nil value)
2016-05-28 11:53:11: ERROR[Main]: stack traceback:
2016-05-28 11:53:11: ERROR[Main]:    /home/user/minetest/bin/../mods/blood/tools.lua:8: in function </home/user/minetest/bin/../mods/blood/tools.lua:6>
2016-05-28 11:53:11: [Server]: [Chatplus] Saving data
2016-05-28 11:53:11: ACTION[Server]: singleplayer leaves game. List of players:
2016-05-28 11:53:11: WARNING[Main]: [xban] Unable to save database: Write failed
2016-05-28 11:53:11: ACTION[Main]: [playereffects] Server shuts down. Rescuing data into playereffects.mt
2016-05-28 11:53:11: ACTION[Main]: [playereffects] Wrote playereffects data into /home/user/minetest/bin/../worlds/jzuij/playereffects.mt.


Please help.

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Fri May 20, 2016 20:06
by MineYoshi
That errors and bugs, are from the mods...
The mods that aren't working alright are: pipeworks and mesecons.

Generally i recommend you to download a newer version, that be compatible with the 0.4.14, maybe you have an old version that doesn't works with the new version...

If you still have the error with the new version of the mod, you can request help or a fix in the official mod thread.
Surely someone answer you.

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Sun May 22, 2016 07:34
by snowflake
They're are the probs with mods.. u should get the new version of mods for minetest 0.4.14 , i use ubuntu as well , it works fine

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Sun May 22, 2016 10:24
by Lejo
I install pipeworks mesecons moreblocks and moreores again it doesn't work now.
If i push a button a lever or a switch they doesn't active.
In the moment i install a mod.
It allways says:
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
get_hp (a nil value)

The problem is it in much mods.
I don't unerstand why that is a nil value.
Other mods use it too.
I install the portable version from here the same Problem: https://forum.minetest.net/viewtopic.php?f=42&t=3837
Please help.
Here part of my mod:
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
blood.tools = {}

minetest.register_tool("blood:victimknife", {
   description = "Victimknife",
   inventory_image = "Victimknife.png",
   on_use = function(name)
      local player = name
         minetest.set_hp(player, (minetest.get_hp(player)-2)) -- in this line is the Problem.
         set_blood(player, (get_blood(player)+20))
   end,
})

minetest.register_craft({
   output = 'blood:victimknife',
   recipe = {
      {'',   'default:glass',   'default:glass'},
      {'',   'default:gold_ingot',   'default:glass'},
      {'default:steel_ingot',   '',   ''},
   }
})

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Sun May 22, 2016 10:33
by Krock
Lejo wrote:
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
blood.tools = {}

minetest.register_tool("blood:victimknife", {
   description = "Victimknife",
   inventory_image = "Victimknife.png",
   on_use = function(name)
      local player = name
         minetest.set_hp(player, (minetest.get_hp(player)-2)) -- in this line is the Problem.
         set_blood(player, (get_blood(player)+20))
   end,
})


The minetest table does not contain these functions. They can be found in the player object.
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_use = function(name)
   local player = minetest.get_player_by_name(name)
   player:set_hp(player:get_hp() - 2)
end

See also: https://github.com/minetest/minetest/bl ... .txt#L2585

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Sun May 22, 2016 10:56
by Lejo
I test it but i get this Error:
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
2016-05-22 12:55:15: ERROR[Main]: ServerError: Lua: Runtime error from mod 'blood' in callback item_OnUse(): /home/user/minetest/bin/../mods/blood/tools.lua:7: bad argument #1 to 'get_player_by_name' (string expected, got userdata)
2016-05-22 12:55:15: ERROR[Main]: stack traceback:
2016-05-22 12:55:15: ERROR[Main]:    [C]: in function 'get_player_by_name'
2016-05-22 12:55:15: ERROR[Main]:    /home/user/minetest/bin/../mods/blood/tools.lua:7: in function </home/user/minetest/bin/../mods/blood/tools.lua:6>

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Thu May 26, 2016 09:16
by Lejo
All works now fine the shift click too.

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Sat May 28, 2016 09:56
by Lejo
I show you short a part of my mod:
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
blood.tools = {}

minetest.register_tool("blood:victimknife", {
   description = "Victimknife",
   inventory_image = "Victimknife.png",
   on_use = function(user)
      local player = user:get_name()
         player:set_hp(player:get_hp--[[this get_hp is the problem]]()-2)
         player:set_blood(player:get_blood()+20)
   end,
})

minetest.register_craft({
   output = 'blood:victimknife',
   recipe = {
      {'',   'default:glass',   'default:glass'},
      {'',   'default:gold_ingot',   'default:glass'},
      {'default:steel_ingot',   '',   ''},
   }
})


I allways get this Error:
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
2016-05-28 11:53:11: ERROR[Main]: ServerError: Lua: Runtime error from mod 'blood' in callback item_OnUse(): /home/user/minetest/bin/../mods/blood/tools.lua:8: attempt to call method 'get_hp' (a nil value)
2016-05-28 11:53:11: ERROR[Main]: stack traceback:
2016-05-28 11:53:11: ERROR[Main]:    /home/user/minetest/bin/../mods/blood/tools.lua:8: in function </home/user/minetest/bin/../mods/blood/tools.lua:6>
2016-05-28 11:53:11: [Server]: [Chatplus] Saving data
2016-05-28 11:53:11: ACTION[Server]: singleplayer leaves game. List of players:
2016-05-28 11:53:11: WARNING[Main]: [xban] Unable to save database: Write failed
2016-05-28 11:53:11: ACTION[Main]: [playereffects] Server shuts down. Rescuing data into playereffects.mt
2016-05-28 11:53:11: ACTION[Main]: [playereffects] Wrote playereffects data into /home/user/minetest/bin/../worlds/jzuij/playereffects.mt.


Please help.

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Sun May 29, 2016 09:44
by azekill_DIABLO
what do you want your Victimknife does?

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Sun May 29, 2016 09:52
by Lejo
it damage you 2 hp and grant you 20 blood.
Blood in the mod.

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Sun May 29, 2016 10:02
by cd2
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
blood.tools = {}

minetest.register_tool("blood:victimknife", {
   description = "Victimknife",
   inventory_image = "Victimknife.png",
   on_use = function(user)
         if not user or not user:is_player() then
              return
         end
         user:set_hp(user:get_hp()-2)
   end,
})

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Sun May 29, 2016 10:16
by Lejo
then i get the same error just like before get_hp (a nil value)

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Sun May 29, 2016 10:25
by cd2
Lejo wrote:then i get the same error just like before get_hp (a nil value)

Try it again now. I added
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
if not user or not user:is_player() then
   return
end

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Sun May 29, 2016 10:35
by Lejo
Now I get this Error:
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
2016-05-29 12:33:32: ERROR[Main]: ServerError: Lua: Runtime error from mod 'blood' in callback item_OnUse(): /home/user/minetest/bin/../mods/blood/tools.lua:7: attempt to call method 'is_player' (a nil value)
2016-05-29 12:33:32: ERROR[Main]: stack traceback:
2016-05-29 12:33:32: ERROR[Main]:    /home/user/minetest/bin/../mods/blood/tools.lua:7: in function </home/user/minetest/bin/../mods/blood/tools.lua:6>

Re: Problem with the new 0.4.14 Version in Ubuntu.

PostPosted: Mon May 30, 2016 13:32
by snowflake
lol again.... this is still mod error from blood