this is probably a dumb question and certainly was answered multiple times, but I got stuck here:
I want to create a simple trigger event, that plays a sound, whenver a units energy reaches zero.
I tried the event "Unit - Property changes" and tried out some different conditions but nothing seems to work.
Thank you for your time and your help.
I can't test this right now, but try to make the sound play when the energy is lower than 1 (is that possible to set it up like this? I haven't looked at that event yet..).
Because energy is actually a Real value. So a unit could have 50.2 energy, then use a spell and have 0.2 energy. Ingame it would show as 0, but the event wouldn't get triggered because it isn't exactly 0.
It's not that common for a unit to actually reach 0 energy. Usually you have like 3 or 5 or so remaining, and since energy is a real value (like s3rius said) you could even have 0.2 and your trigger wouldn't fire. You should just check for < 10 or something, and you'd most likely get it to go off more often. If that was your problem.
Though I'm guessing the sound would go off as you regen as well, with the event you're using. So a sound would be played when you hit, for example, 5 energy, and then again as you regen up to 6, and again at 7 etc. Maybe some kind of on-screen effect might be a better way to display low energy?
Thank you all for your help! That the energy does not always hit 0.0 points helped me much.
My condition now says 1 energy and after the sound played i told the trigger to disable for a few seconds, so that the sound wouldn't go off more than one time.
At the moment it is a one player map with just one hero unit, so this works fine for me.