Game Over +

Game Over +

by Todd (or DoctorTodd on RMRK)

Introduction

Adds an option window to the GameOver screen.

Features

  • Plug and play

Screenshots

capturekb.png

Demo

I don't think it's really necessary.

Script

Spoiler
Code:
#===============================================================================
#
# DT's GameOver +
# Author: DoctorTodd
# Date (04/27/2012)
# Version: (1.0.0) (VXA)
# Level: (Simple)
# Email: [email hidden]
#
#===============================================================================
#
# NOTES: 1)This script will only work with ace.
#
#===============================================================================
#
# Description: Adds an option window to the GameOver screen.
#
# Credits: Me (DoctorTodd)
#
#===============================================================================
#
# Instructions
# Paste above main.
#
#===============================================================================
#
# Contact me for commercial use, other wise just credit me and don't repost
# without my permission.
#
#===============================================================================
#
# Editing begins 37 and ends on 41.
#
#===============================================================================
module DTGOP

  #The Y coordinate of the Command Window
  COMWINY = 300

  #The X coordinate of the Command Window
  COMWINX = 180

end
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
#  This command window appears on the menu screen.
#==============================================================================

class Window_GameOverCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
	super(0, 0)
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
	return 160
  end
  #--------------------------------------------------------------------------
  # * Get Number of Lines to Show
  #--------------------------------------------------------------------------
  def visible_line_number
	item_max
  end
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
	add_load_command
	add_title_command
	add_original_commands
	add_quit_command
  end
  #--------------------------------------------------------------------------
  # * Add load to Command List
  #--------------------------------------------------------------------------
  def add_load_command
   add_command("Load", :load)
  end
  #--------------------------------------------------------------------------
  # * For Adding Original Commands
  #--------------------------------------------------------------------------
  def add_original_commands
  end
  #--------------------------------------------------------------------------
  # * Add Title to Command List
  #--------------------------------------------------------------------------
  def add_title_command
	add_command("Title", :title)
  end
  #------------------------------------------------------------------------
  # * Add quit Game to Command List
  #--------------------------------------------------------------------------
  def add_quit_command
	add_command("Shutdown", :quit)
  end
end
#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
#  This class performs game over screen processing.
#==============================================================================

class Scene_Gameover < Scene_Base
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
	super
	play_gameover_music
	fadeout_frozen_graphics
	create_background
	create_command_window
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
	super
	dispose_background
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
	@command_window =  Window_GameOverCommand.new
	@command_window.set_handler(:load,	  method(:command_load))
	@command_window.set_handler(:title,	 method(:command_title))
	@command_window.set_handler(:quit,	  method(:command_quit))
	@command_window.y = (DTGOP::COMWINY)
	@command_window.x = (DTGOP::COMWINX)
	end
  #--------------------------------------------------------------------------
  # * Execute Transition
  #--------------------------------------------------------------------------
  def perform_transition
	Graphics.transition(fadein_speed)
  end
  #--------------------------------------------------------------------------
  # * Play Music on Game Over Screen
  #--------------------------------------------------------------------------
  def play_gameover_music
	RPG::BGM.stop
	RPG::BGS.stop
	$data_system.gameover_me.play
  end
  #--------------------------------------------------------------------------
  # * Fade Out Frozen Graphics
  #--------------------------------------------------------------------------
  def fadeout_frozen_graphics
	Graphics.transition(fadeout_speed)
	Graphics.freeze
  end
  #--------------------------------------------------------------------------
  # * Create Background
  #--------------------------------------------------------------------------
  def create_background
	@sprite = Sprite.new
	@sprite.bitmap = Cache.system("GameOver")
  end
  #--------------------------------------------------------------------------
  # * Free Background
  #--------------------------------------------------------------------------
  def dispose_background
	@sprite.bitmap.dispose
	@sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Get Fade Out Speed
  #--------------------------------------------------------------------------
  def fadeout_speed
	return 60
  end
  #--------------------------------------------------------------------------
  # * Get Fade In Speed
  #--------------------------------------------------------------------------
  def fadein_speed
	return 120
  end
  #--------------------------------------------------------------------------
  # * [Load] Command
  #--------------------------------------------------------------------------
  def command_load
	SceneManager.call(Scene_Load)
  end
  #--------------------------------------------------------------------------
  # * [Title] Command
  #--------------------------------------------------------------------------
  def command_title
	SceneManager.call(Scene_Title)
  end
  #--------------------------------------------------------------------------
  # * [Quit] Command
  #--------------------------------------------------------------------------
  def command_quit
	fadeout_all
	SceneManager.exit
  end
