[Mod] Gauges [gauges]

Post Reply
User avatar
Calinou
Moderator
Posts: 3162
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

[Mod] Gauges [gauges]

by Calinou » Post

Adds health and breath bars above players.

GitHub repository (includes issue tracker)

Download
Rename the directory to “gauges” after extracting the .zip file.

No dependencies.
License for code: MIT
License for textures: CC0 1.0 Universal

Settings

health_bars: whether to enable gauges. Gauges are always disabled when damage is disabled.[true]

Gauges do not appear above yourself in third person. The breath bar appears as an overlay of the health bar.

Esteban
Member
Posts: 873
Joined: Sun Sep 08, 2013 13:26
GitHub: Esteban-
IRC: Esteban
In-game: Esteban
Location: Somewhere in the Caribbean...

Re: [Mod] Gauges [gauges]

by Esteban » Post

This an awesome mod!
Are there plans on adding a hunger bar if the "Better HUD" mod is enabled?

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

Re: [Mod] Gauges [gauges]

by 4aiman » Post

Oh, and I've thought it was mine gauges brought up to life one again :)
Screen shots, please! ;)

User avatar
Calinou
Moderator
Posts: 3162
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Re: [Mod] Gauges [gauges]

by Calinou » Post

Esteban wrote:This an awesome mod!
Are there plans on adding a hunger bar if the "Better HUD" mod is enabled?
I don't think so, but you can (or someone else) attempt doing it.
4aiman wrote:Oh, and I've thought it was mine gauges brought up to life one again :)
Screen shots, please! ;)
I'm not sure about the visual looks of the bars yet, I may redo them entirely.

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

Re: [Mod] Gauges [gauges]

by 4aiman » Post

No better hud, please. Its hunger is terrible.
I'm not against using its textures if it's enabled. I'm against the mechanics of the hunger there is. Can't understand why no one cares of their inferiority :(

User avatar
indriApollo
Member
Posts: 146
Joined: Fri Sep 26, 2014 11:34
GitHub: indriApollo
IRC: indriApollo
In-game: SudoAptGetPlay
Location: Belgium
Contact:

Re: [Mod] Gauges [gauges]

by indriApollo » Post

This mod is very nice, thanks Calinou :)

User avatar
GreenXenith
Member
Posts: 1314
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
IRC: GreenXenith
In-game: GreenXenith
Location: SCP-3008
Contact:

Re: [Mod] Gauges [gauges]

by GreenXenith » Post

Hate to bump such an old topic, but I noticed the download link is out of date. So I got the mod from Carbone and put it here for anyone that needs it.
Attachments
gauges.zip
(9.08 KiB) Downloaded 59 times
Y▹uTube | Mods | Patre●n | Twitter | Minetest Discord | GreenXenith#3232

Hey, you. You're finally awake.
You were trying to view their profile, right? Found the rest of their signature, same as us, and that guest over there.

User avatar
Lejo
Member
Posts: 684
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: [Mod] Gauges [gauges]

by Lejo » Post

I get this Error after is use a vehicles
and then the server shut down. What is the Problem?
Image
I know that the mod money is there too.

Lejo

User avatar
niwla23
Member
Posts: 118
Joined: Sat Nov 17, 2018 17:40
In-game: Niwla

Re: [Mod] Gauges [gauges]

by niwla23 » Post

please update it to 5.0.0. it must be y=19 instead of y=10

User avatar
FreeGamers
Member
Posts: 602
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Gauges [gauges]

by FreeGamers » Post

niwla23 wrote:please update it to 5.0.0. it must be y=19 instead of y=10
If anyone else uses this mod at this point, edit line 51 to be

Code: Select all

                ent:set_attach(player, "", {x = 0, y = 19, z = 0}, {x = 0, y = 0, z = 0})
Then the gauge will be in the proper position.

User avatar
FreeGamers
Member
Posts: 602
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Gauges [gauges]

by FreeGamers » Post

Can somebody help me understand what is happening with this mod and my server? I get fatal crashes when certain clients/players join or leave the game with multiple players on. I'm using the latest version. It seems maybe its not detected the player names for some reason?

Code: Select all

2019-11-21 16:48:38: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'gauges' in callback environment_Step(): /usr/share/games/minetest/mods/lib_player/gauges/init.lua:47: attempt to index local 'player' (a nil value)
2019-11-21 16:48:38: ERROR[Main]: stack traceback:
2019-11-21 16:48:38: ERROR[Main]:       /usr/share/games/minetest/mods/lib_player/gauges/init.lua:47: in function 'func'
2019-11-21 16:48:38: ERROR[Main]:       /usr/share/games/minetest/builtin/common/after.lua:18: in function </usr/share/games/minetest/builtin/common/after.lua:4>
2019-11-21 16:48:38: ERROR[Main]:       /usr/share/games/minetest/builtin/game/register.lua:419: in function </usr/share/games/minetest/builtin/game/register.lua:399>
2019-11-21 16:48:38: ERROR[Main]: stack traceback:
The function that is crashing is this:

Code: Select all

local function add_HP_gauge(name)
        local player = minetest.get_player_by_name(name)
        local pos = player:get_pos()
        local ent = minetest.add_entity(pos, "gauges:hp_bar")

        if ent ~= nil then
                ent:set_attach(player, "", {x = 0, y = 19, z = 0}, {x = 0, y = 0, z = 0})
                ent = ent:get_luaentity()
                ent.wielder = player:get_player_name()
        end
end
I wonder if something like

Code: Select all

        if ent ~= nil then
                ent:set_attach(player, "", {x = 0, y = 19, z = 0}, {x = 0, y = 0, z = 0})
                ent = ent:get_luaentity()
                ent.wielder = player:get_player_name()
       else
                return
       end
end
Would resolve this? I'm going to add this and try to resolve this fatal crash on my server...

User avatar
FreeGamers
Member
Posts: 602
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Gauges [gauges]

by FreeGamers » Post

Actually, I'm not sure that will resolve this because it looks like the crash comes from the fact that there is no string to pass onto the local variable "player".

How can I prevent this from crashing the game?

User avatar
Calinou
Moderator
Posts: 3162
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Re: [Mod] Gauges [gauges]

by Calinou » Post

FreeGamers wrote:Actually, I'm not sure that will resolve this because it looks like the crash comes from the fact that there is no string to pass onto the local variable "player".

How can I prevent this from crashing the game?
Sorry for the delay in replying. Can you test again with Gauges 1.0.1? It may have been fixed in the refactor.

User avatar
FreeGamers
Member
Posts: 602
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Gauges [gauges]

by FreeGamers » Post

OK I'll load it into my server and give it a test.

MoNTE48
Member
Posts: 321
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

Re: [Mod] Gauges [gauges]

by MoNTE48 » Post

With the additional checks that I added there should be no more another crashes.
I hope that I have solved all the problems of this mod.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests