The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Revo on November 11, 2008, 11:16:57 PM

Title: Game Over to Common Event problem
Post by: Revo on November 11, 2008, 11:16:57 PM
Spoiler for Script:
Code: [Select]
class Scene_Battle
 
  # Aliases update to run before everything else in the method
  alias gameover_to_common_event update
  def update
    if $game_temp.gameover
      # Editable region. This number below is the ID of the common event you
      # wish to run. It is 1 by default, change it to suit your game.
      $game_temp.common_event_id = 11
      $scene = Scene_Map.new
      $game_temp.gameover = false
      return
    end
    gameover_to_common_event
  end
end

So here's the problem... It only goes to the common event game over if the character is knocked out during battle. Unfortunately, I'm using this for a trap system. So the only time characters are damaged and have the chance of being knocked out is on the map, not in battle.

So, my question is... Is there any way to edit this in a way so that it will trigger the common event game over on the map instead of during battle?

Any help is appreciated.