[XP] Save File System

Started by shdwlink1993, July 26, 2008, 06:59:24 am

Previous topic - Next topic

shdwlink1993

July 26, 2008, 06:59:24 am Last Edit: February 21, 2009, 06:06:11 am by Blizzard
Save File System
Authors: shdwlink1993, Phylomortis
Version: 1.12b
Type: Game Enhancement, Save System
Key Term: Title / Save / Load / GameOver Add-on



Introduction

This script has several different (and kinda random :whistle:) systems that I designed to work with Save Files, such as New Game Plus, Multiple Disk System, Infinite Save Files, and Autosave/Restore.


Features


  • New Game Plus: After completing a game, you can use this to let the player start again with their items, party members, and allow them to access new areas and items.
  • Multiple Disk System: Allows you to overcome the Map Limitation and have a smooth transition between disks. Beta release.
  • Infinite Save Files: Set a number and you can have that many Save Files. Much better than the default restriction of 4.
  • Autosave and Autorestore System: This makes it so that if you die, a command window appears asking if you want to retry or quit. Selecting retry will load a temporary save file that can be saved whenever you, the designer, choose.



Screenshots

None needed.


Demo

None needed.


Script

This script can go anywhere underneath Scene_Load, but it is recommended that it go underneath all your other scripts except Main.
Spoiler: ShowHide

#==============================================================================
# Save File System
# Author: Shdwlink1993
# Version: 1.12b
# Type: Game Enhancement, Save System
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# SFS Date 1.0b: 7/26/2008
# SFS Date 1.01b: 7/26/2008
# SFS Date 1.02b: 7/26/2008
# SFS Date 1.1b: 8/24/2008
# SFS Date 1.11b: 8/27/2008
# SFS Date 1.12b: 8/30/2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# #  This work is protected by the following license:
# #----------------------------------------------------------------------------
# # 
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# # 
# #  You are free:
# # 
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# # 
# #  Under the following conditions:
# # 
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# # 
# #  Noncommercial. You may not use this work for commercial purposes.
# # 
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# # 
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# # 
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# # 
# #  - Nothing in this license impairs or restricts the author's moral rights.
# # 
# #----------------------------------------------------------------------------
# #
# # Note that if you share this file, even after editing it, you must still
# # give proper credit to shdwlink1993.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                                    ~= Function =~
#
# This script is designed to provide many different save game functions into
# your game, such as New Game Plus (NGP) functionality (As seen in Chrono
# Trigger), Multiple Disk System (MDS) (As seen in most PSX Final Fantasy
# Games), Infinite Save Files (Which should have been default in RMXP), and an
# Autosave and Autorestore System (ARS).
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                               ~= Version History =~
#
# Version 1.0b ---------------------------------------------------- [7/26/2008]
#  - New Game + added (Version 1.0)
#  - Multiple Disk System added (Version 1.0b)
#  - Infinite Save Files added (Version 1.0)
# Version 1.01b --------------------------------------------------- [7/26/2008]
#  - DREAM for Save Files (Blizzard) Support added (Version 1.0)
# Version 1.02b --------------------------------------------------- [7/26/2008]
#  - DREAM for Save Files (Blizzard) Support fixed (Version 1.1)
# Version 1.1b ---------------------------------------------------- [8/24/2008]
#  - New Game + updated (Version 1.1b)
#  - Multiple Disk System updated (Version 1.1b)
#  - Autosave/Restore System added (Version 1.0)
#  - Chaos Project Save Layout (Fantasist) Support added (Version 1.0b)
# Version 1.11b --------------------------------------------------- [8/27/2008]
#  - Fixed an error with Scene_Save's new functionality
# Version 1.12b --------------------------------------------------- [8/30/2008]
#  - Autosave/Restore System fixed (Version 1.01)
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                            ~= New Functionality =~
#
# Automatically, there is a new function added into Scene_Save. If you want to
# make the player REQUIRED to save the game at a particular point, you can use
# this script call:
#
# $scene = Scene_Save.new(true)
#
# This script call will make it so the player is forced to save the game to
# exit the menu.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                            ~= General Customization =~
#
# DREAM = Set this to true if you are using DREAM for Save Files by Blizzard.
#
# CPSL = Set this to true if you are using Chaos Project Save Layout by
# Fantasist.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                                ~= New Game Plus =~
#                                      - 1.1b -
#
# New Game Plus (Or New Game +) is a system first widely seen in Chrono Trigger
# for the SNES, although the system's roots go back to The Legend of Zelda's
# Second Quest. Essentially, once you beat the game, you can then use this
# option to restart the game with all your items and such. Characters will
# start the game with all the skills and stats they had in the previous file.
#
# To run the New Game Plus File creator, you need to, when the game is
# completed, have a call script that contains this:
#
# SL93.make_ngp
#
# Customization Options:
#
# NGP = Set this to false if you are NOT going to use NG+ at all in your game.
#
# NGP_SWI = Change this to the ID number of the Switch that you want to use for
# New Game + things, such as different dialog and such. The Switch will be set
# before the game starts.
#
# ACTORS = Set this to true if you want a NG+ start with all the Party Members
# from the previous save. Note that this does not alter their stats. All this
# affects is their ability to start in your party.
#
# GOLD = Set this to true if you want the party to start with all their money.
#
# TIME = Set this to true if you want the player to start with the same time
# they finished the game with.
#
# SWI_EXCEPTIONS = Put the ID of any Switch you want remaining in the NG+ into
# the array. Useful if you have an unlockable that the player should be able to
# start with.
#
# VAR_EXCEPTIONS = Put the ID of any Variable you want remaining in the NG+
# into the array.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                             ~= Multiple Disk System =~
#                                      - 1.1b -
#
# The Multiple Disk System is a system that was seen primarily on PlayStation
# games, in particular Final Fantasy's 7, 8, and 9. The reason this system
# would be useful in RMXP is because any attempt to create a Map when all 999
# are already in use will result in the editor crashing, which is a large
# problem for people designing a large game. To work around this, you would
# need to use the Multiple Disk System.
#
# WARNING: Before creating the second disk, be sure that all scripts, database
# entries, ect. that appear in more than one disk have all been finalized and
# will not be edited!
#
# To make the second Disk, simply copy and paste the project folder, open it
# and remove all the maps that you won't need.
#
# After compiling the game, place all the files into the same folder and
# rename them to Disk n.exe, Disk n.ini, and Disk n.rgssad instead of the
# previous name, where n is the disk number.
#
# Customization Options:
#
# MDS = Set this to false if you are NOT going to use the MDS in your game.
#
# PICTURE_NAME = Change this to the Picture name of the image you want
# displayed during the scene. The picture must be in the Picture Folder.
#
# DISK_VAR = Set this to the Variable ID that you are going to use for the save
# file's current disk number.
#
# CURRENT_DISK = Set this to the Disk Number of the disk you are editing. Do NOT
# use this Disk Number in any other disk in this game!
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                            ~= Infinite Save Files =~
#                                     - 1.0 -
#
# Infinite Save Files is a system that can be used to create and save, as the
# title suggests, infinite saves. The system will allow you to choose how many
# save files to allow (so I guess it's not QUITE infinite) for saving and
# loading purposes. If you are using Chaos Project Save Layout, then this
# system will be completely disabled.
#
# Customization Options:
#
# SAVE_FILES = Set this to the number of save files you want the game to use.
# Note that the higher this number is, the more lag is generated while trying
# to load it all. Also note that this variable affects the New Game Plus
# selection. If you don't want any changes, just leave it at 4.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                          ~= Autosave/Restore System =~
#                                     - 1.0 -
#
# The Autosave & Autorestore System is a system used (never by name) subtely by
# many, many games. If you enter a room (or a floor, ala MGS) at some point,
# die, hit the continue button, and are automatically restored to exactly the
# same way you were before then (without loading up a save file), you have been
# Auto-Saved and Restored, and probably have been for some time.
#
# To make an auto-save point, use this syntax:
#
# SL93.update_temp_save
#
# To restore the save point, you use this syntax:
#
# SL93.restore_temp_save
#
# If you want the temp file to be deleted after use, then just use this
# instead:
#
# SL93.restore_temp_save(true)
#
# Customization Options:
#
# ARS = Set this to true if you intend on using the Autosave/Restore System.
#
# TEMP_SAVE = Set this to the name of the temporary save file.
#
# ALL_TRANSFERS = Set this to true if you want the teleport command to
# automatically update the save file.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                               ~= Compatability =~
#
# - Low probability of working with the SDK.
# - Probably will not work with any Title Screen Modifications
# - Will not work with other Custom Save Systems or New Game Plus Systems
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                             ~= Special Thanks =~
#
# - Blizzard, for a few script conventions and inspiration.
# - Phylomortis, because part of the ISF came from his script.
# - Memor-X, for requesting the Multiple Disk System.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#==============================================================================
# ** SL93
#==============================================================================

