Quicksave Command

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Cryranos, Jul 6, 2012.

  1. Cryranos

    Cryranos Veteran Veteran

    Messages:
    58
    Likes Received:
    31
    Location:
    Kansas City
    First Language:
    English
    Primarily Uses:
    RMMV
    Quicksave v.1.3.1

    Cryranos


    Introduction

    This script recreates the functionality in many RPGs on handheld systems, where the player can save and quit their game at any time, and upon restarting, they will be prompted to either load the file or to delete it and return to the title screen. If they load it, it is deleted.

    Features

    -Replicates the autosave feature found in handheld RPGs.

    -Can add autosave to the menu.

    -Can bind autosave to a key.

    -Can change directory to which the file is saved.

    Screenshots

    None.

    How to Use

    Install the script and edit the module.

    Demo

    Not necessary.

    Script

    The most up-to-date version will always be available here on my personal pastebin.

    Patches

    JV Master Script's Skip Title
    Replace class Scene_QuickLoadTitle with the following:
    Code:
    class Scene_QuickLoadTitle < Scene_Title
    
    def start
            SceneManager.clear
            Graphics.freeze
            create_command_window
            create_help_window
    end
    
    def help_window_text
            CryQuicksave::QSVLoad
    end
    
    def create_command_window
            @command_window = Window_QuicksaveCommand.new
            @command_window.set_handler(:confirm,    method(:command_quickload))
            @command_window.set_handler(:decline, method(:command_decline))
            @command_window.set_handler(:cancel,    method(:return_scene))
    end
    
    def create_help_window
            @help_window = Window_Help.new(2)
            @help_window.set_text(help_window_text)
    end
    
    def command_quickload
            close_command_window
            DataManager.quickload_game
            Sound.play_load
            fadeout_all
            $game_system.on_after_load
            SceneManager.goto(Scene_Map)
    end
    
    def command_decline
            DataManager.dispose_quicksave
            DataManager.setup_new_game
            $game_map.autoplay
            SceneManager.goto(Scene_Map)
    end
    
    def return_scene
        fadeout_all
        SceneManager.exit
    end
    end

    CRBeam's IBG Flash Screen/Skip Title V2.0
    Replace module SceneManager with the following:
    Code:
    module SceneManager
      def self.first_scene_class
       if $BTEST
         Scene_Battle
       elsif DataManager.quicksave_file_exists?
         Scene_QuickLoadTitle
       else
         IBG_PT#Scene_Title
       end
      end
    end

    Credit and Thanks

    - Cryranos, author.
    - Acezon, for patch for JV Master Script's Skip Title
    - Roninator2, for patch for CRBeam's IBG Flash Screen/Skip Title V2.0

    Author's Notes

    It is unlikely to be compatible with any script that alters SceneManager.first_scene_class, but other than that, it should be highly compatible.

    You are free to use this in any project, free or commercial, so long as I am credited and receive a free or discounted copy of any finished product.
     
    Last edited: Jun 26, 2019
    #1
  2. HamPants

    HamPants Ayyy! Member

    Messages:
    90
    Likes Received:
    10
    Location:
    Canada
    First Language:
    English
    Awesome Cryranos! I can't tell you how many times I've decided not to play an excellent game, just because I had to go somewhere in 30 minutes, and didn't want to screw myself over. This is a great function.
     
    #2
  3. Chaos17

    Chaos17 Dreamer Veteran

    Messages:
    1,253
    Likes Received:
    420
    Location:
    France
    First Language:
    French
    Can you add a keyboard feature to your script ?

    It will be quicker to press F5 for example rather to have enter the menu or did I read wrong and you've that feature ?
     
    #3
  4. Cryranos

    Cryranos Veteran Veteran

    Messages:
    58
    Likes Received:
    31
    Location:
    Kansas City
    First Language:
    English
    Primarily Uses:
    RMMV
    Done!

    I've also added an option to change the filename to the module, as well as changed some of the module's arguments.
     
    #4
    Chaos17 likes this.
  5. Cryranos

    Cryranos Veteran Veteran

    Messages:
    58
    Likes Received:
    31
    Location:
    Kansas City
    First Language:
    English
    Primarily Uses:
    RMMV
    I've fixed a bug that occurred when you decline to load the quicksave.
     
    #5
  6. Kazu0kami

    Kazu0kami Warper Member

    Messages:
    4
    Likes Received:
    0
    Location:
    California
    First Language:
    English
    Incredibly useful script! One of my favorite games Pokemon Mystery Dungeon utilized this in a way that I truly enjoyed such as after big cut scenes or after dungeon/rescue mission completions. This'll really come in handy!

    By the way, if you don't mind me imposing, might I ask in the screenshot what the font your using is called?
     
    #6
  7. Cryranos

    Cryranos Veteran Veteran

    Messages:
    58
    Likes Received:
    31
    Location:
    Kansas City
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks! The font is Qlassik.
     
    #7
  8. Ocedic

    Ocedic Dog Veteran

    Messages:
    395
    Likes Received:
    67
    Location:
    Seattle
    Not sure if the author is still supporting this script, but I was wondering if it was possible to save the file in a specific location. For example I would like the quicksave file to be written to and read from the /system folder of the game. Could anyone help me with that?
     
    #8
    Cryranos likes this.
  9. Cryranos

    Cryranos Veteran Veteran

    Messages:
    58
    Likes Received:
    31
    Location:
    Kansas City
    First Language:
    English
    Primarily Uses:
    RMMV
    That's actually very simple! All you have to do is add "System/" before the filename in the first item in the module! (so it would be "System/Save.qsav)

    However, I really like that idea, so if you can wait a bit, I'll edit the script to make it a separate item in the module so I updated the module to make that an option.
     
    Last edited by a moderator: Dec 30, 2012
    #9
  10. Ocedic

    Ocedic Dog Veteran

    Messages:
    395
    Likes Received:
    67
    Location:
    Seattle
    Thank you, works great! Just what I was looking for.
     
    #10
  11. Cryranos

    Cryranos Veteran Veteran

    Messages:
    58
    Likes Received:
    31
    Location:
    Kansas City
    First Language:
    English
    Primarily Uses:
    RMMV
    I just fixed it to make the script work should you choose to save the file to the parent directory.
     
    #11
  12. Burgerland

    Burgerland Veteran Veteran

    Messages:
    262
    Likes Received:
    58
    First Language:
    English
    Primarily Uses:
    N/A
    Thank you for this script. I have 2 questions, but first, these are the scripts I'm using:

    • HimeWorks Window Changer
    • Zerbu Title Screen
    • HimeWorks FPS Changer
    • YanFly Save Engine
    • HimeWorks Compressed Saves
    • Your Quicksave script
    • Jack of all Errors Keyboard Manager



    1)



    When I change F5 to any other key, I get this error:



    I wish to bind the quicksave to two number keys: 2 and 7 (for left and right handed people). That when, when you press one key, you can quicksave. How do I do this?


    2)


    How do I get rid of Quicksave in the command menu?



    Since the quicksave is a button, I don't think it needs to be in the menu. Plus, the save option is right there above it.
     
    #12
  13. Burgerland

    Burgerland Veteran Veteran

    Messages:
    262
    Likes Received:
    58
    First Language:
    English
    Primarily Uses:
    N/A
    Hmm, that didn't work. I changed the UseKey part to "true" but Quicksave is still in the command menu.

     
    #13
  14. Ragpuppy87

    Ragpuppy87 Veteran Veteran

    Messages:
    233
    Likes Received:
    159
    Location:
    Idaho, United States
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm really going out on a limb here asking for support on a 7 year old script. But I'm wondering if there is any
    way to somehow combine this with a script that does happen to alter SceneManager.first_scene_class.
    I have a script that displays a splash screen before the title. I'm wondering if it's possible to run both...



    Code:
    # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Splash Screen VXA
    # Author: Soulpour777
    # Version 1
    # Description: Creates a splash screen at the start of the game.
    # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    
    #==============================================================================
    # ** SceneManager
    #------------------------------------------------------------------------------
    # This module manages scene transitions. For example, it can handle
    # hierarchical structures such as calling the item screen from the main menu
    # or returning from the item screen to the main menu.
    #==============================================================================
    module SceneManager
    #--------------------------------------------------------------------------
    # * Get First Scene Class
    #--------------------------------------------------------------------------
    def self.first_scene_class
    $BTEST ? Scene_Battle : Scene_Splash
    end
    end
    
    #==============================================================================
    # ** Splash
    #------------------------------------------------------------------------------
    # This module manages the image shown as a splash screen.
    #==============================================================================
    module Splash
    #--------------------------------------------------------------------------
    # * Create Splash Image
    #--------------------------------------------------------------------------
    def self.create_splash_image
    @splash = Plane.new
    @splash.bitmap = Cache.system("SplashScreen")
    end
    #--------------------------------------------------------------------------
    # * Dispose Splash Image
    #--------------------------------------------------------------------------
    def self.dispose_splash_image
    @splash.bitmap.dispose
    @splash.dispose
    end
    end
    
    class Scene_Splash < Scene_Base
    #--------------------------------------------------------------------------
    # * Start Processing
    #--------------------------------------------------------------------------
    def start
    super
    RPG::BGM.stop
    RPG::BGS.stop
    Graphics.transition(90)
    Graphics.freeze
    RPG::ME.new("Fanfare3", 100, 135).play
    RPG::SE.new("Dog", 100, 135).play
    Splash.create_splash_image
    end
    #--------------------------------------------------------------------------
    # * Termination Processing
    #--------------------------------------------------------------------------
    def terminate
    super
    Splash.dispose_splash_image
    end
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
    def update
    super
    SceneManager.goto(Scene_Title)
    Graphics.wait(400)
    Graphics.fadeout(120)
    end
    #--------------------------------------------------------------------------
    # * Execute Transition
    #--------------------------------------------------------------------------
    def perform_transition
    Graphics.transition(30)
    end
    end
     
    #14
  15. Kes

    Kes Global Moderators Global Mod

    Messages:
    21,044
    Likes Received:
    10,697
    First Language:
    English
    Primarily Uses:
    RMVXA
    @Ragpuppy87 It will be difficult to get support for a Soulpour script. However, there is another script which does the same which you might try and see if it is compatible. It is by CRBeam. Unfortunately, when the forum migrated a while back a lot of first posts were permanently lost, including the page with this script on it. I'll put it here in a spoiler in case it is of any interest to you.

    Code:
    #=============================================================================#
    #-----------------------------------------------------------------------------#
    #---------------------IBG Flash Screen/Skip Title V2.0------------------------#
    #=============================================================================#
    #--------------------------------Free to use----------------------------------#               
    #-----------------------------No credit needed--------------------------------#
    #----------Special Thanks to Doctor Todd for his contribution on BGM----------#
    #=============================================================================#
    #-----------------------------------Setup-------------------------------------#
    #---Just place below materials and specify image to be used as flash screen.--#
    #-------------------(Must be in Graphics/System folder)-----------------------#
    #=============================================================================#
    class IBG_PT < Scene_Base
      module IBG
     
    #=============================================================================#
    #------------------------------------Setup------------------------------------#
    #=============================================================================#
    # Flash: Flash image filenames. (must be in Graphics/System)                  #
    # Ex. ["Flash1",Flash2",Flash3",]                                             #
    # NumF: Number of flash screens. (Be sure to add all of them to Flash)        #
    # Delay: How long to display flash screens in frames. (60 frames = 1 Second)  #
    # Skip: Skip title if no save exists.                                         #
    # MUS: Play music with flash screens.                                         #
    # FAD: Fade out music before Title Screen.                                    #
    # BGM: Name of music file to play.                                            #
    # Skip_Key: Key to skip flash screens, nil to disallow.                       #
    # Ex. :A, :B, or :C (Default :C)                                              #
    #=============================================================================#
        Flash    = ["Screen-title","Screen-title","Screen-title",]
        NumF     = 3
        Delay    = 180
        Skip     = false
        MUS      = true
        FAD      = false
        BGM      = "Horizon_0"
        Skip_Key = :C
      end
     
    #=============================================================================#
    #---------------------------------Processing----------------------------------#
    #=============================================================================#
    
      def initialize
        @time = IBG::Delay
        @screen = 0
        @shown = 0
      end
    
      def start
        super
        create_background
        if IBG::MUS
          Audio.bgm_play("Audio/BGM/" + IBG::BGM, 100, 100) #(DoctorTodd edit)
        end
      end
    
      def create_background
        @time = IBG::Delay
        @sprite = Sprite.new
        @sprite.bitmap = Cache.system(IBG::Flash[@screen])
        @screen += 1
        @shown += 1
      end
    
      def update
        super
        if Input.press?(IBG::Skip_Key)
          goto_title
        end
        if  @shown == IBG::NumF and @time == 0
          goto_title
        else
          if @time == 0 and @shown <= IBG::NumF
            create_background
          else
            @time -= 1
          end
        end
      end
    
      def dispose_background
        @sprite.bitmap.dispose
        @sprite.dispose
      end
    
      def goto_title
        if IBG::Skip
          if DataManager.save_file_exists?
            if IBG::FAD
              fadeout_all
            end
            SceneManager.goto(Scene_Title)
            else
              DataManager.setup_new_game
            if IBG::FAD
              fadeout_all
            end
            $game_map.autoplay
            SceneManager.goto(Scene_Map)
          end
          else
          DataManager.save_file_exists?
            if IBG::FAD
              fadeout_all
            end
          SceneManager.goto(Scene_Title)
        end
      end
    end
    
    module SceneManager
    
      def self.first_scene_class
        $BTEST ? Scene_Battle : IBG_PT
      end
    end
    
     
    #15
    Ragpuppy87 likes this.
  16. Ragpuppy87

    Ragpuppy87 Veteran Veteran

    Messages:
    233
    Likes Received:
    159
    Location:
    Idaho, United States
    First Language:
    English
    Primarily Uses:
    RMMV
    Thank you for your help.
    The script you provided is unfortunately still incompatible. The quicksave option appears in the menu but upon reset
    the option to load the quicksave data doesn't appear. Cryranos does explicitly say that the script is incompatible with anything
    that affects SceneManager.first_scene_class, which most splash screens appear to do. I guess I was just hoping there was somehow a way
    around that.
    Again, thank you though.
     
    #16
  17. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,750
    Likes Received:
    384
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    It looks to me like you just need to modify the quicksave with one small piece
    Putting cyranos below IBG splashscreen with this for the scenemanager in cyranos script
    Code:
    module SceneManager
      def self.first_scene_class
        if $BTEST
          Scene_Battle
        elsif DataManager.quicksave_file_exists?
          Scene_QuickLoadTitle
        else
          IBG_PT#Scene_Title
        end
      end
    end
    
    Tested and works fine
     
    #17
    Ragpuppy87 likes this.
  18. Ragpuppy87

    Ragpuppy87 Veteran Veteran

    Messages:
    233
    Likes Received:
    159
    Location:
    Idaho, United States
    First Language:
    English
    Primarily Uses:
    RMMV
    Thank you so much! I felt that the solution had to be somewhat simple, but I know nothing about coding.
    It works great! I really appreciate it!
     
    #18
  19. Cryranos

    Cryranos Veteran Veteran

    Messages:
    58
    Likes Received:
    31
    Location:
    Kansas City
    First Language:
    English
    Primarily Uses:
    RMMV
    Thank you Kes and Roninator for your help! I've almost totally lost what little coding chops I had and it might have taken me a while to figure out the solution.

    I will add that snippet to the first post when I can get to a computer.
     
    #19
  20. Cryranos

    Cryranos Veteran Veteran

    Messages:
    58
    Likes Received:
    31
    Location:
    Kansas City
    First Language:
    English
    Primarily Uses:
    RMMV
    @Ragpuppy87 Here are more solutions if you prefer the Soulpour script:

    Replace that third branch with Scene_Splash like this:
    Code:
    module SceneManager
      def self.first_scene_class
       if $BTEST
         Scene_Battle
       elsif DataManager.quicksave_file_exists?
         Scene_QuickLoadTitle
       else
         Scene_Splash
       end
      end
    end
    
    NB: This will skip the splashes when there is a Quicksave. I believe that since the version for the other script will NOT skip the splashes, it's probably the better choice.

    If you want to make Soulpour's script work with mine by maintaining splashes when there is a quicksave, comment out or remove that entire section in my script and change def_update in the Soulpour from this:
    Code:
    def update
    super
    SceneManager.goto(Scene_Title)
    Graphics.wait(400)
    Graphics.fadeout(120)
    end
    to this:

    Code:
    def update
    super
    if DataManager.quicksave_file_exists?
    SceneManager.goto(Scene_Title)
    else
    Scene_Manager.goto(Scene_QuickLoadTitle)
    Graphics.wait(400)
    Graphics.fadeout(120)
    end
    This would be better done with an aliased method but I'd need to try it out first and I don't have VXAce installed on any of my computers.

    I may update the module in this script to allow you to designate the starting screen to improve compatibility, but again, I'd have to install VXAce first to work on it.
     
    Last edited: Jun 26, 2019
    #20

Share This Page