Troop Variables help.

First off, let me apologize if there is some sort of sub-forum for support posts and I completely missed it.

But now to my question, now this will probably end up being something extremely easy, but I am still lost.

Alright, so I have a troop with two slimes. I have a quest that counts slimes killed (5 needed to complete) and rewards XP and Gold for the quest. Easy enough.

However, if I kill 1 of the 2 slimes in the troop, and escape the battle. I keep that 1 towards the variable, I would like to set it up so that unless you kill both slimes, you don't get any kills towards the quest goal (to avoid exploitation)

Also take in mind that i'm using the map's random encounter system, so i'm subverting any battle processing events. Any work done has been through the database in the actual Troops section. I have End Phase Triggers and Victory Aftermath in a hope of finding some clues. But alas, so I turn to you guys and gals on the forums for aid.
The problem you're facing is that the last kill ends the battle before the troop events are processed - that's why the condition 0HP doesn't work for a regular last enemy.


You can either add scripts that give a real trigger for end battle (Tsukihime wrote one) or you can prevent autodeath by adding death resistance to all enemies at the beginning of the battle and then rewrite your conditional check for 0HP in a way that it removes the death reasistance only after counting the kill (resulting in the delayed kill happening when the resistance is removed.


The last option does not work if the death resistance is a fixed part of the enemy, it needs to be added to the enemy on turn 0 of the battle only.
I have Tsukihime's End Phase Triggers. I just have to do all of this battle event out of the Troops section of the database, since i'm doing map random encounters. And the Troops section's event creator is quite a bit different, very limited in conditions. I can't manage to make a condition/event combo that pairs the 2 enemies in the troop together, it's either Enemy 1's HP is at 0% or lower. Or Enemy 2's HP is at 0% or lower. And then add a control variable +1 to them individually, but Enemy 1 and 2 are separate pages, so I can't do an all or nothing, which is what i'm trying to achieve. I want either 2 control variable additions for finishing the battle with the 2 enemies in the troop or none at all.
I use the Common Event On Battle End script.

Try turning a switch on when the slime battle starts, then set the script to run a common event at the battles end which checks if the Slime battle switch is on, and then changes the variables.
You can use conditional branches in the troop events to check the other troop's HP - have one enemy as the regular troop condition, and inside that troop event use conditional branch to check the other enemy.
That was one of my first attempts, I tried doing that with the conditional branches, but it just wasn't working for whatever reason. But i'll use that Common Event script! Thank you so much, I think I have my answer. <3

Original thread: https://forums.rpgmakerweb.com/threads/troop-variables-help.37092/