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,809
Reaction score
7,885
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,809
Reaction score
7,885
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 ended up needing to do a chapter one world map remake. It's still WIP but coming along nicely. =D
Stream will be live shortly! I will be beginning a play-through of Resident Evil 4! Feel free to drop by!

1st iteration on castle interior in Tiled.
I've started up Pillars of Eternity. It's interesting how the game does a "select choice" cutscene using still image art for dramatic flair. I wonder if that might work for my RPGMaker project.
The self-righteous indignation of family when you expect them to pay back money you've leant to them never ceases to amaze me.

Forum statistics

Threads
107,750
Messages
1,031,867
Members
139,890
Latest member
jpw5280
Top