[Mod] Hunger NG: A next generation hunger mod (hunger_ng)

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by Linuxdirk » Post

daret wrote:
Tue Nov 24, 2020 14:14
I tried it before, but I'm afraid "effects" are not part of "settings"
Haha, yeah. Silly me :)

Effects are returned when calling the hunger_ng.get_hunger_information('Playername') function, (Don’t build anything on this, It’ll change soon.) The hunger_ng.interoperability table only gives you the settings and the attributes from the configuration.

User avatar
daret
Member
Posts: 136
Joined: Tue Nov 12, 2019 20:36
GitHub: daretmavi
In-game: Daretmavi

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by daret » Post

I tried to add effect to interoperability

Code: Select all

@@ -147,7 +147,8 @@ local api_functions = {
         attributes = hunger_ng.attributes,
         translator = hunger_ng.configuration.translator,
         get_data = hunger_ng.functions.get_data,
-        set_data = hunger_ng.functions.set_data
+        set_data = hunger_ng.functions.set_data,
+		effects = hunger_ng.effects,
     }
 }
It works, it can be used, but it is not satisfying.

Ideal wold be to be able to change effects.heal.amount.
  • =0 - no healing, event is satiation is ok
  • <0 - negative value, decreases health, satiation has to be ignored
It could be even more complex, like according to satiation, the value could be different.

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by Linuxdirk » Post

daret wrote:
Sun Nov 29, 2020 20:18
Ideal wold be to be able to change effects.heal.amount.
For the sake of simplicity it will be a simple on/off switch.

If you want your mod to have different effects run the function in a globalstep and change hunger and satiation as needed using the API functions.

User avatar
daret
Member
Posts: 136
Joined: Tue Nov 12, 2019 20:36
GitHub: daretmavi
In-game: Daretmavi

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by daret » Post

Yes, switch is good as well.

Ignaramico
Member
Posts: 78
Joined: Fri Sep 04, 2020 21:23
GitHub: ignaramico

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by Ignaramico » Post

AS other used mentioned before, sometimes there is a bread showing on the interface (like when you win an award and the award windows pop ups upside a bread) , and other mods that affect the gui (like advanced markers in my case) show the distances followed by "farmingbread.png" text. There are other mod that causes conflict like the "poshud" mod that when activated makes one of the hudbars blink. or the "hud_compass" mod that when positioned on the upper center of the gui in show a loaf of bread xD.

im using the mintest extended game

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by Linuxdirk » Post

Ignaramico wrote:
Tue Dec 01, 2020 04:15
AS other used mentioned before, sometimes there [are issues with other mods]
I'm sorry for that, but there is nothing I can reasonably do. Instead of me adding compatibility code for dozens of mods the individual mod authors should make their mods error-proof instead.

