How to have a monster stay damaged if you run mid battle

Hi!
I'm currently toying with some ideas for a battle system...

It has on map enemies, and I'd like them to stay damaged if you did run mid battle.
So that the next time to run into them, they still have the same hp and if a troop member was already defeated, its still gone.

Does anyone know of a good way to implement this?
Oh wow, I can actually use my notes to help someone!

So, I figured this out when I was still using VX Ace:

1718348621775.png


#1: Make two variables, one for the enemy's max HP and another for their current HP (they're in the "other" part of control variables).

#2: Subtract the enemy's max HP with their current HP as seen above.

#3: Be sure to tag the event as "when the end of the turn" as well as Turn Number 1*X since it'll trigger every other turn.

1718348696087.png


#4: Once you've put that into place, make a turn zero (aka. the start of the fight) and subtract the enemy's health with the variable shown above.

Hope this helps. It should be easily transferrable to MV. 🙂

That said, it might get a bit trickier if you intend to apply this to every enemy in the game... especially if you want KO'd enemies to stay KO'd.
Thank you so much!

This is very similar to what I have so far...
I'd probably end up needing a lot of variables and switches if I want this for every enemy in the game, haha, I thought I'd check if someone has another idea! 🙂

I'm also currently trying to see if I can use yanflys self-switches and variables on the on map enemy to update the battle troop. That would make it so I'd need to reserve far less switches and variables for this.
Hmmm, not sure how to reference the self variables in the battle, but you can make 1 set of normal variables to manage the data in all battles (with troop events etc) and then make self variables that you update with the normal variables in the 'if escape' branch and before 'battle processing'. Depending on how you set it up, you might also have to set a self variable equal to their max hp before 'battle processing' when interacting with the enemy for the first time.

Also, of course if you've killed an enemy and start the battle again, the enemy will die with your turn 0 troop event, which looks a bit silly. But if you don't want that, you'd have to make troops with all combinations and then conditional branches on the battle processing. Or have a plugin with dynamic troops or something.
I was thinking about having one variable reserved for each possible troop slot (so 8, to save their current HP) and one switch to track if they are alive (though as you pointed out I could do that by checking for 0 hp) and transfer that into selfvar at the end of battle (so after escape).
And if I remember correctly there are plugin commands to access an events selfvars from other events so it should be possible from the battle events... but would mean that each troop would be connected to a single event, unless I hand in which event called the troop with another variable for their map and event ID.
... Haha, some stuff gets complicated quickly XD

Oh yeah... them dying at the beginning of battle is a valid point, didn't think about that until now...
I might need to do a test run and see how to avoid that bit!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-have-a-monster-stay-damaged-if-you-run-mid-battle.169505/