module SL93
 
  # for compatablilty
  $sfs = 1.1
  #============================================================================
  # New Game Plus Configuration
  #============================================================================
  NGP = false
  NGP_SWI = 1
  ACTORS = true
  GOLD = true
  TIME = true
  SWI_EXCEPTIONS = [2, 50]
  VAR_EXCEPTIONS = [1, 2]
  #============================================================================
  # Multiple Disk System Configuration
  #============================================================================
  MDS = false
  DISK_VAR = 1
  CURRENT_DISK = 1
  PICTURE_NAME = ''
  #============================================================================
  # Infinite Save Files Configuration
  #============================================================================
  SAVE_FILES = 4
  #============================================================================
  # Autosave/Restore System Configuration
  #============================================================================
  ARS = false
  TEMP_SAVE = 'temp.save'
  ALL_TRANSFERS = false
  #============================================================================
  # Compatability With Other Systems
  #============================================================================
  CPSL = false
  DREAM = false
  #============================================================================
  # End Configuration
  #============================================================================
 
  def self.make_ngp
    if NGP
      $game_system.ngp = true
      if DREAM
        DREAM.save_game("Complete#{$game_temp.last_file_index+1}.ngp")
      else
        Scene_Save.save_game_data("Complete#{$game_temp.last_file_index+1}.ngp")
      end
  $game_system.ngp = false
    else
      raise "Cannot create New Game+ File!\nPlease activate NGP system and retry." if $DEBUG
    end
  end
 
  def self.update_temp_save
    if ARS
      file = File.open(TEMP_SAVE, 'rb')
      Marshal.dump($game_system, file)
      Marshal.dump($game_switches, file)
      Marshal.dump($game_variables, file)
      Marshal.dump($game_self_switches, file)
      Marshal.dump($game_screen, file)
      Marshal.dump($game_actors, file)
      Marshal.dump($game_party, file)
      Marshal.dump($game_troop, file)
      Marshal.dump($game_map, file)
      Marshal.dump($game_player, file)
      file.close
    else
      raise "Cannot update Temp Save File!\nPlease activate ARS and retry." if $DEBUG
    end
  end
 
  def self.restore_temp_save(delete = false)
    if ARS
      if FileTest.exist?(TEMP_SAVE)
        file = File.open(TEMP_SAVE, 'rb')
        Marshal.load($game_system, file)
        Marshal.load($game_switches, file)
        Marshal.load($game_variables, file)
        Marshal.load($game_self_switches, file)
        Marshal.load($game_screen, file)
        Marshal.load($game_actors, file)
        Marshal.load($game_party, file)
        Marshal.load($game_troop, file)
        Marshal.load($game_map, file)
        Marshal.load($game_player, file)
        $game_map.setup($game_map.map_id)
        $game_player.center($game_player.x, $game_player.y)
        $game_party.refresh
        $game_system.bgm_play($game_system.playing_bgm)
        $game_system.bgs_play($game_system.playing_bgs)
        $game_map.update
        File.delete(TEMP_SAVE) if delete
        $scene = Scene_Map.new
      else
        # Start a new game.
        Graphics.frame_count = 0
        $game_temp          = Game_Temp.new
        $game_system        = Game_System.new
        $game_switches      = Game_Switches.new
        $game_variables     = Game_Variables.new
        $game_self_switches = Game_SelfSwitches.new
        $game_screen        = Game_Screen.new
        $game_actors        = Game_Actors.new
        $game_party         = Game_Party.new
        $game_troop         = Game_Troop.new
        $game_map           = Game_Map.new
        $game_player        = Game_Player.new
        $game_variables[DISK_VAR] = 1 if MDS
        $game_party.setup_starting_members
        $game_map.setup($data_system.start_map_id)
        $game_player.moveto($data_system.start_x, $data_system.start_y)
        $game_player.refresh
        $game_map.autoplay
        $game_map.update
        $scene = Scene_Map.new
      end
    else
      raise "Cannot restore Temp Save File!\nPlease activate ARS and retry." if $DEBUG
    end
  end
 
