Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> ~[Game Over Enhanced]~ version 1.1, Adding resume option in GameOver screen :3
YanXie
post Jun 7 2008, 12:43 AM
Post #1


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




Game Over Enhanced

Version 1.0 revision 1
Author puppeto4(puppet5@hotmail.com)
Release Date 06/06/2008

Exclusive Script at RPG RPG Revolution


Introduction

While playing some random RPG because of bored of no internet, I thought of making this,after
going through too many GameOver in that game sad.gif


Features

This script will enable the player to resume the game or return to title from GameOver screen.
When resume option is choosen, the game will automatically load the newest saved game file.
Resume option won't show if there is no save file available.This script is best used with
my force save script ^^.



Script

Download below :

Attached File  GameOverEnhancedScript.txt ( 15.36K ) Number of downloads: 268


Or copy from spoiler below :

[Show/Hide] GameOverEnhancedScript
CODE
#==============================================================================
# ** Game Over Enhanced
#------------------------------------------------------------------------------
# Author  : puppeto4 (puppeto5@hotmail.com)
# Version : 1.1 revision 1
# Date    : 06 / 06 / 2008
# Note    : Order Pizza Hut, support the rebellion.
# Check RPG RPG Revolution(http://www.rpgrevolution.com) for support
#------------------------------------------------------------------------------
# Function :  
#   This script will enable the player to resume the game or return to title
#   from GameOver screen.When resume option is choosen, the game will
#   automatically load the newest saved game file. Resume option won't
#   show if there is no save file available.This script is best used with
#   my force save script ^^.
#==============================================================================
#==============================================================================
# ** GameOverEnhanced : Configuration
#==============================================================================
#==============================================================================
# ** Puppeto
#------------------------------------------------------------------------------
#  This module handles setup for any script writen by me ^^.
#==============================================================================

module Puppeto
#==============================================================================
# ** GameOver
#------------------------------------------------------------------------------
#  This module handles setup for the game over enhanced script.
#==============================================================================
  
module GameOver
  # Resume text
  Resume_Text = "Resume"
  # Return to title screen text
  Return_To_Title_Text = "Return To Title"
  # Path + Filename for GameOver transition.
  GameOver_Transition = "Graphics/System/BattleStart"
#==============================================================================
# ** End of GameOver module
#------------------------------------------------------------------------------    
end
#==============================================================================
# ** End of Puppeto module
#------------------------------------------------------------------------------
end  
#==============================================================================
# ** End of GameOverEnhanced : Configuration
#==============================================================================
#==============================================================================
# ** GameOverEnhanced : Script
#------------------------------------------------------------------------------
# ** Class Alias
#==============================================================================
#----------------------------------------------------------------------------
# * Aliased Class(es) : Scene_File, Scene_Gameover, Game_Interpreter
#----------------------------------------------------------------------------
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This class performs the save and load screen processing.
#==============================================================================
#----------------------------------------------------------------------------
# * Aliased Method(s) : main
# * New Method(s)     : resume_load  
#----------------------------------------------------------------------------

class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  # If @new_stack is empty
  if @new_stack.nil?
    # Aliasing main method; hidden method(to avoid SystemStackError)
    alias puppet_resume_main main
    # Set @new_stack to true
    @new_stack = true
  end  
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    if $RESUME                        # If resume
      resume_load                     # Call resume_load method
    else                              # If normal play
      puppet_resume_main              # Usual main processing
    end
  end
  #--------------------------------------------------------------------------
  # * Load From Game Over Screen
  #--------------------------------------------------------------------------
  def resume_load
    # Call start method
    start
    # Set @index to the latest file index
    @index = self.latest_file_index
    # Loading sound
    Sound.play_load
    # Call do_load method
    do_load
    # Set $RESUME to false to prevent looping
    $RESUME = false
    # Call terminate method
    terminate
  end  
end
#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
#  This class performs game over screen processing.
#==============================================================================
#----------------------------------------------------------------------------
# * Aliased Method(s) : start, terminate
# * New Method(s)     : check_continue, create_command_window,
#                       dispose_command_window, open_command_window,
#                       close_command_window, command_gameover, resume_scene,
#                       perform_gameover_transition
#----------------------------------------------------------------------------

