Professional Documents
Culture Documents
#==============================================================================
# autosave script 1.6
#------------------------------------------------------------------------------
# authors darklord, blue elf and me�
# version 1.8
#------------------------------------------------------------------------------
# this script aliases(a)/rewrites(r) in the folowwing classes and methods:
#
# game_party -> gain_gold (a) , gain_item (a), gain_armor (a), gain_weapon (a)
# game_system -> initialize (a)
# scene_save -> initialize (r) , on_decision (r), on_cancel (r)
# scene_cm -> main (a)
# scene_load -> on_decision(a)
#==============================================================================
#==============================================================================
# *** autosave
#------------------------------------------------------------------------------
# this module handles the autosaving
#==============================================================================
module autosave
#--------------------------------------------------------------------------
# * saves file
#--------------------------------------------------------------------------
def self.save
begin
#saves the file to whatever $game_system.filename is
file = file.open($game_system.filename, "wb")
a = scene_save.new
a.write_save_data(file)
ensure
file.close
end
end
#--------------------------------------------------------------------------
# * deletes file
#--------------------------------------------------------------------------
def self.deletesave
begin
if filetest.exits?($game_system.filename)
file.delete($game_system.filename)
end
end
end
end
#==============================================================================
#==============================================================================
# ** scene_save
#------------------------------------------------------------------------------
# this class performs save screen processing.
# note that scene_save no longer saves the game, it changes the autosave file
#==============================================================================
#==============================================================================
# ** scene_load
#------------------------------------------------------------------------------
# this class performs load screen processing.
#==============================================================================
class scene_load < scene_file
#==============================================================================
# ** game_system
#------------------------------------------------------------------------------
# this class handles data surrounding the system. backround music, etc.
# is managed here as well. refer to "$game_system" for the instance of
# this class.
#==============================================================================
class game_system
#--------------------------------------------------------------------------
# * aliasing objects
#--------------------------------------------------------------------------
alias autosaveinit initialize
#--------------------------------------------------------------------------
# * initialize
#--------------------------------------------------------------------------
def initialize
autosaveinit
@filename = "save1.rxdata"
end
#--------------------------------------------------------------------------
# * filename -> returns autosave filename
#--------------------------------------------------------------------------
def filename
if @filename != nil
return @filename
else
return "save1.rxdata"
end
end
#--------------------------------------------------------------------------
# * filename_change -> sets new autosave filename
#--------------------------------------------------------------------------
def filename_c(newname)
return if newname == "" or newname == nil
@filename = newname
end
end
#==============================================================================
# ** game_party
#------------------------------------------------------------------------------
# this class handles the party. it includes information on amount of gold
# and items. refer to "$game_party" for the instance of this class.
#==============================================================================
class game_party
#==============================================================================
# ** scene change map
#------------------------------------------------------------------------------
# this scene pop-ups when teleporting.
#==============================================================================
class scene_cm
alias autosavescript_changemap_main main
#--------------------------------------------------------------------------
# * main
#--------------------------------------------------------------------------
def main
autosavescript_changemap_main
autosave.save
end
end
#==============================================================================