Jump to content
Thordon123

Help with checkIsAlive for Troops

Recommended Posts

Hime's Enemy Reinforcements: http://himeworks.com/2015/11/enemy-reinforcements-mv/

 

Hello all! I'm new to MV and I'm using a plug-in right now called Hime's Enemy Reinforcements, which lets you introduce new enemies to a battle by the troop or individually. What I hope to create is a wave-based battle system, where a new wave of enemies appears after the prior wave dies (you kill one troop of enemies, another troop appears, that kind of thing), which I should be able to do with this plug-in, however on the page it says that I need to use the script call: 

 

$gameTroop.isTroopReinforcementAdded(troopId, checkIsAlive)

 

The problem is, when I use this, I get a console error telling me that checkIsAlive is undefined. At first I thought the problem was with the Yanfly Engine, but I still got the error after I had disabled all of my YEP plugins. So I guess that I had to define checkIsAlive myself, but the thing is I have no idea how to do that. Is it a common event? A variable? If anybody could help me out with this and tell me how to define it then it would be much appreciated, especially because this is the last part of my combat system I need to make before I can start balancing it. Thanks a lot, and I'm sorry if this is in the wrong place!

 

PS: I've attached a screenshot of the console error. I know it might look like Yanfly is the problem there, but like I said even with YEP disabled it still doesn't work.

Screenshot (3).png

Share this post


Link to post
Share on other sites

It looks like you didn't define checkIsAlive
checkIsAlive should be a boolean

you should write something like
$gameTroop
.isTroopReinforcementAdded(1, true)

or
$gameTroop
.isTroopReinforcementAdded(1, false)
or even
$gameTroop
.isTroopReinforcementAdded(1)

Share this post


Link to post
Share on other sites

Thank you that's very helpful. However it still doesn't work for me. I'm trying to check if the ORIGINAL troop is alive using the script, and then if it isn't, adding the next troop in after. Here's what I have so far, could you offer any suggestions? I'm a really terrible eventer

 

 

Screenshot (7).png

Share this post


Link to post
Share on other sites

ok sorry

the event trigger should be enemy below 0 % hp(not sure it would work with turn X event trigger)
to make sure there no enemy left when reinforcement arrive
try 
if script $gameTroop.aliveMembers.length == 0

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×