Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
railfan101

Disabling the game over screen in wild encounters

Recommended Posts

Not sure if I'm posting this in the right place or not, but I wanted to share a feat I've been trying to do for years.  I finally figured out today how to disable the game over screen whenever you're defeated in a wild encounter that isn't a preset event.  

 

It took me a couple hours but after so much work, I finally solved this problem.  And I'm posting this here to share with you guys how I did it should you want to do the same thing with your games.

 

Unless someone else here managed to do the same thing, in which case this might be moot.  But I'm posting anyway.  

 

The first step involves messing with one script first.  This is the only script we mess around with, and you only need to change two lines.  

 

1. Go to the script editor, either in the menu, or pressing F11.  

2. At the top of the editor you'll see the header Module, and at the bottom, is the script titled, BattleManager.  This is what we want.  

3. Go to line 11 in the script.  That line should read like this: def self.setup(troop_id, can_escape = true, can_lose = false)

By default, the last array is read as false.  This is telling the game that the player is not allowed to lose the battle.  We want to change that so the player is allowed to lose.  Simply change false to true.  DO NOT delete the parenthesis at the end of the line or you'll break the script.  

 

Now you can stop now, as you've achieved the disabling feature already.  The player, when defeated will come out of the battle revived and with 1 HP so you can heal the player and keep going in the dungeon, or whatever place the player is in.  But, if you want the player to be warped to another map for healing, if they are defeated, well I can show you that too.

 

Keep in mind, what I'm about to show you, I highly recommend you do it in the same order I show you here.  The event processing might not work if you try a different order.  

 

1. If you still have the BattleManager script open, scroll to line 240.  You should see the following block of code:

  #--------------------------------------------------------------------------

  # * Defeat Processing

  #--------------------------------------------------------------------------

  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

    else

      SceneManager.goto(Scene_Gameover)

    end

    battle_end(2)

    return true

  end

 

We are only interested in the if @can_lose argument.  The line, revive battle members is the line that makes the game give the player 1 HP if they lose a battle.  We want to get rid of that, so the player maintains the death Status once they leave the battle screen.  Delete that line so the script now looks like this:

 

  #--------------------------------------------------------------------------

  # * Defeat Processing

  #--------------------------------------------------------------------------

  def self.process_defeat

    $game_message.add(sprintf(Vocab::Defeat, $game_party.name))

    wait_for_message

    if @can_lose

      replay_bgm_and_bgs

      SceneManager.return

    else

      SceneManager.goto(Scene_Gameover)

    end

    battle_end(2)

    return true

  end

 

Keep in mind, by deleting the revive_battle_members line, you are having your player defeated and leaving the battle screen with 0 HP on every map you have encounters in your game.  The next step I'm going to show you will allow some flexibility so you are not restricted to one event.  

 

Go into your editor now, and choose any map that has encounters.  You will need to repeat this for every map you have encounters on, but if your not warping the player after defeat, you can just copy and paste once the event is set up.  

 

Once your in any encounter map, double click any empty box to open a new event window for that box.  This order is required.  You must trigger either a recover all command or warp immediately otherwise the game over screen will trigger as soon as the player exits the battle screen.  

 

I wanted my player to warp, so here's what I did.  

 

In the event window, I went to conditional branch, and selected Tab 2.  That gave me the actor’s page.  So I selected my actor’s name, and at the bottom of the window, selected State Death is Inflicted.  My game will always have the same actor in the party, so I don’t need to worry about what if the player doesn’t have this specific person in the party.  If however, you have a situation where you can’t predict which party member your player’s will have, you may need to do a conditional branch for every member in the same event window.  That could become tedious. 

 

Now that the player’s branch is started, we need to tell the game what to do with it.  We want the player healed otherwise the game over screen will trigger and our efforts will be for naught.  How do we prevent that?  Simple, in the first line, right below the start of the conditional branch line, put in Recover all: Entire Party.  Now, when the game is run just like this.  The player will be fully healed, but no indication of such healing will be relayed to the player.  You can now put a message underneath or warp the player to another map. 

 

Congratulations, you have prevented the game over screen from triggering after the player is defeated in battle.  Well done.  

Share this post


Link to post
Share on other sites

For the last part, I guess you can script them all, so you don't need to put the same event on all maps that have encounter.

 

Use

$game_player.reserve_transfer(map_id, x, y, direction)

to transfer player to a specific map, with direction being 2, 4, 6, or 8.

 

Use

$game_party.members.each { |actor| actor.recover_all }

to have everyone fully recovered.

Edited by black mage

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...