It there anyway to detect when any entity is damaged?
The in-game audio alerts for when your stuff getting damaged is incredibly delayed. I often find myself with a chunk of my factory destroyed before the game decides to even play the alert-damaged sound effect let alone when something gets destroyed. If I'm watching for it the alert icons they appear but the sound effect doesn't always play or plays right as the icon disappears.
I've written a "personal" mod the tells me every time one for my units/structures dies. Now I'd like to know when one of my structured gets under 60% health.
Only way I can think of or find is by abusing on_tick to scan all entities hp values and trigger the alert as needed.
Way to detect damaged entities?
Re: Way to detect damaged entities?
The sound plays when an entity is destroyed. That's just a fact since I'm looking at the code that does it now.
If you want to get ahold of me I'm almost always on Discord.
Re: Way to detect damaged entities?
What is that sound? So I can manually play it a few times to "learn" it. Does it play for every biter destroyed structure or with a cool down of some sort? I must not realize what it is to notice it then or think it is a sound for something else. I notice my "C&C Red Alert Structure Destroyed" instantly and check the map for biters.Rseding91 wrote:The sound plays when an entity is destroyed. That's just a fact since I'm looking at the code that does it now.
[edit]
I figured out the sound. I thought it was triggered if I was under attack for a while.