10-03-2006, 01:00 PM
GameOver Menu V.2
by xLeD
Oct 3 2006
It's me xLeD again! I had some spare time over today, so I though: What tha heck! I'll do something new with the GameOver Script.
And I sure got super cool!
What is so special about it?
instead of the menu is run by a usual menu like in the first GameOver menu, The GameOver Menu V.2 is all run by Pictures, 3 pictures to be exact. The pictures work as text and background... There is not usual Text in it.
What Does it do?
Like in most Pro-Games, when you die and enter the GameOver you usualy don't get back to the Main Menu... What usualy happends is that a menu fades in where you can choose:
- Load
- Exit
- Back to Main Menu
So thats exactly what I've done.
Is There no Screenies ?
Well, that would be kind of difficult to make... since the menu is run by a picture.
BUT I will however put up a sample menu instead, (Three Pictures = One menu)
The Installation
This is a 3 step tutorial how to install the script.
1. Insert the menu Pictures in YourGame/Graphics/Titles Name them 1, 2 and 3
2. Find the Script named Scene_Gameover in your scriptlibrary in your game and replace it with this:
3. Play The Game!
Credits Goes to xLeD and ccoa if use!(I learnt how to do this through her Titlescreen script)
Now Post Coments! XD
by xLeD
Oct 3 2006
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
It's me xLeD again! I had some spare time over today, so I though: What tha heck! I'll do something new with the GameOver Script.
And I sure got super cool!
What is so special about it?
instead of the menu is run by a usual menu like in the first GameOver menu, The GameOver Menu V.2 is all run by Pictures, 3 pictures to be exact. The pictures work as text and background... There is not usual Text in it.
What Does it do?
Like in most Pro-Games, when you die and enter the GameOver you usualy don't get back to the Main Menu... What usualy happends is that a menu fades in where you can choose:
- Load
- Exit
- Back to Main Menu
So thats exactly what I've done.
Is There no Screenies ?
Well, that would be kind of difficult to make... since the menu is run by a picture.
BUT I will however put up a sample menu instead, (Three Pictures = One menu)
The Installation
This is a 3 step tutorial how to install the script.
1. Insert the menu Pictures in YourGame/Graphics/Titles Name them 1, 2 and 3
2. Find the Script named Scene_Gameover in your scriptlibrary in your game and replace it with this:
Code:
#================================Metal Forest inc==============================
#=====================================Presents=================================
# ** Scene_Gameover menu V.2
# ** Created by xLeD
# ** Special Credits goes to ccoa
#------------------------------------------------------------------------------
# This class performs game over screen processing.
#==============================================================================
class Scene_Gameover
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make game over graphic
$game_system.bgm_play(nil)
$game_system.bgs_play(nil)
# Play game over ME
$game_system.me_play($data_system.gameover_me)
# Slow Fade in
# NEW CODE
@back_sprite = Sprite.new
# transition between images, set to 0 if none
@transition_frames = 10
@delta = 255 / @transition_frames = 5
@wait = 0
#END NEW CODE
# NEW CODE
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title("1")
@index = 1
Graphics.transition(120)
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Stop BGM and BGS
#Fade in
Graphics.transition(120)
# Make system object
$game_system = Game_System.new
# Make title graphic
@sprite = Sprite.new
# Prepare for transition
Graphics.freeze
# Dispose of title graphic
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# NEW CODE
if @wait > 0
if @wait == 0
@sprite.bitmap = RPG::Cache.title(@index.to_s)
@sprite.opacity = 255
else
@sprite.opacity -= @delta
end
@wait -= 1
return
end
# if directional buttons are pressed
if Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
$game_system.se_play($data_system.cursor_se)
if @index == 1
@index = 3
else
@index -= 1
end
@wait = @transition_frames
@back_sprite.bitmap = RPG::Cache.title(@index.to_s)
end
if Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
if @index == 3
@index = 1
else
@index += 1
end
@wait = @transition_frames
@back_sprite.bitmap = RPG::Cache.title(@index.to_s)
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by index
case @index
when 1 # New game
command_Load
when 2 # Continue
command_Exit_Game
when 3 # Shutdown
command_Back_to_Titlescreen
end
end
# END NEW CODE
end
#--------------------------------------------------------------------------
# * Command: New Game
#--------------------------------------------------------------------------
def command_Load
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Goes to the load menu
$scene = Scene_Load2.new
end
#--------------------------------------------------------------------------
# * Command: Continue
#--------------------------------------------------------------------------
def command_Exit_Game
#Play decision SE
$game_system.se_play($data_system.decision_se)
# Fade out BGM, BGS, and ME
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# Shutdown
$scene = nil
end
#--------------------------------------------------------------------------
# * Command: Shutdown
#--------------------------------------------------------------------------
def command_Back_to_Titlescreen
$game_system.se_play($data_system.decision_se)
# Goes to the Titlescreen
$scene = Scene_Title.new
end
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
# This class performs load screen processing.
#==============================================================================
class Scene_Load2 < Scene_File
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Remake temporary object
$game_temp = Game_Temp.new
# Timestamp selects new file
$game_temp.last_file_index = 0
latest_time = Time.at(0)
for i in 0..3
filename = make_filename(i)
if FileTest.exist?(filename)
file = File.open(filename, "r")
if file.mtime > latest_time
latest_time = file.mtime
$game_temp.last_file_index = i
end
file.close
end
end
super("Which file would you like to load?")
end
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
def on_decision(filename)
# If file doesn't exist
unless FileTest.exist?(filename)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play load SE
$game_system.se_play($data_system.load_se)
# Read save data
file = File.open(filename, "rb")
read_save_data(file)
file.close
# Restore BGM and BGS
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Cancel Processing
#--------------------------------------------------------------------------
def on_cancel
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to title screen
$scene = Scene_Gameover.new
end
#--------------------------------------------------------------------------
# * Read Save Data
# file : file object for reading (opened)
#--------------------------------------------------------------------------
def read_save_data(file)
# Read character data for drawing save file
characters = Marshal.load(file)
# Read frame count for measuring play time
Graphics.frame_count = Marshal.load(file)
# Read each type of game object
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
# If magic number is different from when saving
# (if editing was added with editor)
if $game_system.magic_number != $data_system.magic_number
# Load map
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
# Refresh party members
$game_party.refresh
end
end
end
3. Play The Game!
Credits Goes to xLeD and ccoa if use!(I learnt how to do this through her Titlescreen script)
Now Post Coments! XD