#===============================================================================
#
# DT's Autosave
# Author: DoctorTodd
# Date (06/22/2012)
# Version: (1.0.0) (VXA)
# Level: (Simple)
# Email: Todd@beacongames.com
#
#===============================================================================
#
# NOTES: 1)This script will only work with ace.
#
#===============================================================================
#
# Description: Saves the game when transferring the map, before battle,
# and opening the menu (all optional).
#
# Credits: Me (DoctorTodd)
#
#===============================================================================
#
# Instructions
# Paste above main.
# Call using Autosave.call
#
#===============================================================================
#
# Free for any use as long as I'm credited.
#
#===============================================================================
#
# Editing begins 37 and ends on 50.
#
#===============================================================================
module ToddAutoSaveAce
#Max files (without autosave).
MAXFILES = 16
#Autosave file name.
AUTOSAVEFILENAME = "Autosave"
#Autosave before battle?
AUTOSAVEBB = true
#Autosave when menu opened?
AUTOSAVEM = true
#Autosave when changing map?
AUTOSAVETM = true
end
#==============================================================================
# ** Autosave
#------------------------------------------------------------------------------
# This module contains the autosave method. This is allows you to use the
# "Autosave.call" command.
#==============================================================================
module Autosave
#--------------------------------------------------------------------------
# * Call method
#--------------------------------------------------------------------------
def self.call
DataManager.save_game_without_rescue(0)
end
end
#==============================================================================
# ** DataManager
#------------------------------------------------------------------------------
# This module manages the database and game objects. Almost all of the
# global variables used by the game are initialized by this module.
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# * Maximum Number of Save Files
#--------------------------------------------------------------------------
def self.savefile_max
return ToddAutoSaveAce::MAXFILES + 1
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs the map screen processing.
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# * Preprocessing for Battle Screen Transition
#--------------------------------------------------------------------------
def pre_battle_scene
Graphics.update
Graphics.freeze
@spriteset.dispose_characters
BattleManager.save_bgm_and_bgs
BattleManager.play_battle_bgm
Sound.play_battle_start
Autosave.call if ToddAutoSaveAce::AUTOSAVEBB
end
#--------------------------------------------------------------------------
# * Call Menu Screen
#--------------------------------------------------------------------------
def call_menu
Sound.play_ok
SceneManager.call(Scene_Menu)
Window_MenuCommand::init_command_position
Autosave.call if ToddAutoSaveAce::AUTOSAVEM
end
#--------------------------------------------------------------------------
# * Post Processing for Transferring Player
#--------------------------------------------------------------------------
def post_transfer
case $game_temp.fade_type
when 0
Graphics.wait(fadein_speed / 2)
fadein(fadein_speed)
when 1
Graphics.wait(fadein_speed / 2)
white_fadein(fadein_speed)
end
@map_name_window.open
Autosave.call if ToddAutoSaveAce::AUTOSAVETM
end
end