Hello all, I am working on a project and would like some of the community's help figuring this one out.
My goal is to have a sound effect fire off any time an actor's HP drops to, or below, a set threshold - maybe 25% - as a warning to the player. This warning sound would not sound off again until the Actor's HP is brought up ABOVE this threshold, and then back to the warning limit. (I am not looking for a constant beeping sound, a one-off "this character is in danger" trill is all.)
I'd like this sound to fire off per-character. For example, if "Mark" takes a hit and drops to 20% of their max HP this sound fires, and then in the same round if "Lisa" takes poison damage and drops to 17% of their max HP, this sound would fire again. If Mark and Lisa do not change their health or it drops lower the sound does not fire, since neither of them went "above" the 25% warning threshold, thus "resetting" the warning.
I currently have an extremely simple Troop Event on my troops but this only fires once, for the 5th actor in the database. (This was mostly created as a proof of concept.)
[embedded media]
I've done some searching through these forums and the web but could not fin any real solutions, however I admit I could easily have missed something so any help or points in the right direction are very appreciated.
As I write this out it appears more and more complex... If this is best / only achievable via a custom script that's alright, and I can work on that later. I'm wondering if this is (reasonably) attainable via events etc.
For reference I utilize a lot of Yanfly's engine scripts.
Thanks a ton guys!
Help with adding "Low Health" alert
● ARCHIVED · READ-ONLY
-
-
You might want to set the span of that event to "Turn" instead of battle. If the span is "Battle", as you know, it only fires once in the entire battle.
You could try using a second event to check if the HP is above the limit and set a switch/variable to be turned on whenever it happens. Then run a check in the event triggering upon <limit HP to see if the switch/variable was on and play the SE if it was, and then turn it off (so that it won't come back on until HP goes >limit, which is when the other event triggers again and turns it back on).