[v1.1.0+] Pragmatic Heroism

A place to post your add ons and ideas for them

Moderator: Moderator

Message
Author
Zizzo
Sher'Tul Godslayer
Posts: 2520
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#16 Post by Zizzo »

Hachem_Muche wrote:But why not change the weight of everything? Sounds like a debugging adventure!
Eh heh… that's generally the kind of "adventure" I try to avoid. :?
Hachem_Muche wrote:Actually I thought Zomnibus had a way to change the weight of each individual addon.
No, ZOmnibus is a single addon; it predates the .teaac "addon collection" infrastructure, and back when I asked, no one expressed any interest in having ZOmnibus retooled to use said infrastructure.
Hachem_Muche wrote:The default weight for addons (is supposed to be) 100.
Out of curiosity, what's your source for this?
Hachem_Muche wrote:PTT does override other addons, because it pretty much replaces the entire tooltip for actors. Another addon (at a higher weight) that tried to modify the normal ToME tooltip would probably break.
Oh, I know overloading is necessary sometimes; I've had to resort to it myself.
Hachem_Muche wrote:Have you tested PH with a higher weight than PTT to confirm it works?
I was really hoping to avoid having to resort to that, actually, for the reasons I mentioned above.
Hachem_Muche wrote:The next (rather sloppy) option I can think of is defining something like a new mod.Actor._life_text(self) function that returns the string you want to display, and then using that in your search and replace code to update actor life in the tooltip. It would then be easy enough to have PTT check for that function and use it.
That's pretty much exactly what I was going to suggest, actually.
Hachem_Muche wrote:Also note that if the player really needs to see the negative life of an npc, he can temporarily disable PTT's actor tooltip and the normal tooltip (using PH) will be displayed.
True, but that's kind of inconvenient.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2520
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#17 Post by Zizzo »

Hachem_Muche wrote:The next (rather sloppy) option I can think of is defining something like a new mod.Actor._life_text(self) function that returns the string you want to display, and then using that in your search and replace code to update actor life in the tooltip. It would then be easy enough to have PTT check for that function and use it.
We Apologize for the Delay;™ I was hoping to get Hellcommander's Spine of the Spire error fixed so I could combine both changes into a single ZOmnibus release, but I never could find what that was about. At any rate, the just-released v2d defines the Actor:negativeLifeStr() method for exactly the purpose you describe above. As I read your code, it looks like you could incorporate this by changing this line:

Code: Select all

if self.life < 0 then ts:add({"color", 255, 0, 0}, "HP: unknown")
to something like:

Code: Select all

if self.life < 0 then
  local neg_hp = self.negativeLifeStr and self:negativeLifeStr() or 'unknown'
  ts:add({"color", 255, 0, 0}, "HP: " .. neg_hp)
No one else should see any changes in functionality in this release (I hope…).
"Blessed are the yeeks, for they shall inherit Arda..."

Nagyhal
Wyrmic
Posts: 282
Joined: Tue Feb 15, 2011 12:01 am

Re: [v1.1.0+] Pragmatic Heroism

#18 Post by Nagyhal »

I'm not sure this was ever a very good mechanic.

Frankly, it would be better gameplay if you could see exactly how many negative HP you have lost when you are below 0 HP, but couldn't tell and had to guess when you were above 0 HP.

Zizzo
Sher'Tul Godslayer
Posts: 2520
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#19 Post by Zizzo »

Nagyhal wrote:I'm not sure this was ever a very good mechanic.

Frankly, it would be better gameplay if you could see exactly how many negative HP you have lost when you are below 0 HP, but couldn't tell and had to guess when you were above 0 HP.
*blink* I'm… frankly mystified by the idea that not being able to know how close you are to dying would be good gameplay. That's kind of the raison d'être for this addon, after all.

[Unless you mean that the effect you describe would only apply when you have a die-at threshold less then zero — although even then, typically your die-at threshold is close enough to zero that by the time you're into negative HP, you're already in holy-crap panic territory anyway.]
"Blessed are the yeeks, for they shall inherit Arda..."

Row
Higher
Posts: 54
Joined: Mon Aug 20, 2012 10:57 am

Game Freeze

#20 Post by Row »

When in negative life and mouse over a skill, the game freezes. I think the bug is in the Pragmatic Heroism add-on. Classic UI.

Micbran
Sher'Tul
Posts: 1154
Joined: Sun Jun 15, 2014 12:19 am
Location: Yeehaw, pardner

Re: [v1.1.0+] Pragmatic Heroism

#21 Post by Micbran »

Can you reproduce the error and grab it via. Screenshot?
A little bit of a starters guide written by yours truly here.

Row
Higher
Posts: 54
Joined: Mon Aug 20, 2012 10:57 am

Re: [v1.1.0+] Pragmatic Heroism

#22 Post by Row »

I figured other add-on was responsible: Classic UI buff removal. After turning it off there is no freeze.

