[Mod] HUD bars [1.7.1] [hudbars]

User avatar
GunshipPenguin
Member
 
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin

Re: [Mod] HUD bars [1.2.0] [hudbars]

by GunshipPenguin » Mon May 25, 2015 04:47

Wuzzy wrote:Hmm, this looks like a difficult bug for me. I have looked into the HUD bars mod but was unable to find anything suspicios. What seems to be clear to me is that, for some reason, the hb.hide_hudbars function somehow got a player which is nil, therefore the name is nil, and you can't use nil as a table index.
I also have looked into the Hungry Games mods, especially survival_modpack, but I have not spotted anything suspicious there, too.

I am not even sure which mod is actually responsible for the crash, but it seems to be more likely that HUD bars is responsible, judging from the stack trace. I can't explain it otherwise for now, unless the Hungry Games does some really nasty shit, like overwriting one of HUD bar's core tables. But I don't know yet. :-(

I am also not sure if the code you pointed to is actually responsible, because it does not touch anything near that weird player object, which is nil.

Could you give me more information of the crash? If you still have the log, more context would probably help me. Please give me more text of the debug.txt before the crash. The best thing for me would be a couple of logs for several server sessions, that is, server boots, then runs for a while until the crash.

Also, do you have information on how many players were on the server when it crashed?

Also, are you able to repoduce this crash on a local test server? If so, then please tell me how.

Sadly, I can't reproduce anything of this. Maybe this is a sort of bug which only happens when you use an online server with many players, but does not happen on local servers.


Ok, after much experimenting, I've managed to reproduce this bug on a test server. The test server was running minetest 0.4.12 stable, with my fork of hungry_games, and no mods besides the ones in hungry_games.

The problem seems to arise when a player joins while the countdown to the match is ongoing. You can recreate this yourself, connect 2 clients to a server and make both of them vote to begin, then while the countdown is going on, connect another client to the server, the server crashes 100% of the time on my machine, with the following error:

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:38:42: ERROR[main]: ServerError: ...4.12/bin/../games/hungry_games/mods/hudbars/init.lua:359: attempt to index field '?' (a nil value)
21:38:42: ERROR[main]: stack traceback:
21:38:42: ERROR[main]:    ...4.12/bin/../games/hungry_games/mods/hudbars/init.lua:359: in function 'hide_hudbar'
21:38:42: ERROR[main]:    ...4.12/bin/../games/hungry_games/mods/hudbars/init.lua:438: in function 'update_hud'
21:38:42: ERROR[main]:    ...4.12/bin/../games/hungry_games/mods/hudbars/init.lua:470: in function '?'
21:38:42: ERROR[main]:    ...top/minetest-0.4.12/bin/../builtin/game/register.lua:341: in function <...top/minetest-0.4.12/bin/../builtin/game/register.lua:329>


Another thing I've noticed, is that the player joining during the countdown has a hunger and thirst hudbar, but no health hudbar.

The fact that this bug seemed to arise about 50% of the time on my hungry_games server would make sense, as there were people joining and leaving the server quite often, and statistically, it's likely that somebody would join during the 10 second countdown to the match start.
 

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

Bugfix release: 1.2.1

by Wuzzy » Mon May 25, 2015 14:11

I have found the bug!

The bug was caused by Hungry Games changing enable_damage. HUD bars 1.2.0 is totally not prepared for enable_damage to be changed in mid-game. If you start the server with damage disabled, the default HUD bars won't initialize on the assumption that they are not needed anyways. But when enable_damage gets turned on, the script suddenly tries to update the breath and health HUD bars, which of course don't exist. Therefore the crash.

I just released version 1.2.1, which fixes said bug. This version should not crash anymore when you change enable_damage in mid-game, it also updates the HUD when this happens.
I am not 100% sure how reliable this will go on your sever, and I am personally not really happy with the fix for now, but it seems to work fine. Maybe I will release another patch release which solves the enable_damage switching problematic more sanely.


Thanks for the help, it was really needed here.
 

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

Re: [Mod] HUD bars [1.2.1] [hudbars]

by TenPlus1 » Sun Oct 04, 2015 12:49

