Guest User

Save System

a guest
Nov 21st, 2012
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 20.88 KB | None | 0 0
  1. =begin
  2.                       AutoSave VX + Woratana Neo Save System 3.0
  3.                                  
  4. Author: BulleXt([email protected])
  5. Version: 0.1
  6. Date: 06/07/2009
  7.  
  8. Description:
  9. This script by default will automatically save when you do a map transfer,
  10. after winning a battle and after exiting menu.
  11. You can also manually call an autosave inside an event by simply doing a
  12. call script like this:
  13. Auto_Save.new
  14. The script doesn't disable normal saving system so player can still save on his
  15. slots, he will not be able to overwrite the autosave slot.
  16. The script also lets you set how many saving slots you want.
  17. =end
  18.  
  19.  
  20. #This is the autosave slot number
  21. SAVE_NUMBER = 1
  22.  
  23. #This is an ID switch, if ON it disables the autosave on map transfer
  24. SAVE_ON_MAP_TRANSFER = 92
  25.  
  26. #This is an ID switch, if ON it disables the autosave after winning a battle
  27. SAVE_AFTER_WINNING_BATTLE = 93
  28.  
  29. #This is an ID switch, if ON it disables the autosave after closing Menu
  30. SAVE_AFTER_CLOSING_MENU = 94
  31.  
  32.  
  33.  
  34. #===============================================================
  35. # ? [VX] ? Neo Save System III ? ?
  36. #--------------------------------------------------------------
  37. # ? by Woratana [[email protected]]
  38. # ? Thaiware RPG Maker Community
  39. # ? Released on: 15/02/2009
  40. # ? Version: 3.0
  41. #--------------------------------------------------------------
  42. # ? Log III:
  43. # - Change back to draw tilemap as screenshot. Don't need any image.
  44. # - For drawing tilemap, the characters won't show on the tilemap.
  45. #--------------------------------------------------------------
  46. # ? Log II:
  47. # - Screenshot DLL is not work with Vista Aero, so I remove it
  48. # and use image for each map instead of screenshot.
  49. # - Actor's level in last version (V.1) is incorrect.
  50. #--------------------------------------------------------------
  51. # ? Features:
  52. # - Unlimited save slots, you can choose max save slot
  53. # - You can use image for scene's background
  54. # - Choose your save file's name, and folder to store save files
  55. # - Choose to show only information you want
  56. # - Editable text for information's title
  57. # - Draw tilemap for map that player is currently in.
  58. # - Remove text you don't want from map's name (e.g. tags for special script)
  59. # - Choose map that you don't want to show its name
  60. # - Include save confirmation window before overwrite old save
  61. #=================================================================
  62.  
  63. module Wora_NSS
  64.   #==========================================================================
  65.   # * START NEO SAVE SYSTEM - SETUP
  66.   #--------------------------------------------------------------------------
  67.   NSS_WINDOW_OPACITY = 255 # All windows' opacity (Lowest 0 - 255 Highest)
  68.   # You can change this to 0 in case you want to use image for background
  69.   NSS_IMAGE_BG = '' # Background image file name, it must be in folder Picture.
  70.   # use '' for no background
  71.   NSS_IMAGE_BG_OPACITY = 255 # Opacity for background image
  72.  
  73.   MAX_SAVE_SLOT = 10 # Max save slots no.
  74.   SLOT_NAME = 'SLOT {id}'
  75.   # Name of the slot (show in save slots list), use {id} for slot ID
  76.   SAVE_FILE_NAME = 'Saveslot{id}.rvdata'
  77.   # Save file name, you can also change its file type from .rvdata to other
  78.   # use {id} for save slot ID
  79.   SAVE_PATH = '' # Path to store save file, e.g. 'Save/' or '' (for game folder)
  80.  
  81.   SAVED_SLOT_ICON = 133 # Icon Index for saved slot
  82.   EMPTY_SLOT_ICON = 141 # Icon Index for empty slot
  83.  
  84.   EMPTY_SLOT_TEXT = '-NO DATA-' # Text to show for empty slot's data
  85.  
  86.   DRAW_GOLD = true # Draw Gold
  87.   DRAW_PLAYTIME = true # Draw Playtime
  88.   DRAW_LOCATION = true # Draw location
  89.   DRAW_FACE = true # Draw Actor's face
  90.   DRAW_LEVEL = false # Draw Actor's level
  91.   DRAW_NAME = true # Draw Actor's name
  92.  
  93.   PLAYTIME_TEXT = 'Play Time: '
  94.   GOLD_TEXT = 'Money: '
  95.   LOCATION_TEXT = 'Location: '
  96.   LV_TEXT = 'Lv '
  97.  
  98.   MAP_NAME_TEXT_SUB = %w{}
  99.   # Text that you want to remove from map name,
  100.   # e.g. %w{[LN] [DA]} will remove text '[LN]' and '[DA]' from map name
  101.   MAP_NO_NAME_LIST = [] # ID of Map that will not show map name, e.g. [1,2,3]
  102.   MAP_NO_NAME_NAME = '??????????' # What you will use to call map in no name list
  103.  
  104.   MAP_BORDER = Color.new(0,0,0,200) # Map image border color (R,G,B,Opacity)
  105.   FACE_BORDER = Color.new(0,0,0,200) # Face border color
  106.  
  107.   ## SAVE CONFIRMATION WINDOW ##
  108.   SFC_Text_Confirm = 'Confirm to save' # Text to confirm to save file
  109.   SFC_Text_Cancel = 'Cancel' # Text to cancel to save
  110.   SFC_Window_Width = 200 # Width of Confirmation Window
  111.   SFC_Window_X_Offset = 0 # Move Confirmation Window horizontally
  112.   SFC_Window_Y_Offset = 0 # Move Confirmation Window vertically
  113.   #----------------------------------------------------------------------
  114.   # END NEO SAVE SYSTEM - SETUP
  115.   #=========================================================================
  116. end
  117.  
  118. class Auto_Save < Scene_File
  119.   def initialize
  120.     do_save
  121.   end
  122. end
  123.  
  124.  
  125.  
  126. class Scene_File < Scene_Base
  127.   include Wora_NSS
  128.   attr_reader :window_slotdetail
  129.   #--------------------------------------------------------------------------
  130.   # * Start processing
  131.   #--------------------------------------------------------------------------
  132.   def start
  133.     super
  134.     create_menu_background
  135.     if NSS_IMAGE_BG != ''
  136.       @bg = Sprite.new
  137.       @bg.bitmap = Cache.picture(NSS_IMAGE_BG)
  138.       @bg.opacity = NSS_IMAGE_BG_OPACITY
  139.     end
  140.     @help_window = Window_Help.new
  141.     command = []
  142.     (1..MAX_SAVE_SLOT).each do |i|
  143.       command << SLOT_NAME.clone.gsub!(/\{ID\}/i) { i.to_s }
  144.     end
  145.     @window_slotdetail = Window_NSS_SlotDetail.new
  146.     @window_slotlist = Window_SlotList.new(160, command)
  147.     @window_slotlist.y = @help_window.height
  148.     @window_slotlist.height = Graphics.height - @help_window.height
  149.     @help_window.opacity = NSS_WINDOW_OPACITY
  150.     @window_slotdetail.opacity = @window_slotlist.opacity = NSS_WINDOW_OPACITY
  151.    
  152.   # Create Folder for Save file
  153.   if SAVE_PATH != ''
  154.     Dir.mkdir(SAVE_PATH) if !FileTest.directory?(SAVE_PATH)
  155.   end
  156.     if @saving
  157.       @index = $game_temp.last_file_index
  158.       @help_window.set_text(Vocab::SaveMessage)
  159.     else
  160.       @index = self.latest_file_index
  161.       @help_window.set_text(Vocab::LoadMessage)
  162.       (1..MAX_SAVE_SLOT).each do |i|
  163.         @window_slotlist.draw_item(i-1, false) if !@window_slotdetail.file_exist?(i)
  164.       end
  165.     end
  166.     @window_slotlist.index = @index
  167.     # Draw Information
  168.     @last_slot_index = @window_slotlist.index
  169.     @window_slotdetail.draw_data(@last_slot_index + 1)
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # * Termination Processing
  173.   #--------------------------------------------------------------------------
  174.   def terminate
  175.     super
  176.     dispose_menu_background
  177.     unless @bg.nil?
  178.       @bg.bitmap.dispose
  179.       @bg.dispose
  180.     end
  181.     @window_slotlist.dispose
  182.     @window_slotdetail.dispose
  183.     @help_window.dispose
  184.   end
  185.   #--------------------------------------------------------------------------
  186.   # * Frame Update
  187.   #--------------------------------------------------------------------------
  188.   def update
  189.     super
  190.     if !@confirm_window.nil?
  191.       @confirm_window.update
  192.       if Input.trigger?(Input::C)
  193.         if @confirm_window.index == 0
  194.           determine_savefile
  195.           @confirm_window.dispose
  196.           @confirm_window = nil
  197.         else
  198.           Sound.play_cancel
  199.           @confirm_window.dispose
  200.           @confirm_window = nil
  201.         end
  202.       elsif Input.trigger?(Input::B)
  203.       Sound.play_cancel
  204.       @confirm_window.dispose
  205.       @confirm_window = nil
  206.       end
  207.     else
  208.       update_menu_background
  209.       @window_slotlist.update
  210.       if @window_slotlist.index != @last_slot_index
  211.         @last_slot_index = @window_slotlist.index
  212.         @window_slotdetail.draw_data(@last_slot_index + 1)
  213.       end
  214.       @help_window.update
  215.       update_savefile_selection
  216.     end
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # * Update Save File Selection
  220.   #--------------------------------------------------------------------------
  221.   def update_savefile_selection
  222.     if Input.trigger?(Input::C)
  223.       if @saving and @window_slotdetail.file_exist?(@last_slot_index + 1)
  224.         Sound.play_decision
  225.         text1 = SFC_Text_Confirm
  226.         text2 = SFC_Text_Cancel
  227.         @confirm_window = Window_Command.new(SFC_Window_Width,[text1,text2])
  228.         @confirm_window.x = ((544 - @confirm_window.width) / 2) + SFC_Window_X_Offset
  229.         @confirm_window.y = ((416 - @confirm_window.height) / 2) + SFC_Window_Y_Offset
  230.       else
  231.         determine_savefile
  232.       end
  233.     elsif Input.trigger?(Input::B)
  234.       Sound.play_cancel
  235.       return_scene
  236.     end
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # * Execute Save
  240.   #--------------------------------------------------------------------------
  241.   def do_save
  242.    
  243.     #if true, player is saving from inside menu
  244.     if @saving
  245.       file = File.open(make_filename(@last_slot_index), "wb")
  246.     else
  247.       #if here player has done a manual Auto_Save.new call from event
  248.       s = SAVE_PATH + SAVE_FILE_NAME.gsub(/\{ID\}/i) { SAVE_NUMBER.to_s }
  249.       file = File.open( s , "wb")
  250.     end
  251.     write_save_data(file)
  252.     file.close
  253.     $scene = Scene_Map.new if @saving
  254.   end
  255.   #--------------------------------------------------------------------------
  256.   # * Execute Load
  257.   #--------------------------------------------------------------------------
  258.   def do_load
  259.     file = File.open(make_filename(@last_slot_index), "rb")
  260.     read_save_data(file)
  261.     file.close
  262.     $scene = Scene_Map.new
  263.     RPG::BGM.fade(1500)
  264.     Graphics.fadeout(60)
  265.     Graphics.wait(40)
  266.     @last_bgm.play
  267.     @last_bgs.play
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # * Confirm Save File
  271.   #--------------------------------------------------------------------------
  272.   def determine_savefile
  273.    
  274.     if @last_slot_index + 1 == SAVE_NUMBER
  275.       saving_not_allowed if @saving
  276.       return  if @saving
  277.     end
  278.    
  279.     if @saving
  280.       Sound.play_save
  281.       do_save
  282.     else
  283.       if @window_slotdetail.file_exist?(@last_slot_index + 1)
  284.         Sound.play_load
  285.         do_load
  286.       else
  287.         Sound.play_buzzer
  288.         return
  289.       end
  290.     end
  291.     $game_temp.last_file_index = @last_slot_index
  292.   end
  293.  
  294.   #window warning player can't save on auto save slot
  295.   def saving_not_allowed
  296.     Sound.play_buzzer
  297.     b = Bitmap.new(340,60)
  298.     b.draw_text(0, 20,340, 20, "You can't save on the Auto Save slot.")
  299.     w = Window_Message.new
  300.     w.contents = b
  301.     w.width = 380
  302.     w.height = 100
  303.     w.visible = true
  304.     w.openness = 255
  305.     w.x = 100
  306.     w.y = 180
  307.     w.back_opacity = 255
  308.     w.opacity = 255
  309.     w.update
  310.     Graphics.wait(180)
  311.     b.dispose
  312.     w.dispose
  313.     w = nil
  314.     b = nil
  315.   end  
  316.  
  317.  
  318.  
  319.   #--------------------------------------------------------------------------
  320.   # * Create Filename
  321.   #     file_index : save file index (0-3)
  322.   #--------------------------------------------------------------------------
  323.   def make_filename(file_index)
  324.     return SAVE_PATH + SAVE_FILE_NAME.gsub(/\{ID\}/i) { (file_index + 1).to_s }
  325.   end
  326.   #--------------------------------------------------------------------------
  327.   # * Select File With Newest Timestamp
  328.   #--------------------------------------------------------------------------
  329.   def latest_file_index
  330.     latest_index = 0
  331.     latest_time = Time.at(0)
  332.     (1..MAX_SAVE_SLOT).each do |i|
  333.       file_name = make_filename(i - 1)
  334.       next if !@window_slotdetail.file_exist?(i)
  335.       file_time = File.mtime(file_name)
  336.       if file_time > latest_time
  337.         latest_time = file_time
  338.         latest_index = i - 1
  339.       end
  340.     end
  341.     return latest_index
  342.   end
  343. end
  344.  
  345. class Window_SlotList < Window_Command
  346.   #--------------------------------------------------------------------------
  347.   # * Draw Item
  348.   #--------------------------------------------------------------------------
  349.   def draw_item(index, enabled = true)
  350.     rect = item_rect(index)
  351.     rect.x += 4
  352.     rect.width -= 8
  353.     icon_index = 0
  354.     self.contents.clear_rect(rect)
  355.     if $scene.window_slotdetail.file_exist?(index + 1)
  356.       icon_index = Wora_NSS::SAVED_SLOT_ICON
  357.     else
  358.       icon_index = Wora_NSS::EMPTY_SLOT_ICON
  359.     end
  360.     if !icon_index.nil?
  361.       rect.x -= 4
  362.       draw_icon(icon_index, rect.x, rect.y, enabled) # Draw Icon
  363.       rect.x += 26
  364.       rect.width -= 20
  365.     end
  366.     self.contents.clear_rect(rect)
  367.     self.contents.font.color = normal_color
  368.     self.contents.font.color.alpha = enabled ? 255 : 128
  369.     self.contents.draw_text(rect, @commands[index]) if index + 1 != SAVE_NUMBER
  370.     self.contents.draw_text(rect, "Auto Save") if index + 1 == SAVE_NUMBER
  371.   end
  372.  
  373.   def cursor_down(wrap = false)
  374.     if @index < @item_max - 1 or wrap
  375.       @index = (@index + 1) % @item_max
  376.     end
  377.   end
  378.  
  379.   def cursor_up(wrap = false)
  380.     if @index > 0 or wrap
  381.       @index = (@index - 1 + @item_max) % @item_max
  382.     end
  383.   end
  384. end
  385.  
  386. class Window_NSS_SlotDetail < Window_Base
  387.   include Wora_NSS
  388.   def initialize
  389.     super(160, 56, 384, 360)
  390.     @data = []
  391.     @exist_list = []
  392.     @bitmap_list = {}
  393.     @map_name = []
  394.   end
  395.  
  396.   def dispose
  397.     dispose_tilemap
  398.     super
  399.   end
  400.  
  401.   def draw_data(slot_id)
  402.     contents.clear # 352, 328
  403.     dispose_tilemap
  404.     load_save_data(slot_id) if @data[slot_id].nil?
  405.     if @exist_list[slot_id]
  406.       save_data = @data[slot_id]
  407.       # DRAW SCREENSHOT~
  408.       contents.fill_rect(0,30,352,160, MAP_BORDER)
  409.       create_tilemap(save_data['gamemap'].data, save_data['gamemap'].display_x,
  410.     save_data['gamemap'].display_y)
  411.       if DRAW_GOLD
  412.         # DRAW GOLD
  413.         gold_textsize = contents.text_size(save_data['gamepar'].gold).width
  414.         goldt_textsize = contents.text_size(GOLD_TEXT).width
  415.         contents.font.color = system_color
  416.         contents.draw_text(0, 0, goldt_textsize, WLH, GOLD_TEXT)
  417.         contents.draw_text(goldt_textsize + gold_textsize,0,200,WLH, Vocab::gold)
  418.         contents.font.color = normal_color
  419.         contents.draw_text(goldt_textsize, 0, gold_textsize, WLH, save_data['gamepar'].gold)
  420.       end
  421.       if DRAW_PLAYTIME
  422.         # DRAW PLAYTIME
  423.         hour = save_data['total_sec'] / 60 / 60
  424.         min = save_data['total_sec'] / 60 % 60
  425.         sec = save_data['total_sec'] % 60
  426.         time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  427.         pt_textsize = contents.text_size(PLAYTIME_TEXT).width
  428.         ts_textsize = contents.text_size(time_string).width
  429.         contents.font.color = system_color
  430.         contents.draw_text(contents.width - ts_textsize - pt_textsize, 0,
  431.         pt_textsize, WLH, PLAYTIME_TEXT)
  432.         contents.font.color = normal_color
  433.         contents.draw_text(0, 0, contents.width, WLH, time_string, 2)
  434.       end
  435.       if DRAW_LOCATION
  436.         # DRAW LOCATION
  437.         lc_textsize = contents.text_size(LOCATION_TEXT).width
  438.         mn_textsize = contents.text_size(save_data['map_name']).width
  439.         contents.font.color = system_color
  440.         contents.draw_text(0, 190, contents.width,
  441.         WLH, LOCATION_TEXT)
  442.         contents.font.color = normal_color
  443.         contents.draw_text(lc_textsize, 190, contents.width, WLH,
  444.         save_data['map_name'])
  445.       end
  446.         # DRAW FACE & Level & Name
  447.         save_data['gamepar'].members.each_index do |i|
  448.           actor = save_data['gameactor'][save_data['gamepar'].members[i].id]
  449.           face_x_base = (i*80) + (i*8)
  450.           face_y_base = 216
  451.           lvn_y_plus = 10
  452.           lv_textsize = contents.text_size(actor.level).width
  453.           lvt_textsize = contents.text_size(LV_TEXT).width
  454.         if DRAW_FACE
  455.           # Draw Face
  456.           contents.fill_rect(face_x_base, face_y_base, 84, 84, FACE_BORDER)
  457.           draw_face(actor.face_name, actor.face_index, face_x_base + 2,
  458.           face_y_base + 2, 80)
  459.         end
  460.         if DRAW_LEVEL
  461.           # Draw Level
  462.           contents.font.color = system_color
  463.           contents.draw_text(face_x_base + 2 + 80 - lv_textsize - lvt_textsize,
  464.           face_y_base + 2 + 80 - WLH + lvn_y_plus, lvt_textsize, WLH, LV_TEXT)
  465.           contents.font.color = normal_color
  466.           contents.draw_text(face_x_base + 2 + 80 - lv_textsize,
  467.           face_y_base + 2 + 80 - WLH + lvn_y_plus, lv_textsize, WLH, actor.level)
  468.         end
  469.         if DRAW_NAME
  470.           # Draw Name
  471.           contents.draw_text(face_x_base, face_y_base + 2 + 80 + lvn_y_plus - 6, 84,
  472.           WLH, actor.name, 1)
  473.         end
  474.       end
  475.     else
  476.       contents.draw_text(0,0, contents.width, contents.height - WLH, EMPTY_SLOT_TEXT, 1)
  477.     end
  478.   end
  479.  
  480.   def load_save_data(slot_id)
  481.     file_name = make_filename(slot_id)
  482.     if file_exist?(slot_id) or FileTest.exist?(file_name)
  483.       @exist_list[slot_id] = true
  484.       @data[slot_id] = {}
  485.       # Start load data
  486.       file = File.open(file_name, "r")
  487.       @data[slot_id]['time'] = file.mtime
  488.       @data[slot_id]['char'] = Marshal.load(file)
  489.       @data[slot_id]['frame'] = Marshal.load(file)
  490.       @data[slot_id]['last_bgm'] = Marshal.load(file)
  491.       @data[slot_id]['last_bgs'] = Marshal.load(file)
  492.       @data[slot_id]['gamesys'] = Marshal.load(file)
  493.       @data[slot_id]['gamemes'] = Marshal.load(file)
  494.       @data[slot_id]['gameswi'] = Marshal.load(file)
  495.       @data[slot_id]['gamevar'] = Marshal.load(file)
  496.       @data[slot_id]['gameselfvar'] = Marshal.load(file)
  497.       @data[slot_id]['gameactor'] = Marshal.load(file)
  498.       @data[slot_id]['gamepar'] = Marshal.load(file)
  499.       @data[slot_id]['gametro'] = Marshal.load(file)
  500.       @data[slot_id]['gamemap'] = Marshal.load(file)
  501.       @data[slot_id]['total_sec'] = @data[slot_id]['frame'] / Graphics.frame_rate
  502.       @data[slot_id]['map_name'] = get_mapname(@data[slot_id]['gamemap'].map_id)
  503.       file.close
  504.     else
  505.       @exist_list[slot_id] = false
  506.       @data[slot_id] = -1
  507.     end
  508.   end
  509.  
  510.   def make_filename(file_index)
  511.     return SAVE_PATH + SAVE_FILE_NAME.gsub(/\{ID\}/i) { (file_index).to_s }
  512.   end
  513.  
  514.   def file_exist?(slot_id)
  515.     return @exist_list[slot_id] if !@exist_list[slot_id].nil?
  516.     @exist_list[slot_id] = FileTest.exist?(make_filename(slot_id))
  517.     return @exist_list[slot_id]
  518.   end
  519.  
  520.   def get_mapname(map_id)
  521.     if @map_data.nil?
  522.       @map_data = load_data("Data/MapInfos.rvdata")
  523.     end
  524.     if @map_name[map_id].nil?
  525.       if MAP_NO_NAME_LIST.include?(map_id)
  526.         @map_name[map_id] = MAP_NO_NAME_NAME
  527.       else
  528.         @map_name[map_id] = @map_data[map_id].name
  529.         MAP_NAME_TEXT_SUB.each_index do |i|
  530.           @map_name[map_id].sub!(MAP_NAME_TEXT_SUB[i], '')
  531.         end
  532.       end
  533.     end
  534.     return @map_name[map_id]
  535.   end
  536.  
  537.   def create_tilemap(map_data, ox, oy)
  538.     @viewport = Viewport.new(self.x + 2 + 16, self.y + 32 + 16, 348,156)
  539.     @viewport.z = self.z
  540.     @tilemap = Tilemap.new(@viewport)
  541.     @tilemap.bitmaps[0] = Cache.system("TileA1")
  542.     @tilemap.bitmaps[1] = Cache.system("TileA2")
  543.     @tilemap.bitmaps[2] = Cache.system("TileA3")
  544.     @tilemap.bitmaps[3] = Cache.system("TileA4")
  545.     @tilemap.bitmaps[4] = Cache.system("TileA5")
  546.     @tilemap.bitmaps[5] = Cache.system("TileB")
  547.     @tilemap.bitmaps[6] = Cache.system("TileC")
  548.     @tilemap.bitmaps[7] = Cache.system("TileD")
  549.     @tilemap.bitmaps[8] = Cache.system("TileE")
  550.     @tilemap.map_data = map_data
  551.     @tilemap.ox = ox / 8 + 99
  552.     @tilemap.oy = oy / 8 + 90
  553.   end
  554.  
  555.   def dispose_tilemap
  556.     unless @tilemap.nil?
  557.       @tilemap.dispose
  558.       @tilemap = nil
  559.     end
  560.   end
  561. end
  562.  
  563. class Scene_Title < Scene_Base
  564.   def check_continue
  565.     file_name = Wora_NSS::SAVE_PATH + Wora_NSS::SAVE_FILE_NAME.gsub(/\{ID\}/i) { '*' }
  566.     @continue_enabled = (Dir.glob(file_name).size > 0)
  567.   end
  568. end
  569.  
  570. ################################################################################
  571. class Scene_Menu < Scene_Base
  572.   #save when exiting menu
  573.   alias auto_save_bulletxt_update_command_selection update_command_selection
  574.   def update_command_selection    
  575.     if Input.trigger?(Input::B)
  576.       Auto_Save.new if $game_switches[SAVE_AFTER_CLOSING_MENU] == false
  577.     end
  578.     auto_save_bulletxt_update_command_selection
  579.   end
  580. end
  581.  
  582. class Scene_Battle < Scene_Base
  583.   #save after winning a battle
  584.   alias auto_save_bulletxt_process_victory process_victory
  585.   def process_victory
  586.     auto_save_bulletxt_process_victory
  587.     Auto_Save.new if $BTEST == false && $game_switches[SAVE_AFTER_WINNING_BATTLE] == false
  588.   end
  589. end
  590.  
  591.  
  592.  
  593. class Scene_Map < Scene_Base
  594.   #save on map transfer
  595.   alias auto_save_bulletxt_update_transfer_player  update_transfer_player
  596.   def update_transfer_player
  597.     return unless $game_player.transfer?
  598.     auto_save_bulletxt_update_transfer_player
  599.     Auto_Save.new if $game_switches[SAVE_ON_MAP_TRANSFER] == false
  600.   end
  601. end
  602.  
  603. #======================================================================
  604. # END - NEO SAVE SYSTEM by Woratana
  605. #======================================================================
Advertisement
Add Comment
Please, Sign In to add comment