end

#==============================================================================
# ** Game_System
#==============================================================================

class Game_System
 
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :ngp if SL93::NGP
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias shdwlink1993_sfs_init initialize
  def initialize
    shdwlink1993_sfs_init
    @ngp = false if SL93::NGP
  end
end

#==============================================================================
# ** Window_SaveFile
#==============================================================================

class Window_SaveFile < Window_Base
 
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     file_index : save file index
  #     filename   : file name
  #     position   : placement of window
  #--------------------------------------------------------------------------
  def initialize(file_index, filename, position)
    y = 64 + position * 104
    super(0, y, 640, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    if SL93::DREAM
      @filename = "#{SAVE_NAME}#{file_index + 1}.dream4" if SL93::DREAM
    else
      @filename = "Save#{@file_index + 1}.rxdata"
    end
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      begin
        file = File.open(@filename, 'r')
        @time_stamp = file.mtime
        if SL93::DREAM
          @characters, @frame_count, @game_system, @game_switches,
          @game_variables, @game_party, @game_map, @game_player = DREAM.data(file)
        else
          @characters = Marshal.load(file)
          @frame_count = Marshal.load(file)
          @game_system = Marshal.load(file)
          @game_switches = Marshal.load(file)
          @game_variables = Marshal.load(file)
        end
        @total_sec = @frame_count / Graphics.frame_rate
        file.close
        refresh
      rescue
        @file_exist = false
        refresh
        self.contents.draw_text(4, 20, 600, 32, 'Corrupt Data!', 1)
        time_string = @time_stamp.strftime('%Y/%m/%d %H:%M')
        self.contents.draw_text(4, 40, 600, 32, time_string, 2)
      end
    else
      refresh
    end
    @selected = false
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    # Draw file number
    self.contents.font.color = normal_color
    name = "File #{@file_index + 1}"
    self.contents.draw_text(4, 0, 600, 32, name)
    @name_width = contents.text_size(name).width
    # If save file exists
    if @file_exist
      # Draw character
      @characters.each_index {|i|
        bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
        cw = bitmap.rect.width / 4
        ch = bitmap.rect.height / 4
        src_rect = Rect.new(0, 0, cw, ch)
        x = 300 - @characters.size * 32 + i * 64 - cw / 2
        self.contents.blt(x, 68 - ch, bitmap, src_rect)
      }
      # Draw play time
      hour = @total_sec / 60 / 60
      min = @total_sec / 60 % 60
      sec = @total_sec % 60
      time_string = sprintf('%02d:%02d:%02d', hour, min, sec)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 8, 600, 32, time_string, 2)
      # Draw timestamp
      self.contents.font.color = normal_color
      time_string = @time_stamp.strftime('%Y/%m/%d %H:%M')
      self.contents.draw_text(4, 40, 600, 32, time_string, 2)
    else
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 40, 600, 32, 'No Data')
    end
  end
 
end

#==============================================================================
# ** Window_NGPFile
#==============================================================================

class Window_NGPFile < Window_Base
 
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     file_index : save file index
  #     filename   : file name
  #     position   : placement of window
  #--------------------------------------------------------------------------
  def initialize(file_index, filename, position)
    y = 64 + position * 104
    super(0, y, 640, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Complete#{i+1}.ngp"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      begin
        file = File.open(@filename, 'r')
        @time_stamp = file.mtime
        if DREAM
          @characters, @frame_count, @game_system, @game_switches,
          @game_variables, @game_party, @game_map, @game_player = DREAM.data(file)
        else
          @characters, @frame_count, @game_system, @game_switches,
          @game_variables, @game_party, @game_map, @game_player = Marshal.load(file)
        end
        @total_sec = @frame_count / Graphics.frame_rate
        file.close
        refresh
      rescue
        @file_exist = false
        refresh
        self.contents.draw_text(4, 20, 600, 32, 'Corrupt Data!', 1)
        time_string = @time_stamp.strftime('%Y/%m/%d %H:%M')
        self.contents.draw_text(4, 40, 600, 32, time_string, 2)
      end
    else
      refresh
    end
    @selected = false
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    # Draw file number
    self.contents.font.color = normal_color
    name = "Complete Game #{@file_index + 1}"
    self.contents.draw_text(4, 0, 600, 32, name)
    @name_width = contents.text_size(name).width
    # If save file exists
    if @file_exist
      # Draw character
      @characters.each_index {|i|
        bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
        cw = bitmap.rect.width / 4
        ch = bitmap.rect.height / 4
        src_rect = Rect.new(0, 0, cw, ch)
        x = 300 - @characters.size * 32 + i * 64 - cw / 2
        self.contents.blt(x, 68 - ch, bitmap, src_rect)
      }
      # Draw play time
      hour = @total_sec / 60 / 60
      min = @total_sec / 60 % 60
      sec = @total_sec % 60
      time_string = sprintf('%02d:%02d:%02d', hour, min, sec)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 8, 600, 32, time_string, 2)
      # Draw timestamp
      self.contents.font.color = normal_color
      time_string = @time_stamp.strftime('%Y/%m/%d %H:%M')
      self.contents.draw_text(4, 40, 600, 32, time_string, 2)
    else
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 40, 600, 32, 'No Data')
    end
  end

