Knockout Variable

Hi,

I'm attempting to create a variable where every time a particular enemy--or troop would be fine--is defeated, then a variable is given +1.  How do I create that variable?  And these will be random encounters.  Thanks!
You can set a troop event that triggers when the enemy HP are 0 and increases the variable value. There may be a problem with the last enemy of each troop (I mean I am not sure that you can actually trigger the event if the battle ends). I have no time to test this last thing but I will do it tomorrow for sure.

If KO is allowed and the player can't escape then is much easier, you can just increase the variable value at the beginning of the fight. You only have to add the number of enemies to that variable value. If the player wins you have the right ammount, if the player loses then he gets the gameover screen and the variable is loaded from the last save.

But I promise I will test that last enemy thing as soon as possible.
You can set a troop event that triggers when the enemy HP are 0 and increases the variable value. There may be a problem with the last enemy of each troop (I mean I am not sure that you can actually trigger the event if the battle ends). I have no time to test this last thing but I will do it tomorrow for sure.

If KO is allowed and the player can't escape then is much easier, you can just increase the variable value at the beginning of the fight. You only have to add the number of enemies to that variable value. If the player wins you have the right ammount, if the player loses then he gets the gameover screen and the variable is loaded from the last save.

But I promise I will test that last enemy thing as soon as possible.
Yeah, unfortunately I tested it, and it doesn't end up giving me the variables I need.  

I decided to go with your other idea, and just make these particular enemies inescapable and have the variable changed at the beginning of the fight, which is fine for now.  It's not a big enough deal for me to try to do it via code.  Thanks for the help!

Original thread: https://forums.rpgmakerweb.com/threads/knockout-variable.50316/