Notice: fwrite(): Write of 483 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 59 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 1714 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 8192 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Print Page - Game Over to Common Event problem

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=Script]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
[/spoiler]

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.