Enemy Reinforcements
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.
Download
Script: download here
Enemy Events add-on: Enemy Reinforcement Events
Usage
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.
Adding troops
The simplest way to introduce more enemies is to add an entire troop to the battle.
Use a script call
add_troop(troop_id)
And the entire troop will be added to the battle
Adding enemies
If you only want to add specific enemies from another troop, you can use this script call
add_enemy(troop_id, index)
Removing troops
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
remove_troop(troop_id)
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
troop_exists?(troop_id)
Which returns true if there exists an enemy with the specified troop ID and is alive.
Mh, with Enemy Reinforcement Events i have a bug.
When i try to call the script I get the error:
Script Game Interpreter line 1411 NoMethodOccured
undefined method ‘push’ for nil:NilClass
Okay, so I think I found another one of your scripts that has…issues…with Luna Engine. I’m going to do more tests to be sure.
Never mind. I got it to work. XD
Strike that. It’s still giving me that error. I think other people have had that problem. Actually, it’s the comment below mine…XD
This is what I get from the debug:
Game_Interpreter:1411:in
eval': undefined method
can_add_event_pages?’ for # (NoMethodError)from +Enemy Reinforcements Events:61:in
add_member'
add_enemy’from Enemy Reinforcements:183:in
from Enemy Reinforcements:120:in
add_enemy'
command_355′from (eval):1:in
from Game_Interpreter:1411:in
eval'
command_355′from Game_Interpreter:1411:in
from Game_Interpreter:197:in
execute_command'
run’from Game_Interpreter:103:in
from Game_Interpreter:60:in `block in create_fiber’
Also, I have the Enemy Events script, and the compatibility script.
Actually, I can’t get this working even without the Luna Engine…;-;
I’ve updated the enemy reinforcements script to address the issue
Hi, i’m having trouble with the script, i get the same error everytime and don’t know how to fix it, here’s the error:
Script ‘Game_Interpreter’ line 1411: NoMethodError occured.
undefined method ‘can_add_event_pages?’ for #Array:0x601d654
Can you help me?
I just put the ‘add_troop(14)’ script in my battle event (wich is activated every turn)
It sounds like you’re using “Enemy Events”. Do you have the compatibility script installed?
Um I have the same error massage, and I used the ‘Battle Event’ as shown in the pictures, and I do not have this compatibility script installed. Could you be so kind and maybe share the link please? Btw, thank you for your scripts, I really appreciate that <3
There’s a link to the battle events add-on in the download section
Hey it’s me again. Sorry for bugging you out on an old topic, yet I still have the same problem even tough I downloaded the add-on, and it still doesn’t work and the same error massage gets displaid. Do you know how I could fix this moment? (P.s I even switched out the order of the scripts if it would affect anything :S)
Are you using a script called “Enemy Events”? Because the add-on is only for that script.
If you’re not using that script, you should not have an error message for “can_add_event_pages?”
Ugh, this is old but it’s happening to me too now so…
This is the line that was getting in the way:
def command_355
script = @list[@index].parameters[0] + "\n"
while next_event_code == 655
@index += 1
**script += @list[@index].parameters[0] + "\n"**
end
eval(script)
end
end
The specific issue was bolded in this page, making it get the two stars on each corner.
Where is this? I am not sure what you are referring to.
On Game_Interpreter.
Someone else got the same NoMethodError error I did. So I posted what’s on the Game_Interpreter area.
I can’t seem to get this script to work. I simply created a new project and added the scripts and did what the example did. I get
error 1411
undefined method ‘add_troop’ for #
Can I make monster use their skills at the same turn when I added them to battle? Thank you in advance.
Thats how I add them: http://i.imgur.com/git2KUD.png
Unfortunately, when enemies are added to the battle, their actions are determined on the next turn (since the event runs after actions are selected). What you might do is to have the event run at the end of the turn, but it just changes when they appear.
Hi there ! I’m afraid that your script is bugging with Yanfly’s Core & Battle Engine in the case of more than one enemy added : If in the first time enemies added die correctly, the next reinforcements will keep one of the enemy’s battler on the screen even after its death (for 2 enemies added), and directly from the first time for 3 and more enemies added.
I think this issue may occur even without yanfly’s battle system. Let me check.
Thanks to take a look Hime 🙂
I tried in a new project with and without Yanfy’s Core Engine, same for his Battle Engine and both of them, the problem seems to occur with any one of the two scripts. Of course, your script works correctly without Battle & Core Engine.
Put together a new demo showing how to reproduce the issue (eg: start battle, attack enemy to kill it, next turn add two enemies, etc) and upload it somewhere so I can take a look. This will make it easier for me to debug the issue.
http://www.filedropper.com/enemyreinforcement
Tell me if anything’s wrong ! 🙂
I’ve updated enemy reinforcements to address the issue. Please update the script and it should work.
Is there a way i can show summoning animation on the summoned monsters before they appear????
This script does not support showing an animation before a monster appears, but you could probably show an animation in your event before making the script calls for summoning more monsters.
I’m trying to use this script with Cozziekuns’ Earthbound battle system script but I’ve been running into issues.
I can add troops to the main battle and everything works fine, but when the added enemies die the game freezes (stops accepting input). It’s probably an issue with the Cozzie battle system core, but I can’t quite pin down what. I’ll experiment with script order and see what happens, but I don’t think it’ll help much.
Anyway of making this hybrid with your Enemy Placeholder script?
Like You have a Boss and 7 hidden enemies.
Boss uses Summon spell that summons a random enemy <1,2,6,22> and the summoned enemy replaces one of the hidden placeholder enemies.
And lets say when a summoned enemy dies it returns to being a hidden placeholder again. So the Boss can use that placeholder to summon to again.
Probably an entire separate script itself but seems like you already have 2 of the 3 pieces of the puzzle already complete.
Love your scripts!
Sounds like an interesting idea.
If anybody could do it, its Hime!
I add a troop at turn 5 and then every 4 turns.
My question is: If a troop is present in battle (5° turn), and after 4 turns the monster of the troop are still alive, can i make a conditional branch where:
IF troop(7) is in game
THEN
dont’t call another same troop(7)
ELSE
call another troop (7)
Is it possibile a conditional branch with your script inside? Thank you for your response! 🙂
Yes. You can choose when the script calls should be made. Your question is probably “how to check if troop 7 is in the battle?”
I have updated the script just now to add a new script call. You can use this in a conditional branch
To check if there is an enemy from troop 7.
Thank you Hime!! You’re awesome! Great Scripts!
Hi again, I got the one issue I had before resolved, but now I notice that any summoned enemies don’t disappear after they die… they can’t be targeted or anything, and they are considered dead and all, but their sprite remains on the battlefield…
This may be related to how you solved your previous problem.
Hey, great script. I noticed there might be a bug with Victor's Target Arrow. After an enemy has been summoned, the arrows are not shown with the proper enemy (mind you, this could easily be considered a bug with his script).
Thanks for your continuous hard work 🙂
I don't know how his script works, but you can set up a demo that shows the problem.
https://www.dropbox.com/s/mgaabl9kl9ahn48/Demo%20-%20Cursors.exe
Here's a demo containing the game.
I can't see anything obvious why that might be happening. When I tried enemy reinforcements and the target arrows on a new project, it works fine even with reinforcements. You'll have to see if there's another script that's causing the problem.
Works perfectly, good job!
I am not able to use this script because of this error:
“Script “Game_Interpreter’ line 14111: ArgumentError occurred.
Help me please! 🙁
You need to explain when the error occurs
I got the same error too. But it could because I’m using Yanfly Battle Engine and Yami Symphony? (The error occured testing in the database in troops when I did it.)
Try it in a new project and see if it works. Then add each script one by one. I will also need to know what script calls are being made since the previous report did not specify anything.
I’ve written an add-on to provide support for my Enemy Events script. When enemies/troops are added or removed, their event pages are also added or removed.
Hi, sorry but I’m new to RPG Maker vx Ace, and I am having a problem that I just do not understand. I download the script and put it into my script editor under Materials (Insert here).
After I did that I put add_troop(34) into the battle event. After all that, I get an error that says:
“Script “Game_Interpreter’ line 14111: ArgumentError occurred.
wrong number of arguments (1 for 2)”
Any help would be great! Much thanks. <3
I noticed something that might be an issue and updated the script, but I don’t know if that solves your specific problem.
Hello, I'd really like to use these amazing scripts and I have same problem like HumanBLuE.
In my case, arguments error happens when I tried to use enemy reinforcements script along with enemy reinforcement events (I also added enemy events script as you mentioned in the script). Enemy reinforcement script itself works when used alone.
Hope this info helps you solving the matter, and I'd really appreciate your help! Thank you in forward. 🙂
I've updated the enemy reinforcements events add-on. It seems like I had updated enemy reinforcements without updating that one. See if the new change works.
Thank you for quick update! Yet I still get a problem. When I use those scripts and it says me "undefined method 'can_add_event_pages?'for#<Array:0x6c*****>". (***** are different everytime I try) Any ideas for this matter? Thank you for your kindness.
Probably, lol. Lost progress when it crashed and had to put in my dialogues again which weren’t the same as the original and now I’m sad. :[
I installed it under my Material tab in the Script Editor.
Above Main?
Somehow the problem went away after my RPG Maker VX Ace crashed, thanks for trying to help anyway.
You were probably doing a test battle but didn’t save the game before test battling.
http://sadpanda.us/images/1734216-DJ7IJY0.png Since I can’t put it in text.
I am not sure what the issue is. Try it in a new project. I am assuming you know how to add scripts to your project.
Script ‘Game_Interpreter’ line 1411: NoMethodError occurred.
undefined method `add_troop’ for #
Getting the same error, I just copy and pasted the Reinforcements script into my script editor. For the troops I did the same thing you did as shown in the tutorial too…
I cannot reproduce the issue. How did you install the script?
I got this error:
Script ‘Game_Interpreter’ line 1409: NoMethodError occurred.
undefined method `add_troop’ for #
What is #?
I don’t know, I just pasted in the reinforcements script and put add_troop(34) as the script for another troop.
This does not work with ace animated battlers for some reason, do you have a way to fix this?
I don’t know what that is.
It is a final fantasy 1 like battle system, when I set the script call to add troops, it says:
Script ‘Ace animated battlers’ line 296: TypeError occurred. nil can’t be coerced into Fixnum
Can you post a link to the script?
http://yanflychannel.wordpress.com/rmvxa/battle-scripts/visual-battlers/
I’ve updated the script to support it.
Thank you
how about Reinforcements for your party? exaple: new actor will join your party. Nice script
I think you can just do a regular “change actors” event call