This script allows you to combine and remove troops from battle. You can add other troops to the current battle, or add individual enemies from other troops. This allows you to create battles with many enemies, and you have full control over how they should be positioned by setting up the sprites in another troop.
In a battle with multiple troops, you can also remove an entire troop from battle.
The purpose of this script is to allow you to set up your troops using the troop editor, and then add them to battles without having to worry about how to place them.
Script: download here
Enemy Events add-on: Enemy Reinforcement Events
We begin with a troop
We would like to add more enemies to this battle, so we set up the second troop.
You will need to remember the “index” of each enemy, so it would be best to place them from left to right so. In this example, the bat on the left is “enemy 1” and the bat on the right is “enemy 2”, which is the order they were added.
The simplest way to introduce more enemies is to add an entire troop to the battle.
Use a script call
And the entire troop will be added to the battle
If you only want to add specific enemies from another troop, you can use this script call
You can remove troops from battle. If a troop is to be removed, all enemies from that troop will disappear. They are not “defeated” so you would not receive exp or gold from them. Use the script call
Checking for Troops
Sometimes, you might need to know whether enemies added from a different troop is in the current battle. Maybe the troop will keep re-appearing whenever the whole troop is defeated.
You can check whether a certain troop is in the battle using the script call
Which returns true if there exists an enemy with the specified troop ID and is alive.