Disabling Death?

Hi there,

I'm working on a game right now where I do not want death to actually restart the game.  Ideally, I'd liek to be able to, upon zero HP of the last party member in my team, call a common event.  I think the area I'd need to tamper with in the script is here :

  # * Defeat Processing
  #--------------------------------------------------------------------------
  def self.process_defeat
    $game_message.add(sprintf(Vocab:😀efeat, $game_party.name))
    wait_for_message
    if @can_lose
      revive_battle_members
      replay_bgm_and_bgs
      SceneManager.return
    else
      SceneManager.goto(Scene_Gameover)
    end
    battle_end(2)
    return true

....buuuut I'm not sure what i'm doing exactly 😀   Am I on the right track?  or is there another way to interrupt 0hp defeat with a common event outside of scripting?  Thanks, any thoughts will be appreciated!
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

Are you using random encounters, or map/event based encounters? That method only calls GameOver if you want to continue when your party loses - so if you're using events, in your Call Battle Processing command, ensure the 'continue when loser' box is checked. If you're using random encounters, you'll need to alter the script.

In that case, just change it to something like this:

Code:
 def self.process_defeat    revive_battle_members    replay_bgm_and_bgs    $game_switches[x] = true    SceneManager.return    battle_end(2)    return true
where x is the number of a switch that conditions your common event, which does what you need it to do, then turns that switch back off again.
wow, thanks! It'll take me a little bit to impliment this, ( the scripts.. they scare me!) but it sounsds like exactly what i need! 😀

thanks again!
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/disabling-death.15269/