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,784
Reaction score
7,875
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,784
Reaction score
7,875
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

Since I started in this world of make games, It's hard for me to enjoy playing a game. It's like, coding and make it work, sounds like I'm playing and have fun o_O
Not sure if it's true (and I won't judge or blame anyone if it is, really), but I heard from confident sources that you guys (and girls) really really like to
How is this new year for everyone? Hope you are well. Still deep in Covid in the US. Its like a vampire and refuses to die with even more strains. I need some holy water to kill it with.
in my game, what's known as HeadSpace is combining with the real world...
oh looks like the forums updated while I wasn't looking and we can put a banner now. Neat!

Forum statistics

Threads
107,670
Messages
1,031,300
Members
139,789
Latest member
TransDiv
Top