Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #===============================================================================
  2. #
  3. # DT's Autosave
  4. # Author: DoctorTodd
  5. # Date (06/22/2012)
  6. # Version: (1.0.0) (VXA)
  7. # Level: (Simple)
  8. # Email: Todd@beacongames.com
  9. #
  10. #===============================================================================
  11. #
  12. # NOTES: 1)This script will only work with ace.
  13. #
  14. #===============================================================================
  15. #
  16. # Description: Saves the game when transferring the map, before battle,
  17. # and opening the menu (all optional).
  18. #
  19. # Credits: Me (DoctorTodd)
  20. #
  21. #===============================================================================
  22. #
  23. # Instructions
  24. # Paste above main.
  25. # Call using Autosave.call
  26. #
  27. #===============================================================================
  28. #
  29. # Free for any use as long as I'm credited.
  30. #
  31. #===============================================================================
  32. #
  33. # Editing begins 37 and ends on 50.
  34. #
  35. #===============================================================================
  36. module ToddAutoSaveAce
  37.  
  38.       #Max files (without autosave).
  39.       MAXFILES = 16
  40.  
  41.       #Autosave file name.
  42.       AUTOSAVEFILENAME = "Autosave"
  43.  
  44.       #Autosave before battle?
  45.       AUTOSAVEBB =  true
  46.  
  47.       #Autosave when menu opened?
  48.       AUTOSAVEM =  true
  49.  
  50.       #Autosave when changing map?
  51.       AUTOSAVETM =  true
  52.     end
  53. #==============================================================================
  54. # ** Autosave
  55. #------------------------------------------------------------------------------
  56. # This module contains the autosave method. This is allows you to use the
  57. # "Autosave.call" command.
  58. #==============================================================================
  59.  
  60. module Autosave
  61.   #--------------------------------------------------------------------------
  62.   # * Call method
  63.   #--------------------------------------------------------------------------
  64.   def self.call
  65.   DataManager.save_game_without_rescue(0)
  66. end
  67. end
  68. #==============================================================================
  69. # ** DataManager
  70. #------------------------------------------------------------------------------
  71. #  This module manages the database and game objects. Almost all of the
  72. # global variables used by the game are initialized by this module.
  73. #==============================================================================
  74.  
  75. module DataManager
  76.   #--------------------------------------------------------------------------
  77.   # * Maximum Number of Save Files
  78.   #--------------------------------------------------------------------------
  79.   def self.savefile_max
  80.     return ToddAutoSaveAce::MAXFILES + 1
  81.   end  
  82. end
  83. #==============================================================================
  84. # ** Scene_Map
  85. #------------------------------------------------------------------------------
  86. #  This class performs the map screen processing.
  87. #==============================================================================
  88.  
  89. class Scene_Map < Scene_Base
  90.   #--------------------------------------------------------------------------
  91.   # * Preprocessing for Battle Screen Transition
  92.   #--------------------------------------------------------------------------
  93.   def pre_battle_scene
  94.     Graphics.update
  95.     Graphics.freeze
  96.     @spriteset.dispose_characters
  97.     BattleManager.save_bgm_and_bgs
  98.     BattleManager.play_battle_bgm
  99.     Sound.play_battle_start
  100.   Autosave.call if ToddAutoSaveAce::AUTOSAVEBB
  101. end
  102.   #--------------------------------------------------------------------------
  103.   # * Call Menu Screen
  104.   #--------------------------------------------------------------------------
  105.   def call_menu
  106.     Sound.play_ok
  107.     SceneManager.call(Scene_Menu)
  108.     Window_MenuCommand::init_command_position
  109.   Autosave.call if ToddAutoSaveAce::AUTOSAVEM
  110. end
  111.   #--------------------------------------------------------------------------
  112.   # * Post Processing for Transferring Player
  113.   #--------------------------------------------------------------------------
  114.   def post_transfer
  115.     case $game_temp.fade_type
  116.     when 0
  117.       Graphics.wait(fadein_speed / 2)
  118.       fadein(fadein_speed)
  119.     when 1
  120.       Graphics.wait(fadein_speed / 2)
  121.       white_fadein(fadein_speed)
  122.     end
  123.     @map_name_window.open
  124.   Autosave.call if ToddAutoSaveAce::AUTOSAVETM
  125. end
  126. end