~[Game Over Enhanced]~ version 1.1, Adding resume option in GameOver screen :3 |
|
|
|
|
Jun 7 2008, 12:43 AM
|

Because Tomorrow Will Surely Come...

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
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 :
GameOverEnhancedScript.txt ( 15.36K )
Number of downloads: 268
Or copy from spoiler below :
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

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  Falcom for producing YS: The Oath in Felghana(this is the game that I mentioned earlier)
cheers,puppeto4.
__________________________
|
|
|
|
|
|
|
|
|
Jun 7 2008, 03:08 AM
|

Level 20

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.
|
|
|
|
|
|
|
|
Guest_From_Ariel_*
|
Jun 9 2008, 01:48 AM
|
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
|
|
|
|
|
|
|
|
|
Jun 9 2008, 05:27 AM
|

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

|
Awesome. I'll try this, absolutely have to try.
Thanks puppeto4.
|
|
|
|
|
|
|
|
|
Jun 12 2008, 10:40 AM
|
Level 1

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

Level 1

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."
|
|
|
|
|
|
|
|
|
Jun 17 2008, 10:15 AM
|

Because Tomorrow Will Surely Come...

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.
__________________________
|
|
|
|
|
|
|
|
|
Jun 26 2008, 08:02 AM
|

Level 1

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."
|
|
|
|
|
|
|
|
|
Jun 28 2008, 01:06 AM
|
Level 2

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
|
|
|
|
|
|
|
|
|
Jun 28 2008, 01:21 AM
|

Because Tomorrow Will Surely Come...

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.
__________________________
|
|
|
|
|
|
|
|
|
Jun 28 2008, 04:22 AM
|
Level 2

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.  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.
|
|
|
|
|
|
|
|
|
Jun 30 2008, 06:23 AM
|

Level 5

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? I like pizza hut but the one here is disgusting
This post has been edited by sargunster: Jun 30 2008, 06:25 AM
__________________________
|
|
|
|
|
|
|
|
|
Jul 5 2008, 07:55 AM
|

Level 1

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."
|
|
|
|
|
|
|
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:
RPG RPG Revolution is an Privacy
Policy and Legal
|
|