Page 1 of 1

[v1.1.0+] Low Health Popup

Posted: Sun Jul 12, 2015 12:14 am
by Zizzo
Inspired by this thread, I've put together a quick Low Health Popup addon. The idea is to interrupt what you're doing when your life falls below a configurable percent of full by popping up a dialog in your face, to block your keystrokes and prevent you from merrily carrying on and only noticing the problem a few turns later when you're dead (why, no, I have no personal experience with this at all, why do you ask? :oops: ). The pop-up threshold is configurable via the "Low-health warning popup threshold" game option in the UI tab of the Game Options dialog.

So, to those who were asking for an option like this in the prior thread (and to those who are interested here), was this what you had in mind? Any changes you'd like to see? And is this something we want to merge into ZOmnibus at some point?

[Technical info:]

Code: Select all

Hooks:
  GameOptions:tabs [to add our game option]
Superload:
  mod.class.Player:
    takeHit() [to check for threshold crossing and pop up the dialog]

Re: [v1.1.0+] Low Health Popup

Posted: Wed Aug 03, 2016 1:36 am
by Zizzo
v1a is a compatibility release with ZOmnibus v15, mostly to avoid having the game option listed twice. If you have any characters using this addon together with ZOmnibus, you should upgrade both together, and future characters should only use one or the other (if you forget, the character creation dialog will warn you).

Re: [v1.1.0+] Low Health Popup

Posted: Sat Aug 06, 2016 7:59 pm
by Zizzo
Some of the dialog collision juggling I had to do in the ZOmibus v15 release inspired me to tweak a few more places with multiple-dialog problems. In this addon in particular, I've occasionally gotten multiple "you-have-fallen-below-N%-life" popups on the same turn, which is kind of redundant. v1b, just released, fixes this by checking whether there's already a low-life popup active before popping up a new one.

Re: [v1.1.0+] Low Health Popup

Posted: Sat Sep 03, 2016 4:23 pm
by Micbran
Low health pop-ups will still appear when the threshold is set to 0... just only if you have negative life.

EDIT: might be related to surge of power

Re: [v1.1.0+] Low Health Popup

Posted: Sun Sep 04, 2016 3:11 am
by Zizzo
Micbran wrote:Low health pop-ups will still appear when the threshold is set to 0... just only if you have negative life.
[sound F/X: source diving] …Okay, that was just sloppy thinking on my part; I forgot about negative die-at thresholds, so I assumed we'd never have to worry about checking a zero threshold. That should be fixed in v1b.1, just pushed out.

Re: [v1.1.0+] Low Health Popup

Posted: Wed Nov 20, 2019 2:11 am
by Zizzo
So I thought I was going to need to retire this addon thanks to 1.6.1's new "Gameplay | Life Lost Warning" option, but on closer examination, it looks like the two can coexist peacefully. I'm posting it as an FAQ below, so that I can link back to it from the Steam page.

[Incidentally, we note that with a heroism infusion or similar effect, it's possible to lose more than 100% of your max life in a single turn and still not die — and the code doesn't appear to check for that, which means you could still get the warning even with the option "disabled" at 100. Easy mistake to make. :oops: :wink: (Although frankly, I'd probably want to get the warning in that case anyway… :shock: )]

Re: [v1.1.0+] Low Health Popup

Posted: Wed Nov 20, 2019 2:12 am
by Zizzo
Frequently Asked Questions:

Is this redundant with the Life Lost Warning game option?

Game release 1.6.1 adds a new option "Gameplay | Life Lost Warning", which pops up a warning and temporarily blocks keyboard and mouse input if you lose more than a specified percentage of your maximum life in a single turn. That's subtly different from this addon's warning dialog, which pops up when your life falls below a specified percentage of maximum. We believe that these two safety checks are complementary, and they should work seamlessly together.

Re: [v1.1.0+] Low Health Popup

Posted: Tue Mar 17, 2020 1:37 am
by Zizzo
By request, v2 adds a new game option "UI | Low-health warning as flyer", which changes the low-health warning from a popup dialog to the way the in-game "UI | Life Lost Warning" works, with a big flyer message and blocking keyboard/mouse input for two seconds.