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

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

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

by Wuzzy » Post

To be honest, I'm too lazy for this. Sorry.

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

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

by FreeGamers » Post

lol, is that all?

I appreciate the honesty at least. :D
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

Revulent
Member
Posts: 12
Joined: Thu Jun 18, 2020 16:30
GitHub: Revulent
In-game: Virulent

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

by Revulent » Post

Is there a way to adjust how quickly health regenerates with this?

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

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

by Wuzzy » Post

No.

The mod is fine as-is. It is working, and it is finished. I don't plan to add any features.
There are probably billions of ways you could implement hunger, and this mod is just one of them.

I'm afraid for a new hunger mechanic you need a new mod. But at least the “progress bar” is in a different mod, so if you're a coder, you don't have to start from zero.

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

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

by FreeGamers » Post

Revulent, Why not try to make it add 2 HP points instead of 1, that would x2 the speed of healing wouldnt it?

Look at this section in the source code.

Code: Select all

-- heal player by 1 hp if not dead and satiation is > 15 (of 30)
			if h > 15 and hp > 0 and player:get_breath() > 0 then
				player:set_hp(hp+1)
				-- or damage player by 1 hp if satiation is < 2 (of 30)
				elseif h <= 1 then
					if hp-1 >= 0 then player:set_hp(hp-1) end
				end
			end
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

ThorfinnS
Member
Posts: 311
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

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

by ThorfinnS » Post

Alternatively, he's done a great job establishing his constants at the beginning of init.lua.

Just search for "800" (the number of seconds to use 1 satiation point) and tweak the values in the constants in that and adjacent lines and see if you can make it work the way you like.

Since Wuzzy is not updating it, you won't have to put your changes back in very often. Maybe at a major minetest release, at most.

User avatar
Rayjack
Member
Posts: 25
Joined: Thu Nov 15, 2018 18:18
In-game: Rayjack

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

by Rayjack » Post

fyi the mod as a .bundle is not something that is obvious on how to extract it in linux, the work around is to download (this and HUD bars) using the "content" option in the game (but it would be great if the mod creator used a different format like zip or tar)

Duvalon
Member
Posts: 43
Joined: Thu Jun 18, 2020 00:32
Location: Canada

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

by Duvalon » Post

Hi Wuzzy,

Would you please add this french translation?

Code: Select all

# textdomain:hbhunger
Satiation=Satiété
Thanks!

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

Version 1.1.0

by Wuzzy » Post

Version 1.1.0 released!
  • Add "/satiation" command to set satiation
  • Add Russian locale by lmk
  • Play sound at eater again
  • Random sound pitch (slightly)
  • Add MTG blueberries to food registrations
  • Lots of code refactoring
I have added Duvalon's French translation, but sadly it didn't make it into this release.

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

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

by Wuzzy » Post

Version 1.1.1 released!
  • Added French translation by Duvalon
  • Hearty Stew (from the Ethereal mod) no longer poisons you

hlqkj
Member
Posts: 38
Joined: Wed Dec 11, 2019 20:10
GitHub: hlqkj
IRC: hlqkj
In-game: hlqkj

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

by hlqkj » Post

Hello! :)
Sorry for posting this here, but couldn't find an issue tracker elsewhere. I have crashes when players put edible foods into their node breakers.

I saw that Gabriel already fixed this issue in the past with 4e86216 but that fix got "obsoleted" by 37eaefa since now the object property is used in place of pos while calling minetest.sound_play() .

That property is required to be a valid ObjectRef, while pipeworks provides a fakeplayer in the form of a table instead. Indeed, here's the error I get:
Spoiler

Code: Select all

