Game Over +

Todd

Game Developer
Veteran
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
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

Code:
#===============================================================================
#
# DT's GameOver +
# Author: DoctorTodd
# Date (04/27/2012)
# Version: (1.0.0) (VXA)
# Level: (Simple)
# Email: Todd@beacongames.com
#
#===============================================================================
#
# 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.
 
Last edited by a moderator:

Lorenze

Veteran
Veteran
Joined
Mar 17, 2012
Messages
826
Reaction score
547
First Language
English
Primarily Uses
RMMV
Nice, I think I'm gonna use this. By the way, your image links to the one actor status menu. :)
 

Todd

Game Developer
Veteran
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
Thanks, I fixed the image.
 

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,906
Reaction score
458
First Language
April Fools
Primarily Uses
N/A
I saw one somewhere that has ability to retry battle and more.
 

Todd

Game Developer
Veteran
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
Well...ok. May I see it?
 

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,906
Reaction score
458
First Language
April Fools
Primarily Uses
N/A
MY little brother has it. I will get it off him tonight/tomorrow and post it more then.
 

DarthVollis

Moogle Master
Veteran
Joined
May 5, 2012
Messages
409
Reaction score
85
First Language
English
Primarily Uses
I do have it. Here it is. Please give credit to the person that credit it.

#=================================================# 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::Defeat, $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
 

Todd

Game Developer
Veteran
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
Interesting, You actually could get a similar result with my auto save script.
 

DarthVollis

Moogle Master
Veteran
Joined
May 5, 2012
Messages
409
Reaction score
85
First Language
English
Primarily Uses
It is nice with this script because if you lose the battle you can try it again.
 

Todd

Game Developer
Veteran
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
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.
 

MooshraKun

Making Dreams Stand Up
Veteran
Joined
Jul 11, 2012
Messages
238
Reaction score
11
First Language
Lokota
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
 
Last edited by a moderator:

Ultimacj

Cookie Knight
Veteran
Joined
Oct 15, 2013
Messages
406
Reaction score
60
First Language
Englist
Primarily Uses
N/A
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 :)
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
What retry? I don't even see a retry option there...


oh wait, you mean the other script?? hmmm... it's hijacking...
 
Last edited by a moderator:

Ultimacj

Cookie Knight
Veteran
Joined
Oct 15, 2013
Messages
406
Reaction score
60
First Language
Englist
Primarily Uses
N/A
@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

 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
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...
 
Last edited by a moderator:

JAD94

The lunar knight
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
189
First Language
English
Primarily Uses
RMMV
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 :)
 

Reapergurl

Drummer Extraordinaire! xD
Veteran
Joined
Dec 15, 2016
Messages
534
Reaction score
552
First Language
British English
Primarily Uses
Other
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

The self-righteous indignation of family when you expect them to pay back money you've leant to them never ceases to amaze me.
Gamedev for relaxing? yes or no?
I've been having a rough couple of months and as such let down some friends of mine in the RPG Maker community. I still need time to get back to my normal self, but it's nice to be back, to read articles, and to design again (albeit at a slow pace). Hope to give updates on Kid Crescent soon.
Friendly reminder that you don't have to be able to do absolutely everything. It's okay to scale back features or assets if things are too much - especially if you're the only one working on the game! And you can always add things in later. <3
My new cutscene system makes it so much easier to add parallel stuff happening in the background, I can easily fill the whole screen with action.

Forum statistics

Threads
107,735
Messages
1,031,740
Members
139,869
Latest member
Anzi
Top