Making it so losing in Battle doesn't necessarily trigger a game over

So, as it stands, no matter how many members your party has, if you activate a battle sequence and lose, it will trigger a game over.

I'm wanting to make it so that if you have 5+ members of your party and at least one of those characters is still alive, a game over is not triggered. However, if you only have 4 members and you lose, you will still have a game over as usual. Any suggestions? Will I need to modify a script?
I don't have Ace on me so these are MV screenshots, but you can move game-over processing into your event.
1595955116882.png


When you check those boxes, you can have custom result handling

1595955431290.png


Of course, this is for evented battles. If you're using random encounters, might need to change some scripts.
You could use Common events with a random variable and branch conditions for random encounters. Allowing you to create a massive RNG encounter.
Within the "If Lose" you can add Call common event to check the conditions of everything you want to trigger game over of not. Reason why I say in a Common event is that so you don't have to copy paste all the conditions everywhere. 🙂
Add this as a new script and it should do what you're asking for.

Code:
BattleManager.module_eval do
  def self.process_defeat
    $game_message.add(sprintf(Vocab::Defeat, $game_party.name))
    wait_for_message
    if @can_lose
      revive_battle_members
      replay_bgm_and_bgs
      SceneManager.return
    elsif $game_party.reserve_alive?
      $game_party.battle_members.size.times do
        member = $game_party.members[0]
        $game_party.remove_actor(member.id)
        $game_party.add_actor(member.id)
      end
      replay_bgm_and_bgs
      SceneManager.return
    else
      SceneManager.goto(Scene_Gameover)
    end
    battle_end(2)
    return true
  end
end

Game_Party.class_eval do
  def reserve_alive?
    !all_members.select {|member| member.alive? }.empty?
  end
end
Add this as a new script and it should do what you're asking for.

Code:
BattleManager.module_eval do
  def self.process_defeat
    $game_message.add(sprintf(Vocab::Defeat, $game_party.name))
    wait_for_message
    if @can_lose
      revive_battle_members
      replay_bgm_and_bgs
      SceneManager.return
    elsif $game_party.reserve_alive?
      $game_party.battle_members.size.times do
        member = $game_party.members[0]
        $game_party.remove_actor(member.id)
        $game_party.add_actor(member.id)
      end
      replay_bgm_and_bgs
      SceneManager.return
    else
      SceneManager.goto(Scene_Gameover)
    end
    battle_end(2)
    return true
  end
end

Game_Party.class_eval do
  def reserve_alive?
    !all_members.select {|member| member.alive? }.empty?
  end
end
Thank you, everyone, and Trihan's solution works like a charm! Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/making-it-so-losing-in-battle-doesnt-necessarily-trigger-a-game-over.124640/