end

#==============================================================================
# ** Scene_Title
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # If battle test
    if $BTEST
      battle_test
      return
    end
    # Load database
    $data_actors        = load_data('Data/Actors.rxdata')
    $data_classes       = load_data('Data/Classes.rxdata')
    $data_skills        = load_data('Data/Skills.rxdata')
    $data_items         = load_data('Data/Items.rxdata')
    $data_weapons       = load_data('Data/Weapons.rxdata')
    $data_armors        = load_data('Data/Armors.rxdata')
    $data_enemies       = load_data('Data/Enemies.rxdata')
    $data_troops        = load_data('Data/Troops.rxdata')
    $data_states        = load_data('Data/States.rxdata')
    $data_animations    = load_data('Data/Animations.rxdata')
    $data_tilesets      = load_data('Data/Tilesets.rxdata')
    $data_common_events = load_data('Data/CommonEvents.rxdata')
    $data_system        = load_data('Data/System.rxdata')
    if FileTest.exist?('save.tmp')
      Scene_Load.read_save_data('save.tmp')
      return
    end
    # Make system object
    $game_system = Game_System.new
    # Make title graphic
    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.title($data_system.title_name)
    # Make command window
    s1 = 'New Game'
    if SL93::NGP
      s2 = 'New Game +'
      s3 = 'Continue'
      s4 = 'Shutdown'
    else
      s2 = 'Continue'
      s3 = 'Shutdown'
    end
    if SL93::NGP
      @command_window = Window_Command.new(192, [s1, s2, s3, s4])
    else
      @command_window = Window_Command.new(192, [s1, s2, s3])
    end
    @command_window.back_opacity = 160
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 288
    # Continue enabled determinant
    # Check if at least one save file exists
    # If enabled, make @continue_enabled true; if disabled, make it false
    @continue_enabled = (0..SL93::SAVE_FILES-1).any? {|i|
      if SL93::DREAM
        FileTest.exist?("#{SAVE_NAME}#{file_index + 1}.dream4") if SL93::DREAM
      else
        FileTest.exist?("Save#{i+1}.rxdata") if !SL93::DREAM
      end
    }
    @newgameplus_enabled = (0..8).any? {|i|
      FileTest.exist?("Complete#{i+1}.ngp")
    } if SL93::NGP
    @newgame_enabled = true
    @newgame_enabled = (SL93::CURRENT_DISK == 1) if SL93::MDS
    # If continue is enabled, move cursor to 'Continue'
    # If disabled, display 'Continue' text in gray
    if @continue_enabled
      if SL93::NGP
        @command_window.index = 2
      else
        @command_window.index = 1
      end
    else
      if SL93::NGP
        @command_window.disable_item(2)
      else
        @command_window.disable_item(1)
      end
    end
    @command_window.disable_item(0) if !@newgame_enabled && SL93::MDS
    @command_window.disable_item(1) if !@newgameplus_enabled && SL93::NGP
    # Play title BGM
    $game_system.bgm_play($data_system.title_bgm)
    # Stop playing ME and BGS
    Audio.me_stop
    Audio.bgs_stop
    # Execute transition
    Graphics.transition
    # Main loop
    loop {
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      break if $scene != self
    }
    # Prepare for transition
    Graphics.freeze
    # Dispose of command window
    @command_window.dispose
    # Dispose of title graphic
    @sprite.bitmap.dispose
    @sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update command window
    @command_window.update
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      if SL93::NGP
        case @command_window.index
        when 0 then command_new_game
        when 1 then command_ngplus
        when 2 then command_continue
        when 3 then command_shutdown
        end
      else
        case @command_window.index
        when 0 then command_new_game
        when 1 then command_continue
        when 2 then command_shutdown
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Command: New Game
  #--------------------------------------------------------------------------
  def command_new_game
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Stop BGM
    Audio.bgm_stop
    # Reset frame count for measuring play time
    Graphics.frame_count = 0
    # Make each type of game object
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_actors        = Game_Actors.new
    $game_party         = Game_Party.new
    $game_troop         = Game_Troop.new
    $game_map           = Game_Map.new
    $game_player        = Game_Player.new
    $game_variables[SL93::DISK_VAR] = 1
    # Set up initial party
    $game_party.setup_starting_members
    # Set up initial map position
    $game_map.setup($data_system.start_map_id)
    # Move player to initial position
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    # Refresh player
    $game_player.refresh
    # Run automatic change for BGM and BGS set with map
    $game_map.autoplay
    # Update map (run parallel process event)
    $game_map.update
    # Switch to map screen
    $scene = Scene_Map.new
  end
  #--------------------------------------------------------------------------
  # * Command: New Game +
  #--------------------------------------------------------------------------
  def command_ngplus
    # If continue is disabled
    unless @newgameplus_enabled
      # Play buzzer SE
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Switch to load screen
    $scene = Scene_New_Game_Plus.new
  end
end

#==============================================================================
# ** Scene_Map
#==============================================================================