end
FAQ

None right now.

Credit and Thanks

- Todd

Author's Notes

Free for non-commercial and commercial games. You must credit me! If you use this in a commercial game I expect a free copy.
Nice, I think I'm gonna use this. By the way, your image links to the one actor status menu. 🙂
Thanks, I fixed the image.
I saw one somewhere that has ability to retry battle and more.
Well...ok. May I see it?
MY little brother has it. I will get it off him tonight/tomorrow and post it more then.
I do have it. Here it is. Please give credit to the person that credit it.

Spoiler
#=================================================# by bStefan aka. regendo

# please give credit if used

# for use with RMVX ACE

#=================================================

# GameOver with choices

#=================================================

# adds four choices to Scene_Gameover:

# : Retry Battle (if you lost the battle)

# : Load Savegame (if there is a savefile)

# : Return to Title

# : Quit Game

#=================================================

# implement over Main

# implement under Multiple_Cols_in_Command_Window

# if existant

#=================================================

module Regendo

unless @scripts

@scripts = Hash.new

def self.contains?(key)

@scripts[key] == true

end

end

@scripts["GameOver_Window"] = true

module GameOver_Window

def self.multiple_cols?

return false unless Regendo::contains?("Horizontal_Command")

USE_MULTIPLE_COLUMNS

end

#=======

#CONFIG

#=======

RETRY = true #if false, Retry Battle function will not be aviable

#==============================================

#requires Horizontal_Command script by regendo

#==============================================

if Regendo::contains?("Horizontal_Command")

USE_MULTIPLE_COLUMNS = true #use Horizontal_Command Script?

COLUMNS = 2 #requires ^ set to true

end

#=================================================

#only used if not using Horizontal_Command Script

#=================================================

WINDOW_WIDTH = 225

end

end

if Regendo::GameOver_Window::multiple_cols?

class Window_GameOver < Window_HorizontalCommand #more than one column possible

end

else

class Window_GameOver < Window_Command #only one column

end

end

class Window_GameOver

def initialize

if Regendo::GameOver_Window::multiple_cols?

if Regendo::GameOver_Window::COLUMNS

super(0, 0, Regendo::GameOver_Window::COLUMNS)

else

super(0, 0)

end

else

super(0, 0)

end

update_placement

self.openness = 0

open

end

unless Regendo::GameOver_Window::multiple_cols?

def window_width

Regendo::GameOver_Window::WINDOW_WIDTH

end

end

def update_placement

self.x = (Graphics.width - width) / 2

self.y = (Graphics.height - height) / 1.1

end

#======================================

# add your own to this list

# also requires changes at

# Scene_Gameover#create_command_window

#======================================

def make_command_list

add_command("Retry Battle", :tryagain) if SceneManager.scene.is_defeat?

add_command("Load", :load, load_enabled)

add_command(Vocab::to_title, :to_title)

add_command(Vocab::shutdown, :shutdown)

end

def load_enabled

DataManager.save_file_exists?

end

end

class Scene_Gameover < Scene_Base

attr_reader :command_window

alias start_old start

def start

start_old

create_command_window

end

def pre_terminate

super

close_command_window

end

def update

super

end

#======================================

# add your own to this list

# also requires changes at

# Window_GameOver#make_command_list

# and requires adding your own methods

#======================================

def create_command_window

@command_window = Window_GameOver.new

@command_window.set_handler🙂tryagain, method🙂command_retry)) if is_defeat?

@command_window.set_handler🙂load, method🙂command_load))

@command_window.set_handler🙂to_title, method🙂goto_title))

@command_window.set_handler🙂shutdown, method🙂command_shutdown))

end

def close_command_window

@command_window.close if @command_window

update until @command_window.close?

