[v1.0.2] DamNums - Universal Damage Numbers

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
Lord Misfit
Posts: 219
Joined: Wed Dec 27, 2006 8:13 pm
Location: Canton, OH

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by Lord Misfit »

While it's a nice addon and a good template for ZScript learning with this kind of thing, I was wondering if damage indicators for the player [like maybe on-screen/HUD indicators ala DoomRPG/Aetherius/Wrath of Cronos] were possible to do in this?

Also, in the future, would this be able to work with "healing" elements in the rare situation that happens to a monster? :o
User avatar
kadu522
Posts: 212
Joined: Fri Mar 03, 2017 12:32 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Location: Brasil,Rio de janeiro

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by kadu522 »

Lord Misfit wrote:While it's a nice addon and a good template for ZScript learning with this kind of thing, I was wondering if damage indicators for the player [like maybe on-screen/HUD indicators ala DoomRPG/Aetherius/Wrath of Cronos] were possible to do in this?

Also, in the future, would this be able to work with "healing" elements in the rare situation that happens to a monster? :o
I asume is preaty easy to do.

Just detect that a heal has bean done and change the color acordingly(Defalt Grean mostly).
If you want to take a step futher you could allow individual constumisation for healing and damage as well!

as for hud however the hard part in inplementing it on a non-intrusive maner, DoomRPG got the right idea of concentrating them on the botton part of the screen so that your area of vision is not "Number Cloged"; it is also a good candidate for constumisation itself.
User avatar
ZZYZX
 
 
Posts: 1381
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by ZZYZX »

For some reason the numbers don't spawn when monsters explode in Doom4Doom. They do with regular damage (non-xdeath).
I first thought they are just not visible in the blood mess, but then I just typed freeze and apparently there are actually no numbers :(
Tekish
Posts: 130
Joined: Tue Jun 28, 2016 6:31 pm

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by Tekish »

I tried this out yesterday and now I use this with everything - nice work. There are two issues I've noticed:

- More resilient enemies that move toward you while taking damage can block the numbers with their own sprites.
- When the game auto-kills a lost soul from a pain elemental, it displays 99999 damage. I'm not sure if this is intended behavior (because I guess the game is doing that much damage to kill the lost soul), but it can get a bit spammy when a lot of pain elementals are confined to a small area.
User avatar
Enjay
 
 
Posts: 26416
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by Enjay »

Tekish wrote:- When the game auto-kills a lost soul from a pain elemental, it displays 99999 damage. I'm not sure if this is intended behavior (because I guess the game is doing that much damage to kill the lost soul), but it can get a bit spammy when a lot of pain elementals are confined to a small area.
If you hit an enemy with the MDK console command, the same thing happens - but I quite like it. :P
User avatar
Major Cooke
Posts: 8070
Joined: Sun Jan 28, 2007 3:55 pm

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by Major Cooke »

The max limit for the numbers is 99999. That's the highest it can go.

@Xaser: Made a pull request. This fixes the issue ZZYZX mentioned and also cleans things up a bit.
User avatar
Xaser
 
 
Posts: 10771
Joined: Sun Jul 20, 2003 12:15 pm

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by Xaser »

I'm planning on extending the number of digits eventually. Right now I'm using some TEXTURES voodoo to offset all the numbers (that way they look correct from all angles), but the definitions are pretty tedious. There's a suggestion for an A_SpriteOffset function that Graf is planning on taking a look at after 3.0's release. Failing that, I'll write a script to generate the TEXTURES lump so definitions of new fonts doesn't totally suck; I'll probably bump the max digit count way up at that point.

Either way, for the Lost Souls, there's not a super-easy way to detect for that case since A_PainAttack (well, its scripted sub-function A_PainShootSkull) is just dealing a million damage with DamageType 'None'. So, uh... "it's a feature," I guess. It's not like it's incorrect. :P

@Major Cooke: thanks for the PR! It's hella good seeing Git working as intended for mod development. :D
User avatar
Major Cooke
Posts: 8070
Joined: Sun Jan 28, 2007 3:55 pm

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by Major Cooke »

Be warned: When you set a name for a thinker, you better stick with it. I just discovered the hard way that by changing DamageKeeper's name, it broke my saved games.
User avatar
Xaser
 
 
Posts: 10771
Joined: Sun Jul 20, 2003 12:15 pm

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by Xaser »

I wouldn't hold my breath on any savegames working between mod updates, for any mod, frankly. It's a rather rare occurrence when it does.
User avatar
ZZYZX
 
 
Posts: 1381
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by ZZYZX »

And that's why GZDoom should maintain checksum of ZScript classes between savegames. I've opened a ticket at the tracker, Graf closed it instantly and said "it's not needed because we've been here for decades without it and it works".
User avatar
Major Cooke
Posts: 8070
Joined: Sun Jan 28, 2007 3:55 pm

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by Major Cooke »

Is there a reason why you're using floats instead of doubles?
User avatar
Xaser
 
 
Posts: 10771
Joined: Sun Jul 20, 2003 12:15 pm

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by Xaser »

If you see something that looks incorrect, please point it out as "hey this looks wrong," not "why did you do 'x'?" The latter wastes time and brain cells.

Related, though: I was under the impression that "float" aliased to "double" in ZScript -- though according to Graf here, it looks like the answer is "sometimes," which is really weird on the surface. I'm guessing this was a case of being forced to support single-precision for compatibility or somesuch.
User avatar
Major Cooke
Posts: 8070
Joined: Sun Jan 28, 2007 3:55 pm

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by Major Cooke »

The reason I didn't say it's wrong is because of just that. I thought you had a particular use case for floats and wanted to know. That wasn't a trick question.

But now that we're on that channel with your response, floats only truly mean doubles in DECORATE. That was randi's doing.
User avatar
Major Cooke
Posts: 8070
Joined: Sun Jan 28, 2007 3:55 pm

Re: [v0.1.1] DamNums - Universal Damage Numbers

Post by Major Cooke »

Shot up a new pull request. This one's pretty critical and probably should warrant another version release after doing some extensive testing (which I'm working on now).
User avatar
Xaser
 
 
Posts: 10771
Joined: Sun Jul 20, 2003 12:15 pm

Re: [v0.2.0] DamNums - Universal Damage Numbers

Post by Xaser »

Update! Whoop!

Version v0.2.0 is live and available at the usual place. Aside from sporting totally rewritten (read: less-hacky) internals, the big changes are the addition of a couple of new options:
  • Physics: choose between the gravity-affected "Toss" (default) or a more subtle vertical "Float" style.
  • Spawn Numbers For... allows you to choose whether numbers should spawn on just monsters (default), or all shootable objects (including barrels).
As always, give it a whirl and let me know if there's anything funkular (particularly with the "works with any mod" bit -- there was a D4D edge case that got patched in this version, so it's getting better-er now).

Return to “Graphic/Audio Patches”