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

Locked
User avatar
linushsao
Member
Posts: 418
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus
Location: Taipei,Taiwan(R.O.C)
Contact:

by linushsao » Post

4aiman wrote:Sorry for being irritated... It's just I don't know how to explain in other words..
for me? no, i am fine. i learn alot things about minetest(&english..XD) from discussion in here.

i has terrible english,so need to confirm. actully, i have to say sorry,because after finished testing minetest & minetest with luajit/leveldb, i relize that maybe i have learn to tweak some option for.i do'nt know much about minetest with luajit/leveldb.

I only know that under the minetest with luajit/leveldb, the way to put in/out from chest , it got terrible delay,even after converting current map by --migrate leveldb . if i reinstall minetest(not support with luajit/leveldb) from ABS(from archlinux),no delay. it's very strange for me.

i try to introduce minetest to TAIWAN,so i have to study/test minetest. i still do'nt know how to figure out the problem of chinese-tradition input,but still feel great .
Last edited by linushsao on Sun Mar 23, 2014 16:03, edited 1 time in total.
1)Server:Mars World
2).address:139.59.238.211:30016
3).manual(in processing):http://tinyurl.com/jyjkrgl
4).for my(admin's) role in all my servers,i'll be as the earth/water/fire/wind. i maintain that system,but not manage/touch players directly in game,not own the crafts on planet. i just keep watching the worlds.
5).TODO-List

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

Maybe you should try to open an issue at the github?
Like, "lags when using luajit+leveldb"?
What server you're using? maybe it's connection just too slow/poor to send needed data...
*I once tried to run a Minecraft server on a RPi with a 128KBs connection, so do I know how bad thing may be*
Also, profiler dump would be nice.
Maybe bugs & problems is the better place for this conversation to continue.

User avatar
ak399g
Member
Posts: 160
Joined: Tue Jul 30, 2013 02:36
In-game: SAFR
Contact:

by ak399g » Post

With the [areas] mod, I've set the color of the text in the lower left corner of the screen to appear white (FFFFFF). However, when I enable your [hud] mod, it overrides the [areas] mod's settings and puts the text as black. Why is that?
aka SAFR

User avatar
linushsao
Member
Posts: 418
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus
Location: Taipei,Taiwan(R.O.C)
Contact:

by linushsao » Post

4aiman wrote:Maybe you should try to open an issue at the github?
Like, "lags when using luajit+leveldb"?
What server you're using? maybe it's connection just too slow/poor to send needed data...
*I once tried to run a Minecraft server on a RPi with a 128KBs connection, so do I know how bad thing may be*
Also, profiler dump would be nice.
Maybe bugs & problems is the better place for this conversation to continue.
yes,i think you are right. after those trying , make me know it's not all about the HUD mod. I'll finish this issue!

thx for you reply.
1)Server:Mars World
2).address:139.59.238.211:30016
3).manual(in processing):http://tinyurl.com/jyjkrgl
4).for my(admin's) role in all my servers,i'll be as the earth/water/fire/wind. i maintain that system,but not manage/touch players directly in game,not own the crafts on planet. i just keep watching the worlds.
5).TODO-List

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

ak399g wrote:With the [areas] mod, I've set the color of the text in the lower left corner of the screen to appear white (FFFFFF). However, when I enable your [hud] mod, it overrides the [areas] mod's settings and puts the text as black. Why is that?
Does this belongs here?

Anyway, this happens when one text hud overlaps another. Try to change window size and see if problem remains. Also, black text may be caused by wrong update, e.g. truing to set "number" value to nil or string. BTW, does this happens every time you join the game?

User avatar
ak399g
Member
Posts: 160
Joined: Tue Jul 30, 2013 02:36
In-game: SAFR
Contact:

by ak399g » Post

4aiman wrote:
ak399g wrote:With the [areas] mod, I've set the color of the text in the lower left corner of the screen to appear white (FFFFFF). However, when I enable your [hud] mod, it overrides the [areas] mod's settings and puts the text as black. Why is that?
Does this belongs here?

