Creating a semi-immortal character

Okay, so here's what I'm hoping to do...

One of the characters in the project I'm working on can't be killed during a battle. I won't go into the weird backstory on that, but that's the general idea. So, I'm building a custom class to represent their abilities and I'm trying to figure out how to make this work.

The first part of the puzzle is regeneration, which I believe I have solved by just setting an Ex-Parameter on their class. So I think that's fine.

The second is that when the character is knocked out I want them to auto-revive.

Since this character is going to be present in every fight, this creates an obvious problem...how do the players lose a fight?

So, what I'm hoping is that being knocked out will take them out of the fight for something like 2-3 turns, at which point they will revive. But if the other characters on the team are KO'd in the interim the fight is lost.

Any idea how to go about this? (full disclosure, I'm pretty new at this so feel free to explain it to me like I'm ten years old).
You could make a base troop event that checks every turn to see if the immortal character is dead. If he is dead than you raise a variable up +1 every turn until it hits 3 then revives the character and sets the variable back to 0.
Thanks!

Let's see, I think I've got an idea how that would work.

...so I create an event for any troop where the character would be present (most of them), with a condition of something like this first screenshot...

1577424188503.png

But I'm not seeing a way within the troop settings to create an event page triggered by a variable, only by a switch. Maybe creating a common event, if I understand how those work correctly?


EDIT: okay, it doesn't look like common events can be triggered by a variables either....hmmm, how would I trigger the actual revival?

Maybe a conditional branch? I'll tinker with that.
Okay, I think a conditional branch is probably the way to go but I must be doing something wrong,

Here's what I've got...

1577481836468.png


If things operate as I intend then every time Mahalah's HP is at 0 a variable increments by 1. When that variable equals 2 the conditional branch triggers and removes the knockout state and heals her for 25 damage.

But it doesn't seem to be happening. I've tinkered with other effects from the conditional branch so I'm fairly sure the problem is the branch isn't triggering. Which means either the variable isn't counting up (maybe my conditions are wrong?) or the event isn't repeating to increase the variable past 1 (which probably also means my conditions are wrong).

Any suggestions?


EDIT: One thing I know I did wrong was not reset the counter, but that isn't the main problem since the revival isn't triggering in the first place.

I replaced the variable with a basic switch, set to trigger on Turn End and Mahalah HP =0. That did work, so at least I've got the event itself triggering. The problem is that it only happens once. Even if she gets knocked out again she won't get back up a second time. So I probably need something to tell the event to repeat itself...but I'm not sure what needs to happen for that.
Okay, I think I solved it. The span of the condition needed to be by Turn rather than Battle.
Sorry I didn't get back to you but looks like you got it.
Just remember to also set the variable back to 0 once the character is revived.

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-semi-immortal-character.116645/