[Mod] Hunger with HUD bar [1.1.4] [hbhunger]

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Hunger with HUD bar [0.3.2] [hbhunger]

by Wuzzy » Post

Sorry, I don't get much smarter by reading your commit list on your modified hbhunger mods.

Most commits just seem to tweak some server-related values. Most of the other commits which actually fix bugs are already included.

I don't understand this commit:
“Prevent hbhunger from searching exhaustion value of random items”—Why? / What was the bug?

If you have found a particular bug not in 0.3.2, please report it here so I can fix it. Patches are welcome, of course.

User avatar
Clouds
Member
Posts: 102
Joined: Sat Aug 01, 2015 01:58
In-game: Cloud

Re: [Mod] Hunger with HUD bar [0.3.2] [hbhunger]

by Clouds » Post

I suggest making it so if hunger is full then no longer able to eat other wise people can waste food by eating and getting nothing from it.

User avatar
benrob0329
Member
Posts: 1341
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Re: [Mod] Hunger with HUD bar [0.3.2] [hbhunger]

by benrob0329 » Post

Could you please add support for the crops mod?

viewtopic.php?f=11&t=11795#p175593

User avatar
benrob0329
Member
Posts: 1341
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Re: [Mod] Hunger with HUD bar [0.3.2] [hbhunger]

by benrob0329 » Post

Could you make it so that it replaced the eat function like Better Hud/Hinger does?

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Hunger with HUD bar [0.3.2] [hbhunger]

by Wuzzy » Post

Version 0.4.0 released!
It was about time for this update, the mod was very outdated and it was missing support for a lot of foods.

This mod supports now overwrites the eat function like in the hunger mod, as suggested by benrob0329. This also means the crops mod is automatically supported.

