More than 20 Base Troop Events with Yanfly's plugin

I am having quite a problem with Yanfly's Base Troop Events plugin. The problem is that you can only fit 20 events into each troop, and I need well over 40. I tried installing the plugin twice and selecting two different base troops, but only the first one works. I could use some advice on this. Is there a way to alter the plugin to allow for multiple base troops?

Alternatively, my problems could probably be just as easily fixed if there was a way to set a parallel trigger common event running at the start of the battle and let it continue running throughout, thus avoiding the freezing effect of the 'moment' span battle events.

Any advice on the matter would be much appreciated.
Could you please expand on why you need so many different events? Maybe we can reduce the number you need by grouping some together or replacing them with states with the <Custom Battle Effect> notetag from Yanfly's Buffs and States Core?
I'm afraid I already tried that. Custom Effects don't always work in this particular case.

I am trying to create skills that bring specific actors into the battle and then remove them when either they are knocked out or the battle ends, like a traditional summon (And, before you ask, yes, I have already tried different summoning plugins. None of them worked for me.)

I started by creating a 'Summoned' state with a <Custom Remove Effect>, <Custom Leave Effect>, <Custom Victory Effect> and <Custom Respond Effect> for when the actor's HP reaches 0, and had the actor removed from the party under each of these conditions. I then set up a common event to summon each actor when a specific skill is used and apply the 'Summoned' state to them. The 'Summoned' state did work, but the CE didn't always apply the effect when it was supposed to, resulting in summoned actors not leaving the party when they were supposed to.

