GZSHud - Gutawer's ZScript HUD

For high-res texture/sprite projects, sprite-fix patches, music add-ons, music randomizers, and other graphic/sound-only projects.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

GZSHud - Gutawer's ZScript HUD

Post by Gutawer »

Gutawer's ZScript HUD - a minimalist status bar-inspired HUD

Note - GZSHud requires GZDoom 3.0.0 to work properly. Update GZDoom before complaining that something is broken.
Spoiler: Screenshots
GZSHud is written entirely in ZScript, meaning that it maintains a very large amount of mod compatibility compared to previous SBARINFO HUDs where compatibility patches are necessary - specifically, the ammo bar will display ammo from any mod you throw at it, as can be seen here:
Spoiler: Mod Compatibility Screenshots
(Note - I'm not claiming full mod compatibility here, certain mods will still cause oddities, but most simple weapon packs will work just fine.)

Download
https://www.dropbox.com/s/7dbdxiyyrjysa ... d.pk3?dl=0

Other stuff

GZSHud might look like a status bar, but it works as a fullscreen HUD, so please switch to that if you want to actually use the HUD.

Check the GZSHud Options menu item for customisation options, including background box alpha, ammo bar display, etc.

Feel free to use the code to learn about ZScript status bars (I urge you to give it a go, they're pretty cool), and feel free to use parts of the code in your own projects if you want (provided I get credited).
Critique, improvements, etc. are encouraged.

So, urr... that's about it. Enjoy!
Spoiler: Updates
Spoiler: Credits
Last edited by Gutawer on Sat Sep 09, 2017 7:03 pm, edited 5 times in total.
User avatar
leodoom85
Posts: 684
Joined: Sun Sep 14, 2014 6:40 pm
Location: Earth-shaking Chile

Re: GZSHud - Gutawer's ZScript HUD

Post by leodoom85 »

Did a little showcase of the hud :)
User avatar
jpalomo
Posts: 771
Joined: Mon May 17, 2010 9:45 am

Re: GZSHud - Gutawer's ZScript HUD

Post by jpalomo »

Gutawer wrote: These aren't in any menu, because I don't want to clash with other mods' MENUDEF lumps. Change them through the console, if you want to.
You can use AddOptionMenu in MENUDEF. If you need an example of how to use it, see Xaser's DamNums mod.

I really like the simplistic look of this. I'll give it a try.
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: GZSHud - Gutawer's ZScript HUD

Post by Gutawer »

Good point about the AddOptionMenu thing, I'll put that in the next update with the level stat stuff.
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: GZSHud - Gutawer's ZScript HUD

Post by Gutawer »

https://www.dropbox.com/s/7dbdxiyyrjysa ... d.pk3?dl=0
New version (link is the same as it was), added a menu item for the HUD's settings + level stat stuff.
argv
Posts: 184
Joined: Tue Aug 30, 2016 4:47 pm

Re: GZSHud - Gutawer's ZScript HUD

Post by argv »

Looks cool, but murders my frame rate! FPS in a small room is down by 80% (from 100 to 20). “stat vm” (in the console) shows that it's spending a lot of time in the VM (around 20ms per frame with this mod, and 0.2ms without). Running GZDoom 3.1.0.

So, I went and optimized it. :D Now it has no noticeable performance impact. Here's the patch: https://gist.github.com/argv-minus-one/ ... 2634a0d53a

Please consider publishing your mod on a code hosting site like GitHub (https://github.com/). Then, others can observe the changes you make, and easily contribute (with pull requests).
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: GZSHud - Gutawer's ZScript HUD

Post by Gutawer »

Good call! Looking back on my original code for that... I was probably tired when I wrote that part, it's fucking awful (also, I was much newer to ZScript and wasn't aware that array.find() functioned similarly to C++'s std::vector::find(), heh) :P. I'll merge this in in a short while (though I don't plan to move GZDHud to github, it's pretty much done as of now).

EDIT: Alright, updated. The DL link in the OP should contain the newest version. Thanks for that :D.
argv
Posts: 184
Joined: Tue Aug 30, 2016 4:47 pm

Re: GZSHud - Gutawer's ZScript HUD

Post by argv »

Oh, I didn't notice the word “minimalist”, heh. Fair enough. Hopefully there'll be more feature-rich ZScript HUDs soon.
TERMiNAL
Posts: 9
Joined: Mon Jul 31, 2017 11:40 am

Re: GZSHud - Gutawer's ZScript HUD

Post by TERMiNAL »

This is an awesome HUD, works well with Project Brutality!

But any chance you could add mines/grenades to the hud for PB?
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: GZSHud - Gutawer's ZScript HUD

Post by Gutawer »

The code for the ammo bar & ammo display is all done automatically based on the ammo that weapons use - one goal of this mod is to showcase ZScript's ability to create mods which are inherently compatible with other mods (much moreso than previously possible using SBARINFO/DECORATE/ACS, anyway). As such, I feel that it would be going against my intent for this mod to write code specifically to support one of PB's features; many mods add hotkey grenades, and unfortunately there is no community-agreed on (or in-engine) standard for that feature, making it impossible for me to support PB's grenades without going against the point of this mod. Sorry about that.
User avatar
Outtagum
Posts: 72
Joined: Wed Aug 16, 2017 5:29 am

Re: GZSHud - Gutawer's ZScript HUD

Post by Outtagum »

I've only just come across this HUD. It's really pretty cool. I like the modern vibe mixed with the traditional layout and it seems to work with pretty much every Doom thing I throw at it!

I wonder, though, if you'd consider making a Heretic version or make this one Heretic compatible?

Regardless, this HUD is now on my Doom autoload list. Thank you. :)
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: GZSHud - Gutawer's ZScript HUD

Post by Gutawer »

Sorry about taking so long to respond, but yeah I'll have a go at adding Heretic support, along with an update I've been planning to add a fullscreen mode with the boxes off in the corners.
User avatar
Barry Burton
Posts: 87
Joined: Tue Sep 03, 2019 2:20 pm

Re: GZSHud - Gutawer's ZScript HUD

Post by Barry Burton »

Apologies for the bump but I thought I should mention that the HUD doesn't seem to function correctly for me in GZDoom 4.2.4. While the stat numbers are updated there is no health bar and the armour bar seems to stay yellow.

I wonder if there's any chance of an update? Being a nice mix of modern aesthetic and old school layout it looks really pretty. :)
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: GZSHud - Gutawer's ZScript HUD

Post by Gutawer »

I've been aware of these issues for a while but didn't fix them due to not knowing if anyone actually used the HUD, heh. I'll take a look at fixing it now that someone's asked about it. Thanks!

EDIT: Fixed. Here's a new link: https://www.dropbox.com/s/7dbdxiyyrjysa ... d.pk3?dl=0

If anyone's curious on why this broke cross-versions, I was accidentally relying on undefined behaviour related to the lack of implicit defaulting for values declared in ZScript in the past. Now, ZScript does implicitly provide a default values for variables, so my code broke.
User avatar
Barry Burton
Posts: 87
Joined: Tue Sep 03, 2019 2:20 pm

Re: GZSHud - Gutawer's ZScript HUD

Post by Barry Burton »

Thanks so much for your quick reply and super quick fix. All's running well now. It looks particularly good with D4V. :)
Post Reply

Return to “Graphic/Audio Patches”