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,747
Reaction score
7,860
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,747
Reaction score
7,860
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

I have trauma after accidentally stumbling upon vore CYOA on text adventures and then reading the description "unwilling and willing" "one half lives inside other half" Oh my.... And peoples comments... "please add pregnant" "very good" "the best vore CYOA ive ever seen"...what...I wanna vomit, seriously. Its horrible.
If you're reviewing someone else's game, don't focus only on the negative and criticize them. Use positive constructive feedback. As game developers, we need to empower one another; not put each other down.
just posted a song I made for my game a while back... I sampled the HEY from Earthworm Jim's Snot a problem levels lol...
Based on this screenshot alone, which one would you sell, and which to equip?
Some random sketch-letons.

Forum statistics

Threads
107,481
Messages
1,030,001
Members
139,612
Latest member
Imjeax
Top