Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,891
Reaction score
642
First Language
English
Primarily Uses
RMVXA
Auto Save / Auto Load v1.00
by Roninator2​

Introduction
A script requested to perform auto save on specific maps and auto load

Features
- Decide to use switch to control auto save or not
- Specify number of save slots used
- Specify if you want auto load from the start of the game of when pressing continue on the title screen
- add in what maps you want auto save to work on
- must have only 1 save slot specified for auto load to work.
- if using more than 1 save file then saving will use the last save file used.

How to Use
Put below ▼ Materials

Images
I don't think any is required

Script
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Auto Save / Load             ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function: Requested by kiriyubel    ║   Date Created     ║
# ║                                     ╠════════════════════╣
# ║ Allows auto saving and auto loading ║    21 Jan 2021     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Requires: nil                                            ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Script provides auto save and auto load features         ║
# ║ Switch controls and specifically designed for a single   ║
# ║ save slot. Can be used for multiple save slots but the   ║
# ║ auto load will not work if using more than 1 save slot.  ║
# ║                                                          ║
# ║ Autosave is designed to work for specific maps.          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates:                                                 ║
# ║ 1.00 - 21 Jan 2021 - Initial publish                     ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all RPG Maker uses                              ║
# ╚══════════════════════════════════════════════════════════╝

module R2_AutoSave_AutoLoad
  Switch_Save = 6 # switch to enable auto save
  Use_switch = true # turns switch feature on if true

  Save_Maps = [1, 2]
  # add as many maps as you want to use autosave feature with
  Save_Slots = 1
  # change the number for how many slot you wish to use.
  # only one slot is possible for auto load feature.

  Auto_load = false
  # if true will load the saved game if there is only one save slot
  # without going to scene title
  Continue_load = true
  # if true this will load the save game when selecting continue
  # if there is only one save slot
end

module DataManager
  def self.savefile_max
    return R2_AutoSave_AutoLoad::Save_Slots
  end
end

class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  alias r2_autostart_autoload start
  def start
    if R2_AutoSave_AutoLoad::Auto_load
      if (R2_AutoSave_AutoLoad::Save_Slots == 1) && DataManager.save_file_exists?
        super
        SceneManager.clear
        fadeout_all
        DataManager.load_game(0)
        SceneManager.goto(Scene_Map)
      else
        r2_autostart_autoload
      end
    else
      r2_autostart_autoload
    end
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias r2_autosave_load_terminate  terminate
  def terminate
    if R2_AutoSave_AutoLoad::Auto_load == true
      if (R2_AutoSave_AutoLoad::Save_Slots == 1) && DataManager.save_file_exists?
        super
      end
    else
      r2_autosave_load_terminate
    end
  end
  #--------------------------------------------------------------------------
  # * [Continue] Command
  #--------------------------------------------------------------------------
  def command_continue
    if R2_AutoSave_AutoLoad::Continue_load == true
      if R2_AutoSave_AutoLoad::Save_Slots == 1
        DataManager.load_game(0)
        fadeout_all
        RPG::BGM.fade(30)
        $game_map.autoplay
        SceneManager.goto(Scene_Map)
      else
        close_command_window
        SceneManager.call(Scene_Load)
      end
    else
      close_command_window
      SceneManager.call(Scene_Load)
    end
  end
end
class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # * Post Processing for Transferring Player
  #--------------------------------------------------------------------------
  alias r2_autosave_post_transfer   post_transfer
  def post_transfer
    r2_autosave_post_transfer
    if $game_switches[R2_AutoSave_AutoLoad::Switch_Save] == true &&
      R2_AutoSave_AutoLoad::Use_switch == true
      if R2_AutoSave_AutoLoad::Save_Maps.include?($game_map.map_id)
        if R2_AutoSave_AutoLoad::Save_Slots == 1
          DataManager.save_game(0)
        else
          DataManager.save_game(last_savefile_index) if DataManager.save_file_exists?
        end
      end
    end
  end
end

Credit and Thanks
- Roninator2

Terms of use
Free for all RPG Maker VX Ace uses
 
Last edited:

RedRose190

Anna/Misty190
Veteran
Joined
Oct 9, 2018
Messages
95
Reaction score
37
First Language
Greek
Primarily Uses
RMVXA
Thank you for this useful script!

i have a small issue, when i load the load file with those settings (continue load false):

11.png

This pop up

222.png

Edit: I was doing something wrong the script works just fine!
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,891
Reaction score
642
First Language
English
Primarily Uses
RMVXA
Maybe I DO something wrong i am sorry
Are you loading a saved game? try starting a new game and save over your save file then try to load from the title again.
 

RedRose190

Anna/Misty190
Veteran
Joined
Oct 9, 2018
Messages
95
Reaction score
37
First Language
Greek
Primarily Uses
RMVXA
So it turns out that the script work just fine. I tested it on other project and it's working
I am doing something wrong..
Very nice script anyway! thank you again!
 

Latest Threads

Latest Posts

Latest Profile Posts

Does anyone know of NPC sprites for RMMZ? I know of Flirion's RMMV recolours, but RMMZ's sprites are slimmer and more detailed, so I'm a bit on the edge to use Flirion's im RMMZ...
I can't believe that after all those years, KH Union X Dark Road is closing the services.

Due to a situation in which I thought plugin adaptations had stopped for the QPlugins, I "ghetto" converted these 7 over yesterday. They appear to work perfectly as long as you use old style plugin commands. I am uncertain if I will have a lot of free time in the future to work on this, but if you'd like them, here they are.
Was there a thread that you could share a screenshot of your game? I feel like I found it once but can't locate it again.

I was being lazy and just copied a map to test a new parallax, but I forgot to delete all the events. This was the result. :o

Forum statistics

Threads
108,818
Messages
1,039,786
Members
141,277
Latest member
acoolusername
Top