Hi! I'm using RPGMaker MV and trying to create a state called Rebirth - when a character takes lethal damage, they will revive with full HP and the state will be removed. I've tried a couple of approaches and both of them have their own issues.
1) Passive States
The first approach was to have a particular character have the passive state of Rebirth (using YEP_AutoPassiveStates plugin). i.e. in the character's Note I have <Passive State: 11> which corresponds to my Rebirth state. Rebirth itself doesn't do anything,
its behavior is handled by the Knockout state.
In my Knockout state, I have the following code in the Note section (using YEP_BuffsStatesCore).
This almost works. When the character dies in battle, they are reborn with full HP the way they're supposed to.
However, Rebirth isn't removed, even though I have a call to removeState. I've tried working around it by making Rebirth have a conditional switch, but I'm not sure how to activate the switch during the battle. I've thought about messing about with Rebirth's removal conditions, but none of those seem to fit what I need.
I've also tried applying Rebirth at the start of battle instead of having it be a passive state, but then I run into my second problem:
2) Actively applying Rebirth doesn't work
When I use a skill to give a character Rebirth or when I apply it at the start of combat, the same code I used above doesn't work. The character just dies. Rebirth clearly does get applied because its icon shows up, but it doesn't activate. The code for it works when Rebirth is a passive state, but not when I apply it during battle. I'm really not sure why.
I know this is a pretty specific issue but I was wondering if anyone had run into something like this. Thanks in advance for the help!
1) Passive States
The first approach was to have a particular character have the passive state of Rebirth (using YEP_AutoPassiveStates plugin). i.e. in the character's Note I have <Passive State: 11> which corresponds to my Rebirth state. Rebirth itself doesn't do anything,
its behavior is handled by the Knockout state.
In my Knockout state, I have the following code in the Note section (using YEP_BuffsStatesCore).
State #1 will be automatically added when HP reaches 0.
<Custom Apply Effect>
if (target.isStateAffected(11))
{
target.startAnimation(42);
target.gainHp(target.mhp);
target.startDamagePopup();
target.removeState(11);
}
</Custom Apply Effect>
This almost works. When the character dies in battle, they are reborn with full HP the way they're supposed to.
However, Rebirth isn't removed, even though I have a call to removeState. I've tried working around it by making Rebirth have a conditional switch, but I'm not sure how to activate the switch during the battle. I've thought about messing about with Rebirth's removal conditions, but none of those seem to fit what I need.
I've also tried applying Rebirth at the start of battle instead of having it be a passive state, but then I run into my second problem:
2) Actively applying Rebirth doesn't work
When I use a skill to give a character Rebirth or when I apply it at the start of combat, the same code I used above doesn't work. The character just dies. Rebirth clearly does get applied because its icon shows up, but it doesn't activate. The code for it works when Rebirth is a passive state, but not when I apply it during battle. I'm really not sure why.
I know this is a pretty specific issue but I was wondering if anyone had run into something like this. Thanks in advance for the help!