The only thing that seemed to work was setting a switch for each summoned actor, setting up a battle event to apply the 'Summoned' state every turn (turn based) and then setting up another BE to remove the 'Summoned' state, turn the respective switch off and remove the actor from the party anyway (just in case the 'Summoned' state wasn't applied) when the actor's HP reached 0 while the switch was on (moment based). This worked for pretty much every summon, but I have nearly thirty actors! I could probably condense the turn based BEs into one using conditional branches, but each actor requires their own moment based BE! I also need a battle based BE to turn all the switches off at the beginning of the battle.

By this point, I am almost completely resigned to the fact that there are going to be glitches in the summoning method that I cannot fix, unless someone comes up with a way to either install multiple Base Troop Events or have a parallel CE run throughout the battle without freezing it.

I hope that clears things up.
I am trying to create skills that bring specific actors into the battle and then remove them when either they are knocked out or the battle ends, like a traditional summon (And, before you ask, yes, I have already tried different summoning plugins. None of them worked for me.)
That's odd, SRD's summon plugin works perfectly for me with a bunch of Yanfly plugins in the project.

I started by creating a 'Summoned' state with a <Custom Remove Effect>, <Custom Leave Effect>
There's no reason for that; Custom Remove is more encompassing and contains Custom Leave. Having both of those notetags present will result in the code running twice when your state decays. And if your state doesn't decay after a number of turns, the Custom Leave is pointless because that's the only time it runs.

I then set up a common event to summon each actor when a specific skill is used and apply the 'Summoned' state to them. The 'Summoned' state did work, but the CE didn't always apply the effect when it was supposed to
We'd have to see the event to try to troubleshoot that. It should be able to work, although I would personally choose a different route (like resolving whatever issues you have with the Summon Core).

The only thing that seemed to work was setting a switch for each summoned actor, setting up a battle event to apply the 'Summoned' state every turn (turn based) and then setting up another BE to remove the 'Summoned' state, turn the respective switch off and remove the actor from the party...when the actor's HP reached 0
Even if this were the only solution, there are other more efficient ways.
- Use a plugin to run a common event on actor death, check if they're a summon and remove them from the party. Nothing in the troop necessary.

- Use a plugin to create a custom troop condition that can check for any specific dead actors instead of needing a separate event for each one. Only one troop event necessary.

By this point, I am almost completely resigned to the fact that there are going to be glitches in the summoning method that I cannot fix, unless someone comes up with a way to either install multiple Base Troop Events or have a parallel CE run throughout the battle without freezing it.
I'm just sort of bemused that you have these other, better ways to implement things, and you're not trying to fix those 😉 This whole system that you've outlined is like covering your rotten boat with duct tape to keep sailing on it.

Instead of trying to fix this, why not try to fix one of the higher level parts that would work better? Ask for help to get your common event working correctly. Ask for help to get the Summon Core (or another equivalent plugin) working correctly. Having 40 events in all troops (or, really, any troop) just doesn't seem like the best place to stand your ground.
I've done a test-run using markers, and it looks like the problem wasn't the application of the state after all, as the 'Summoned' icon appears above every battler that I use the skill with. It looks like the actual problem is with the javascript I'm using for the state's React and Respond effect. It's not removing the battler when its HP is 0 like it should. Here's what the script looks like:

<Custom React Effect>
</Custom React Effect>
<Custom Respond Effect>
if ($gameParty.inBattle() && target.hp <= 0) {
$gameParty.removeActor(user._actorId);
}
</Custom Respond Effect>

I made it using Yanfly's 'Second Chance' state as a basis. Any idea how I can rectify this? Alternatively, I could try adding an apply effect to the 'Knockout' state to remove a battler when the switch associated with its summon is switched on, but I don't know how to call on a common event in lunatic mode.

B.T.W.:
I'm just sort of bemused that you have these other, better ways to implement things, and you're not trying to fix those 😉 This whole system that you've outlined is like covering your rotten boat with duct tape to keep sailing on it.
LMAO! That is exactly what it feels like! Mind you, according to MythBusters, you can fix a boat with duct tape, as long as it's not in the water at the time. By that logic, I should be able to patch the game, as long as I don't try patching it during a play-test.
<Custom React Effect>
</Custom React Effect>
What's the point in having a notetag with no code in it? Either this should do something that you're missing, or you should delete it.

<Custom Respond Effect>
if ($gameParty.inBattle() && target.hp <= 0) {
$gameParty.removeActor(user._actorId);
}
</Custom Respond Effect>
1 - There's no reason for that first condition, $gameParty.inBattle() - these notetags only get looked at in battle, so that will never be false.

2 - The problem is that you're confusing two variables. You're checking for the condition whether the target is at less than 0 hp (a better condition is target.isDead() ), but then you're trying to remove the user from the party. Since the user is presumably the enemy attacking you, that will never do anything.

I'm not certain that just calling removeActor() will do everything you need, you might also need to refresh something in the party or on the screen for it to display properly...but at least you can remove the correct battler.
Another point: <Custom Respond> effects will only be executed if the battler with the state is actually the target of an action (item or skill). If the battler dies through other means, like a damage over time effect, it will not be executed. Therefore I think your approach of a <Custom Apply> effect on the death state would be the most elegant way. However I don't think there is a need for a complex system involving switches and common events. Simply check if the battler that got the death state applied is an actor and has an actor id of one of your summon actors. If true, remove that battler.
Another point: <Custom Respond> effects will only be executed if the battler with the state is actually the target of an action (item or skill). If the battler dies through other means, like a damage over time effect, it will not be executed. Therefore I think your approach of a <Custom Apply> effect on the death state would be the most elegant way. However I don't think there is a need for a complex system involving switches and common events. Simply check if the battler that got the death state applied is an actor and has an actor id of one of your summon actors. If true, remove that battler.
I agree that adding a <Custom Apply Effect> to the death state is the more elegant. I can't code the removal of specific actor IDs because the battlers have to be recruited as party members first before they can be used as summons. However, I've set a switch to activate whenever the state is applied and set up a moment based battle event to remove every knocked-out battler whose summon switch is on at the time, before turning the switch off. This seems to work fine now. I wish that I could show the <state remove animation> when the battlers are removed, but it doesn't look like there's a way to do that. Still, at least the game runs more smoothly now.
I'm not certain that just calling removeActor() will do everything you need, you might also need to refresh something in the party or on the screen for it to display properly...but at least you can remove the correct battler.

Actually, removeActor() works for everything except the death state.
Actually, removeActor() works for everything except the death state.
I'm not sure what that means.

I wish that I could show the <state remove animation> when the battlers are removed, but it doesn't look like there's a way to do that.
Code:
target.startAnimation(ID);
There's a pinned thread in the JavaScript forum that has a list of basic script calls.
I'm not sure what that means.
I mean that it successfully removes the actor in the event of removal, victory or escape. It just doesn't work when the state is removed by the actor dying.
Code:
target.startAnimation(ID);
There's a pinned thread in the JavaScript forum that has a list of basic script calls.
Thanks for that! I was aware of the spreadsheet of script calls; I just didn't know that battle animations could be applied to actors as well as enemies, as only enemies are available as targets when using event commands.

It looks as though the problem has been sorted out entirely, at least for now. My boat is sailing smoothly once again. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/more-than-20-base-troop-events-with-yanflys-plugin.151414/