Gameover -> Common Event
Version: 1.0
Author: modern algebra
Date: February 20th, 2008
Description
Requested by zzzdude, I figured I would post it in case anyone else wanted it. Instead of calling up the GameOver scene when you die in battle, it calls a common event you specify. This can be used for an epilogue, or any kind of evented Game Over cutscene. Bear in mind that you do have to call the Game Over screen at the end, or else arrange an alternate game over. You will need to set everything in the common event. The script does not do anything a regular Game Over scene does.
Paste it into it's own script page in the editor, just above main.
Features
- Allows you to call a common event, instead of going straight to Scene_GameOver. This allows you to have an evented gameover or send to an inn or whatever.
Instructions
Just paste this code above main. Then, go down to line 6 and set @gameover_ce_id to the ID of the common event you want to use as the common event it calls when you hit gameover. This only works for game overs in battle. If you leave it as 0, then it will game over as default. If you ever want to change what common event is called during the game or to set it back to default, just use a call script like this:
$game_system.gameover_ce_id = <new common event ID>
Script
class Game_System
attr_accessor :gameover_ce_id
alias modalg_gameover_to_common_event_init initialize
def initialize
modalg_gameover_to_common_event_init
@gameover_ce_id = 0 # Default Common Event ID
end
end
class Scene_Battle
alias modern_algebra_gameover_common_event_call call_gameover
def call_gameover
if $game_system.gameover_ce_id != 0
$game_party.clear_actions
$game_party.remove_states_battle
$game_troop.clear
if $game_temp.battle_proc != nil
$game_temp.battle_proc.call (2)
$game_temp.battle_proc = nil
end
unless $BTEST
$game_temp.map_bgm.play
$game_temp.map_bgs.play
end
$scene = Scene_Map.new
@message_window.clear
Graphics.fadeout(30)
$game_temp.common_event_id = $game_system.gameover_ce_id
$scene = Scene_Map.new
else
modern_algebra_gameover_common_event_call
end
end
end
Credit
No credit is necessary for such a simple script, but it was written by me
Support
Please post your questions here if you run into problems
Author's Notes
This, when I made it for RMXP, was just released as a scriptlet. But, I figure I will test releasing them independently to see what happens. Once the VX database gets more scripts I will probably merge them all back into the Useful Scriptlets topic. It has a few changes from the XP version. Mainly it overwrites the call_gameover method and throws in a few safety features.
This script by
modern algebra is licensed under a
Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.