end

def command_load

close_command_window

fadeout_all

SceneManager.call(Scene_Load)

end

def goto_title

close_command_window

fadeout_all

SceneManager.goto(Scene_Title)

end

def command_shutdown

close_command_window

fadeout_all

SceneManager.exit

end

def command_retry

fadeout_all

SceneManager.goto(Scene_Battle)

BattleManager.setup(@troop_id, @can_escape, @can_lose)

$game_party.members.each do |actor|

actor.recover_all

end

$game_troop.members.each do |enemy|

enemy.recover_all

end

BattleManager.bmgs_by_regendo(@map_bgm, @map_bgs)

BattleManager.play_battle_bgm

Sound.play_battle_start

end

def is_defeat (b = true)

@defeat = b

end

def is_defeat?

Regendo::GameOver_Window::RETRY ? @defeat : false

end

def battle_setup (troop_id, can_escape = true, can_lose = false)

@troop_id = troop_id

@can_escape = can_escape

@can_lose = can_lose

end

def bgms_setup(map_bgm, map_bgs)

@map_bgm = map_bgm

@map_bgs = map_bgs

end

end

module BattleManager

class << self

alias_method :setup_old, :setup

end

def self.setup(troop_id, can_escape = true, can_lose = false)

self.setup_old(troop_id, can_escape = true, can_lose = false)

@troop_id = troop_id

end

def self.bmgs_by_regendo(map_bgm, map_bgs)

@map_bgm = map_bgm

@map_bgs = map_bgs

end

def self.process_defeat

$game_message.add(sprintf(Vocab:😀efeat, $game_party.name))

wait_for_message

if @can_lose

revive_battle_members

replay_bgm_and_bgs

SceneManager.return

else

SceneManager.goto(Scene_Gameover)

SceneManager.scene.is_defeat #this is new

SceneManager.scene.battle_setup(@troop_id, @can_escape, @can_lose) #this also

SceneManager.scene.bgms_setup(@map_bgm, @map_bgs) #and this

end

battle_end(2)

return true

end

end
Interesting, You actually could get a similar result with my auto save script.
It is nice with this script because if you lose the battle you can try it again.
You can do that with both this and my autosave script. You can have it autosave before each battle, if you lose you can load the autosave file. It's the not the same but its close.
There is what I believe to be the perfect retry script for vx where you make a script call called checkpoint and it makes a quite save with out showing anything so it wporks behind the scenes which I love. Then when you die you can retry and it loads the last checkpoint area but it doesn't over write any save files so you could make area check point and if they die its eithier they can retry from the check point or load there own save file to continue from take a look it here. Still nice job with yours.

http://rmrk.net/inde...p?topic=42095.0
I like this script but is there a way when the player retries their HP/MP values are the current values when they enter combat previously?

I.E. player enters with 500/1000 HP  200/400 MP but loses the fight.

Player selects retry and starts with the same values.

When I select "retry" the player starts at full health and full MP values.

Thanks 🙂
What retry? I don't even see a retry option there...


oh wait, you mean the other script?? hmmm... it's hijacking...
@adiktuzmiko or however you want retry battle to say in the script.  I'm using this script (the one DarthVollis posted) in his script it says "Retry Battle" for mine all I changed was the vocab to be different in the screenshot below.  It's a great retry script but my original question was is how can you retry the battle when you lose that your HP/MP values are the same values when you started to battle?  When you retry the battle, you're restored to full status.  I"m not much of a scripter so I'm not sure how it's done

Spoiler
yeah, which is quite a bit of thread hijacking already since it was already about a different script... but well, you need to save the values before each battle and disable the full recovery...


I suggest you open up a new thread for it instead of asking for it in here because this thread is not about the script that Darth posted...
This is awesome. I've so many playtesters tell me the wait in between the game over screen and load screen was getting repetitious, this script helps a lot. Thank you Todd 🙂
Would this interfere with Yanfly's Save game Script? New Game+?


I wonder because I see the following scenario:


With those two and this script, if I went to load a save game, my query is if it would crash upon trying to load Yanfly's Save Screen.

Original thread: https://forums.rpgmakerweb.com/threads/game-over.1719/