Page 1 of 1

changing mugshot midgame

Posted: Wed Aug 27, 2025 7:01 pm
by Connorpo1221
I was wondering if there was anyway to do this because I wanted to make it so when you pick up an armor bonus it changes the mugshot to a helmet wearing one, and if you lose all armor the mugshot would change back. I doubt this would be possible with SBARINFO but what about Zscript?

Re: changing mugshot midgame

Posted: Thu Aug 28, 2025 7:10 am
by Enjay
It is possible to check the presence of an item in the users inventory in ZScript and then only do something if the item is/is not present. That also applies to any ZScript used to define a status bar.

As a similar principle, I use a simple check for a custom inventory item in my ZScript status bar.
if (!CheckInventory("NJHUDHider", 1))
After the above line, my code defines the status bar.
If the NJHUDHider item is not present, the status bar gets drawn. If I want the status bar to vanish (during a cutscene) I give the player the NJHUDHider item and the status bar disappears. After the cutscene, I take the NJHUDHider item away again and the status bar returns.

The same idea could probably be used to check for amour and, if present, draw one set of HUD faces, if not present, draw the other set.

It may even be possible to do in SBARINFO. As I recall, it can also draw things conditionally, depending on whether an item is present or not (e.g. keys, inventory bars and so on) but it might be less flexible.

Re: changing mugshot midgame

Posted: Wed Sep 03, 2025 5:43 pm
by Connorpo1221
Thank you for replying I will try this out

Re: changing mugshot midgame

Posted: Wed Sep 03, 2025 8:34 pm
by Connorpo1221
Yeah I'm trying but I really don't know zscript or Sbarinfo, how exactly would I use if (!CheckInventory("NJHUDHider", 1))

(also I'm trying to make sure this is compatible with other hud mods)