Battle over and over until player says stop?

So I finally started dabbling in the battle system for my game.

I'd like to set up a training gym for the player, where player enters the battle and fights an enemy. Let's say a slime. I want it to go like this:

1) Battle with first slime. Player defeats it.
2) Still in the battle window, player is asked if they've had enough. If yes ---> exit battle.
3) If no, summon another slime. And loop this until the player dies or says they've had enough.

How do I even approach that?
Pretty sure you'll need a plugin. Shouldn't be a difficult one to make.
I think I have seen something like that in some videos, so I'm guessing there already are some plugins like that around. Anyone can point me in the right direction? 🙂
the check for victory involves checking for death state, and the troop event check happens before that.
you can check for death state, remove it, and present the choice to continue.
you can always force a victory by troop event if the player chooses to exit.
if the player continues, just heal the enemy and exit the check.

when solving a problem, always start from the end: you want the battle to end on demand... ok, you *can* do that.
how do you get there? you have to prevent the automatic check from happening.
that's where you introduce a change.
You could make your enemy immune to death, and on every turn check to see if their hp is 1 (I think that's what happens when you add death immunity - hp drops to 0 and is then restored to 1, but it's worth confirming). If enemy hp is 1, you may be able to simulate the enemy dying or just make them transparent, show choices, then make visible again and restore full hp/mp, or exit, depending on choice.


I thought troop events did not get run when all enemies were dead. Or is that just when all the player party is dead?
I thought troop events did not get run when all enemies were dead. Or is that just when all the player party is dead?
Code:
update
 if in_turn?
   battlemanager.process_event
   battlemanager.process_action
 end
 battlemanager.check_win_loss
end

check_win_loss implies troop.all_dead?, and troop.all_dead exits to battle_end(win)
that's why it doesn't happen when all enemies are dead..... it doesn't go for the next loop of the update.
I'm sorry, but I have no idea what you guys are talking about. I have no idea about JS and I would need a very step-by-step guide to do something script-related. Can I somehow edit the in-battle events from the classic event editor in RPG maker?
None of this requires JS. The instructions you were given were to add a troop event that checks for the death state, and if found, presents the player with choices to battle on or exit, and if they choose to battle on, restore the enemy's health.

That is all done via event commands.
Alright, so I found the troop event thing (didn't know it works like that) and I put together something like this:
battle-PleAi3rQ.1512571389.png


battle-PleAi3rQ.1512571389.png

http://picpaste.com/pics/battle-PleAi3rQ.1512571389.png

and it doesn't really work. What's more, when it executes, the debugger tells me:

SCRIPT CALL ERROR
/C:/Users/[...]/js/plugins/YEP_CoreEngine.js:2274 update
if in_turn?
battlemanager.process_event
battlemanager.process_action
end
battlemanager.check_win_loss
end

/C:/Users/[...]/js/plugins/YEP_CoreEngine.js:2275 SyntaxError: Unexpected identifier
He did not tell you to put that script into your event, and I told you that you don't need to do any scripting.

The script snippet is from Ace, not MV, so will not work in MV anyway. And it was a response to my post, not an instruction to you.
So how am I supposed to make that work? I tried without any scripting, with a condition "Enemy HP 0% or below" but it just ends the battle without displaying the dialogue.

The conditional branch checking for enemy knockout doesn't give me the desired result either. And in both cases logic dictates it should work. Unless the last fallen enemy automatically ends the battle before any event gets a chance to run. Is there a way to force it to run before the end of battle?
change the check span to Moment instead of Turn.
and make sure it's set to 0 + 1, and not end of the turn.

and remove the script entry! that's not a script, that's an example!
Changed it the way you said:

http://picpaste.com/pics/battle-grv0Tqlc.1512589702.png

Still doesn't work though. The battle just ends.

EDIT: Removing the conditional branch doesn't make it work either.
"enemy appear" only works on hidden enemies.
when Rat dies, it's *dead*, not *hidden*
you have to *remove Dead* first, and then *heal*.

concepts.
Thanks for the tip on that, but since it's not even showing the dialogue, it's not just a problem with the rat adding, but with triggering this event in general.
Did you make the enemy immortal? By default, when the last enemy dies, the battle ends immediately and battle events are not processed. There is a plugin somewhere that changes this behaviour, but the easiest solution is to just give the enemy the Immortal state at the start of the battle - then you also don't have to remove the Death state, just heal the enemy back to full HP.
Hmmm... That won't work for me, unfortunately. I need the enemy to get killed. I want the player to be able to decide how many rats they want to slay and get the appropriate exp. If I keep a rat immortal and keep restoring it to full HP, it's still one rat and exp for one rat.
If I keep a rat immortal and keep restoring it to full HP, it's still one rat and exp for one rat.

uhhhhhh...... Houston, we have a problem.... :/

experience is not calculated until the enemy is down for good and the battle is over.
that won't work with what you want.
you're going to need a specialized solution, you can't do it with regular eventing unless you add some scripting workaround either as part of the event or directly into the code.

the quickest solution I can think of, is add a counter to the validation to keep track of how many times the rat died.
on exit, multiply the experience and increase the players experience manually.
You know... I just gave up 🙂 I remade the whole gym and now the player enters battle, kills the rat, exits battle, gets asked if they want to kill another rat, enters battle again.
Until death or until "I'm done for today".

Adds a lot of screen switching, but balancewise works exactly the same.

Original thread: https://forums.rpgmakerweb.com/threads/battle-over-and-over-until-player-says-stop.88124/