Yanfly Battle A.I. Core: Help with setting up enemy escaping behavior

Hungry Moogle

A Rat in the Wall
May 4, 2017
Reaction score
First Language
Primarily Uses
I was wondering if I could some help with setting up an enemy A.I. behavior wherein when the enemy forces have been reduced to a single remaining enemy, the sole survivor will run away. I've been trying to setup this behavior with Yanfly's Battle A.I. Core plugin, using the following AI Priority:

<AI Priority>
Troop Alive Members = 1: Escape
<AI Priority>

Unfortunately, this setup hasn't been working as intended, as the enemy will instead run away despite all of their allies being alive, those craven curs. I'm not sure why it isn't working, I would have thought that 'Troop Alive Members = 1' would translate to the enemy running away when the number of enemies was equal to one, but evidently not since its working the way I wanted it to.

There's also a 'group DEAD MEMBERS eval' option as well, which (unless I'm misinterpreting its function) counts the number of enemies currently KO'd in the battle. The issue I with this have this option though, is that (unless, once-again, I'm misinterpreting the manner in which its works) this would be problematic with enemy formations with varying numbers of enemies. For example, if the enemy is setup with the AI Priority 'Troop Dead Members <= 3: Escape', the enemy would run away from the battle once the number of enemies dropped below three, despite there being two enemies left to continue the fight.

I also wondering if it is at possible to include a <=25% HP trigger to go along with the A.I. instructions for an enemy to escape when alone, so that an enemy would only run away if it is both alone and it's HP is in critical.

Latest Threads

Latest Posts

Latest Profile Posts

Going to try my luck with Rust programming language. C++ is just way too gosh darn frustrating.
Phew. Finally fixed all of the tileset and event issues in this demo. And now, it's time to release another, finished game. Stay tuned!

Forum statistics

Latest member