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,734
Reaction score
7,851
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,734
Reaction score
7,851
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 Posts

Latest Profile Posts

My computer broke yesterday, so no RPG maker for at least a week until I can get it repaired. :(
Just wanted to share how my game won 1st place in a game jam for itch.io. Everyone else used Unreal, Unity, GMS2, Godot, etc but I used RPG Maker 2003 :guffaw: It just shows that you can create a good game and it doesn't matter which engine you use
Working on cutscenes~

if your game is the first (or ONLY) in a series and still has a colon in its title, you are a bad person and I hate you...... jk.

who could ever hate BETWEEN: TWO SOULS?

Forum statistics

Threads
107,404
Messages
1,029,440
Members
139,501
Latest member
FLXYM
Top