Full changelog:
- Generic eating functionality, items using the minetest.item_eat are now automatically supported
- Change health bar and icon when poisoned
- Special support for red and brown mushroom from Minetest Game [flowers]
- Special support for [pizza]
- Special support for beans from Farming Redo [farming]
- Fix crash when poisoned player leaves server (Bug from original hunger mod, read more here)
- Changed license to LGPL v2.1 (because I pulled in newer code from BlockMen's hunger mod)
I suggest making it so if hunger is full then no longer able to eat other wise people can waste food by eating and getting nothing from it.
Rejected. Players just have to be a bit more careful not to waste stuff. :P


PS: If you find any food in any mod which, for some reason, does NOT work or does not work as it should (e.g. no satiation bonus, or no poisoning where poisoning is to be expected, etc.), please report it in this thread.

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

Re: [Mod] Hunger with HUD bar [0.4.0] [hbhunger]

by BrunoMine » Post

I realized that does not have a API.md but to report an error.
About the method:

Code: Select all

hbhunger.register_food(name, hunger_change, replace_with_item, poisen, heal, sound)
Apparently the specified sound is not being played. Instead, a generic sound is played. I will continue using this method, but waiting for the error correction to function properly in the future.

Taking advantage of the opportunity.
Congratulations for the good work. I'm upgrading my server, replacing hud_hunger by hbhunger. I will help you in what i can (feedback, bugtester, commits).

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

Re: [Mod] Hunger with HUD bar [0.4.1] [hbhunger]

by BrunoMine » Post

The custom sound does not work.

Code: Select all

hbhunger.register_food(name, hunger_change, replace_with_item, poisen, heal, sound)

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Version 0.5.0

by Wuzzy » Post

Small update: Version 0.5.0 released!

Changelog:
- Portuguese translation by BrunoMine
- Custom sound bug fixed (reported and fixed by BrunoMine)

manawy
Member
Posts: 10
Joined: Sat May 28, 2016 20:14

Re: [Mod] Hunger with HUD bar [0.5.0] [hbhunger]

by manawy » Post

FYI : there is a slight incompatibility between this mod and pipeworks as described here : viewtopic.php?p=237375#p237375

manawy
Member
Posts: 10
Joined: Sat May 28, 2016 20:14

Re: [Mod] Hunger with HUD bar [0.5.0] [hbhunger]

by manawy » Post

Nore already gave the solution : viewtopic.php?p=237397#p237397

If we correct the exshaution function by :

Code: Select all

function hbhunger.handle_node_actions(pos, oldnode, player, ext)
        if not player or not player:is_player() or player.is_fake_player == true then
                return
        end
        local name = player:get_player_name()
        -- the same
I don't know lua well enough to be sure that this correction is 100% correct and will not cause problem, so be careful, but it seems to work for me.

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Hunger with HUD bar [0.5.1] [hbhunger]

by Wuzzy » Post

Version 0.5.1 released!

It fixes the compability problem with pipeworks. Thanks, manawy, for reporting!

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Bugfix release 0.5.2

by Wuzzy » Post

Version 0.5.2 released! Changes:

- Fix mod not working when both intllib and mod security are enabled
- Add missing screenshot
- Rewrite README and use Markdown format

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

Re: [Mod] Hunger with HUD bar [0.5.2] [hbhunger]

by BrunoMine » Post

Very good. Congratulations.

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: [Mod] Hunger with HUD bar [0.5.2] [hbhunger]

by maikerumine » Post

I'm moving this here so it applies and discussion can be here as well.
Wuzzy wrote:Can you give me the relevant error message? Just copy the relevant stuff from debug.txt, please. It bugs me that my mod apparently has a bug. XD

PS: Placing a toxic water bucket crashes the game.
Thanks for the bug , I'll fix asap.

Here are the debugs for the hud:

Code: Select all

2016-11-13 01:02:36: ERROR[Main]: ServerError: Runtime error from mod 'hudbars' in callback environment_Step(): D:\FALLOUT\bin\..\games\aftermath\mods\hudbars\init.lua:406: attempt to index a nil value
2016-11-13 01:02:36: ERROR[Main]: stack traceback:
2016-11-13 01:02:36: ERROR[Main]: 	D:\FALLOUT\bin\..\games\aftermath\mods\hudbars\init.lua:406: in function 'unhide_hudbar'
2016-11-13 01:02:36: ERROR[Main]: 	D:\FALLOUT\bin\..\games\aftermath\mods\hudbars\init.lua:473: in function 'update_hud'
2016-11-13 01:02:36: ERROR[Main]: 	D:\FALLOUT\bin\..\games\aftermath\mods\hudbars\init.lua:514: in function <D:\FALLOUT\bin\..\games\aftermath\mods\hudbars\init.lua:505>
2016-11-13 01:02:36: ERROR[Main]: 	D:\FALLOUT\bin\..\builtin\game\register.lua:407: in function <D:\FALLOUT\bin\..\builtin\game\register.lua:387>

Thirsty error:

Code: Select all

2016-11-13 02:05:56: ERROR[Main]: ServerError: Lua: Runtime error from mod 'thirsty' in callback on_dieplayer(): ...\aftermath\mods\thirsty/persistent_player_attributes.lua:109: attempt to index a nil value
2016-11-13 02:05:56: ERROR[Main]: stack traceback:
2016-11-13 02:05:56: ERROR[Main]: 	...\aftermath\mods\thirsty/persistent_player_attributes.lua:109: in function 'set_value'
2016-11-13 02:05:56: ERROR[Main]: 	...ALLOUT\bin\..\games\aftermath\mods\thirsty/functions.lua:40: in function <...ALLOUT\bin\..\games\aftermath\mods\thirsty/functions.lua:33>
2016-11-13 02:05:56: ERROR[Main]: 	D:\FALLOUT\bin\..\builtin\game\register.lua:407: in function <D:\FALLOUT\bin\..\builtin\game\register.lua:387>


hud_hunger as well:

Code: Select all

2016-11-15 10:38:46: ERROR[Main]: ServerError: Runtime error from mod 'hunger' in callback environment_Step(): ...\..\games\aftermath\mods\hud_hunger\hunger/functions.lua:271: attempt to index local 'player' (a nil value)
2016-11-15 10:38:46: ERROR[Main]: stack traceback:
2016-11-15 10:38:46: ERROR[Main]: 	...\..\games\aftermath\mods\hud_hunger\hunger/functions.lua:271: in function 'setSprinting'
2016-11-15 10:38:46: ERROR[Main]: 	...\..\games\aftermath\mods\hud_hunger\hunger/functions.lua:233: in function <...\..\games\aftermath\mods\hud_hunger\hunger/functions.lua:121>
2016-11-15 10:38:46: ERROR[Main]: 	D:\FALLOUT\bin\..\builtin\game\register.lua:407: in function <D:\FALLOUT\bin\..\builtin\game\register.lua:387>

And sprinting:

Code: Select all

2016-11-15 12:52:43: ERROR[Main]: ServerError: Runtime error from mod 'hunger' in callback environment_Step(): ...\..\games\aftermath\mods\hud_hunger\hunger/functions.lua:271: attempt to index local 'player' (a nil value)
2016-11-15 12:52:43: ERROR[Main]: stack traceback:
2016-11-15 12:52:43: ERROR[Main]: 	...\..\games\aftermath\mods\hud_hunger\hunger/functions.lua:271: in function 'setSprinting'
2016-11-15 12:52:43: ERROR[Main]: 	...\..\games\aftermath\mods\hud_hunger\hunger/functions.lua:233: in function <...\..\games\aftermath\mods\hud_hunger\hunger/functions.lua:121>
2016-11-15 12:52:43: ERROR[Main]: 	D:\FALLOUT\bin\..\builtin\game\register.lua:407: in function <D:\FALLOUT\bin\..\builtin\game\register.lua:387>

Don't forget itemwheel:

Code: Select all

2016-11-15 19:34:36: ERROR[Main]: ServerError: Lua: Runtime error from mod 'default' in callback luaentity_Step(): ...bin\..\games\aftermath\mods\hud_hunger\hud/itemwheel.lua:172: attempt to index local 'player' (a nil value)
2016-11-15 19:34:36: ERROR[Main]: stack traceback:
2016-11-15 19:34:36: ERROR[Main]: 	...bin\..\games\aftermath\mods\hud_hunger\hud/itemwheel.lua:172: in function 'callback'
2016-11-15 19:34:36: ERROR[Main]: 	D:\FALLOUT\bin\..\builtin\game\falling.lua:92: in function <D:\FALLOUT\bin\..\builtin\game\falling.lua:43>


Sigh... I don't know what to do. :/
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Hunger with HUD bar [0.5.2] [hbhunger]

by Wuzzy » Post

Hmm, only the first debug output actually mentions HUD Bars directly, and without context, I can't really find your post useful.
Especially I need to know when the crash occours.

Can you also please give me the commit ID of your aftermath game where these crashes occour (and under which conditions), so that I can try to debug this one, too?
I am not sure if the bug is really HUD Bars' fault or lies somewhere else.

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: [Mod] Hunger with HUD bar [0.5.2] [hbhunger]

by maikerumine » Post

Commit:
https://github.com/maikerumine/aftermat ... 5dd56d83f2

I start from scratch.

When I get the error again I will explain here.
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

Griiimon
Member
Posts: 11
Joined: Sun Jan 08, 2017 13:20
IRC: TelepathicVampire
In-game: Griiimon

Re: [Mod] Hunger with HUD bar [0.5.2] [hbhunger]

by Griiimon » Post

As far as i can see, the self-healing process doesn't lower satiation?

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Hunger with HUD bar [0.5.2] [hbhunger]

by Wuzzy » Post

No, the self-healing process doesn't lower satiation.

Griiimon
Member
Posts: 11
Joined: Sun Jan 08, 2017 13:20
IRC: TelepathicVampire
In-game: Griiimon

Re: [Mod] Hunger with HUD bar [0.5.2] [hbhunger]

by Griiimon » Post

by Wuzzy » Fri Jan 20, 2017 19:45
No, the self-healing process doesn't lower satiation.
While testing my mod it occured to me, that this should probably a feature.

I'm penalising the player by dealing a small amount of damage at a low frequency and as long as his satiation is high enough and he is not moving or working he is able to regenerate infinetly. It just doesn't feel right. From a game mechanic viewpoint there should be some kind of cost for self-regenerating.

And in real life, your metabolism would also need extra energy.

I just wanted to let you know because i thought you might not have considered this yet, and it is easy to include into your architecture.


Also i'm having trouble with this code:

Code: Select all

minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, user, pointed_thing)
	local name= user:get_player_name()
	local item= itemstack:get_name()
	
	minetest.chat_send_player(name, "Eaten "..item)