class Scene_Map

  if SL93::MDS
    #--------------------------------------------------------------------------
    # * Main Processing
    #--------------------------------------------------------------------------
    alias shdwlink1993_mds_up update
    def update
  $scene = Scene_MDS.new if $game_variables[SL93::DISK_VAR] !=
      SL93::CURRENT_DISK
  shdwlink1993_mds_up
    end
  end
 
  if SL93::ARS && SL93::ALL_TRANSFERS
    alias shdwlink1993_ars_transfer_player transfer_player
    #--------------------------------------------------------------------------
    # * Player Place Move
    #--------------------------------------------------------------------------
    def transfer_player
      shdwlink1993_ars_transfer_player
      SL93.update_temp_save
    end
  end
 
end

#==============================================================================
# ** Scene_MDS
#==============================================================================

class Scene_MDS
  if SL93::MDS
    def main
      if $game_variables[SL93::DISK_VAR] == SL93::CURRENT_DISK
        $scene = Scene_Map.new
        return
      end
      @mds = Sprite.new
      @mds.bitmap = Bitmap.new(640, 480)
      @pic = RPG::Cache.picture(SL93::PICTURE_NAME.to_s)
      self.bitmap.blt(0, 0, @pic, Rect.new(0, 0, picture.width, picture.height))
      @mds.bitmap.draw_text(0, 0, 320, 240, 'Changing Disk.')
      Scene_Save.save_game_data('save.tmp')
      Thread.new {system("Disk #{$game_variables[SL93::DISK_VAR]}")}
      15.times {Graphics.update}
      $scene = nil
    end
  end
end

#==============================================================================
# ** Scene_File
#==============================================================================

class Scene_File
  if !SL93::CPSL
    #--------------------------------------------------------------------------
    # * Object Initialization
    #     help_text : text string shown in the help window
    #--------------------------------------------------------------------------
    def initialize(help_text)
      @help_text = help_text
    end
    #--------------------------------------------------------------------------
    # * Main Processing
    #--------------------------------------------------------------------------
    def main
      # Make help window
      @help_window = Window_Help.new
      @help_window.set_text(@help_text)
      # Make save file window
      @savefile_windows = []
      @cursor_displace = 0
      (0..3).each {|i|
        @savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))
      }
      # Select last file to be operated
      @file_index = 0
      @savefile_windows[@file_index].selected = true
      # Execute transition
      Graphics.transition
      # Main loop
      loop {
        # Update game screen
        Graphics.update
        # Update input information
        Input.update
        # Frame update
        update
        # Abort loop if screen is changed
        break if $scene != self
      }
      # Prepare for transition
      Graphics.freeze
      # Dispose of windows
      @help_window.dispose
      @savefile_windows.each {|win| win.dispose}
    end
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
    def update
      # Update windows
      @help_window.update
      @savefile_windows.each {|win| win.update }
      # If C button was pressed
      if Input.trigger?(Input::C)
        # Call method: on_decision (defined by the subclasses)
        on_decision(make_filename(@file_index))
        $game_temp.last_file_index = @file_index
      # If B button was pressed
      elsif Input.trigger?(Input::B)
        # Call method: on_cancel (defined by the subclasses)
        on_cancel
      # If the down directional button was pressed
      elsif Input.repeat?(Input::DOWN)
        # If the down directional button pressed down is not a repeat,
        # or cursor position is more in front than the max save files.
        if Input.trigger?(Input::DOWN) || @file_index <
              SL93::SAVE_FILES - 1
          if @file_index == SL93::SAVE_FILES - 1
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          @cursor_displace += 1
          if @cursor_displace == 4
            @cursor_displace = 3
            @savefile_windows.each {|win| win.dispose }
            @savefile_windows = []
            (0..3).each {|i|
              f = i - 2 + @file_index
              name = make_filename(f)
              @savefile_windows.push(Window_SaveFile.new(f, name, i))
              @savefile_windows[i].selected = false
            }
          end
          $game_system.se_play($data_system.cursor_se)
          @file_index = (@file_index + 1)
          @file_index = SL93::SAVE_FILES - 1 if @file_index ==
              SL93::SAVE_FILES
          (0..3).each {|i| @savefile_windows[i].selected = false }
          @savefile_windows[@cursor_displace].selected = true
          return
        end
      elsif Input.repeat?(Input::UP)
        if Input.trigger?(Input::UP) || @file_index > 0
          if @file_index == 0
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          @cursor_displace -= 1
          if @cursor_displace == -1
            @cursor_displace = 0
            @savefile_windows.each {|win| win.dispose }
            @savefile_windows = []
            (0..3).each {|i|
              f = i - 1 + @file_index
              name = make_filename(f)
              @savefile_windows.push(Window_SaveFile.new(f, name, i))
              @savefile_windows[i].selected = false
            }
          end
          $game_system.se_play($data_system.cursor_se)
          @file_index = (@file_index - 1)
          @file_index = 0 if @file_index == -1
          (0..3).each {|i| @savefile_windows[i].selected = false }
          @savefile_windows[@cursor_displace].selected = true
          return
        end
      end
    end
    #--------------------------------------------------------------------------
    # * Make File Name
    #     file_index : save file index (0-3)
    #--------------------------------------------------------------------------
    def make_filename(file_index)
      return "Save#{file_index + 1}.rxdata" if !SL93::DREAM
      return "#{SAVE_NAME}#{file_index + 1}.dream4" if SL93::DREAM
    end
  end
 
end

#==============================================================================
# ** Scene_Save
#==============================================================================

class Scene_Save < Scene_File
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias shdwlink1993_sfs_init initialize
  def initialize(cancel_lock = true)
    shdwlink1993_sfs_init
  @cancel_lock = cancel_lock
  end
  #--------------------------------------------------------------------------
  # * Cancel Processing
  #--------------------------------------------------------------------------
  def on_cancel
    if @cancel_save
      $game_system.se_play($data_system.cancel_se)
      return
    else
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # If called from event
      if $game_temp.save_calling
        # Clear save call flag
        $game_temp.save_calling = false
        # Switch to map screen
        $scene = Scene_Map.new
      else
        # Switch to menu screen
        $scene = Scene_Menu.new(4)
      end
    end
  end
 