Anyway, this happens when one text hud overlaps another. Try to change window size and see if problem remains. Also, black text may be caused by wrong update, e.g. truing to set "number" value to nil or string. BTW, does this happens every time you join the game?
This always happens when both are enabled. Changing window size did not help. Is there a place I can insert into hud.conf perhaps to specify "number = 0xFFFFFF"?

EDIT:
Spoiler
Maybe part of the issue lies in the usage of the "number" parameter under "player:hud_add({"

Code: Select all

player:hud_add({
        hud_elem_type = "statbar",
        position = HUD_HEALTH_POS,
        scale = {x=1, y=1},
        text = "hud_heart_bg.png",
        number = 20,
        alignment = {x=-1,y=-1},
        offset = HUD_HEALTH_OFFSET,
    })
and all the other instances that say "number = 20". Is there a different way to denote the number of heart spaces displayed? Because normally, "number" sets the hex value of hud text.

Or perhaps, because [hud] loads itself after all other mods are loaded, it overrides the settings set under [areas]. Maybe a line of code could be added/changed so as to allow [areas] to load after [hud] as an exception?
EDIT 2: Ignore the above, I read the HUD api (reproduced below) and I'm once more left in the dark regarding this issue. No idea what's causing it.
Spoiler
HUD element types
-------------------
The position field is used for all element types.
To account for differing resolutions, the position coordinates are the percentage of the screen,
ranging in value from 0 to 1.
The name field is not yet used, but should contain a description of what the HUD element represents.
The direction field is the direction in which something is drawn.
0 draws from left to right, 1 draws from right to left, 2 draws from top to bottom, and 3 draws from bottom to top.
The alignment field specifies how the item will be aligned. It ranges from -1 to 1,
with 0 being the center, -1 is moved to the left/up, and 1 is to the right/down. Fractional
values can be used.
The offset field specifies a pixel offset from the position. Contrary to position,
the offset is not scaled to screen size. This allows for some precisely-positioned
items in the HUD.
Below are the specific uses for fields in each type; fields not listed for that type are ignored.

Note: Future revisions to the HUD API may be incompatible; the HUD API is still in the experimental stages.

- image
Displays an image on the HUD.
- scale: The scale of the image, with 1 being the original texture size.
Only the X coordinate scale is used (positive values)
Negative values represent that percentage of the screen it
should take; e.g. x=-100 means 100% (width)
- text: The name of the texture that is displayed.
- alignment: The alignment of the image.
- offset: offset in pixels from position.
- text
Displays text on the HUD.
- scale: Defines the bounding rectangle of the text.
A value such as {x=100, y=100} should work.
- text: The text to be displayed in the HUD element.
- number: An integer containing the RGB value of the color used to draw the text.
Specify 0xFFFFFF for white text, 0xFF0000 for red, and so on.
- alignment: The alignment of the text.
- offset: offset in pixels from position.
- statbar
Displays a horizontal bar made up of half-images.
- text: The name of the texture that is used.
- number: The number of half-textures that are displayed.
If odd, will end with a vertically center-split texture.
- direction
- offset: offset in pixels from position.
- inventory
- text: The name of the inventory list to be displayed.
- number: Number of items in the inventory to be displayed.
- item: Position of item that is selected.
- direction
- waypoint
Displays distance to selected world position.
- name: The name of the waypoint.
- text: Distance suffix. Can be blank.
- number: An integer containing the RGB value of the color used to draw the text.
- world_pos: World position of the waypoint.
Last edited by ak399g on Tue Mar 25, 2014 03:34, edited 1 time in total.
aka SAFR

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

number works for text huds as color.
number works as count of half-images for statbar hud.

User avatar
ak399g
Member
Posts: 160
Joined: Tue Jul 30, 2013 02:36
In-game: SAFR
Contact:

by ak399g » Post

Good to know, but still doesn't tell me what's causing the bug, or where to look.
aka SAFR

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

