Specific battle conditions

Orbit135

Villager
Member
Joined
Dec 15, 2019
Messages
10
Reaction score
0
First Language
English
Primarily Uses
RMMV
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?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
it 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.
 

Orbit135

Villager
Member
Joined
Dec 15, 2019
Messages
10
Reaction score
0
First Language
English
Primarily Uses
RMMV
it 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.
upload_2019-12-16_3-10-24.png

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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
As you can see I stored Stefan's hp into a variable
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.
 

Orbit135

Villager
Member
Joined
Dec 15, 2019
Messages
10
Reaction score
0
First Language
English
Primarily Uses
RMMV
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
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.
 

Orbit135

Villager
Member
Joined
Dec 15, 2019
Messages
10
Reaction score
0
First Language
English
Primarily Uses
RMMV
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.
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
I'm sorry but I just don't know how to compare hp.
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.
 

Orbit135

Villager
Member
Joined
Dec 15, 2019
Messages
10
Reaction score
0
First Language
English
Primarily Uses
RMMV
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. :(
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
then show us a screenshot of your troop event - we can't tell you where you made a mistake without seeing what you did
 

Orbit135

Villager
Member
Joined
Dec 15, 2019
Messages
10
Reaction score
0
First Language
English
Primarily Uses
RMMV
then show us a screenshot of your troop event - we can't tell you where you made a mistake without seeing what you did
upload_2019-12-17_4-7-22.png
Stefan HP 2 is the current HP while Stefan HP is the last HP.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
that should work - as long as it is the actor stefan who gets wounded.

how did you test this and what exactly happens then?
 

Orbit135

Villager
Member
Joined
Dec 15, 2019
Messages
10
Reaction score
0
First Language
English
Primarily Uses
RMMV
that should work - as long as it is the actor stefan who gets wounded.

how did you test this and what exactly happens then?
I ran the battle test and Stefan makes no sound at all.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
battle test
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.
 

Orbit135

Villager
Member
Joined
Dec 15, 2019
Messages
10
Reaction score
0
First Language
English
Primarily Uses
RMMV
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. :(
 

Orbit135

Villager
Member
Joined
Dec 15, 2019
Messages
10
Reaction score
0
First Language
English
Primarily Uses
RMMV
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.
I feel like I need to give up and just run the game without voices. And I had my hopes up too. :(
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,574
Latest member
nikisknight
Top