end

#==============================================================================
# ** Scene_Load
#==============================================================================

class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Remake temporary object
    $game_temp = Game_Temp.new
    # Timestamp selects new file
    $game_temp.last_file_index = 0
    latest_time = Time.at(0)
    (0..SL93::SAVE_FILES-1).each {|i|
      filename = make_filename(i)
      if FileTest.exist?(filename)
        file = File.open(filename, 'r')
        if file.mtime > latest_time
          latest_time = file.mtime
          $game_temp.last_file_index = i
        end
        file.close
      end
    }
    super('Which file would you like to load?') if !SL93::CPSL
  end
 
end

#==============================================================================
# ** Scene_New_Game_Plus
#==============================================================================

class Scene_New_Game_Plus < Scene_File
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Remake temporary object
    $game_temp = Game_Temp.new
    # Timestamp selects new file
    $game_temp.last_file_index = 0
    latest_time = Time.at(0)
if CPSL
else
    (0..SL93::SAVE_FILES-1).each {|i|
      filename = make_filename(i)
      if FileTest.exist?(filename)
        file = File.open(filename, 'r')
        if file.mtime > latest_time
          latest_time = file.mtime
          $game_temp.last_file_index = i
        end
        file.close
      end
    }
end
    super('Which file would you like to import?')
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make help window
    @help_window = Window_Help.new
    @help_window.set_text(@help_text)
    # Make save file window
    @savefile_windows = []
    @cursor_displace = 0
    (0..3).each {|i|
      @savefile_windows.push(Window_NGPFile.new(i, make_filename(i), i))
    }
    # Select last file to be operated
    @file_index = 0
    @savefile_windows[@file_index].selected = true
    # Execute transition
    Graphics.transition
    # Main loop
    loop {
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      break if $scene != self
    }
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @savefile_windows.each {|win| win.dispose}
  end
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(filename)
    # If file doesn't exist
    unless FileTest.exist?(filename)
      # Play buzzer SE
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    # Play load SE
    $game_system.se_play($data_system.load_se)
    # Read save data
    file = File.open(filename, 'rb')
    if read_save_data(file)
      file.close
      # Set up initial party
      $game_party.setup_starting_members if !SL93::ACTORS
      # Set up initial map position
      $game_map.setup($data_system.start_map_id)
      # Move player to initial position
      $game_player.moveto($data_system.start_x, $data_system.start_y)
      # Refresh player
      $game_player.refresh
      # Run automatic change for BGM and BGS set with map
      $game_map.autoplay
      # Update map (run parallel process event)
      $game_map.update
  # Close any possible loopholes
  $game_system.ngp = false
      # Switch to map screen
      $scene = Scene_Map.new
    else
      # Reset game_system
      $game_system = Game_System.new
      # Play buzzer SE
      $game_system.se_play($data_system.buzzer_se)
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Cancel Processing
  #--------------------------------------------------------------------------
  def on_cancel
    # Play cancel SE
    $game_system.se_play($data_system.cancel_se)
    # Switch to title screen
    $scene = Scene_Title.new
  end
  #--------------------------------------------------------------------------
  # * Read Save Data
  #     file : file object for reading (opened)
  #--------------------------------------------------------------------------
  def read_save_data(file)
    if DREAM
      DREAM.load_game(file)
    else
      characters           = Marshal.load(file)
      Graphics.frame_count = Marshal.load(file)
      $game_system         = Marshal.load(file)
      $game_switches       = Marshal.load(file)
      $game_variables      = Marshal.load(file)
      $game_actors         = Marshal.load(file)
      $game_party          = Marshal.load(file)
      $game_troop          = Marshal.load(file)
      $game_map            = Marshal.load(file)
    end
    Graphics.frame_count = 0 if !SL93::TIME
    return false if $game_system.ngp != true
    $game_switches_bk, $game_variables_bk = $game_switches, $game_variables
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    SL93::SWI_EXCEPTIONS.each {|s|
      $game_switches[s] = $game_switches_bk[s]
    }
    SL93::VAR_EXCEPTIONS.each {|v|
      $game_variables[v] = $game_variables_bk[v]
    }
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_party.lose_gold(9999999) if !SL93::GOLD
    $game_player        = Game_Player.new
    # Refresh party members
    $game_party.refresh
    return true
  end
end

#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
#  This class performs game over screen processing.
#==============================================================================

class Scene_Gameover
  if SL93::ARS
    #--------------------------------------------------------------------------
    # * Main Processing
    #--------------------------------------------------------------------------
    def main
      # Make game over graphic
      @sprite = Sprite.new
      @sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
      # Stop BGM and BGS
      $game_system.bgm_play(nil)
      $game_system.bgs_play(nil)
      # Play game over ME
      $game_system.me_play($data_system.gameover_me)
      # Execute transition
      Graphics.transition(120)
      c1 = 'Retry'
      c2 = 'Quit'
      @command_window = Window_Command.new(192, [c1, c2])
      @command_window.back_opacity = 160
      @command_window.x = 320 - @command_window.width / 2
      @command_window.y = 288
      # Main loop
      loop {
        # Update game screen
        Graphics.update
        # Update input information
        Input.update
        # Frame update
        update
        # Abort loop if screen is changed
        break if $scene != self
      }
      # Prepare for transition
      Graphics.freeze
      # Dispose of game over graphic
      @sprite.bitmap.dispose
      @sprite.dispose
      @command_window.dispose
      # Execute transition
      Graphics.transition(40)
      # Prepare for transition
      Graphics.freeze
      # If battle test
      $scene = nil if $BTEST
    end
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
    def update
      @command_window.update
      if Input.trigger?(Input::C)
        case @command_window.index
        when 0 then SL93.restore_temp_save
        when 1 then $scene = Scene_Title.new
        end
      end
    end
  end
end



Instructions

Found in Script.


Compatibility

