MV How to automatically set actor's health to 1 and auto-escape whenever they would usually die?

I was testing my educational RMMZ game with my son, who hated dying (of course!) While I think dying should be part of RPG's, progressing on the educational challenge is what I want to focus on, and not the strategy of how to survive.

So, how can I set the actor's health to 1 whenever their HP would normally go to 0 or < 0?

Bonus question, how do I make the actor auto-escape when this happens?
Moved to: Plugin Requests

How many actors can be in your party?

(ps - I'm with your son - I hate dying too!)
Thanks for moving it 🙂

Actors: Max 4.

Here's the thing - this is ONLY for the leader (player 0). One actor will always be the leader - there will be no changing of the formation in this game.

Other actors can be knocked out and will move with the party. But the leader ("you") will never die, only escape at 1 hp.
several things to do

first thing, add a trait "resist death" to the actor you don't want to die - with this the actor can reach 0 HP but would not die from this, nowhere in the game.

second thing, add a troop event conditioned to that actors HP=0 that has the abort battle command.
you'll either have to repeat that for every troop or use a base troop plugin to autorepeat that for every troop.

this will only work because you want to always survive that actor however - most people would need the troop event be a bit more complex and the resist death handled by state to get better control on when the actor should survive or not.
I think you'll also need to avoid inflicting the Death state via skills and events, or when you do, divert every one using the passive state.
no, resist deth will automatically fail any attempt to apply the death state directly as well.
please note that I said resist death as a trait, not as a passive state - you don't need any passives here.
So if someone casts a Death Spell on you, it will fail. But it won't abort the battle if your hit points don't go to 0.
But it won't abort the battle if your hit points don't go to 0.
of course not - that is why I described the need of a troop event to abort battle in my post above
Maybe I'm misunderstanding but if you resist Death, your actor won't die, and their HP will never reach 0. HP = 0 only works for attacks, not for death spells.
If your battles are not random encounters but scripted events, then you can also use this option:
"can lose" and just make them teleport or abort or whatever you like for that matter.

1640173793914.png


You can also make random scripted battle events via variable ect... but dunno what would be easier to setup.

BTW, forgot to mention, if you leave it blank "after the If Lose" then the fight will just end and your actors will be alive but with 1HP each. If you want them at full HP after losing, just change actors HP after the IF lose branch.
Just made a moving enemie wich aproaches with all this and works like a charm:
1640174634489.png

The only thing i would add as well, is an erase event maybe, since when you lose and get out the enemy is in front of you and if you go closer then he attacks again, with an erase command then he will be gone till you reenter the map.
Maybe I'm misunderstanding but if you resist Death, your actor won't die, and their HP will never reach 0. HP = 0 only works for attacks, not for death spells.
Andar is correct: Resist State 1 prevents the death state from being applied, be that directly or at 0 HP. It does not prevent HP from reaching 0.
let's say a skill inflicts Death 100%. Resist death will cause the skill not to have any effect. It will not trigger HP = 0 events, because if you resist death, your hit points won't go to 0. That could be the desired behavior. But if you want the battle to end whenever the main would die, that is not the desired behavior.
@pawsplay granted, that specific possibility would not be covered by my solution - but on the other hand it wouldn't come up either.

a guaranteed death skill like that would have to be created by the developer, and if the developer doesn't want the player to loose he would not create such spells for the enemies.
so I strongly doubt such a skill would exist in a game where the intention is for the player to keep playing - and even if it is, so what? it still works by letting the player continue playing...
Well, imagine the main is a human, and the other party members are magical companions. The spell could be a Desummon or something. As I said in the first place, you can either not create such skills, or code a workaround if you want it to cause the main to retreat.
Just remembered something else, you could make an eq item / weapon / armor with the resist dead trait, so whenever one of your charas is wearing it, he / she cant die and via condition you can end the fight without them dying. (but take care, if you run around with the resist dead trait and are at 0 HP, as soon as you take the item off you get a game over)
You can then make tweaks to your liking, like refresh HP after the fight is aborted, eq and unequip the resist dead item ect...
You can even add such an item as an "easy" difficulty since you never die.
This is a good idea, but I think "Lose" means all actors are 0 hp, right?

I'm looking to make it so that only if the main actor ("you") reach 0 hp, the entire party automatically escapes.

They should all end up in the spot where the battle activated.

If your battles are not random encounters but scripted events, then you can also use this option:
"can lose" and just make them teleport or abort or whatever you like for that matter.

View attachment 210525

You can also make random scripted battle events via variable ect... but dunno what would be easier to setup.

BTW, forgot to mention, if you leave it blank "after the If Lose" then the fight will just end and your actors will be alive but with 1HP each. If you want them at full HP after losing, just change actors HP after the IF lose branch.
Just made a moving enemie wich aproaches with all this and works like a charm:
View attachment 210526
The only thing i would add as well, is an erase event maybe, since when you lose and get out the enemy is in front of you and if you go closer then he attacks again, with an erase command then he will be gone till you reenter the map.
This is a good idea, but I think "Lose" means all actors are 0 hp, right?

I'm looking to make it so that only if the main actor ("you") reach 0 hp, the entire party automatically escapes.

They should all end up in the spot where the battle activated.
Actually no, i mean yes you "lose" the battle but there is absolutely no indication that you did so, when your last member is at 0 HP, then your game just goes black and youre infront of the enemy that attacked you with all your party members alive but at 1HP (so to say, in the position before you started the battle) , you can set in the branch that their HP go to full again.
So dont worry, there is absolutely no indication for losing, you can even add in the "lose" branch an text, something like "we had to retreat" or whatever you want, actually your imagination is the limit.

If you need help to put those events together, then feel free to ask.

but if you still want it to be mainly the main chara to reach 0HP then you need the resist dead trait for that main character and just a condition in the troop section "when main character = 0%HP or less" then abort battle" looks something like this:
1640205778626.png

You can add there text messages as well or whatever you like, also i would suggest to revil his HP.

Here is how it would look:



and here the event:
1640206286830.png
This works perfectly. Thanks!

The only thing left - how to make the characters actually show the Escape animation?

I tried to "Force player action" and choose "Escape" from the skill list, but it didn't work. It seems the target intends for this action to be done by an NPC?

I attached a screenie below


Actually no, i mean yes you "lose" the battle but there is absolutely no indication that you did so, when your last member is at 0 HP, then your game just goes black and youre infront of the enemy that attacked you with all your party members alive but at 1HP (so to say, in the position before you started the battle) , you can set in the branch that their HP go to full again.
So dont worry, there is absolutely no indication for losing, you can even add in the "lose" branch an text, something like "we had to retreat" or whatever you want, actually your imagination is the limit.

If you need help to put those events together, then feel free to ask.

but if you still want it to be mainly the main chara to reach 0HP then you need the resist dead trait for that main character and just a condition in the troop section "when main character = 0%HP or less" then abort battle" looks something like this:
View attachment 210579
You can add there text messages as well or whatever you like, also i would suggest to revil his HP.

Here is how it would look:



and here the event:
View attachment 210580
The escape skill has no animation, tbh i really even dont know if there is such a animation, battlethingis are my weak point in the maker...
1640208455122.png
There is no "escape animation," you'd have to use action sequences or something similar to make that.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-automatically-set-actors-health-to-1-and-auto-escape-whenever-they-would-usually-die.143227/