- Joined
- May 22, 2016
- Messages
- 2,893
- Reaction score
- 642
- First Language
- English
- Primarily Uses
- RMVXA
Auto Save / Auto Load v1.00
by Roninator2
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: