Enemy Reinforcements MV

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

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)
Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

19 Responses

  1. 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).

  2. 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.

  3. 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.

  4. 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.

  5. 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)

  6. 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.

  7. Exas says:

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

  8. Anonymous says:

    Love this! Great job Hime.

  9. 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

  10. 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

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax