How to run a common event at the end of a battle?

Hello RPG Maker community! 🙂


Is it possible to run a common event at the end (before the player enters the map again) of every battle by default?


I ceated a summon skill, where the entire party is replaced by a summon in battle (the summon itself is a new actor) and another skill, wich makes the summon disappear and the party come back again.


However, when my summon wins a battle, there seems to be no way to switch my party back to its original members befor the battle ends, wich results in my summon being my only party member after the battle. 
Another thing is, when my summon dies in battle, the game is over. After the summon is dead, I want my party to come back, so that the fight keeps going. 


I want to fix this problems with a custom event, but I do not know how to trigger them ... is this even possible without custom code?



 


Unbenannt.PNG
here you go:





You can use that to turn on up to 4 different switches depending on the battle outcome (if you just want to know a battle has ended, use the same switch ID for all of them).  Then condition your common event by that switch ID and set it to autorun or parallel process.  Remember to turn the switch off again at the end of the common event.


Edit: I am not actually sure if you want it to run during battle, or when the player is back on the map.  Your text in brackets could be read in two different ways.  This plugin will only work when you return to the map.  Parallel process or autorun common events do not run during battle, and when a battle is ended (last enemy is defeated), no more troop event commands run either, so you also can't do a Call Common Event command.  If you want it to run at the end of battle before you return to the map, you'll need a different plugin, and the one I linked to above won't be of any use to you.
Ahhhh - very nice. Thank you! 😀
re-read my post - I added some extra that you probably haven't seen.  I'm not sure that plugin will do what you want.
Ok, I'll edit my post. Sorry.


I need to trigger a switch before the player enters the map again.
Do you want the common event to run while the battle screen is still visible?  Before or after the battle results are displayed?  Or can it be after the battle is over, but before the map is visible again?
It would be optimal if it runs while the battle Screen is still visible and before the battle results are displayed.
Yanfly has a Victory Aftermath plugin, but I'm not sure what sort of things it would let you do.
I already have it in use, it does not provide turning on switches at the end of a battle, unfortunately.


But well, I might have found a way to make things work for my first issue. If I turn on a switch at the beginning of my game, it triggers a paralell event wich does constant checks on my battle members. So when I return to the map, it automatically removes the summon from my team and adds my original party members back. That does not solve the EXP problem (The sumon then gets all the exp from the battle and not my party members) but I can live with that.


However, the second problem that I have (summon dies = game over) is still valid :-/

Original thread: https://forums.rpgmakerweb.com/threads/how-to-run-a-common-event-at-the-end-of-a-battle.65483/