end)
Ouput is only "Eaten". Does your mod interfere or am i using wrong?

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Hunger with HUD bar [0.5.2] [hbhunger]

by Wuzzy » Post

I don't know; I can't help you. Better ask in IRC or post in Modding Discussion, along with more details.

I agree that the suggested game mechanic is a good idea.

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

Re: [Mod] Hunger with HUD bar [0.5.2] [hbhunger]

by BrunoMine » Post

There is a problem with `replace_with_item` of food items. If the inventory is full, the item disappears.
I suggest you create a drop of the remaining item.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Hunger with HUD bar [0.5.2] [hbhunger]

by texmex » Post

New sprint mod supporting hbhunger: hbsprint.

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Version 0.5.3

by Wuzzy » Post

Version 0.5.3 released!
Changes:
- Minimum required Minetest version: 0.4.16
- Fix item being destroyed if it uses replace_with_item and the inventory was full. Instead, the new item drops on the ground
- Remove deprecated Minetest settings syntax

User avatar
Lone_Wolf
Member
Posts: 2578
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [Mod] Hunger with HUD bar [0.5.3] [hbhunger]

by Lone_Wolf » Post

Image
Any way to fix this?
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Hunger with HUD bar [0.5.3] [hbhunger]

by Hamlet » Post

Italian locale:

Code: Select all

Satiation = Sazietà
My repositories: Codeberg.org | My ContentDB's page

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 45 guests