Anyone know of a way to get a conditional branch to check if all enemies in a battle are dead? Basically, I'm using Visu's CTB battle system and have an image to support the CTB gauge and status areas and I can't figure out how to get it to disappear when all monsters are dead. I've thrown a bunch of conditional branches in the first troop (since the plugins apply all events of troop 1 to all troops) to go down the list if enemy a is dead + b is dead + c is dead, but I'm not sure it runs properly because there's not always 8 enemies.
So if there's a way to do a script call or whatever it would take in order to check if all enemies are dead and erase the image, that would be the best way to solve it I think. The image stays on screen and conflicts with the victory aftermath.
don't event the image.
use the scene's own code, or the CTB code.
every battle system is scripted to it's own scene, which takes care of opening windows and refreshing gauges.
IT must have a block that loads or unloads all images. Hook up your image there.
I solved it by putting $gameScreen.clearPictures(); in the managers.js in the checkBattleEnd area. Seems to play well with the Visu plugins so all is well now 😀
Thanks to the both of you.
not the ideal solution, unless you alias that through Visu's work.
if you added that call through Visu's own code and not the vanilla code, it'll be fine as long as there are no other pictures that get cleared by it when they don't have to.
if that's an edit to the vanilla code, it could conflict with other calls to render pictures.
all in all, this approach is much better than eventing the picture to show up, which is the top-most layer of the stack.
probably because neither grabs the screen.... IDK.
the point is, the instruction exists, to remove the picture from the screen.
if you add and remove the picture by eventing, you'll have problems when the removal of that picture isn't available because the scene changes through another route.
if you instead task the scene to take care of it, IT will always perform the cleanup because all scenes work the same, and scenes handle their own structure, which doesn't require a *screen* (object)
the problem in this case is adding the instruction before or after the execution of the add-on that is Visu's plugin, which runs separately.
IT must run as if there was no editing, mind your editing when shutting down, run your code, and then return control to the vanilla code. How exactly to do that? I don't know, it depends on Visu's code, not yours. If it's a mess, you can still figure it out because the instructions are always the same, even if they're not named the same.
I moved it here because you were talking about a specific battle system that you're using, so it would need to be done within the confines of that battle system. By default, troop events won't run after the last enemy has been killed, unless you go with the method mentioned of setting enemies to immortal. There are plugins that will get around that, but maybe the one you're using already has that ability.