03-07-2008, 09:56 PM
Continue From Gameover
Version: 0.1
Version: 0.1
Introduction
Well I'm not sure if anyone wants to use this, but it's really easy to change. I have simply changed Scene_Gameover so you can go to the Title, Shutdown the Game and Continue if you're party has enough gold. The amount of gold is customisable at the top of the script. I guess this is kinda useful, but most people probably won't use it, I just wanted to make something ^_^
Screenshots
Script
"Script"
Code:
#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
# by Syvkal
# Version 0.1
# 03-11-08
#==============================================================================
# Gauge Border Colors
PENALTY = 10000
class Scene_Gameover < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
RPG::BGM.stop
RPG::BGS.stop
@penalty = PENALTY
$data_system.gameover_me.play
Graphics.transition(120)
Graphics.freeze
create_gameover_graphic
create_command_window
end
#--------------------------------------------------------------------------
# * Post-Start Processing
#--------------------------------------------------------------------------
def post_start
super
open_command_window
end
#--------------------------------------------------------------------------
# * Pre-termination Processing
#--------------------------------------------------------------------------
def pre_terminate
super
close_command_window
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_command_window
dispose_gameover_graphic
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
@command_window.update
case @command_window.index
when 0
@window_penalty.visible = true
when 1,2
@window_penalty.visible = false
end
if Input.trigger?(Input::B)
command_to_title
elsif Input.trigger?(Input::C)
if $game_party.gold < @penalty and @command_window.index == 0
Sound.play_buzzer
return
end
case @command_window.index
when 0 # continue
command_continue
when 1 # to title
command_to_title
when 2 # shutdown
command_shutdown
end
end
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::continue
s2 = Vocab::to_title
s3 = Vocab::shutdown
@command_window = Window_Command.new(172, [s1, s2, s3])
@command_window.x = (544 - @command_window.width) / 2
@command_window.y = (416 - @command_window.height) - 64
@command_window.openness = 0
@window_penalty = Penalty_Window.new((544 + @command_window.width) / 2, (416 - @command_window.height) - 64)
@window_penalty.openness = 0
@window_penalty.set_text("- " + @penalty.to_s + Vocab::gold)
if $game_party.gold < @penalty
@command_window.index = 1
@command_window.draw_item(0, false)
end
end
#--------------------------------------------------------------------------
# * Create Game Over Graphic
#--------------------------------------------------------------------------
def create_gameover_graphic
@sprite = Sprite.new
@sprite.bitmap = Cache.system("GameOver")
end
#--------------------------------------------------------------------------
# * Dispose of Game Over Graphic
#--------------------------------------------------------------------------
def dispose_gameover_graphic
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Dispose of Command Window
#--------------------------------------------------------------------------
def dispose_command_window
@command_window.dispose
@window_penalty.dispose
end
#--------------------------------------------------------------------------
# * Open Command Window
#--------------------------------------------------------------------------
def open_command_window
@command_window.open
@window_penalty.open
begin
@command_window.update
@window_penalty.update
Graphics.update
end until @command_window.openness == 255 and @window_penalty.openness == 255
end
#--------------------------------------------------------------------------
# * Close Command Window
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
@window_penalty.close
begin
@command_window.update
@window_penalty.update
Graphics.update
end until @command_window.openness == 0 and @window_penalty.openness == 0
end
#--------------------------------------------------------------------------
# * Process When Choosing [Continue] Command
#--------------------------------------------------------------------------
def command_continue
Sound.play_decision
$game_party.lose_gold(@penalty)
RPG::BGM.fade(800)
RPG::BGS.fade(800)
RPG::ME.fade(800)
$scene = Scene_Map.new
close_command_window
Graphics.fadeout(60)
end
#--------------------------------------------------------------------------
# * Process When Choosing [To Title] Command
#--------------------------------------------------------------------------
def command_to_title
Sound.play_decision
RPG::BGM.fade(800)
RPG::BGS.fade(800)
RPG::ME.fade(800)
$scene = Scene_Title.new
close_command_window
Graphics.fadeout(60)
end
#--------------------------------------------------------------------------
# * Process When Choosing [Shutdown] Command
#--------------------------------------------------------------------------
def command_shutdown
Sound.play_decision
RPG::BGM.fade(800)
RPG::BGS.fade(800)
RPG::ME.fade(800)
$scene = nil
end
end
#==============================================================================
# ** Penalty_Window
#------------------------------------------------------------------------------
class Penalty_Window < Window_Base
def initialize(x, y)
super(x, y, 128, 64 - 16)
end
def set_text(text)
if text != @text
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, -4, self.width - 40, WLH, text, 0)
@text = text
end
end
end
Instructions
Put it under the Materials Section
Compatibility
Should work with most things, but I'm not 100% sure
Credits and Thanks
Umm... I didn't really do much, it's mostly just normal scripting, juggled round a bit.
Author's Notes
This is obviously not that amazingly special, it's just for anyone who wants it :P Enjoy ^_^