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

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

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

by Wuzzy » Tue Feb 24, 2015 17:47

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: 752
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 » Tue Feb 24, 2015 20:50

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: 67
Joined: Thu Jun 28, 2012 13:48

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

by drkwv » Wed Feb 25, 2015 19:37

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

User avatar
mtmodder148
Member
 
Posts: 131
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 » Wed Feb 25, 2015 22:51

@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: 67
Joined: Thu Feb 19, 2015 13:21
In-game: Echoes

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

by Echoes91 » Thu Feb 26, 2015 10:35

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
"It wasn't easy to break so many functions by editing a single line"
 

User avatar
Echoes91
Member
 
Posts: 67
Joined: Thu Feb 19, 2015 13:21
In-game: Echoes

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

by Echoes91 » Sun Mar 08, 2015 17:17

Missing
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
overwrite("ethereal:orange", 2)
for full ethereal support.
"It wasn't easy to break so many functions by editing a single line"
 

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 » Tue Mar 17, 2015 18:55

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

User avatar
mtmodder148
Member
 
Posts: 131
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 » Tue Mar 17, 2015 19:00

Np. Glad to help.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

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

by BlockMen » Fri Apr 03, 2015 11:14

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 » Fri Apr 03, 2015 18:25

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:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Wed Apr 08, 2015 18:48

Update Version 2.0.1

- Fixed disappearing hotbar (reported by poet-nohit)
- Fixed unused global var
- Added one more check to catch probably incorrect players
 

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

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

by poet.nohit » Thu Apr 09, 2015 12:16

One more bug fix. Funny, but it was actually working better when it assumed show_hunger was a global.

https://github.com/poet-nohit/minetest- ... 0bad173762
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun

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

by Minetestforfun » Thu Apr 09, 2015 18:18

Hi BlockMen,

We worked on the upgrade of hud mod 1.4 to 2.0, and we found this : https://github.com/minetest/minetest/issues/2615
Maybe it will interest you
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

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

by BlockMen » Sun Apr 12, 2015 17:39

Update Version 2.1

New: ItemWheel
Image

Inspired by Voxelands new hotbar, I added the ItemWheel as experimental hotbar replacement.
It might cause lags on servers or at least slow them down the more users online, so I can only recommend using it on singleplayer. But if someone would test it on a server and post the results would be nice aswell :)

To use the ItemWheel add "hud_item_wheel = true" to minetest.conf.

Known issues:
Currently there is no stack counting or wearout level displayed (fxed in 2.1.1)

Changelog:
- Added "ItemWheel" (experimental)
- Fixed disapperaring hunger bar (reported by poet-nohit)

---

@Minetestforfun
Well, i guess if there is no easy/fast fix for that i should switch back to override the items on_use, since this bug breaks (sometimes) the whole system :\
Last edited by BlockMen on Mon Apr 13, 2015 10:28, edited 1 time in total.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

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

by prestidigitator » Sun Apr 12, 2015 18:55

BlockMen wrote:Well, i guess if there is no easy/fast fix for that i should switch back to override the items on_use, since this bug breaks (sometimes) the whole system :\


Trying to change this could also create a sort of war of escalation over which event handlers take precedence, can override each other, etc. However, with that caveat, here's an implementation of the Decorator pattern (mostly):

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
--- Do whatever it is I want to do when eating food, after calling all other
 -- on_item_eat() handlers.
 --
 -- @param otherReturn
 --    The value returned by the other (normal) on_item_eat() handlers.  Can be
 --    taken into account and/or changed in my function.
 --
local function myEater(hp_change, replace_with_item, itemstack, user, pointed_thing, otherReturn)
   -- Whatever
end;

local oldEaters = minetest.registered_on_item_eats;

local function runOldEaters(...)
   for _, e in ipairs(oldEaters) do
      local val = e(...);
      if val then
         return val;
     end;
   end;
   return nil;
end;

local function alwaysEat(...)
   return myEater(..., runOldEaters(...));
end;

minetest.registered_on_item_eats = { alwaysEat };


Note that minetest.register_on_item_eat() always adds to the original table, as the table is accessed through a closure rather than using the minetest.registered_item_eats variable (see builtin/game/register.lua). That makes it unnecessary to replace the minetest.register_on_item_eat() function itself. However, you could always replace the function anyway, to safeguard against future changes to the implementation:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_on_item_eat = function(handler) table.insert(oldEaters, handler); end;


This might be worth a try if you'd otherwise fall back on using on_use() callbacks on everything and having to whitelist foods. Keep in mind that it's POSSIBLE it might not work if the event handling system (like the registration code) grabs a reference to the minetest.registered_item_eats table before mods get initialized instead of fetching the variable each time.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

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

by BlockMen » Mon Apr 13, 2015 10:32

Update Version 2.1.1

Changelog:
- Added itemcounting/wearout info
- Added support for hud scaling
- Fixed typo causing endless updating
- Fixed image scaling of some textures (like glass)
- Improved ItemWheel image

Screenshot:
Image

