Trying to make a skill that gives you a benefit if your character didn't take damage the last round. No idea how to check for it
Skill that does extra effect if last round you were not damaged.
RPG Maker MV SupportI suppose one way would be to set a variable equal to the hp of the user and check if it’s lowered.
Yeah, run a common event each turn in battle, that sets the current HP of the character to two different variables, and in between the 2 checks, a conditional branch that grants the skill boost (probably should set it to a variable, which should be made part of the skill damage formula), if the 2nd HP variable is equal or higher to the 1st HP variable.
That way, after the starting turn, if the character was hit during that turn, the first variable will be read lower than the second variable, therefore not trigger the boost. If they didn't get hit, or got healed for more than they started with, it'll read it as such, and trigger the boost.
That way, after the starting turn, if the character was hit during that turn, the first variable will be read lower than the second variable, therefore not trigger the boost. If they didn't get hit, or got healed for more than they started with, it'll read it as such, and trigger the boost.
On second thought it wouldn’t be that easy. You could make a troop event that runs at turn 0 and sets a variable to equal the hp of the user. Then on the next event page make the condition “turn end” and set a different variable to equal the users hp and then check if that variable is less than your previous variable.
Milennin’s answer is more concise. His explanation should do the trick.
Ah so you mean Troop event page?
Page 1: every turn
V1: Current HP
V2: Current HP
if V2 >= V1 then X
I dont see how it would work if both Variables check and are check at the same time?
Also does that mean I need to add this in every enemy troops?
Every troops page, yes. Trigger each turn.
Put the branch in between variable 1 and 2, like this:
V1: current HP
if V2 >= V1 then give boost
V2: current HP
Put the branch in between variable 1 and 2, like this:
V1: current HP
if V2 >= V1 then give boost
V2: current HP
You would need to check the hp at the beginning of the turn by setting the page condition to turn 0. Then on another page set the condition to turn end and check the hp again. You can use yanflys base troop events so you don’t have to copy it to every troop.
Original thread: https://forums.rpgmakerweb.com/threads/skill-that-does-extra-effect-if-last-round-you-were-not-damaged.126040/