I have no problems with any huds turning black if those aren't overlapped or misconfigured/misdefined/misupdated.
If you want MC-like hunger, you can try out my 4hunger mod, but I need to have a list of mods you've installed to add support of any possible food you're using now.

If you want air bubbles, I can send you a mod that does only this - adds air bubbles and hurts you when there's none of them.

Hearts are shown by default, so no need bothering with them.

PS: I'm not advertising or saying my mods are better. But I do have mods that do similar things with which I had no problems. Of course it's easier to understand and edit my own code. (Besides I have no desire to fix better hud if it is all it's fault. Why? Because of "custom", which alone had driven me to write 4hunger despite me being a lazy a**).

User avatar
ak399g
Member
Posts: 160
Joined: Tue Jul 30, 2013 02:36
In-game: SAFR
Contact:

by ak399g » Post

Haha yes I too take issue with le 'costum'es
I'll try your mod. If the API is logical, I may be able to add my own foods, but if no, then I'll ask for assistance.
aka SAFR

User avatar
Capaverdeferro
Member
Posts: 68
Joined: Mon Feb 03, 2014 22:21

by Capaverdeferro » Post

have to version 0.4.9?

User avatar
JPRuehmann
Member
Posts: 334
Joined: Fri Mar 21, 2014 21:40
Location: Germany
Contact:

by JPRuehmann » Post

Hello

Excellent work.
will or is there support for
fruit and mushrooms?

Thanks,
JPR

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

by BlockMen » Post

JPRuehmann wrote:Hello

Excellent work.
will or is there support for
fruit and mushrooms?

Thanks,
JPR
In general yes, but as you can see the posts above the mod is (still) kinda laggy. So it might be better to rewrite/improve the mod and then add new features.

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

by BlockMen » Post

Update! Version 1.2 released

Changelog:
- Send statbar values only to client when changed
- Hide armor bar if not wearing armor
- More reliable food overrides (by CiaranG)
- Support for bushes_classic foods (plantlife modpack) (by CiaranG)
- Add support for mushroom mod food/poison (by CiaranG)
- Add support for mods: fruit and mush45
- New images for hotbar, smaller armor icons

---
linushsao wrote:With this MOD in my MT server(cloud hosted,archlinux,from AUR,ver 0.4.9), I found It took about 10 seconds when I put something into chest or furnace,the same when i took from. after disable HUD , no more lag with put/get thing from chest or furnace.

anyone else found this like me?only me?
It could be cause by the fact, that the mod sent very often the values of the bars to the client (even if they didnt change). Since this is fixed in Version 1.2 now the lag should be reduce a lot or not occur anymore

ak399g wrote:With the [areas] mod, I've set the color of the text in the lower left corner of the screen to appear white (FFFFFF). However, when I enable your [hud] mod, it overrides the [areas] mod's settings and puts the text as black. Why is that?
I was not able to reproduce this issue with the current MT version, so i cant do anything to fix that, sorry.
Last edited by BlockMen on Sun Apr 06, 2014 17:24, edited 1 time in total.

User avatar
JPRuehmann
Member
Posts: 334
Joined: Fri Mar 21, 2014 21:40
Location: Germany
Contact:

by JPRuehmann » Post

Thank you a lot.

Is it possible to make the directon of the Status bars make configurable.
So that for example, I can put them on the left and right side of the Screen, but not horizontal but vertical.

Thanks,
JPR

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:

by rubenwardy » Post

You should probably add the Food mod to currently supported food, as it adds support for this mod automatically.

Maybe sort alphabetically as well.

Code: Select all

- Apples (default)
- Animalmaterials (mobf modpack)
- Bread (default)
- Bushes
- bushes_classic
- Dwarves (beer and such)
- Docfarming
- Fishing
- Farming plus
- Food
- fruit
- Glooptest
- Mooretrees
- Mtfoods
- mushroom
- mush45
- Simple mobs
Last edited by rubenwardy on Mon Apr 07, 2014 15:11, edited 1 time in total.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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:

by rubenwardy » Post

When you start a game, the hunger bar does not immediately set to the correct level.

For example, if your hunger is zero (bar empty), the bar appears full. It is only when you eat something that it goes to the correct level. I guess it is because it does not get updated correctly.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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

by BlockMen » Post

rubenwardy wrote:When you start a game, the hunger bar does not immediately set to the correct level.

For example, if your hunger is zero (bar empty), the bar appears full. It is only when you eat something that it goes to the correct level. I guess it is because it does not get updated correctly.
Already known problem, the hunger is being reworked and will be fixed next release then, but thanks.

alcipri
Member
Posts: 15
Joined: Sat Apr 12, 2014 15:27

by alcipri » Post

First, thanks for this great mod. Second, I think there is a fatal error:

When I'm hungry (1/2 bread left) I loose health, but When there is only half heart, it stop loss. I survive with half heart and half bread left. When I think I have only half bread and half heart left, I Should die.

The

PD: Sorry for my Inglés and thanks
Last edited by alcipri on Mon Apr 14, 2014 07:20, edited 1 time in total.

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

by BlockMen » Post

Update! Version 1.3 released

Changelog:
- New way hunger is saved (all old files in world dirctory can get deleted [e.g. hud_BlockMen_hunger])
- Fixed healing (not while drowning, fix after death)
- Add support for mods: seaplants[sea] and mobfcooking (by Xanthin)
- Tweaked hand image
- Player can die caused by starving now
- Lowered update rate to increase perfomance


---
alcipri wrote:First, thanks for this great mod. Second, I think there is a fatal error:

When I'm hungry (1/2 bread left) I loose health, but When there is only half heart, it stop loss. I survive with half heart and half bread left. When I think I have only half bread and half heart left, I Should die.

The

PD: Sorry for my Inglés and thanks
The hunger bar is gets complete emptied now. Furthermore i enabled death by starving now, but i will revert it if people complain about it.

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

by TenPlus1 » Post

Thanks for the new update BlockMen, death by hunger is a good feature and will be using it on Xanadu server...

For anyone wishing to add support for Ethereal mod foods, copy/paste the following lines to the end of hunger.lua

Code: Select all

if minetest.get_modpath("ethereal") ~= nil then
    overwrite("ethereal:strawberry", 1)
    overwrite("ethereal:banana", 2)
    overwrite("ethereal:pine_nuts", 1)
    overwrite("ethereal:fern_tubers", 1)
    overwrite("ethereal:banana_bread", 7)
    overwrite("ethereal:mushroom_plant", 1)
    overwrite("ethereal:coconut_slice", 2)
    overwrite("ethereal:golden_apple", 10)
    overwrite("ethereal:wild_onion_plant", 1)
    overwrite("ethereal:mushroom_soup", 2)
    overwrite("ethereal:mushroom_soup_cooked", 3)
    overwrite("ethereal:hearty_stew", 4)
    overwrite("ethereal:hearty_stew_cooked", 6)
    overwrite("ethereal:bucket_cactus", 2)
    overwrite("ethereal:fish_raw", 2)
    overwrite("ethereal:fish_cooked", 4)
end
Last edited by TenPlus1 on Mon Apr 14, 2014 12:29, edited 1 time in total.

alcipri
Member
Posts: 15
Joined: Sat Apr 12, 2014 15:27

by alcipri » Post

Ok, thanks. I think now the game is more real and entertaining. In my opinion, it's a main feature, but everyone to his own taste.

User avatar
teamcrafterz112233
New member
Posts: 3
Joined: Thu Mar 13, 2014 13:32

by teamcrafterz112233 » Post

why here mod is a not exp im a need now exp

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

teamcrafterz112233 wrote:why here mod is a not exp im a need now exp
Because there would be no use for xp. Also, post that in mod suggestions.
Back from the dead!

alcipri
Member
Posts: 15
Joined: Sat Apr 12, 2014 15:27

by alcipri » Post

There is a mod like XP: viewtopic.php?id=3343

Locked

Who is online

Users browsing this forum: No registered users and 1 guest