Zizzo
Sher'Tul Godslayer
Posts: 2520
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#23 Post by Zizzo »

Pushing out v2d.1 to fix Yet Another Glitch™ in the Classic UI.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2520
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#24 Post by Zizzo »

I'm experimenting with a new style of life bar display:
combined-lifebar.png
combined-lifebar.png (13.65 KiB) Viewed 11704 times
combined-lifebar-classic.png
combined-lifebar-classic.png (2.73 KiB) Viewed 11704 times
The idea is a "combined" life bar, showing both your normal hit points and your "negative" hit points (the latter is the bit in darker red on the Minimalist UI and black on the Classic UI). I figure this will be more useful for characters who have some permanent source of a negative die-at threshold, as a more visible reminder that you've still got some buffer if your life gets low. I plan to make it switchable between this and the original black-bar display via a new game option.

So. Thoughts before I release this? [Up to and including "dear lord, don't do that, it's horrible!" :oops: :wink: ]
"Blessed are the yeeks, for they shall inherit Arda..."

astralInferno
Uruivellas
Posts: 834
Joined: Mon Jan 27, 2014 10:40 am

Re: [v1.1.0+] Pragmatic Heroism

#25 Post by astralInferno »

What does it look like when your current life is /lower/ than your negative life? a red bar with the dark red bit extending from it? (IE, reversed colors from the examples?)

Zizzo
Sher'Tul Godslayer
Posts: 2520
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#26 Post by Zizzo »

astralInferno wrote:What does it look like when your current life is /lower/ than your negative life?
Like this:
combined-lifebar-negative.png
combined-lifebar-negative.png (13.07 KiB) Viewed 11692 times
combined-lifebar-negative-classic.png
combined-lifebar-negative-classic.png (1.88 KiB) Viewed 11692 times
The test character I've been grabbing these images from has 148hp and a die-at threshold of -100hp; it may be clearer in the full-health bars:
combined-lifebar-full.png
combined-lifebar-full.png (13.79 KiB) Viewed 11692 times
(oops, only 3 attachments allowed…) that the "negative-life" part of the bar takes up about 40% of the bar, which works out proportionally. The idea is that instead of the life bar going from 0hp to 148hp when you're above 0hp and -100hp to 0hp when you're below 0hp, it will go from -100hp to 148hp all the time (well, or until the die-at threshold expires, if it's temporary :wink: ), and the below-zero part is just colored differently.
"Blessed are the yeeks, for they shall inherit Arda..."

astralInferno
Uruivellas
Posts: 834
Joined: Mon Jan 27, 2014 10:40 am

Re: [v1.1.0+] Pragmatic Heroism

#27 Post by astralInferno »

Zizzo wrote:The test character I've been grabbing these images from has 148hp and a die-at threshold of -100hp; it may be clearer in the full-health bars:
combined-lifebar-full.png
Ah, that's not what I meant. What I meant was-
(oops, only 3 attachments allowed…) that the "negative-life" part of the bar takes up about 40% of the bar, which works out proportionally. The idea is that instead of the life bar going from 0hp to 148hp when you're above 0hp and -100hp to 0hp when you're below 0hp, it will go from -100hp to 148hp all the time (well, or until the die-at threshold expires, if it's temporary :wink: ), and the below-zero part is just colored differently.
-irrelevant! Cool. ^^

Zizzo
Sher'Tul Godslayer
Posts: 2520
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#28 Post by Zizzo »

astralInferno wrote:-irrelevant! Cool. ^^
And with that… sort of ringing endorsement, :wink: I'll go ahead and push this out as v3. By default, the new "Combined life bar" game option is disabled, leaving the original life bar handling in place, so as not to surprise anyone.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2520
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#29 Post by Zizzo »

I swear, I keep tripping over missing bits in the life-bar/shield display… :oops: v3a fixes another of those bugs that would have choked the display. We Apologize for the Inconvenience.™
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2520
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#30 Post by Zizzo »

…Wow, I really wasn't paying attention, was I? Instead of "HP: unknown", 1.6 apparently will now happily report that an actor has -200 HP, and even "helpfully" add that that's -162% of its max life — neither of which, of course, offer any insight into how close said actor is to, y'know, actually dying, which was kind of the whole point of this addon. :oops: v3a.1 restores the intended behavior, re-adding the actor's die-at threshold and changing the percentage to reflect the remaining percentage of the actor's negative life.

(Now, as I recall, some other addons, notably Plenum, were using this addon's :negativeLifeStr() method in their own downstream manipulation of the actor tooltip. As a heads-up to those addons' authors, this release changes that method to return a slightly different string: since we're now doing reassembly via Lua's .. operator instead of string.gsub(), we no longer have to double-escape the '%' character, so :negativeLifeStr() returns a string with slightly fewer '%'s than before. We Apologize for the Inconvenience.™)
"Blessed are the yeeks, for they shall inherit Arda..."

Post Reply