Doesn't work with other Save Systems, New Game Plus Systems, or the SDK.
Requires a little modifying to work with Title Screen Mods.
Should work with DREAM and CPSL.


Credits and Thanks


  • shdwlink1993 - for making it.
  • Blizzard - for some inspiration and scripting conventions.
  • Phylomortis - because part of the Infinite Save Files came from his script.
  • Memor-X - for requesting the Multiple Disk System.



Author's Notes

As this is the first script I have released, any and all issues or bug reports would be greatly appreciated. If you have any requests or add-ons you'd like to see, don't hesitate to drop a suggestion.

Also, the Multiple Disk System is currently beta because I have not tested it completely yet. There is a chance that there are blatantly (and not-so-blatantly) obvious errors in it.

Why do I always release updates for this script when it's very early in the morning?
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Blizzard

You could have posted this in database right away. BTW, does it work with DREAM? :naughty:
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

shdwlink1993

Oh! I knew there would be something I forgot  :^_^':. No. It doesn't support DREAM... yet.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Blizzard

That's why I am asking, lol!
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

shdwlink1993

OK. It should work with DREAM now.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Blizzard

"Should" is not good enough. ._.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

July 26, 2008, 09:54:36 am #6 Last Edit: July 26, 2008, 09:56:36 am by Fantasist
Ah, a save file system by my arch scripting rival shdwlink! And very impressive indeed! Seriously, looks awesome (+1 energy to you :D)
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




diablosbud

Could you please make this compatible with the Chaos Project Save Layout?

shdwlink1993

OK. I should be able to do that.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

diablosbud

Thanks, because I am going to make my game even funner using this system, being able to redo the game with new Elite equipment. Also could there be an option to increase the enemy stats by a percentage of their current stats on that savefile?

Blizzard

You can use Different Difficulties from Tons of Add-ons.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

diablosbud

Does the difficulty in tons of addons have a menu, if there is could you please help me take it out, because I already have a difficulty menu + difficulty unlocker for normal new game? All I want to do with the difficulties is increase them by a percentage, if there is a way to do that with new game plus could you please help me do it Blizz?

Blizzard

Different Difficulties has a menu right at the title screen when you start a new game. If you want New Game+, you should get New Game+. :P
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

diablosbud

No I mean on new game plus start (not new game, only NG+) it increases all monster stats by 50%.

Shadonking

can this work with a custom title because every time i try this script it overrides the the custom title script





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Juan

sure you need to post a link to the script it conflicts with.
Dropbox Who need luck when you can make your own.
3ds Friend code: ShowHide
 4468 1422  6617

shdwlink1993

August 24, 2008, 12:25:17 am #16 Last Edit: August 24, 2008, 07:15:59 am by shdwlink1993
Yes, it can work with any custom title. The only catch is that I need to know what the custom parts of it are. :P If you have much experience with scripting, it wouldn't take more than a couple minutes to make a patch for it yourself, :evil: but otherwise, I need to know what script you are using.

EDIT: Version 1.1b coming shortly... 8)
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

shdwlink1993

August 24, 2008, 07:16:28 am #18 Last Edit: August 24, 2008, 07:36:46 am by shdwlink1993
Oops! :^_^': That's my bad. I meant 1.1b. xD

