Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

2 Pages V   1 2 >  
Reply to this topicStart new topic
> ~[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
   
drebenk
post Jun 7 2008, 03:08 AM
Post #2


Level 20
Group Icon

Group: Revolutionary
Posts: 405
Type: Event Designer
RM Skill: Skilled




@puppeot4 it's really nice script.


__________________________
Nobody dies a virgin. Sooner or later life f***s everybody.
Go to the top of the page
 
+Quote Post
   
reddrago789
post Jun 7 2008, 04:45 AM
Post #3


Level 4
Group Icon

Group: Member
Posts: 54
Type: None
RM Skill: Undisclosed




Nice script! i'll certainly use it biggrin.gif (dont worry i Will give credits tongue.gif)
Only one thing: where to place it? i'm kinda new with the scripts system 'nd all

This post has been edited by reddrago789: Jun 7 2008, 04:47 AM


__________________________


Please visit my site and join the forums!

Go to the top of the page
 
+Quote Post
   
syvkal
post Jun 7 2008, 05:20 AM
Post #4


Level 7
Group Icon

Group: Revolutionary
Posts: 104
Type: Scripter
RM Skill: Advanced




Read 'Installation' on the first page.

And nice script puppeto ^.^


__________________________



Is time the wheel that turns, or the track it leaves behind?


Go to the top of the page
 
+Quote Post
   
Protoman5801
post Jun 7 2008, 06:31 AM
Post #5


Level 3
Group Icon

Group: Member
Posts: 33
Type: None
RM Skill: Undisclosed




Cool, I've been looking for a script like this!


__________________________
[Show/Hide] Cool thingy I made


[Show/Hide] Can you read this?
Cna yuo raed tihs? Olny 55% of plepoe can.
I cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg. The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno't mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Azanmig huh? yaeh and I awlyas tghuhot slpeling was ipmorantt!
fi yuo cna raed tihs, palce it in yuor siantugre.



Signature made by me with GIMP
Go to the top of the page
 
+Quote Post
   
Guest_From_Ariel_*
post Jun 9 2008, 01:48 AM
Post #6





Guests





This would be perfect especially if it was combined with a newgame plus like script like in Chrono Trigger


If your not aware in chrono trigger when you complete the game it gives you the new game plus option.....
You keep items and levels but basically everything is returned to the start state at beginning of the game and you can play through a second time like monster easy smile.gif
Go to the top of the page
 
+Quote Post
   
rebirth2life
post Jun 9 2008, 05:09 AM
Post #7



Group Icon

Group: Member
Posts: 2
Type: None
RM Skill: Beginner




thumbsup.gif Thank you for the script!
Go to the top of the page
 
+Quote Post
   
Eiffenheart
post Jun 9 2008, 05:27 AM
Post #8



Group Icon

Group: Member
Posts: 2
Type: Event Designer
RM Skill: Beginner




Awesome.
I'll try this, absolutely have to try.

Thanks puppeto4.
Go to the top of the page
 
+Quote Post
   
Bando
post Jun 12 2008, 10:40 AM
Post #9


Level 1
Group Icon

Group: Member
Posts: 8
Type: Musician
RM Skill: Skilled




I'm using this with the Neo Save System by Woratana.

A: It has the resume option even though I haven't saved in that file yet.

B: When I click it, I get an error:

CODE
Script 'Neo Save System' line 282: NoMethodError occurred.

undefined method `file_exist?' for nil:NilClass


And this is what is in the line: (from 274 to 293)

CODE
#--------------------------------------------------------------------------
# * Select File With Newest Timestamp
#--------------------------------------------------------------------------
def latest_file_index
latest_index = 0
latest_time = Time.at(0)
(1..MAX_SAVE_SLOT).each do |i|
file_name = make_filename(i - 1)
next if !@window_slotdetail.file_exist?(i)
file_time = File.mtime(file_name)
if file_time > latest_time
latest_time = file_time
latest_index = i - 1
end
end
return latest_index
end
end

class Window_SlotList < Window_Command


This post has been edited by Bando: Jun 12 2008, 10:41 AM
Go to the top of the page
 
+Quote Post
   
YanXie
post Jun 12 2008, 11:32 AM
Post #10


Because Tomorrow Will Surely Come...
Group Icon

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






A: Weirdly, it didn't happen to me. Try to check if you can load from main title.

B: Updated the script to version 1.1 mellow.gif

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
   
ClawsofSlash
post Jun 15 2008, 11:17 AM
Post #11


Level 1
Group Icon

Group: Member
Posts: 8
Type: Event Designer
RM Skill: Advanced




Excellent script. I'll see usage by me.
One thing though, when I hit the resume, I get no background music for the area it loads me to.
Any suggestions?


__________________________
"Reality is what you make of it. Games are what you make them."
Go to the top of the page
 
+Quote Post
   
YanXie
post Jun 17 2008, 10:15 AM
Post #12


Because Tomorrow Will Surely Come...
Group Icon

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




Weird, I've tried to add BGM & BGS for the playtest map... and it didn't happen to me D;

Anyway... just try to add this :

CODE
    # Autoplay the BGM & BGS of the map
    $game_map.autoplay


Below this line(line 105) :

CODE
terminate


See if that works.

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
   
ClawsofSlash
post Jun 26 2008, 08:02 AM
Post #13


Level 1
Group Icon

Group: Member
Posts: 8
Type: Event Designer
RM Skill: Advanced




Nope, unfortunately even with that in there, it doesn't play the BGM of the area it's loaded into.

I've also come to realise that the combat sequence I get into not long after also has no BGM.

EDIT: Actually, I just tested something and used multiple BGMs. None of them played after loading from the enhanced game over. One was a .mp3, one a .midi, and one a .wav... just to test.

This post has been edited by ClawsofSlash: Jun 26 2008, 08:14 AM


__________________________
"Reality is what you make of it. Games are what you make them."
Go to the top of the page
 
+Quote Post
   
YanXie
post Jun 27 2008, 02:57 AM
Post #14


Because Tomorrow Will Surely Come...
Group Icon

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




Weird, since it works for me... try to use this script in a new project and see if the problem still occur.

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
   
Vanisher
post Jun 28 2008, 01:06 AM
Post #15


Level 2
Group Icon

Group: Member
Posts: 28
Type: None
RM Skill: Undisclosed




Hello, I have the same problem as theirs. I tried copying these two lines under "line 105":
CODE
# Autoplay the BGM & BGS of the map
$game_map.autoplay

But it doesn't work. How can I repair this?

This post has been edited by Vanisher: Jun 28 2008, 01:11 AM
Go to the top of the page
 
+Quote Post
   
YanXie
post Jun 28 2008, 01:21 AM
Post #16


Because Tomorrow Will Surely Come...
Group Icon

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




I tried this script in an empty new project, and it worked fine(the BGM & BGS played like normal).

Is there any other kind of save script that you use, like Neo Save or anything other than that?

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
   
Vanisher
post Jun 28 2008, 04:22 AM
Post #17


Level 2
Group Icon

Group: Member
Posts: 28
Type: None
RM Skill: Undisclosed




QUOTE (puppeto4 @ Jun 28 2008, 04:35 PM) *
I tried this script in an empty new project, and it worked fine(the BGM & BGS played like normal).

Is there any other kind of save script that you use, like Neo Save or anything other than that?

cheers, puppeto4. smile.gif

I don't have the Neo Save script in my existing project. I have some Neo Message scripts, some KGC scripts, Quest Journal, Battle Background and a Slanted Bar script. And also, I put the Game Over Enhanced script below the other scripts.

Anyway, the BGM & BGS did not play normally on my existing project.
Go to the top of the page
 
+Quote Post
   
YanXie
post Jun 28 2008, 04:28 AM
Post #18


Because Tomorrow Will Surely Come...
Group Icon

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




Since I couldn't duplicate the error, I think it's better that you upload your existing project and send it to me(by PM or post here) so that I can look for the faulty codes.

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
   
sargunster
post Jun 30 2008, 06:23 AM
Post #19


Level 5
Group Icon

Group: Member
Posts: 65
Type: Event Designer
RM Skill: Beginner




QUOTE (puppeto4 @ Jun 7 2008, 03:57 AM) *
CODE
# Note    : Order Pizza Hut, support the rebellion.


What does that have to do with the script? tongue.gif
I like pizza hut but the one here is disgusting smile.gif

This post has been edited by sargunster: Jun 30 2008, 06:25 AM


__________________________

Go to the top of the page
 
+Quote Post
   
ClawsofSlash
post Jul 5 2008, 07:55 AM
Post #20


Level 1
Group Icon

Group: Member
Posts: 8
Type: Event Designer
RM Skill: Advanced




I still get it.
I made a blank game, started out and saved, then ran around until combat began. Died. Loaded up my position, and I've got no BGMs. Combat ensues once more, and no BGMs. I even tried waiting until my defeat music is over, but to no avail. I'll pack up the little thing I made and send it to you, see if you get it to.


__________________________
"Reality is what you make of it. Games are what you make them."
Go to the top of the page
 
+Quote Post
   

2 Pages V   1 2 >
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: 19th June 2013 - 09:18 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker