Enemy Reinforcements MV

Do you want to add new enemies to battle, during the battle? This plugin provides you with a variety of commands that allow you to create more dynamic battles through enemy reinforcements.

You can create enemy skills that will essentially summon new enemies to battle. Enemies can be added as a single enemy, or entire troops of enemies.

Do you want to make sure a particular reinforcement does not already exist? With this plugin, methods are provided to allow you to check whether a certain enemy from a certain troop exists at a certain position.

If you want reinforcements to automatically disappear after a certain amount of time has passed, you can easily do so by making a single command to remove all enemy reinforcements from another troop!

Download

Plugin: download here (right-click and save as)

Installation

Download the plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the EnemyReinforcements plugin.

Once it is in your list of plugins, turn the plugin on.

Usage

(日本語の説明はこちらです)

When enemies are added to the battle, there are two questions that need to be answered: which enemy is added, and where are they placed?

This plugin uses troops in the database to set up the enemy positions. The enemy that will be added depends on the enemy that you choose in a troop, and their position will be based on where they are in the troop.

enemyReinforcements2

Keep this numbering system in mind as you read on.

Enemy Positions

When enemies or troops are added to battle, the positions are determined by how you have set them up in the troop edtior.

If you refer to the three slimes above, if you added slime 2 to battle, that slime will appear in that exact position during battle. This means that if you added the same slime multiple times, they will overlap each other.

Adding Enemy Troops

enemyReinforcements6

You can add entire troops to the current battle. When a troop is added, all enemies in the other troop will be added, whether they should appear half-way or not. To add a troop into battle, use the plugin command:

  add_enemy_troop TROOP_ID

Where the TROOP_ID is the ID of the troop that you want to add. For example, if the three slimes is troop 4, you would write

  add_enemy_troop 4

Adding Certain Enemies from Troops

enemyReinforcements4

Instead of adding an entire troop, you may want to add a specific enemy from a specific troop. To add a specific enemy, use the plugin command:

  add_enemy TROOP_MEMBER_ID from troop TROOP_ID

The TROOP_MEMBER_ID uses the numbering system that I described earlier. So for example, if you wanted to add the second slime from the three slimes troop to battle, you would write

add_enemy 2 from troop 4

Removing Enemy Troops

enemyReinforcements3

If you wish to remove a troop that was added to the battle (for example, they are all retreating or their summon time has expired), you can use the plugin command

  remove_enemy_troop TROOP_ID

So for example if you want to remove the three slimes troop which is troop 4, you can write

  remove_enemy_troop 4

Removing Certain Enemies from Troops

enemyReinforcements7

You can also remove certain enemies from certain troops. Use the plugin command:

  remove_enemy TROOP_MEMBER_ID from troop TROOP_ID

So for example, if you added the three slimes into the battle, but want to remove the second one, you can say

  remove_enemy 2 from troop 4

And only that specific enemy will be removed.

Checking whether a troop exists

enemyReinforcements5

To check whether an entire troop exists, you can use the script call

  $gameTroop.isTroopReinforcementAdded(troopId, checkIsAlive)

Which will return true if the specific troop exists. If you pass in `true` for checking whether it’s alive or not, it will return true if any of the members from that troop are alive. If you don’t pass in anything, then it will return true if ANY members of the troop exists. This is useful if you wanted the summons to only appear once (unless you explicitly remove them).

Checking whether an enemy from a certain troop exists

enemyReinforcements8

There are methods available for checking whether a certain troop member exists. You can use this in a script call (such as a conditional branch):

  $gameTroop.isEnemyReinforcementAdded(troopID, memberId, checkIsAlive)

Which will return true if the specific member from the specified troop exists, and whether it’s alive or not. If you pass in `true` for whether it’s alive or not, you can force it to check whether the enemy exists and is alive.

For example, if you want to check if the second slime from troop 4 is alive, you would write

  $gameTroop.isEnemyReinforcementAdded(4, 2, true)

You may also like...

121 Responses

  1. Eindride says:

    Is not this the same as the “Appear halfway” command? It’s not a skill activating it

  2. Fal says:

    Hey there Hime. Great work, I just have a small problem here.
    I happened to make a battle with around 50 enemies using this plugin. Every time 4 enemies are beaten, the next 4 are added and the previous ones are removed using the remove_enemy_troop and remove_enemy commands.
    Thing is the more the battle goes on, the more the game starts to lag. This continues until the game is barely playable.

    I don’t know if there’s some kind of memory leakage going on or something. I am removing the unused enemies as soon as they die, so there shouldn’t be a problem. It’s not like the bodies are piling up, and yet it feels like they do somehow. Do you have any idea on how to solve this? Thanks.

    • Fal says:

      Nevermind, I solved it myself. Made some Javascript for the first time.
      Go into the plugin file, and right above the clearReinforcements function, put this in :

      Game_Troop.prototype.shinclear = function() {
      this._enemies = [];
      this._namesCount = {};
      };

      Then you can call it using “$gameTroop.shinclear()” in your events.
      What it does is it TRULY removes all enemies (not just reinforcements) as well as their names. If you’re in a case like mine it should do the job.

      I am tired as hell right now.

  3. Jesse says:

    Hello Hime,
    Thank you for all the plugins you have developed.

    I plan to make a commercial game and I have recently been using this plugin, it seems to have a problem with the script line “$ gameTroop.isTroopReinforcementAdded (troopId, checkIsAlive)”, the plugin commands work but not the script commands themselves by deactivating all my plugins.

    I use like this:

    Condition: End of turn, Span turn.

    if $ gameTroop.isTroopReinforcementAdded (999, true)
    {

    } else {

    add_enemy_troop 998

    }

    Regardless of the condition if I kill 1 in 3 enemies or even 0, it will add the new troop to me.
    Is it up to date with the latest version of mv?

  4. masteroth1 says:

    Am working on a hopefully commercial game and have just started using this plugin. I can’t get the $gameTroop.isTroopReinforcementAdded command to work correctly. It keeps creating overlapping troops. The only workaround I’ve found is to remove all the existing troops and then replacing them all. Other than that, it’s a very useful plugin. Especially seeing as how I’ve discovered that it defies the 8-enemy-limit. I haven’t decided on how I’m going to exploit this yet, but a self-replicating enemy such as a hydra or giant germ seems like a neat idea at the moment. Thanks anyway.

    • Hime says:

      I looked at the code and it basically goes through all of the enemies currently in battle and checks if all of the enemies from a specific troop are alive. I can’t find any code that assigns troop ID to the initial set of enemies though, which might be the problem?

      For example if you start with troop 1 that has enemies A and B, then you add troop 2 that has two enemies C and D, you can check if troop 2 is still alive, but I’m not sure if you’re able to check if troop 1 is alive.

  5. teratoma314 says:

    Does not work. Summoning is impossible.

  6. T.K. says:

    Is there any way to make enemy troops also appear in Yanfly’s Turn Order Display script? :/

    • Syelia says:

      How does it work for you?
      Maybe youre using an older version of rpg maker mv?

      Currently trying to figure out how to downgrade a little… Steam seems to not allow it anymore

  7. Alexis says:

    The download link does not work 🙁

  8. Dope says:

    First I want to just say thanks for the plugin Hime~Sama, it’s working perfectly. I do have a question though. I need to setup an event where the game reads if the added troop is affected by a particular state. How would I do that? I can’t use the standard enemy “x” check and I assume I need a script call similar to $gameTroop.isTroopReinforcementAdded(“x”, true).

  9. Mikey says:

    Hi there, I can’t seem to get the “check if troop exists” command to work. I have a boss fight where when the boss reaches 50% HP, he will put a state on himself that gives him 100% physical and magical evasion. At the same time, he spawns a troop of 3 spirits. Now, I want the state on the boss to be removed when the 3 spirits are defeated, is this possible? So far I have managed to make the 3 spirits spawn, but when I make a conditional branch to check if the spirits are dead it will always trigger , regardless of being true or not.

  10. Marcus Parreiras says:

    Hi, Hime! Great job, as always!

    Maybe you can help me? I use the Sideview Enemies from Yanfly, and when the enemies I put in with this script die their bodies stay there (as it should be). So far so good, but when I put the same enemy repeated again then their bodies disappear (all of them), and I would like to keep them there.

    Summing up,

    I use the command: add_enemy 2 from troop 4. The enemy appears.
    I use again: add_enemy 2 from troop 4. Now there are 2 repeated.
    I kill A. Your body stays there. B is still alive.
    I kill B. Your body stays there, and A’s too.
    I use it again: add_enemy 2 from troop 4. The bodies of A and B disappear at this point, C appears. C stays alive normally, but A and B disappear.

    When I ask to resurrect all dead enemies, all are resurrected normally (both those who are drawn dead and those who have disappeared).

    Please help me fix this! I need the sprites to stand there dead!
    Thank you!

    Sorry for the bad english.

  11. Esfirati says:

    Is there a script call to check on exactly how much HP is left on the enemy reinforcement as well as their state (not just whether they are alive or dead)? For example, during battle I use $gameTroop.members()[enemy index].hp script call to check on the enemies on my original troop so I can create events depending on how much hp they have. I would like to do the same for the reinforcements if possible. The same for their state.

  12. vhstapes says:

    I’m getting this when I set up a summoner who can summon 3 slimes from troop 3. I have my common event set up to check if slime #1 is there (else, make slime #1), then check if slime #2 is there (else, make slime #2). I get this error when the summoner tries to summon a second slime (the first one works fine). In my game a summoner can summon up to 3 monsters in a battle, so I need to figure out the logic needed to get the game to spawn a character in whichever of the three possible slots is open. Thanks for the help!

    TypeError: undefined is not a function
    at Game_Troop.isEnemyReinforcementAdded (file:///C:/Users/Cyrus/Documents/RPG%20MV%20Projects/ConjurersCards/js/plugins/HIME_EnemyReinforcements.js:305:58)
    at Game_Interpreter.eval (eval at (file:///C:/Users/Cyrus/Documents/RPG%20MV%20Projects/ConjurersCards/js/rpg_objects.js:9274:37), :1:12)
    at Game_Interpreter.command111 (file:///C:/Users/Cyrus/Documents/RPG%20MV%20Projects/ConjurersCards/js/rpg_objects.js:9274:20)
    at Game_Interpreter.executeCommand (file:///C:/Users/Cyrus/Documents/RPG%20MV%20Projects/ConjurersCards/js/rpg_objects.js:8897:34)
    at Game_Interpreter.update (file:///C:/Users/Cyrus/Documents/RPG%20MV%20Projects/ConjurersCards/js/rpg_objects.js:8805:19)
    at Game_Troop.updateInterpreter (file:///C:/Users/Cyrus/Documents/RPG%20MV%20Projects/ConjurersCards/js/rpg_objects.js:5197:23)
    at Function.BattleManager.updateEventMain (file:///C:/Users/Cyrus/Documents/RPG%20MV%20Projects/ConjurersCards/js/rpg_managers.js:2076:16)
    at Function.BattleManager.updateEvent (file:///C:/Users/Cyrus/Documents/RPG%20MV%20Projects/ConjurersCards/js/plugins/YEP_BattleEngineCore.js:1630:21)
    at Function.BattleManager.update (file:///C:/Users/Cyrus/Documents/RPG%20MV%20Projects/ConjurersCards/js/plugins/YEP_BattleEngineCore.js:1588:33)
    at Scene_Battle.updateBattleProcess (file:///C:/Users/Cyrus/Documents/RPG%20MV%20Projects/ConjurersCards/js/rpg_scenes.js:2054:23)

  13. Tyler Robinson says:

    I’ve done exactly as shown above, yet I can’t seem to get it to work. I’m using a lot of Yanfly scripts, is there any known incompatibility there?

    I have some TEXT (for the Villain announcement) and then
    Plugin Command: add_enemy_troop 77

    I have the Boss set up as troop 76 and his minions as troop 77. I do a battle test and… Nothing happens. The villain says the text and then the battle continues on. No summon. Any suggestions?

    • Hime says:

      I think there was a change that corrected one of the plugin commands (add_troop vs add_enemy_troop).
      See if re-downloading it makes a difference.

  14. Exas says:

    Arigatou gozaimasu, Hime-sama!! You are great, I missed really something like this! Made my day 🙂

  15. Anonymous says:

    Love this! Great job Hime.

  16. manoma says:

    hi! i have found a compatibility bug, i’m not sure to who i should adress it, but if i use MOG_BattleCursor i’ll get a error saying :cannot set propiety ‘visible’ of undefined when i add a enemy to battle. It works fine without it. i also tested with only the 2 plugins, but i also got the error :/, if you want i can paste the console log, but since it’s so easy to reproduce i don’t think it’s necessary

  17. mosblau says:

    I have some problems with this plugin and I wanted to ask if you could make a demo where everything is set, so people could look how you’ve done it?

Leave a Reply to mosblau Cancel reply

Your email address will not be published. Required fields are marked *