In other news: I have finished 1.1b (I'm not known for giving much warning time). This version includes support for CPSL (still beta (technically alpha) because... well... I forget), a new system, and improvements to some of the others.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Shadonking

ok here is the script iv got for the title screen

Spoiler: ShowHide
=begin
=========================================
Professional Title Screen ver. 2.0 English Translation
Script by ???, Edited by Kio !! :D
http://rpg.para.s3p.net/
-->Released and translated by Sonicia.
Search for my name (Sonicia)for the customizing place where you can arange the
graphics where you want them. Please credit Kio, who orginally made this script
compatable, and me for translating, releasing, and finding out how to use it.
Note, in a few rare spots there is still Japanese, since it was code I didnt
change it for fear of messing it up. All comments are translated by Sonicia.

Note: you need continue.png, continue_active.png, newgame.png,
newgame_active.png, shutdown.png, and shutdown_active.png in your game's
graphics\title folder. The graphics must be the same size, both active and inactive.
This means that if you have an arrow or text make that one first, duplicate,
then erase the arrow and edit the rest of the picture or it will be set off.
=========================================

=========================================
Title menu picture
=========================================
=end
module PARA_TITLE_CUSTOM

# Menu command picture, (true/false)
IMG_MENU = true

#?---Menu command picture Setting---
#Character string of menu command
#MENU_NEWGAME = "new game" # new game
MENU_NEWGAME = "??????" # ??????
#MENU_LOAD = "continuing" # continuing
MENU_LOAD = "???????" # ???????
#MENU_END = "shutdown" # shutdown
MENU_END = "???????" # ???????

# window frame (true/false)
WINDOW_TRANS = false
#Transparency of the window frame
WINDOW_OPACITY = 160

#Side size (horizontal?) of # window
WINDOW_WIDTH = 192
#Vertical position of window (0: Coordinate appointment/
#1: The left edge/2: Center/3: Right hand edge)
WINDOW_ALIGN = 2
#When # "coordinate appointment" being, abscissa of the window
WINDOW_POS_X = 0
#Vertical position of # window (0: Coordinate appointment/
#1: Top/2: Center/3: Bottom)
WINDOW_VALIGN = 0
#When "coordinate appointment" being, ordinate of the window
WINDOW_POS_Y = 288


#==========================================
=begin
Sonicia
Customize the location and the graphics make sure you change
only the numbers, 250 is approxamtely the center of
the vertical screen.
Make sure that the command pictures are in the "Graphics/Titles" folder
=end
#==========================================
=begin
#New Game Graphic
IMG_NEWGAME = ["newgame","newgame_active"]
IMG_NEWGAME_X = 100 # Horizontal position
IMG_NEWGAME_Y = 160 # Vertical position
#Continue Graphic
IMG_LOAD = ["continue","continue_active"]
IMG_LOAD_X = 250 # Horizontal position
IMG_LOAD_Y = 160 # Vertical position
#Shut Down Graphic
IMG_END = ["shutdown","shutdown_active"]
IMG_END_X = 400 # Horizontal position
IMG_END_Y = 160 # Vertical position
=end
#My orginal settings for reference Copy and paste if you need to
#New Game Graphic
IMG_NEWGAME = ["newgame","newgame_active"]
IMG_NEWGAME_X = 180 # Horizontal position
IMG_NEWGAME_Y = 180 # Vertical position
#Continue Graphic
IMG_LOAD = ["continue","continue_active"]
IMG_LOAD_X = 212 # Horizontal position
IMG_LOAD_Y = 250 # Vertical position
#Shut Down Graphic
IMG_END = ["shutdown","shutdown_active"]
IMG_END_X = 252 # Horizontal position
IMG_END_Y = 320 # Vertical position


#END CUSTOMIZABLE AREA
#============================================
#Synthetic method of picture (0: Usually/1: Addition/2: Subtraction)
BLEND_TYPE = 0
end


#------------------------------------------------------------------------------

#======================================
# ? Scene_Title
#======================================

class Scene_Title
#--------------------------------------------------------------------------
# - Main processing
#--------------------------------------------------------------------------
def main
#If battle test
if $BTEST
battle_test
return
end
# Load database
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
# Make system object
$game_system = Game_System.new
# Make title graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
# Make command window
s1 = PARA_TITLE_CUSTOM::MENU_NEWGAME
s2 = PARA_TITLE_CUSTOM::MENU_LOAD
s3 = PARA_TITLE_CUSTOM::MENU_END
w = PARA_TITLE_CUSTOM::WINDOW_WIDTH
@command_window = Window_Command.new(w, [s1, s2, s3])
if PARA_TITLE_CUSTOM::WINDOW_TRANS
@command_window.opacity = 0
else
@command_window.back_opacity = PARA_TITLE_CUSTOM::WINDOW_OPACITY
end
# Position of the window
case PARA_TITLE_CUSTOM::WINDOW_ALIGN
when 0
@command_window.x = PARA_TITLE_CUSTOM::WINDOW_POS_X
when 1
@command_window.x = 0
when 2
@command_window.x = ( 640 - @command_window.width ) / 2
when 3
@command_window.x = 640 - @command_window.width
end
case PARA_TITLE_CUSTOM::WINDOW_VALIGN
when 0
@command_window.y = PARA_TITLE_CUSTOM::WINDOW_POS_Y
when 1
@command_window.y = 0
when 2
@command_window.y = ( 480 - @command_window.height ) / 2
when 3
@command_window.y = 480 - @command_window.height
end
# Continue enabled determinant
# Check if at least one save file exists
# If enabled, make @continue_enabled true; if disabled, make it false
@continue_enabled = true
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# If continue is enabled, move cursor to "Continue"
# If disabled, display "Continue" text in gray
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
# Command Picture
if PARA_TITLE_CUSTOM::IMG_MENU
@command_window.visible = false
@command_img1 = Sprite.new
@command_img1.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
@command_img1.x = PARA_TITLE_CUSTOM::IMG_NEWGAME_X
@command_img1.y = PARA_TITLE_CUSTOM::IMG_NEWGAME_Y
@command_img2 = Sprite.new
@command_img2.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
@command_img2.x = PARA_TITLE_CUSTOM::IMG_LOAD_X
@command_img2.y = PARA_TITLE_CUSTOM::IMG_LOAD_Y
@command_img3 = Sprite.new
@command_img3.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[0])
@command_img3.x = PARA_TITLE_CUSTOM::IMG_END_X
@command_img3.y = PARA_TITLE_CUSTOM::IMG_END_Y
# If continue is enabled, move cursor to "Continue"
# If disabled, display "Continue" text in gray
if @continue_enabled
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[1])
else
@command_img2.opacity = 160
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[1])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
end
end
# Play title BGM
$game_system.bgm_play($data_system.title_bgm)
# Stop playing ME and BGS
Audio.me_stop
Audio.bgs_stop
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of command window
@command_window.dispose
if PARA_TITLE_CUSTOM::IMG_MENU
@command_img1.dispose
@command_img2.dispose
@command_img3.dispose
end
# Graphics Dispose
@sprite.bitmap.dispose
@sprite.dispose
end


#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update command window
@command_window.update
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
if PARA_TITLE_CUSTOM::IMG_MENU
if Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN)
case @command_window.index
when 0 # New Game
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[1])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[0])
when 1 # Continue Game
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[1])
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[0])
when 2 # End Game
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[1])
end
end
end
end
def command_new_game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Stop BGM
Audio.bgm_stop
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each type of game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up initial party
$game_party.setup_starting_members
# Set up initial map position
$game_map.setup($data_system.start_map_id)
# Move player to initial position
$game_player.moveto($data_system.start_x, $data_system.start_y)
# Refresh player
$game_player.refresh
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Command: Continue
#--------------------------------------------------------------------------
def command_continue
# If continue is disabled
unless @continue_enabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to load screen
$scene = Scene_Load.new
end
#--------------------------------------------------------------------------
# * Command: Shutdown
#--------------------------------------------------------------------------
def command_shutdown
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Fade out BGM, BGS, and ME
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# Shutdown
$scene = nil
end
#--------------------------------------------------------------------------
# * Battle Test
#--------------------------------------------------------------------------
def battle_test
# Load database (for battle test)
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up party for battle test
$game_party.setup_battle_test_members
# Set troop ID, can escape flag, and battleback
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# Play battle start SE
$game_system.se_play($data_system.battle_start_se)
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
# Switch to battle screen
$scene = Scene_Battle.new
end
end






Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0