I'm at a loss. I've spent all day trying to set my newly purchased voice files so that specific conditions in battles can trigger them. For example, my protagonist, Stefan, is supposed to grunt in pain every time he loses HP, but it doesn't work if he's grunting every turn he has less than maximum hp. It's just silly! I've tried everything, even plugins, but it's not going well! Can anyone help out? What can I do to set it so he will only make that noise the moment he's hit by an enemy?
Specific battle conditions
RPG Maker MV Supportit would have helped if you showed a screenshot of what you've done, because without details we'll have to guess as to where you made a mistake. This is especially true as there are several different ways to handle voices, and you didn't describe which one you used.
Either you forgot to store the HP to be able to check the difference between new and old damage (which means we need to see the event code to check) or you messed up condition/span of the troop event.
Either you forgot to store the HP to be able to check the difference between new and old damage (which means we need to see the event code to check) or you messed up condition/span of the troop event.
As you can see I stored Stefan's hp into a variable, but because of this he seems to grunt in pain every time his turn comes around, and he has less than his max hp. I want to set it so he only grunts the moment he's hit. I know about what all three spans do, but if I choose battle he will grunt once and never do it again, while moment will make him do it on a really loud loop, which hurts my ears, let me tell you. As for conditions, none of them fit what I need.
wrong, you didn't store his HP into a variable, you stored his Max HP into a variable.
MaxHP never changes, because the damage goes to the current HP and not to the maximum number of HP when fully healed.
second, while you stored the value you compared it to itself. I said you need to compare old hp to current hp to determine if the actor was hit additionally since last time the check was run. that means you need to use two different variables for the conditional branch, one that is set before the branch to contain the current HP and another that only gets updated inside the branch and only if it was different from current HP.
third - that troop event runs at turn end, not during the turn when an attack damages the actor. that can cause a delay of a few second between the wound and when the sound plays.
Could you please tell me what condition to use? I only use turn end because it was the closest one that I thought would let the event happen.
you need to experiment - there are several ways this can work, but only you can check the timing.
one option would be a condition on actor HP and span = moment, but that will only work if you got the content logic right and there is a limited number of actors.
for other solutions it would be to condition on every turn instead of turn end, but that might need modifications on span and event logic.
and you need to test because of possible lag - the more often the condition is checked the better it will look, but check too often and you create lag causing the timing to get worse and the battles to slow down.
we can't make your game for you - never forget that everyone here helps for free despite usually having their own projects that would need their time. A lot of people here are willing to help to find bugs and to point out to you where you need to work, but we usually don't have enough time to create extensive step-by-step solutions and tutorials.
one option would be a condition on actor HP and span = moment, but that will only work if you got the content logic right and there is a limited number of actors.
for other solutions it would be to condition on every turn instead of turn end, but that might need modifications on span and event logic.
and you need to test because of possible lag - the more often the condition is checked the better it will look, but check too often and you create lag causing the timing to get worse and the battles to slow down.
we can't make your game for you - never forget that everyone here helps for free despite usually having their own projects that would need their time. A lot of people here are willing to help to find bugs and to point out to you where you need to work, but we usually don't have enough time to create extensive step-by-step solutions and tutorials.
I'm sorry but I just don't know how to compare hp. You see, I have autism and I find it really hard to understand. Could you please specify it for me? I'm not asking for a full on tutorial, just easy to understand help.
you have already done this, just with the wrong variables.
your conditional branch needs to read
"If stefan current HP < stefan last HP"
instead of the wrong
"If stefan HP < stefan HP"
And current HP you get the same way you tried to get stefan HP, just use "HP of Actor" instead of "Max HP of Actor" in the game data section.
while last HP will be set only inside the branch, where you have the play SE command, and then in exactly the same way.
I did that and it didn't work. I don't know what else to do. 🙁
then show us a screenshot of your troop event - we can't tell you where you made a mistake without seeing what you did
that should work - as long as it is the actor stefan who gets wounded.
how did you test this and what exactly happens then?
how did you test this and what exactly happens then?
I ran the battle test and Stefan makes no sound at all.
battletest is a quick but incomplete way to start a fight, and should only be used for balancing test because a lot of the other options are intentionally disabled to make the battle test faster.
and that includes skipping configurations for 90% of the plugins.
please launch a real playtest of the game and test the sound in a real game battle.
Nothing. Stefan was completely quiet. 🙁
I feel like I need to give up and just run the game without voices. And I had my hopes up too. 🙁
Original thread: https://forums.rpgmakerweb.com/threads/specific-battle-conditions.116262/