Would it be possible to add your hudbars, hbhunger and related mods to github so mod makers can post changes and fixes to your code more easily.
 

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

Re: [Mod] HUD bars [1.2.1] [hudbars]

by Wuzzy » Sun Oct 04, 2015 14:47

Yes, of course. But I am not going to do it. I have published a Git repository already:
http://repo.or.cz/w/minetest_hudbars.git

Feel free to copy it and post it on GitHub yourselves. If you want to have some changes upstream, just clone my repo do the changes and publish your modified version on any public repository, then write a post here and point to the relevant branch or commits. If I have time, motivation and like the changes, I'll include them.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

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

Re: [Mod] HUD bars [1.2.1] [hudbars]

by TenPlus1 » Sun Oct 04, 2015 16:26

No probs, uploaded to my own git for testing :)

https://github.com/tenplus1/hudbars
Last edited by TenPlus1 on Fri Jul 22, 2016 19:01, edited 1 time in total.
 

User avatar
pinkysnow
Member
 
Posts: 89
Joined: Sat Sep 26, 2015 01:58
GitHub: pinkysnowman

Re: [Mod] HUD bars [1.2.1] [hudbars]

by pinkysnow » Tue Dec 22, 2015 04:00

there needs to be a way to set the position of each bar to whatever you want seperatly of any other bar
 

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

Re: [Mod] HUD bars [1.2.1] [hudbars]

by Wuzzy » Mon Jan 04, 2016 00:28

pinkysnow wrote:there needs to be a way to set the position of each bar to whatever you want seperatly of any other bar


Uh, why? Honestly, I wanted to avoid this kind of “micromanagement” and wanted to keep my mod as simple as possible. But I may be more likely to be convinced if you can give me a concrete use case for your feature request.

But currently, I am not in my Minetest phase, so things can take a while.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

drkwv
Member
 
Posts: 67
Joined: Thu Jun 28, 2012 13:48

Re: [Mod] HUD bars [1.2.1] [hudbars]

by drkwv » Sat Mar 26, 2016 19:37

Hi, Wuzzy.
Could you please add an ability to change hud icon, bar icon and text color for a player? I've made a wadsprint mod and have trouble integrating it with hudbars because the mod should change an icon from `off` to `on` state while sprinting but that isn't an option in the hudbars API.
 

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

Re: [Mod] HUD bars [1.2.1] [hudbars]

by Wuzzy » Sat Mar 26, 2016 20:03

This is a good idea. In fact, I had a similar idea much earlier, but I never got around to actually implement it.
First I need to think how exactly I should implement such a feature to make it useful for a wide audience, not just a single mod. ;-) But that should not be too hard.

I'll put it on the to-do list, but no promises are made.

What do you mean, you have trouble integrating? Doesn't it work at all or don't you just like the final result because that feature is missing?
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

drkwv
Member
 
Posts: 67
Joined: Thu Jun 28, 2012 13:48

Re: [Mod] HUD bars [1.2.1] [hudbars]

by drkwv » Sat Mar 26, 2016 20:09

Just the feature is missing. Everything else works nice and the API is good and consistent.
 

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

Version 1.3.0

by Wuzzy » Sat Jul 02, 2016 20:22

Version 1.3.0 is released!

Changes:
- Make all settings avaialbe in Minetest's new advanced settings menu
- Fix HUD bars overlapping (basically breaking the HUD) when both hudbars_tick and hudbars_vmargin were set
- Use Markdown syntax in readme file
- Fix some factual mistakes in readme file
- Add metadata: mod.conf, description.txt, screenshot.png

Sorry, no possibility to change images on-the-fly yet. Maybe later. :-/
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

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

Version 1.4.0

by Wuzzy » Sat Jul 02, 2016 22:27

Version 1.4.0 released!

I have implemented the suggestion of drkwv!

Now the API allows you to change the appearance (images and text) of a HUD bar after it has been registered. This is done by extending the function hb.change_hudbar.

Specifically, you can change the following values:
- icon
- background icon for the “modern statbar” mode
- bar segment image
- text label
- text color

So, basically almost everything. :-)
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

drkwv
Member
 
Posts: 67
Joined: Thu Jun 28, 2012 13:48