class Scene_Gameover < Scene_Base
  #--------------------------------------------------------------------------
  # * Include Puppeto::GameOver modules
  #--------------------------------------------------------------------------  
  include Puppeto::GameOver
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias puppet_resume_start start
  alias puppet_resume_terminate terminate
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    # Check if save file exist or not
    check_continue
    # Create menu background
    create_menu_background
    # Create command window
    create_command_window
    # The usual
    puppet_resume_start
  end
  #--------------------------------------------------------------------------
  # * Post-Start Processing
  #--------------------------------------------------------------------------
  def post_start
    super
    # Call open_command_window method
    open_command_window
  end
  #--------------------------------------------------------------------------
  # * Pre-termination Processing
  #--------------------------------------------------------------------------
  def pre_terminate
    super
    # Call close_command_window method    
    close_command_window
  end  
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    # The usual
    puppet_resume_terminate
    # Dispose command window
    dispose_command_window
    # Dispose menu background
    dispose_menu_background
    # If next scene is Scene_File
    if $scene.is_a?(Scene_File)
      # Call perform_gameover_transition method
      perform_gameover_transition
    end  
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    # Update menu background
    update_menu_background
    # Update command window
    @command_window.update
    # If Input::C is triggered
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0  
        # If save file exist
        if @continue_enabled
          # Create [resume] command
          command_gameover(true)
        else
          # Create [to title] command
          command_gameover(false)
        end
        # Create [to title] command
      when 1;  command_gameover(false)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update Background for Menu Screen
  #--------------------------------------------------------------------------
  def update_menu_background
    super
    # Set tome for menuback_sprite
    @menuback_sprite.tone.set(0, 0, 0, 128)  
  end  
  #--------------------------------------------------------------------------
  # * Determine if Continue is Enabled
  #--------------------------------------------------------------------------
  def check_continue
    # Check the availablity of save file
    @continue_enabled = (Dir.glob('Save*.rvdata').size > 0)
  end  
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Resume_Text
    s2 = Return_To_Title_Text
    # If save file exist
    if @continue_enabled
      # Include s1 and s2 in the option
      @command_window = Window_Command.new(172, [s1, s2])
    else
      # Include s2 in the option
      @command_window = Window_Command.new(172, [s2])
    end  
    @command_window.x = (544 - @command_window.width) / 2
    @command_window.y = 288
    # Draw item with center alignment
    @command_window.draw_item(0,true, 1)
    @command_window.draw_item(1,true, 1)
    # Set openness to 0
    @command_window.openness = 0
    @command_window.open    
  end
  #--------------------------------------------------------------------------
  # * Dispose of Command Window
  #--------------------------------------------------------------------------
  def dispose_command_window
    @command_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Open Command Window
  #--------------------------------------------------------------------------
  def open_command_window
    @command_window.open
    begin
      @command_window.update
      Graphics.update
    end until @command_window.openness == 255
  end
  #--------------------------------------------------------------------------
  # * Close Command Window
  #--------------------------------------------------------------------------
  def close_command_window
    @command_window.close
    begin
      @command_window.update
      Graphics.update
    end until @command_window.openness == 0
  end
  #--------------------------------------------------------------------------
  # * Process When Choosing [Resume] or [To Title] Command
  #--------------------------------------------------------------------------
  def command_gameover(resume = false)
    # Set resume to @resume
    @resume = resume
    # Call resume_scene method
    resume_scene
    Sound.play_decision
    RPG::BGM.fade(800)
    RPG::BGS.fade(800)
    RPG::ME.fade(800)    
    close_command_window
  end  
  #--------------------------------------------------------------------------
  # * Resume Scene
  #--------------------------------------------------------------------------
  def resume_scene
    # If @resume is true
    if @resume
      # Go to Scene_File(load type)
      $scene = Scene_File.new(false, true, false)
      # Set $RESUME to true to enable Scene_File to initialize resume_load
      $RESUME = true
    else
      # Go to Scene_Title
      $scene = Scene_Title.new
      Graphics.fadeout(60)
    end
  end  
  #--------------------------------------------------------------------------
  # * Execute Pre-battle Transition
  #--------------------------------------------------------------------------
  def perform_gameover_transition
    @trans_name = GameOver_Transition
    Graphics.transition(80, @trans_name, 80)
    Graphics.freeze
  end  
end
#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
#  An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================
#----------------------------------------------------------------------------
# * Aliased Class(es) : command_353
#----------------------------------------------------------------------------

