[Modpack] "Better HUD" and "hunger" [2.x.1] [hud][hunger]

User avatar
LodeRunner
Member
Posts: 25
Joined: Mon Nov 17, 2014 03:14
Location: Random Desert Biome

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by LodeRunner » Post

N,

Hmmm...I hadn't noticed this when I did my testing. I may have to backtrack and try a few things.

Thanks for the tip. I'll see what happens.
LodeRunner
Wait...didn't I just explore this cavern?

varnayskiy
New member
Posts: 5
Joined: Tue Jun 24, 2014 15:13

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by varnayskiy » Post

What's about HUD_HUNGER_EXHAUST_MOVE*2 on jump event?
function hud.handle_node_actions(pos, oldnode, player, ext)
And what ext stands for? Can't understand from where it's value passed to handle_node_actions()?
Thanks in advance.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by rubenwardy » Post

Are you aware of minetest.register_on_item_eat? You can override the default eat action.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by TenPlus1 » Post

ruberwardy: the hunger.lua file has an overwrite function that replaces the default eat/heart feature and adds healing as well as additional features like hunger and poison...

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by rubenwardy » Post

I am aware of that TenPlus, but using the register_on_item_eat will stop you having to have a list of foods. There are very little poisons supported, these could be handled in the override way rather than overriding every food.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by TenPlus1 » Post

The register_on_item_eat adds a callback AFTER the item has been eaten so the hunger.lua still needs to override the initial values for each food item supported otherwise you eat say an apple and it will add 2 hearts instead of 2 hunger...

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by rubenwardy » Post

TenPlus1 wrote:The register_on_item_eat adds a callback AFTER the item has been eaten so the hunger.lua still needs to override the initial values for each food item supported otherwise you eat say an apple and it will add 2 hearts instead of 2 hunger...
You are mistaken. I wrote that callback. You can return non-nil to cancel the default action.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by TenPlus1 » Post

Apologies, I misread the guide on that particular command, it looked like it was called after the fact...

gumangel
Member
Posts: 23
Joined: Thu Jan 01, 2015 21:44
In-game: LaA

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by gumangel » Post

can anyone help me?
when i try to start the server it says :"ERROR:ModError:Failed to load and run
..........\mods\hunger\init.lua
Cheack debug.txt for details
i also dont have all the mods listed in depends.

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

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by ExeterDad » Post

Without more output from debug.txt it's hard to see whats going on. If I were to guess, I'd say you answered your own question. A mod needs those deps for a reason. They "depend" on them to work as intended.

gumangel
Member
Posts: 23
Joined: Thu Jan 01, 2015 21:44
In-game: LaA

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by gumangel » Post

ExeterDad wrote:Without more output from debug.txt it's hard to see whats going on. If I were to guess, I'd say you answered your own question. A mod needs those deps for a reason. They "depend" on them to work as intended.
21:22:48: ERROR[main]: ========== ERROR FROM LUA ===========
21:22:48: ERROR[main]: Failed to load and run script from
21:22:48: ERROR[main]: D:\Minetest\minetest-0.4.10-64bit\bin\..\mods\hunger\init.lua:
21:22:48: ERROR[main]: ...netest\minetest-0.4.10-64bit\bin\..\mods\hunger\init.lua:71: attempt to concatenate a nil value
21:22:48: ERROR[main]: stack traceback:
21:22:48: ERROR[main]: ...netest\minetest-0.4.10-64bit\bin\..\mods\hunger\init.lua:71: in main chunk
21:22:48: ERROR[main]: ======= END OF ERROR FROM LUA ========
21:22:48: ERROR[main]: Server: Failed to load and run D:\Minetest\minetest-0.4.10-64bit\bin\..\mods\hunger\init.lua
21:22:48: ERROR[main]: ModError: ModError: Failed to load and run D:\Minetest\minetest-0.4.10-64bit\bin\..\mods\hunger\init.lua


but i think u are right...i think i need all the depend mods

User avatar
Napiophelios
Member
Posts: 1035
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by Napiophelios » Post

you dont need every mod listed in the depends text

the mods listed with "?" at the end are soft dependancies (supported mods)

default is the only mandatory dependancy.

with all the various error messages you have posted in different topics
I would think you have a something else going on...like the mod folder's name

rename the folder to: hud (not hunger)

gumangel
Member
Posts: 23
Joined: Thu Jan 01, 2015 21:44
In-game: LaA

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by gumangel » Post

Napiophelios wrote:you dont need every mod listed in the depends text

the mods listed with "?" at the end are soft dependancies (supported mods)

default is the only mandatory dependancy.

with all the various error messages you have posted in different topics
I would think you have a something else going on...like the mod folder's name

rename the folder to: hud (not hunger)
u are helping me on every single topic :) thank you!

User avatar
Echoes91
Member
Posts: 80
Joined: Thu Feb 19, 2015 13:21
In-game: Echoes
Location: Lombardy, Italy

Re: [Mod] Better HUD (and hunger) [1.4] [hud]

by Echoes91 » Post

Good job! This works great and it's the closest thing to a unified hunger system for all those mobs related to food, farming and animal stuff. May I ask why support for "Mobs Redo" has not been implemented yet? That's a common, simple but good and funny mob set, it has already proposed hunger values in its tread and i see that there's already a pull request for them.
I'll upload my own configuration which i use because i find it more rational for a laptop widescreen, expecially for us who didn't play MC and have no need to match its layout :)

Code: Select all

--
-- health bar
--
HUD_HEALTH_POS = {x=0,y=1}			--min 0, max 1
HUD_HEALTH_OFFSET = {x=10,y=-30}		--offset in pixel

--
-- armor bar
--
HUD_ARMOR_POS = {x=0,y=1}
HUD_ARMOR_OFFSET = {x=10, y=-60}

