Check for specific amount of an enemy type.

● ARCHIVED · READ-ONLY
Started by Klunky2 3 posts View original ↗
  1. If I use $gameTroop.aliveMembers().length I can get the total amount of enemies on the battlefield, but what can I do if I want to check only for the amount of an certain enemy? So at example the enemies are 5 rabbits and two 2 slimes. The rabbits flee when there is only 1 rabbit on the field, (ignoring the amount of slime enemies)
    I need to adress the amount of enemys form a certain id, but I have no idea how to accomplish that.
  2. I think for what you need you will need to assign a variable for each of the enemies id's that you want to track. You would do this in the troops tab of the database. Create an event page for each enemy in each troop to be tracked. On each page you would have:

    Condition: Enemy HP (x) <=0%
    Span: Battle
    Then add a Control Variables: y +=1

    X = the enemy number so in a troop event 1 is the first enemy 2 is the 2nd and so on.
    Y = the id number of the variable being used to hold the specific enemy id type to be tracked.

    Hope this helps out, I am pretty sure that's what you are asking for but I did just wake up.:smile:
  3. Thanks, yes that's a pretty valuable solution.