Todd

Game Over +

16 posts in this topic

Game Over +

by Todd (or DoctorTodd on RMRK)

Introduction

Adds an option window to the GameOver screen.

Features

  • Plug and play

Screenshots

post-328-0-04792100-1336076726_thumb.png

Demo

I don't think it's really necessary.

Script


#===============================================================================
#
# 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.

Edited by Todd
Acetonide, XDreamerX, JAD94 and 2 others like this

Share this post


Link to post
Share on other sites

Nice, I think I'm gonna use this. By the way, your image links to the one actor status menu. :)

Share this post


Link to post
Share on other sites

Thanks, I fixed the image.

Share this post


Link to post
Share on other sites

I saw one somewhere that has ability to retry battle and more.

Share this post


Link to post
Share on other sites

Well...ok. May I see it?

Share this post


Link to post
Share on other sites

MY little brother has it. I will get it off him tonight/tomorrow and post it more then.

Share this post


Link to post
Share on other sites

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

Chaos17 and ShinGamix like this

Share this post


Link to post
Share on other sites

Interesting, You actually could get a similar result with my auto save script.

DarthVollis likes this

Share this post


Link to post
Share on other sites

It is nice with this script because if you lose the battle you can try it again.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Edited by Mooshrago12

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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

oh wait, you mean the other script?? hmmm... it's hijacking...

Edited by adiktuzmiko

Share this post


Link to post
Share on other sites

@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

gameover_zpsc76a68b0.png

Share this post


Link to post
Share on other sites

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...

Edited by adiktuzmiko

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.