I have a battle with 5 different enemies in the troop. I want a different thing to happen depending on which of these 5 enemies are the last enemy left alive in battle.
I'm looking under the Battle Event conditions until the Troops section of the database, but there doesn't seem to be a simple way to do this. I've searched on the forums but I don't think anyone has asked this question yet. Hoping that this won't be too tricky and that someone here will be able to help me out. It would be super appreciated!
Another idea:
Make a page in which the condition is that the first enemy has 0% HP or less. Triggered once per battle.
In the event's page, make a script condition: $gameTroop.aliveMembers().length == 1
If it's true, that means there's only 1 enemy left, execute your commands.
Once you're done putting everything down, copy the page and paste it to have as many as there are enemies. Change the condition so that each one will be triggered by a different enemy dying.
If you want to make it easier to make changes later, another option would be to set up a switch that will be off at the start of the fight.
In the troop event pages, instead of all the commands and the condition, add the command to turn on the switch.
Add a page in which the condition is that switch. Set the triggering to "Moment".
In this page, first of all turn off the switch. Then add the condition, and the commands to execute.
Not really, just do the conditional branches one after the other. Only one of them is going to have its condition met. 😛
Ah, that's true, though that feels ugly for a different reason, because you're still checking those conditions that you know will be false. But sure, it will work.
In that case, you could stick to the built-in conditions and check if an enemy has appeared. Dead enemies count as disappeared, after all, and scrolling down over the drop-down menu takes less time than changing a number in a string.
Give me like five minutes and I'll verify. 😛
Ahh. The reason is because the interpreter command for the conditional branch calls isAlive() for the "appeared" check. So really it's checking whether the enemy has been killed or not.