Using switches in battle?

Koveras95

Villager
Member
Joined
Oct 17, 2017
Messages
17
Reaction score
1
First Language
Hungarian
Primarily Uses
RMMV
How do I turn on a switch on the death of an enemy while the battle is still running?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,821
Reaction score
7,887
First Language
German
Primarily Uses
RMMV
condition a troop event to that enemies HP, then use control switch in that event.
This will not work if that enemy was the last one because the battle will then end before the troop events are processed, but it will work as long as the battle is not yet finished.

if you want it to happen even if this was the last enemy and the battle ends, that just needs some fancier coding with an immortal state to prevent battle end until the troop event removes the state.
 

Koveras95

Villager
Member
Joined
Oct 17, 2017
Messages
17
Reaction score
1
First Language
Hungarian
Primarily Uses
RMMV
condition a troop event to that enemies HP, then use control switch in that event.
This will not work if that enemy was the last one because the battle will then end before the troop events are processed, but it will work as long as the battle is not yet finished.

if you want it to happen even if this was the last enemy and the battle ends, that just needs some fancier coding with an immortal state to prevent battle end until the troop event removes the state.
I'm trying to make a timed battle. The parallel event that handles what would happen if the time runs out takes priority over everything. I tried adding a swtich after the battle to the battle event, but it's ignored. If the enemy dies, but I'm not fast enough the leave the menu the time limit still goes down.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,821
Reaction score
7,887
First Language
German
Primarily Uses
RMMV
in that case you also need to use the immortal state as mentioned above.

make one troop event on turn zero that adds an immortal state to the enemies.
then make the troop event conditioned on HP=0 like described above.
in that troop event, you'll need a command to remove the immortal state AFTER the switch was turned.
 

Koveras95

Villager
Member
Joined
Oct 17, 2017
Messages
17
Reaction score
1
First Language
Hungarian
Primarily Uses
RMMV
in that case you also need to use the immortal state as mentioned above.

make one troop event on turn zero that adds an immortal state to the enemies.
then make the troop event conditioned on HP=0 like described above.
in that troop event, you'll need a command to remove the immortal state AFTER the switch was turned.
Thanks, I got it working.
 

Latest Threads

Latest Posts

Latest Profile Posts

I'm moving on from RMXP finally. I've been stuck in a difficult decision between XP and MZ, and I've given up and moved on to MZ. Overall I'm really liking it, I wish tilesets were easier to setup like XP, but it's actually not that bad!
Have you ever gone full 'Ship of Theseus' while frankenspriting? Because I just did.
I saw my new eye doctor today, he reminds me of Satoru Iwata for some reason
I've been using a modified version of a script called Multiple Messages. It makes my text boxes look like a Mario & Luigi game! There is something about it that bothers me a little bit, but I shouldn't worry about that now.

Side note, Mist's walking animation is almost perfectly in sync with Loose Yourself by Eminem.
Starting work on some stuff for the community. Hopefully it will be fun, and useful to somebody.

Forum statistics

Threads
107,773
Messages
1,032,038
Members
139,915
Latest member
nick7626
Top