----
@prestidigitator
thx, this is indeed worth testing before switching back ;)
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

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

by Krock » Mon Apr 13, 2015 10:40

A 'yay!' for that new HUD, thank you!
Sadly, there's no way to see the other items in the hotbar.

EDIT: After setting "hud_item_wheel = true":
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
ERROR[main]: ServerError: E:\Programme\minetest\bin\..\builtin\game\item.lua:20: attempt to call method 'gsub' (a nil value)
ERROR[main]: stack traceback:
ERROR[main]:       E:\Programme\minetest\bin\..\builtin\game\item.lua:20: in function 'inventorycube'
ERROR[main]:       E:\Programme\minetest\bin\..\mods\hud/itemwheel.lua:59: in function 'update_wheel'
ERROR[main]:       E:\Programme\minetest\bin\..\mods\hud/itemwheel.lua:189: in function <E:\Programme\minetest\bin\..\mods\hud/itemwheel.lua:184>
ERROR[main]:       E:\Programme\minetest\bin\..\builtin\game\register.lua:341: in function <E:\Programme\minetest\bin\..\builtin\game\register.lua:329>

EDIT2: This was caused by a table value, default:torch.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

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

by BlockMen » Mon Apr 13, 2015 15:56

Krock wrote:A 'yay!' for that new HUD, thank you!
Sadly, there's no way to see the other items in the hotbar.
-snip-

EDIT: It's somewhat intentional for the "wheel" that you do not see every item. Else the "loop"/toogle-through would be kinda boring IMO; it would be just a "round" hotbar.
---

Update Version 2.1.2

Changelog:
- Fixed crash caused by animated nodes (reported by Krock)
- Fixed "freezing" of empty slots (reported by kilbith)

Also, kilbith brought to my attention that meshnodes are not displayed correct. Same goes for nodeboxes, such as stairs and slabs. Currently there is no way to draw those via Lua, so they are displayed as block currently :\
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

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

by Evergreen » Mon Apr 13, 2015 18:07

This is awesome! The only problem I encountered is the fact that it doesn't update when you add an item to the hotbar, but it does update when you change items.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

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

by philipbenr » Wed Apr 15, 2015 14:01

That one looks awesome and probably would look good on Android version of Minetest for scrolling around...
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun

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

by Minetestforfun » Wed Apr 15, 2015 18:33

i has tested the "Update Version 2.1.1" on my serveur "0.4.12-stable"

So i met a big issue, after a time between 30min and 2 hours, the hud met a BIG crashs, the server still online but we have no more hunger bar, and foods don't do sounds anymore...

With "verbose = 2" i see nothing in my logs for explain that issue

(PS : So we have been forced to revert the 1.4 -> 2.1.x update of your mod...)
Last edited by Minetestforfun on Fri Apr 17, 2015 23:44, edited 3 times in total.
 

supercutsminetest
Member
 
Posts: 21
Joined: Wed Apr 08, 2015 12:58

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

by supercutsminetest » Fri Apr 17, 2015 23:36

Eating cooked slice of blueberry pie sates 1/2 a hunger and brown mushroom essence sates 1 hunger, is there a functional reason for cooking vs eating an apple then?
 

User avatar
Ben
Member
 
Posts: 157
Joined: Tue Mar 31, 2015 20:09

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

by Ben » Thu Apr 23, 2015 20:12

Hi, I'm writing a mod which adds a new stat bar. I'm having a bit of trouble with the positioning: do I read it right that all bars are absolutely positioned, and that whoever installs all these mods together sorts out the positioning?

If so, what's the preferred way to let the mod user select the position? The hud.conf file contains a set of globals; would I define some new variables for my mod's stat bar in there?
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

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

by TenPlus1 » Sat Apr 25, 2015 15:59

Could you add the following food item under the farming redo section of your hunger mod:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
overwrite("farming:beans", 1)
 

Carnildo
New member
 
Posts: 4
Joined: Tue Sep 23, 2014 07:59

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

by Carnildo » Wed May 27, 2015 04:54