--
-- hunger bar
--
HUD_HUNGER_POS = {x=1,y=1}			--min 0, max 1
HUD_HUNGER_OFFSET = {x=-250,y=-30}	--offset in pixel

--
-- breath bar
--
HUD_AIR_POS = {x=1,y=1}		--min 0, max 1
HUD_AIR_OFFSET = {x=-250,y=-60}	--offset in pixel
Attachments
My hud layout
My hud layout
screenshot_3081800049.png (724.26 KiB) Viewed 1059 times

User avatar
BlockMen
Developer
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen
Location: Germany

by BlockMen » Post

Update! Version 1.4.1 released

Changelog:
- Added plantlife_modpack/mushroom potions (by mgl512)
- Updated Mobs Redo and Farming Redo (by mgl512)
- Support for ferns (plantlife_modpack) (by mgl512)

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

Re: [Mod] Better HUD (and hunger) [1.4.1] [hud]

by Wuzzy » Post

Please fix the dependencies:
  • Add optional dependency to 3d_armor, because you use this mod
  • Make dependency on default optional (I see no reason why this is a mandatory dependency)

User avatar
Napiophelios
Member
Posts: 1035
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [Mod] Better HUD (and hunger) [1.4.1] [hud]

by Napiophelios » Post

My armor bar doesnt show above the hotbar till I get hurt or adjust/view armor via the inventory;
is this delay normal?

drkwv
Member
Posts: 102
Joined: Thu Jun 28, 2012 13:48
GitHub: aa6

Re: [Mod] Better HUD (and hunger) [1.4.1] [hud]

by drkwv » Post

Could you please add a stamina bar and support for the sprint mod?

User avatar
mtmodder148
Member
Posts: 132
Joined: Wed May 14, 2014 13:44
GitHub: MT-Modder
In-game: mtmodder148

Re: [Mod] Better HUD (and hunger) [1.4.1] [hud]

by mtmodder148 » Post

@Napiophelios, this happened to me until I wrote a patch for it here: https://github.com/BlockMen/hud/pull/13
Blockmen says it's unconfirmed.

User avatar
Echoes91
Member
Posts: 80
Joined: Thu Feb 19, 2015 13:21
In-game: Echoes
Location: Lombardy, Italy

Re: [Mod] Better HUD (and hunger) [1.4.1] [hud]

by Echoes91 » Post

mtmodder148 wrote:@Napiophelios, this happened to me until I wrote a patch for it here: https://github.com/BlockMen/hud/pull/13
Blockmen says it's unconfirmed.
I can confirm it happened to me too

User avatar
Echoes91
Member
Posts: 80
Joined: Thu Feb 19, 2015 13:21
In-game: Echoes
Location: Lombardy, Italy

Re: [Mod] Better HUD (and hunger) [1.4.1] [hud]

by Echoes91 » Post

Missing

Code: Select all

overwrite("ethereal:orange", 2)
for full ethereal support.

poet.nohit
Member
Posts: 55
Joined: Fri Mar 06, 2015 00:50
GitHub: poet-nohit

Re: [Mod] Better HUD (and hunger) [1.4.1] [hud]

by poet.nohit » Post

@mtmodder148: tried your fix and that seems to work. Thanks. :D

User avatar
mtmodder148
Member
Posts: 132
Joined: Wed May 14, 2014 13:44
GitHub: MT-Modder
In-game: mtmodder148

Re: [Mod] Better HUD (and hunger) [1.4.1] [hud]

by mtmodder148 » Post

Np. Glad to help.

User avatar
BlockMen
Developer
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen
Location: Germany

Re: [Mod] Better HUD (and hunger) [2.0] [hud]

by BlockMen » Post

Update! Version 2.0 released.

I kinda rewrote the mod completely, now HUD is (mainly) an API.

But the changes step by step:
- I seperated the HUD and the hunger mechanics to clean up the current code mess. But since already many people are using this mod and search for this mod when they want add Hunger to Minetest I will release this Mod as Modpack, including hud and hunger.

Changes to "hud":
- Added an API (that is currently limited to statbars, should be extended soon(tm))
- Provides "reserved" statbars for armor and hunger which can be used by mods even more easily.
- Armor statbar now show your current protection level, not the "health" of the armor

Changes to "hunger":
- Added API to add food (hunger.register_food())
- Works with every food now (but registering is recommended for better balance/behavior)
- Eating sound added and hungerbar gets differend color if poisend
- Using minetest.register_on_item_eat() instead overriding the function completly


Summerizing:
If you download the Modpack there should no difference for you, except (hopefully) less problems. All problems mentioned in posts above should be fixed.
Also, all mods that are depending on this mod should also still work as before, i added a couple legacy functions for that.

Anyway, it would be nice if you could report anything you notice and report bugs if found. For the hunger related issues or request, please do that here: https://github.com/BlockMen/hunger

poet.nohit
Member
Posts: 55
Joined: Fri Mar 06, 2015 00:50
GitHub: poet-nohit

Re: [Modpack] Better HUD (and hunger) [2.0] [hud][hunger]

by poet.nohit » Post

No problems here, so far.

Okay, just a few things. Beds now remove your hotbar when you get up in the morning. Plus a few minor details:

Code: Select all

12:54:11: WARNING: Undeclared global variable "show_hunger" accessed at ...minetest-0.4.12/bin/../games/spiffy/mods/hud/builtin.lua:83
12:54:43: WARNING: Undeclared global variable "HUD_ENABLE_HUNGER" accessed at ...minetest-0.4.12/bin/../games/spiffy/mods/hud/builtin.lua:22

Locked

Who is online

Users browsing this forum: No registered users and 4 guests