MV YEP Swap Enemies based on switch or variable?

Hi! :hhappy:

I was wondering if there's a way after the player beats the final boss, if I can change the Swap enemies based on a switch or variable, so lets say:

<Swap: 5, 6, 7, 8, 9>

*Player defeats final boss*
Switch 200 Flips on

<Swap: 5, 6, 7, 8, 9, 10, 11, 12>
So I took a look at YEP_SwapEnemies and it looks like it loads all the notetag data once at game initialization and might not ever again after that. In that case, this is going to require a script to manually pass a new $dataEnemies object into the DataManager.processSwENotetagsE function when you flip your bossDefeated switch.
It's not clear to me from your first post exactly what you're trying to do.

Are you trying to change what will happen in the current battle if you defeat the boss first? Are you trying to make defeating the boss change what happens in other troops?

Either way, as AquaEcho said, notetags are tied to database entries. So you can't change them once a game has started, and if you do overwrite the values they'll reset when you launch the game again.

A better way is to change the actual enemies being used once that switch is flipped. If that's during the boss battle you can transform the enemies to another version. If it's something that happens in the game after the boss is defeated, you can use conditional encounters to change which troops/enemies get loaded.
So I took a look at YEP_SwapEnemies and it looks like it loads all the notetag data once at game initialization and might not ever again after that. In that case, this is going to require a script to manually pass a new $dataEnemies object into the DataManager.processSwENotetagsE function when you flip your bossDefeated switch.
Wow that is actually interesting and very helpful to know thank you! I think I can definitely use ATT Turan's method to help me achieve this 🙂

@ATT_Turan

So basically I was going to have a New Game + option through Yanfly New Game + but I kind of just want to keep the game without New Game + but still modifying it to be more difficult once you defeat the final boss! I still don't really know if I should go about this way though as I pretty much have NG+ implemented into my game already but I just want to scale my enemies like 50% stronger or something instead of manually copying every enemy again and making them harder.


Are you saying that I can put it like this in my troop battle event page, and it will load the battle in the event page instead of showing the battle in the original troop screen?

Like this?

1682523876542.png
Are you saying that I can put it like this in my troop battle event page, and it will load the battle in the event page instead of showing the battle in the original troop screen?
No, definitely not. Trying to start a battle within a battle...well, it will probably have checks built in so that it won't crash your game. I expect nothing will happen. If something does happen, it will visibly load the original troop then restart the battle with the new one.

No, when I said use conditional encounters, that's a plugin you'd use.

Or, now that we know why you're asking the question, you should be able to do this using Yanfly's Enemy Levels plugin to set conditions for them to be a higher level and such. Either way.
No, definitely not. Trying to start a battle within a battle...well, it will probably have checks built in so that it won't crash your game. I expect nothing will happen. If something does happen, it will visibly load the original troop then restart the battle with the new one.

No, when I said use conditional encounters, that's a plugin you'd use.

Or, now that we know why you're asking the question, you should be able to do this using Yanfly's Enemy Levels plugin to set conditions for them to be a higher level and such. Either way.
I actually have the conditional encounters plugin already put into place for the new game + switch it's just I feel like I can do things easier by putting what you just said with Enemy Levels or like adding a passive aura to my main character that buffs enemies parameters to 150% but I feel like that will mess with like other skills that buff parameters in the same way.. So I'm going to look into Enemy Levels first and maybe I don't even need any of the Conditional Encounters or this probably bad aura idea I thought of :hswt: Thank you as always @ATT_Turan

Original thread: https://forums.rpgmakerweb.com/threads/yep-swap-enemies-based-on-switch-or-variable.156965/