I'm seeing an intermittent crash when using Pipeworks to make an automatic tree-harvester. The harvester consists of a stack of five node-breakers and a deployer that are activated by a Mesecons sensor. I believe the crash is being caused by one of the node-breakers (which one varies from time to time).

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
21:26:02: ERROR[main]: ServerError: ~/.minetest/mods/hud_hunger/hud/api.lua:91: attempt to call method 'hud_change' (a nil value)
21:26:02: ERROR[main]: stack traceback:
21:26:02: ERROR[main]:    ~/.minetest/mods/hud_hunger/hud/api.lua:93: in function 'change_item'
21:26:02: ERROR[main]:    ~/.minetest/mods/hud_hunger/hunger/functions.lua:57: in function 'update_hunger'
21:26:02: ERROR[main]:    ~/.minetest/mods/hud_hunger/hunger/functions.lua:95: in function 'callback'
21:26:02: ERROR[main]:    /usr/share/games/minetest/builtin/game/item.lua:467: in function </usr/share/games/minetest/builtin/game/item.lua:405>
21:26:02: ERROR[main]:    (tail call): ?
21:26:02: ERROR[main]:    /home/mark/.minetest/mods/pipeworks/wielder.lua:325: in function 'act'
21:26:02: ERROR[main]:    ~/.minetest/mods/pipeworks/wielder.lua:109: in function 'wielder_on'
21:26:02: ERROR[main]:    ~/.minetest/mods/pipeworks/wielder.lua:145: in function 'action_on'
21:26:02: ERROR[main]:    ~/.minetest/mods/mesecons/mesecons/internal.lua:189: in function '?'
21:26:02: ERROR[main]:    ~/.minetest/mods/mesecons/mesecons/actionqueue.lua:90: in function 'execute'
21:26:02: ERROR[main]:    ~/.minetest/mods/mesecons/mesecons/actionqueue.lua:84: in function '?'
21:26:02: ERROR[main]:    /usr/share/games/minetest/builtin/game/register.lua:341: in function </usr/share/games/minetest/builtin/game/register.lua:329>


After the crash, the first attempt to enter the game crashes with the following traceback:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
21:47:59: ERROR[main]: ServerError: ~/.minetest/mods/hud_hunger/hunger/functions.lua:68: attempt to index field '?' (a nil value)
21:47:59: ERROR[main]: stack traceback:
21:47:59: ERROR[main]:    ~/.minetest/mods/hud_hunger/hunger/functions.lua:71: in function 'callback'
21:47:59: ERROR[main]:    /usr/share/games/minetest/builtin/game/item.lua:299: in function </usr/share/games/minetest/builtin/game/item.lua:191>
21:47:59: ERROR[main]:    (tail call): ?
21:47:59: ERROR[main]:    (tail call): ?
21:47:59: ERROR[main]:    ~/.minetest/mods/pipeworks/wielder.lua:379: in function 'act'
21:47:59: ERROR[main]:    ~/.minetest/mods/pipeworks/wielder.lua:109: in function 'wielder_on'
21:47:59: ERROR[main]:    ~/.minetest/mods/pipeworks/wielder.lua:145: in function 'action_on'
21:47:59: ERROR[main]:    ~/.minetest/mods/mesecons/mesecons/internal.lua:189: in function '?'
21:47:59: ERROR[main]:    ~/.minetest/mods/mesecons/mesecons/actionqueue.lua:90: in function 'execute'
21:47:59: ERROR[main]:    ~/.minetest/mods/mesecons/mesecons/actionqueue.lua:84: in function '?'
21:47:59: ERROR[main]:    /usr/share/games/minetest/builtin/game/register.lua:341: in function </usr/share/games/minetest/builtin/game/register.lua:329>
 

User avatar
crazyR
Member
 
Posts: 47
Joined: Thu Jun 19, 2014 14:41
GitHub: Ryan-Nolan
IRC: crazyR
In-game: crazyR

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

by crazyR » Mon Jun 01, 2015 10:08

Technic drills icon image is oversized when usimg the wheel mode..

screenshot:
Image
 

User avatar
linushsao
Member
 
Posts: 331
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus

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

by linushsao » Sun Jun 21, 2015 16:32

solved,It caused by other mods.
1.hunger mod enables falied because of moretree mod enabled failed.
2.moretree mod enabled failed because of plants_lib mod not enabled.

so,enabled plants_lib mod could solved this problem.
 

dannyplaysminetest
Member
 
Posts: 37
Joined: Sun Jun 28, 2015 19:20
In-game: Danny

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

by dannyplaysminetest » Tue Jun 30, 2015 21:10

Thanks for this Mod, it gives a more realistic feel when playing survival mode and the Hud looks nice in combination with the 3D armor mod since it shows that bar as wel ^_^
 

amadin
Member
 
Posts: 471
Joined: Tue Jun 16, 2015 16:23
GitHub: Amadin

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

by amadin » Sun Jul 12, 2015 06:33

08:09:05: WARNING: Undeclared global variable "HUD_ENABLE_HUNGER" accessed at .../games/minetest_game/mods/hud_hunger/hud/builtin.lua:41

What i do wrong?
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

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

by BlockMen » Wed Jul 15, 2015 00:38

Update Version 2.1.3

HUD:
- Added hud.swap_statbar() and fix wrong behavior of previous workaround
- Fixed missing background of some statbars in multiplayer

hunger:
- Fixed healing after death
- Fixed healing while drowning
- Fixed crashed caused by Pipeworks mod
- Added wrapper for minetest.item_eat(). see Readme.txt for more informations
- Updated HUD-API usage
- Added beans of Farming Redo

Information for Modders:
If this mod is installed registered on_item_eat callbacks are called AFTER this mods actions, means the itemstack is already modified when passed. You can catch the original itemstack as 6th parameter and modifiy this mods actions aswell that way if wanted.


@amadin: nothing to worry about, its just a warning that is caused by legacy code. Just ignore it ;)
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 49 guests

cron