2021-08-27 07:17:10: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'biome_lib' in callback environment_Step(): ...kj/minetest/bin/../mods/minetest_hbhunger/hunger.lua:82: bad argument #-1 to 'sound_play' (userdata expected, got table)
2021-08-27 07:17:10: ERROR[Main]: stack traceback:
2021-08-27 07:17:10: ERROR[Main]:       [C]: in function 'sound_play'
2021-08-27 07:17:10: ERROR[Main]:       ...kj/minetest/bin/../mods/minetest_hbhunger/hunger.lua:82: in function <...kj/minetest/bin/../mods/minetest_hbhunger/hunger.lua:74>
2021-08-27 07:17:10: ERROR[Main]:       (tail call): ?
2021-08-27 07:17:10: ERROR[Main]:       ...kj/minetest/bin/../mods/minetest_hbhunger/hunger.lua:13: in function <...kj/minetest/bin/../mods/minetest_hbhunger/hunger.lua:11>
2021-08-27 07:17:10: ERROR[Main]:       (tail call): ?
2021-08-27 07:17:10: ERROR[Main]:       ...ome/hlqkj/minetest/bin/../mods/pipeworks/wielder.lua:328: in function 'act'
2021-08-27 07:17:10: ERROR[Main]:       ...ome/hlqkj/minetest/bin/../mods/pipeworks/wielder.lua:111: in function 'wielder_on'
2021-08-27 07:17:10: ERROR[Main]:       ...ome/hlqkj/minetest/bin/../mods/pipeworks/wielder.lua:147: in function 'action_on'
2021-08-27 07:17:10: ERROR[Main]:       .../minetest/bin/../mods/mesecons/mesecons/internal.lua:192: in function '?'
2021-08-27 07:17:10: ERROR[Main]:       ...netest/bin/../mods/mesecons/mesecons/actionqueue.lua:137: in function 'execute'
2021-08-27 07:17:10: ERROR[Main]:       ...netest/bin/../mods/mesecons/mesecons/actionqueue.lua:111: in function '?'
2021-08-27 07:17:10: ERROR[Main]:       ...home/hlqkj/minetest/bin/../builtin/game/register.lua:422: in function <...home/hlqkj/minetest/bin/../builtin/game/register.lua:406>
2021-08-27 07:17:10: ERROR[Main]: stack traceback:
I think it's worth to add a check to make it fallback to the old way, that is using the pos property, or just fail gracefully not playing any sound...
Quando omni flunkus, moritati.

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

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

by Wuzzy » Post

I added a crude check for "fake players". Please check the latest commit of hbhunger and tell me if it works now.

hlqkj
Member
Posts: 38
Joined: Wed Dec 11, 2019 20:10
GitHub: hlqkj
IRC: hlqkj
In-game: hlqkj

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

by hlqkj » Post

That worked, thank you very much! I hope mod authors will soon have a standardized way to do such things properly.
Quando omni flunkus, moritati.

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

Version 1.1.2!

by Wuzzy » Post

Version 1.1.2 released! This fixes the aforementioned problem with fake players. There are no other changes.

Icalasari
Member
Posts: 166
Joined: Tue Sep 23, 2014 05:29
IRC: Icalasari
In-game: Icalasari

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

by Icalasari » Post

I know this is a mod you're not interested in working on anymore, so two things:

1) Mind if I use it in my mod pack (not sure the correct etiquette with including mods in mod packs)

2) How would I change the location of the HUD? I oddly can't find where that is set in the mod (I do see a mention of hbhunger.conf but I am not seeing that anywhere in the mod?)

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

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

by Wuzzy » Post

1) Yes, you can. This mod is free software, therefore you already have the permission. As long you keep the license file intact and don't outright plagiarize, you're gonna be fine.

2) You can change the location of the HUD with a setting in the hudbars mod. Read the hudbars mod README.

Also, I moved this mod to Codeberg.org today. https://codeberg.org/Wuzzy/minetest_hbhunger/

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

Version 1.1.3!

by Wuzzy » Post

Version 1.1.3 released!
This version fixes a problem that the maximum player HP is always assumed to be 20. Now the mod takes the player object propertiy "hp_max" into account instead. This is important for mod development.

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests