Floating Damage Text


Damage dealt to enemies and structures appear as floating text above their heads. Highly configurable.

Utilities
2 months ago
0.17 - 2.0
17.2K

g Using format '%d', frequent '0' values, presumably due to floor(value) where 0 < value < 1

5 years ago

I found the extra detail in the float values uninteresting, so opted to use '%d' instead. This frequently shows '0' values, presumably because some damage values are 0 < value < 1, and round down.

I'm not sure what the right choice here is, and I've gone back to %.1f for now... I'd kind of like integer display to work, though. Probably by either rounding yourself and not emitting a zero integer value, or using ceil(value) for output. That'd require interpreting the format string though, so ... IDK.

5 years ago

It appears to be that using %i causes floats to be truncated, effectively flooring them. I can add an option to round that number (either using normal rounding or using a ceiling) when the user is using an integer format (%i or %d). I'm working on an update already, so I'll add it to that.

5 years ago

<3 thank you very much.

5 years ago

The update is taken longer than expected so I'll just push the rounding update. I ended up going with an option for rounding to a configurable number of digits. Setting this to 0 would round to the nearest integer. There is an exception in that numbers between 0 and 1 will round up to 1. Actual zeroes aren't displayed at all.

New response