(Minetest's HUD system is pretty much broken by design, having numeric HUD element IDs sharing the same numberspace instead of properly namespaced alphanumerical IDs defined by individual mods *g*)

timsoft
Member
Posts: 58
Joined: Sat Jun 04, 2016 20:38
GitHub: timsoftgit

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by timsoft » Post

hi, I am playing hamlets quest which uses Hunger NG with farming redo and caverns df. I noticed that some items of food don't satiate. The ones i've spotted relating to farming redo are as follows.
mint tea, onion soup, apple pie, spaghetti, butter, pasta, meat block, cheese block, cup of hot chocolate ( no receipe in farming redo?,) and cup of coffee
any chance that those items could be added to your farming redo support in hunger NG ? thanks.

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by Linuxdirk » Post

Drinks are explicitly not supported. I'll look into the missing food items. If they come from Farming Redo I'll likely add them in a future release.

Ignaramico
Member
Posts: 78
Joined: Fri Sep 04, 2020 21:23
GitHub: ignaramico

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by Ignaramico » Post

ohhh ok, i just thought since the main culprit was a loaf of bread, it was something related to hunger NG and farming redo.

timsoft
Member
Posts: 58
Joined: Sat Jun 04, 2016 20:38
GitHub: timsoftgit

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by timsoft » Post

many thanks, Regarding drinks, I didn't realise that Hunger_NG didn;t include drinks. Looking deeper at hamlets quest which is the game I'm playing, it includes Hunger_NG and Thirst, but Thirst does nothing with drinks either. I'm wondering what the point of things like mint tea and coffee is, as it doesn't appear to do anything. I could see some drinks restoring health, but that crosses half way between functionality provided by hunger_ng and thirst. Any suggestions? It would be nice to have them do something, to make it worth while collecting/crafting.

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by Linuxdirk » Post

timsoft wrote:
Tue Dec 01, 2020 22:25
Thirst does nothing with drinks either. [...] Any suggestions?
You can either ignore them or contact author of the Thirst mod to implement them.

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by Linuxdirk » Post

daret wrote:
Tue Nov 24, 2020 14:14
I'm looking for function if player is poisoned, or sick, I want to stop the healing effect for him (or make a bigger damage then healing), till he is cured.
See latest Git version and API documentation on how to use it. If it works I will create a CDB release with this version.

https://4w.gitlab.io/hunger_ng/README.A ... er-effects

Also please note that the hunger information table changed a little. All Entries are described here.

https://4w.gitlab.io/hunger_ng/README.A ... nformation

The API change is described in the issue for that feature.

https://gitlab.com/4w/hunger_ng/-/issues/31#get-status

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by sirrobzeroone » Post

Hey Linuxdirk,

Guess nobody has tried to use the "myhunger" chat command in awhile :). Looks like it references a removed part of the api line 114 in chat_commands.lua "player:is_player_connected()"

Not sure this is this best way to go but to get the chat command working I changed that line to:

Code: Select all

if player:is_player() and minetest.get_player_by_name(player:get_player_name()) then
Thanks for all your work on this mod :).

User avatar
LMD
Member
Posts: 1385
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by LMD » Post

sirrobzeroone wrote:
Mon Sep 13, 2021 00:59
Hey Linuxdirk,

Guess nobody has tried to use the "myhunger" chat command in awhile :). Looks like it references a removed part of the api line 114 in chat_commands.lua "player:is_player_connected()"

Not sure this is this best way to go but to get the chat command working I changed that line to:

Code: Select all

if player:is_player() and minetest.get_player_by_name(player:get_player_name()) then
Thanks for all your work on this mod :).
Something simpler like `player:get_pos()` should do the job too: It should return nil if the ref has been removed.
My stuff: Projects - Mods - Website

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng)

by Linuxdirk » Post

sirrobzeroone wrote:
Mon Sep 13, 2021 00:59
Guess nobody has tried to use the "myhunger" chat command in awhile :). Looks like it references a removed part of the api line 114 in chat_commands.lua "player:is_player_connected()"
Ah, yes. Thanks for reporting.

This seems to be removed because it was not documented or so. Since I already use minetest.get_player_by_name() which returns nil if there is no player of the given name online the check was unnecessary anyways. I removed it and did a quick test and the function now does what it’s supposed to do.

Get the new version Git or wait till it’s pushed as update via CDB.

happy_sadan
New member
Posts: 1
Joined: Tue Dec 07, 2021 15:24
GitHub: happy_sadan
In-game: happy_sadan

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng

by happy_sadan » Post

Linuxdirk wrote:
Fri Feb 07, 2020 21:50
RobertBuilder wrote:In the lower right hand corner the areas HUD will be overwritten with "farming_bread.png"
Please do a minimal test with hunger_ng and areas only. I was not able to reproduce it using the latest versions of hunger_ng and the areas mod on Minetest 5.1.1.
This only happens when hudbars is also enabled. Tested on Minetest 5.4.1.
cdb_d91d71aa69ba

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests