How can I Show a Picture after all enemies are defeated?

greensdream

"GREEN'S DREAM" developer page
Veteran
Joined
Jul 15, 2017
Messages
63
Reaction score
27
First Language
English
Primarily Uses
RMMV
I would like to Show a Picture after all the enemies in a battle have been defeated. I don't see this option in the Troops tab.

The closest to what I need might be accomplished by using the Switch option, but I'd need some way to have the Switch turn on once all the enemies are defeated. Maybe there is another way?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,382
Reaction score
8,099
First Language
German
Primarily Uses
RMMV
neither will work as is, because there is another problem in the way: the troop events will not be executed after the last enemy dies, it goes directly to the battle aftermath unless you trick the engine.

you'll need a variable for death counting and several troop events as well as an invisible immortal state.
you'll need one troop event to be run on turn 0 that sets the variable to the number of enemies in the troop (either manually or by script) and that gives all enemies an invisible immortal state (no messages, no icon, trait is resistance to death state).

then you'll make one troop event per enemy, conditioned on that enemies HP=0.
This troop event will count the enemies down by one, then check if the variable is zero.
If yes, display picture.
In both cases remove the immortal state after that, making the enemy correctly die only after the troop event has run.

Most people doing this also implement a bast troop plugin that copies all events from the base troop to all troops, so they don't have to manually set these events up for every troop,
 

Latest Threads

Latest Posts

Latest Profile Posts

Whenever I start on a new chapter, it doesn't feel like the next episodes, but more like sequels :)
It can be frustrating that so many commercial games have used up titles that might otherwise be great for a project.
Light up explosions with QABS and Community Lighting.
qcPQHt9.gif

Forum statistics

Threads
110,655
Messages
1,054,985
Members
143,779
Latest member
Epitaph78
Top