Re: [Mod] HUD bars [1.4.0] [hudbars]

by drkwv » Sun Jul 03, 2016 05:29

Thank you! Will try it as soon as possible.
 

drkwv
Member
 
Posts: 67
Joined: Thu Jun 28, 2012 13:48

Re: [Mod] HUD bars [1.4.0] [hudbars]

by drkwv » Fri Jul 22, 2016 17:03

I've updated minetest_wadsprint to be compatible with new hudbars API but it works only if I comment the lines in hb.change_hudbar:
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
   -- if new_value == nil and new_max_value == nil then
   --    return
   -- end

That's because my code changes only icon and bar image. Please fix. :)
 

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

Bugfix release 1.4.1.

by Wuzzy » Sat Jul 23, 2016 09:54

Oops! Thanks for reporting the bug. This was obviuosly an embarrassing oversight by me. ;-)

I just now released version 1.4.1.
This version fixes the aforementioned bug that hb.change_hudbar is a no-op if new_value and new_max_value were both nil. In 1.4.0 it was not possible to update a HUD bar if you only want to change its appearance but not the value. That's all!

If there are still problems, report them.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

Martno
Member
 
Posts: 77
Joined: Thu May 28, 2015 07:09

Re: [Mod] HUD bars [1.4.1] [hudbars]

by Martno » Sun Aug 07, 2016 20:08