class Game_Interpreter
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias puppet_resume_command_353 command_353
  #--------------------------------------------------------------------------
  # * Game Over
  #--------------------------------------------------------------------------
  def command_353
    # The usual
    puppet_resume_command_353
    # Add 1 to @index
    @index += 1
  end
end
#==============================================================================
# ** End of Class Alias
#------------------------------------------------------------------------------
# ** Class Rewrite
#==============================================================================
#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================
#----------------------------------------------------------------------------
# * Rewrite Method(s) : draw_item(Adding alignment function)
#----------------------------------------------------------------------------

class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index   : item number
  #     enabled : enabled flag. When false, draw semi-transparently.
  #     align   : alignment flag.
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true, align = 0)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    @align = align
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    if @align == 0
      self.contents.draw_text(rect, @commands[index])
    elsif @align == 1
      self.contents.draw_text(rect, @commands[index], 1)
    else
      self.contents.draw_text(rect, @commands[index], 2)
    end  
  end
end
#==============================================================================
# ** End of Class Rewrite
#------------------------------------------------------------------------------
# ** End of GameOverEnhanced : Script
#==============================================================================



Customization

Line 35, 37 and 39. Change the value there if needed.


Compatibility

Compatible with my Random Title + BattleTransition + GameOver Screen Simplified script,
since I didn't change the method there. Also, now compatible with woratana's Neo Save System


Screenshot


If there is no save file in game folder...


If there is at least 1 save file...


DEMO

DEMO


Installation

Copy and paste in a new script page below material section but above main


FAQ

ohmy.gif


Terms and Conditions

Credit to me, puppeto4. Free to use for non-commercial project.

Do not redistribute this script without my permission.


Special Thanks

Moghunter for his GameOver image that used in the demo tongue.gif
Falcom for producing YS: The Oath in Felghana(this is the game that I mentioned earlier)

cheers,puppeto4. smile.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   

Posts in this topic
- puppeto4   ~[Game Over Enhanced]~ version 1.1   Jun 7 2008, 12:43 AM
- - drebenk   @puppeot4 it's really nice script.   Jun 7 2008, 03:08 AM
- - reddrago789   Nice script! i'll certainly use it (dont ...   Jun 7 2008, 04:45 AM
- - syvkal   Read 'Installation' on the first page. An...   Jun 7 2008, 05:20 AM
- - Protoman5801   Cool, I've been looking for a script like this...   Jun 7 2008, 06:31 AM
- - From_Ariel   This would be perfect especially if it was combine...   Jun 9 2008, 01:48 AM
|- - Twilight27   QUOTE (From_Ariel @ Jun 9 2008, 05:02 AM)...   Jul 5 2008, 02:40 PM
- - rebirth2life   Thank you for the script!   Jun 9 2008, 05:09 AM
- - Eiffenheart   Awesome. I'll try this, absolutely have to try...   Jun 9 2008, 05:27 AM
- - Bando   I'm using this with the Neo Save System by Wor...   Jun 12 2008, 10:40 AM
- - puppeto4   A: Weirdly, it didn't happen to me. Try to che...   Jun 12 2008, 11:32 AM
- - ClawsofSlash   Excellent script. I'll see usage by me. One t...   Jun 15 2008, 11:17 AM
- - puppeto4   Weird, I've tried to add BGM & BGS for the...   Jun 17 2008, 10:15 AM
|- - ClawsofSlash   Nope, unfortunately even with that in there, it do...   Jun 26 2008, 08:02 AM
- - puppeto4   Weird, since it works for me... try to use this sc...   Jun 27 2008, 02:57 AM
- - Vanisher   Hello, I have the same problem as theirs. I tried ...   Jun 28 2008, 01:06 AM
- - puppeto4   I tried this script in an empty new project, and i...   Jun 28 2008, 01:21 AM
|- - Vanisher   QUOTE (puppeto4 @ Jun 28 2008, 04:35 PM) ...   Jun 28 2008, 04:22 AM
- - puppeto4   Since I couldn't duplicate the error, I think ...   Jun 28 2008, 04:28 AM
- - sargunster   QUOTE (puppeto4 @ Jun 7 2008, 03:57 AM) C...   Jun 30 2008, 06:23 AM
- - ClawsofSlash   I still get it. I made a blank game, started out a...   Jul 5 2008, 07:55 AM
- - Bredd   Very cool. Haha. Im defenintley using this. I espe...   Jul 5 2008, 12:55 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 04:02 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker