[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 [0.6.0] [hbhunger]

by Wuzzy » Post

Version 0.6.0 released!

- Added Italian translation by Hamlet (thanks!)
- Texture license is now MIT License


@Lone_Wolf: This is a bug in the [hudbars] mod, it has nothing to do with [hbhunger].

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

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

by Stix » Post

@Wuzzy how do i add support for this to my mod, more_bread?
viewtopic.php?f=9&t=18508
Hey, what can i say? I'm the bad guy.

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 [0.6.0] [hbhunger]

by Wuzzy » Post

Supported food:
All food items which use the standard minetest.item_eat function are automatically supported.

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

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

by Stix » Post

Wuzzy wrote:
Supported food:
All food items which use the standard minetest.item_eat function are automatically supported.
wow! thats great!
Hey, what can i say? I'm the bad guy.

User avatar
Shnikety
New member
Posts: 4
Joined: Sun Jun 11, 2017 00:45

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

by Shnikety » Post

excellent mod, love the support this offers for food and other mods

btw, I went to add some chat commands to this add ran into a minor issue that confused me for a moment, lines 119 to 129 need indented another tab

dawgdoc
Member
Posts: 260
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

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

by dawgdoc » Post

Wuzzy,

The latest updates TenPlus1 made to mobs_redo seems to have broken hbhunger for me.

After pulling his newest updates from github I have received an error on startup of an existing survival world, singleplayer, with only non-hostile mobs enabled. It is a world that I have had for a month of two, if not three. It was created after updating to MT 0.4.16. Even though the error references hbhunger mod, I am also reported on the mobs_redo forum since it seems to be involved. -- all mods are current with their git repositories. The world shutdown on startup and play did not commence.

debug.txt

Code: Select all

-------------

2017-10-11 03:24:59: ERROR[Main]: ModError: Failed to load and run script from /home/dawgdoc/.minetest/mods/hbhunger/init.lua:
2017-10-11 03:24:59: ERROR[Main]: /home/dawgdoc/.minetest/mods/hbhunger/hunger.lua:129: attempt to index global 'mobs' (a nil value)
2017-10-11 03:24:59: ERROR[Main]: stack traceback:
2017-10-11 03:24:59: ERROR[Main]: 	/home/dawgdoc/.minetest/mods/hbhunger/hunger.lua:129: in main chunk
2017-10-11 03:24:59: ERROR[Main]: 	[C]: in function 'dofile'
2017-10-11 03:24:59: ERROR[Main]: 	/home/dawgdoc/.minetest/mods/hbhunger/init.lua:46: in main chunk
2017-10-11 03:24:59: ERROR[Main]: Check debug.txt for details.
The hbhunger mod references mobs_redo at line 129 of hunger.lua, the code beginning at line 128

Code: Select all

if minetest.get_modpath("mobs") ~= nil then
	if mobs.mod ~= nil and mobs.mod == "redo" then
		hbhunger.register_food("mobs:cheese", 4)
		hbhunger.register_food("mobs:meat", 8)
		hbhunger.register_food("mobs:meat_raw", 4)
		hbhunger.register_food("mobs:rat_cooked", 4)
		hbhunger.register_food("mobs:honey", 2)
I am not sure where the fix is required or even that it is due to hbhunger.

I created a new world just now and 2017-10-11 04:21:33: ERROR[Main]: ModError: Failed to load and run script from /home/dawgdoc/.minetest/mods/hbhunger/init.lua:
2017-10-11 04:21:33: ERROR[Main]: /home/dawgdoc/.minetest/mods/hbhunger/hunger.lua:348: attempt to index global 'farming' (a nil value)
2017-10-11 04:21:33: ERROR[Main]: stack traceback:
2017-10-11 04:21:33: ERROR[Main]: /home/dawgdoc/.minetest/mods/hbhunger/hunger.lua:348: in main chunk
2017-10-11 04:21:33: ERROR[Main]: [C]: in function 'dofile'
2017-10-11 04:21:33: ERROR[Main]: /home/dawgdoc/.minetest/mods/hbhunger/init.lua:46: in main chunk
2017-10-11 04:21:33: ERROR[Main]: Check debug.txt for details.only enabled default, farming_redo, hbhunger, hudbars, mobs_redo, and mobs_animal. The same error was generated.

EDIT: In a new world if I enable the same mods as above excluding hbhunger, there are no error messages. Once I add hbhunger I get the same message as above. If I only enable hbhunger and hudbars I get this error
Give a man a fish, feed him for a day. Give a kid a fish, it's going to die.

dawgdoc
Member
Posts: 260
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

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

by dawgdoc » Post

My apologies to you. I also posted in the mobs_redo thread and TP1 suggested I add farming? and mobs? to depends.txt. I went to follow his instructions and found that several files were missing from my hbhunger folder, one of them depends.txt. I corrected the file structure and on a cursory peek in my established world all seems well.
Give a man a fish, feed him for a day. Give a kid a fish, it's going to die.

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

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

by ManElevation » Post

how do i enable the posion bar?
My Public Mods! Discord: Rottweiler Games#3368

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 [0.6.0] [hbhunger]

by Wuzzy » Post

ManElevation, I don't know what you mean. There's no poison bar here. Only a hunger bar. But the health bar can become green when you eat poisonous food, like a red mushroom, and you lose health for a few seconds. And that's it. The poison system in this mod is very simple.

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

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

by ManElevation » Post

Wuzzy wrote:ManElevation, I don't know what you mean. There's no poison bar here. Only a hunger bar. But the health bar can become green when you eat poisonous food, like a red mushroom, and you lose health for a few seconds. And that's it. The poison system in this mod is very simple.
oh ok, my bad dint understand how it worked
My Public Mods! Discord: Rottweiler Games#3368

Chem871
Member
Posts: 999
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

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

by Chem871 » Post

How would I tweak the code to make hunger come faster?
What is SCP-055?

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 [0.6.0] [hbhunger]

by Wuzzy » Post

Sadly, this is currently only possibly by editing the source code. Look into init.lua. Decrease the value of hbhunger.HUNGER_TICK. There are also other variables you could tinker with (read the comments).

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 [0.7.0] [hbhunger]

by Wuzzy » Post

I added a Malay translation in version 0.7.0 (thanks, muhdnurhidayat!).

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 [0.7.1] [hbhunger]

by Wuzzy » Post

Version 0.7.1 released!

This adds a sanity check in the eating code to (hopefully) prevent some crashes. One such crash happened “whenever someone was operating a node breaker with something edible inside the tool slot, and the operator player is absent”.

Thanks to gpcf for the find and bugfix.

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

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

by ExeterDad » Post

Wuzzy wrote:Version 0.7.1 released!

This adds a sanity check in the eating code to (hopefully) prevent some crashes. One such crash happened “whenever someone was operating a node breaker with something edible inside the tool slot, and the operator player is absent”.

Thanks to gpcf for the find and bugfix.
I wouldn't of seen that coming either. Nice find :)
Thanks for the update

Wooster
Member
Posts: 11
Joined: Tue Jun 05, 2018 20:37
GitHub: WoosterUK

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

by Wooster » Post

I modded your mod. :-) (New player, found a few mods I liked, tinkered... This is probably a common story!)

All simple stuff. Made a couple of variables to allow fine-tuning of the mechanism and incorporated them into the Settings section for users to play with. One nice side-effect is that the mod now exposes satiation capacity as a variable so that mods with optional dependency (like diet) can access it and thus changes are propagated appropriately. I have done a bit of testing in singleplayer and it seems (fingers crossed!) to be working as intended.

Hope it's of use, if not directly then at least as a start. I don't know whether / how you like pull requests, but here is the git pull request text in case it is of use.

Code: Select all

The following changes since commit 7b10cdcb5bd89ee4b9ecc7ac696c04a3e6463ce3:

  Mark changelog as old (2018-06-01 12:01:39 +0200)

are available in the Git repository at:

  http://repo.or.cz/minetest_hbhunger/wooster.git 

for you to fetch changes up to 6dd37c2658c573b1cca4d6a1be04c956bbbdc4a3:

  Change global variables to more intuitive name. (2018-06-05 19:52:34 +0100)

----------------------------------------------------------------
Wooster (6):
      Resolve conflict.
      Modify starvation effect.
      Set new player to 2/3 full stomach.
      Add section in README explaining customisability.
      Fix starting stomach for very first player.
      Change global variables to more intuitive name.

WoosterUK (1):
      Make hunger modifiable in settings.

 README.md        | 14 +++++++++++++-
 hunger.lua       |  4 ++--
 init.lua         | 37 +++++++++++++++++++++----------------
 settingtypes.txt | 11 +++++++++++
 4 files changed, 47 insertions(+), 19 deletions(-)
 create mode 100644 settingtypes.txt

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 [0.7.1] [hbhunger]

by Wuzzy » Post

There are no pull requests, the usual way is just to publish a fork of the project anywhere and commit there, then just notify me. What you did is exactly that.

I don't think your changes in particular fit into the philosophy of my mod. Also, I'm a bit lazy.

FlameFireling
Member
Posts: 24
Joined: Sun Jul 23, 2017 12:37

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

by FlameFireling » Post

[DELETED :( ]
Last edited by FlameFireling on Wed Jun 20, 2018 19:10, edited 1 time in total.
Telnet > IRC

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 [0.7.1] [hbhunger]

by Wuzzy » Post

The word “Starvation” is not used in the mod.

FlameFireling
Member
Posts: 24
Joined: Sun Jul 23, 2017 12:37

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

by FlameFireling » Post

[DELETED]
Telnet > IRC

cristytgirl
New member
Posts: 2
Joined: Tue Aug 28, 2018 02:59

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

by cristytgirl » Post

i seem to be having issues down loading this the links seem to be broken for me ( im new and this could be me being a idiot )

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

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

by sorcerykid » Post

cristytgirl wrote:i seem to be having issues down loading this the links seem to be broken for me ( im new and this could be me being a idiot )
You may have better luck downloading the package from the Content DB:

https://content.minetest.net/packages/Wuzzy/hbhunger/

Be sure to download and install the hudbars mod as well, since it's a dependency.

cristytgirl
New member
Posts: 2
Joined: Tue Aug 28, 2018 02:59

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

by cristytgirl » Post

thank you for the alternate link

hexYeah
New member
Posts: 8
Joined: Wed Dec 12, 2018 02:09
In-game: hexYeah

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

by hexYeah » Post

awesome thank you !

bell07
Member
Posts: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

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

by bell07 » Post

Just get the mod working with minetest 5 dev trough the next hack:
Added 2 lines at the end of init.lua

Code: Select all

-- Remove builtin bars
core.hud_replace_builtin("health", {hud_elem_type ~= "statbar"})
core.hud_replace_builtin("breath", {hud_elem_type ~= "statbar"})
Unsure if it is the right way :-/

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 23 guests