Is it possible to make the hud bars changing their size according to the gui_scaling setting, or the font size?
I always make fonts bigger because they are too small on my screen (1680x1050). But the hud bars are too small (they are good on a 15" laptop screen, but on bigger resolution monitors, they are small), and if I change the gui_scaling or font size, this problem occurs:
Image
Attachments
gui-scalingHUD.png
gui-scalingHUD.png (29.08 KiB) Viewed 4782 times
 

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

Re: [Mod] HUD bars [1.4.1] [hudbars]

by Wuzzy » Mon Aug 08, 2016 01:55

I fear the answer is “No.”. I can only scale some particular HUD elements with screen size, but not all. Especially the colored part of the progress bar is not scalable since the HUD API of Minetest is simply too weak for now. Well, I can scale it, but only with absolute numbers, not along with screen size.
If I would know of some way to scale the HUD elements properly, I would probably have done it already.

And with fonts it's even worse. Minetest has zero support for custom font sizes and mods can't handle it in any way.

Which means the HUD Bars as of now have to be fixed-size, sadly.

If someone finds a workaround to sacle ALL HUD elements, that would help a lot. But IMO the real problem lies in Minetest's incomplete HUD element API.

What I COULD do would be to increase the size of everything manually. That would still be fixed size but hopefully it's more managable.
But I fear there is not a single good solution to your problem at the moment. :-(
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

Martno
Member
 
Posts: 77
Joined: Thu May 28, 2015 07:09

Re: [Mod] HUD bars [1.4.1] [hudbars]

by Martno » Fri Aug 12, 2016 16:26

Ok, thanks for the answer.
If you increase the size a bit (not too big for lower resolution screens) I think that would be good enough.
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Re: [Mod] HUD bars [1.4.1] [hudbars]

by BrunoMine » Fri Aug 12, 2016 16:40

I liked this work. I want to help, but the repository looks confused. Is there a nicer interface to contribute?
 

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

Re: [Mod] HUD bars [1.4.1] [hudbars]

by Wuzzy » Fri Aug 12, 2016 16:54

With what do you want to help?
Repositories don't need any interface to contribute. My hoster just happens to have a HTML interface.

If you are looking for the git clone URL, use this one:
http://repo.or.cz/minetest_hudbars.git
(yes, this is both the HTML page and the actual repository clone URL)
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Re: [Mod] HUD bars [1.4.1] [hudbars]

by BrunoMine » Thu Oct 20, 2016 00:07

I sent some changes about 2 months ago.

The following changes since commit afad4e847d65fa300412d42be42dc1749e76619a:

Add translate into portuguese (2016-08-14 14:22:46 -0300)

are available in the git repository at:

git://repo.or.cz/minetest_hudbars/brunomine.git

for you to fetch changes up to afad4e847d65fa300412d42be42dc1749e76619a:

Add translate into portuguese (2016-08-14 14:22:46 -0300)


I would like to know the cause of not having pulled yet.
I hope this tool will be useful. Or you really do not want help?
 

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

Version 1.5.0 released!

by Wuzzy » Thu Oct 20, 2016 14:36

HUD Bars 1.5.0 released, now with translation into Portuguese by BrunoMine.

Sorry, BrunoMine, but I either was not aware of your commits or I have forgotten or overlooked them. Maybe I was not notified. Note that the mere act of uploading a repository somewhere does not give me an automatic notification or whatever.
Anyway, your commits are now part of HUD Bars, thanks!
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Re: [Mod] HUD bars [1.5.0] [hudbars]

by BrunoMine » Thu Oct 20, 2016 14:48

I sent an email to the owner of the repository (almikes@aol.com) on repo.or.cz

I wonder if this email is correct, or if you received so that this does not happen again.

I like to contribute to this project. (Because I use it on my server).
I'll help any way you can.
 

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

Re: [Mod] HUD bars [1.5.0] [hudbars]

by Wuzzy » Thu Oct 20, 2016 16:05

This e-mail address is correct. If I fail to respond, you can also contact me per forum PM or XMPP. I personally prefer XMPP.
My e-mail reading discipline is probably too low at the moment. This is my fault, and I should really get my shit together. :D I haven't found your e-mail, however. Probably I lost it (not sure).
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

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

Bugfix release 1.5.1

by Wuzzy » Sat Nov 12, 2016 20:13

Version 1.5.1 released. Changes:

  • Fix critical bug: Mod does not work with both intllib and mod security enabled
  • Update screenshot to standardized 3:2 aspect ratio
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
SaKeL
Member
 
Posts: 193
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: [Mod] HUD bars [1.5.1] [hudbars]

by SaKeL » Mon Nov 21, 2016 22:14

just got this error right after the last player logged out and server was empty
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
2016-11-21 22:48:43: ERROR[Main]: ServerError: Runtime error from mod 'hudbars' in callback environment_Step(): /root/.minetest/mods/hudbars/hudbars/init.lua:564: attempt to index a nil value
2016-11-21 22:48:43: ERROR[Main]: stack traceback:
2016-11-21 22:48:43: ERROR[Main]:    /root/.minetest/mods/hudbars/hudbars/init.lua:564: in function 'hide_hudbar'
2016-11-21 22:48:43: ERROR[Main]:    /root/.minetest/mods/hudbars/hudbars/init.lua:722: in function 'update_hud'
2016-11-21 22:48:43: ERROR[Main]:    /root/.minetest/mods/hudbars/hudbars/init.lua:769: in function </root/.minetest/mods/hudbars/hudbars/init.lua:755>
2016-11-21 22:48:43: ERROR[Main]:    /usr/share/minetest/builtin/game/register.lua:412: in function </usr/share/minetest/builtin/game/register.lua:392>
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 

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

Re: [Mod] HUD bars [1.5.1] [hudbars]

by Wuzzy » Mon Nov 21, 2016 22:49

SaKeL, weren't you using the latest HUD bars version? Because your error messages indicate that this error did not happen in version 1.5.1. The error messages refer to line 564, but the current file is shorter.

Please use the latest version and tell me if the error still happens.
Also, where did you obtain the mod?
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
SaKeL
Member
 
Posts: 193
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: [Mod] HUD bars [1.5.1] [hudbars]

by SaKeL » Mon Nov 21, 2016 23:06

i have merged your latest changes to my repo right after that, even though it said "up to date" ..im using tenplus1 modification
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 

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

Re: [Mod] HUD bars [1.5.1] [hudbars]

by Wuzzy » Tue Nov 22, 2016 01:07

Well, sorry. I do not support unofficial forks and modifications of this mod. I only support the mod which you can download from this thread.
Please only post bugs here if you found them in the official version.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
SaKeL
Member
 
Posts: 193
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: [Mod] HUD bars [1.5.1] [hudbars]

by SaKeL » Tue Nov 22, 2016 06:55

Yes that is clear, but my question was more about if you have experienced this issue with yr mod also in order for me to determin the right forum page. Thanks though.
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 14 guests

cron