Problem with the new 0.4.14 Version in Ubuntu.

Post Reply
User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Problem with the new 0.4.14 Version in Ubuntu.

by Lejo » Post

I show you short a part of my mod:

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:

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.
Last edited by Lejo on Sat May 28, 2016 09:57, edited 3 times in total.

User avatar
MineYoshi
Member
Posts: 5373
Joined: Wed Jul 08, 2015 13:20
Contact:

Re: Problem with the new 0.4.14 Version in Ubuntu.

by MineYoshi » Post

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.
Have a nice day! :D

snowflake
Member
Posts: 215
Joined: Mon Nov 16, 2015 16:50

Re: Problem with the new 0.4.14 Version in Ubuntu.

by snowflake » Post

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

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: Problem with the new 0.4.14 Version in Ubuntu.

by Lejo » Post

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:

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: viewtopic.php?f=42&t=3837
Please help.
Here part of my mod:

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',	'',	''},
	}
})

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Problem with the new 0.4.14 Version in Ubuntu.

by Krock » Post

Lejo wrote:

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.

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
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: Problem with the new 0.4.14 Version in Ubuntu.

by Lejo » Post

I test it but i get this Error:

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>
Last edited by Lejo on Sat May 28, 2016 09:50, edited 1 time in total.

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: Problem with the new 0.4.14 Version in Ubuntu.

by Lejo » Post

All works now fine the shift click too.

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: Problem with the new 0.4.14 Version in Ubuntu.

by Lejo » Post

I show you short a part of my mod:

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:

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.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Problem with the new 0.4.14 Version in Ubuntu.

by azekill_DIABLO » Post

what do you want your Victimknife does?
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: Problem with the new 0.4.14 Version in Ubuntu.

by Lejo » Post

it damage you 2 hp and grant you 20 blood.
Blood in the mod.

User avatar
cd2
Member
Posts: 562
Joined: Mon Jun 01, 2015 06:30
GitHub: cdqwertz
In-game: cd cd2
Location: Linux
Contact:

Re: Problem with the new 0.4.14 Version in Ubuntu.

by cd2 » Post

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,
})
Last edited by cd2 on Sun May 29, 2016 10:24, edited 2 times in total.

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: Problem with the new 0.4.14 Version in Ubuntu.

by Lejo » Post

then i get the same error just like before get_hp (a nil value)

User avatar
cd2
Member
Posts: 562
Joined: Mon Jun 01, 2015 06:30
GitHub: cdqwertz
In-game: cd cd2
Location: Linux
Contact:

Re: Problem with the new 0.4.14 Version in Ubuntu.

by cd2 » Post

Lejo wrote:then i get the same error just like before get_hp (a nil value)
Try it again now. I added

Code: Select all

if not user or not user:is_player() then
   return
end

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: Problem with the new 0.4.14 Version in Ubuntu.

by Lejo » Post

Now I get this Error:

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>

snowflake
Member
Posts: 215
Joined: Mon Nov 16, 2015 16:50

Re: Problem with the new 0.4.14 Version in Ubuntu.

by snowflake » Post

lol again.... this is still mod error from blood

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests