QuesTMajoR 4 Report post Posted February 16, 2014 Do you have one? Plug and Play ..The auto-save script that saves everytime the map location is changing .. :) Thank you .. Share this post Link to post Share on other sites
Marked 197 Report post Posted February 16, 2014 http://www.gdunlimited.net/search?q=auto+save+script+for+rmxp Are you looking for a script that backs up your game's data? Or an in-game auto save system? Share this post Link to post Share on other sites
black mage 28 Report post Posted February 16, 2014 (edited) Here's my version. I recomend you to check Mark's link for a better one, but incase you just need a simpler one, then take mine :) #============================================================================== # Autosave by Black Mage #------------------------------------------------------------------------------ # This class performs save screen processing. #============================================================================== class Auto_Save def initialize end def main on_decision("Save1.rxdata") Graphics.freeze $scene = Scene_Map.new end #-------------------------------------------------------------------------- # * Decision Processing #-------------------------------------------------------------------------- def on_decision(filename) file = File.open(filename, "wb") write_save_data(file) file.close end #-------------------------------------------------------------------------- # * Write Save Data # file : write file object (opened) #-------------------------------------------------------------------------- def write_save_data(file) # Make character data for drawing save file characters = [] for i in 0...$game_party.actors.size actor = $game_party.actors[i] characters.push([actor.character_name, actor.character_hue]) end # Write character data for drawing save file Marshal.dump(characters, file) # Wrire frame count for measuring play time Marshal.dump(Graphics.frame_count, file) # Increase save count by 1 $game_system.save_count += 1 # Save magic number # (A random value will be written each time saving with editor) $game_system.magic_number = $data_system.magic_number # Write each type of game object Marshal.dump($game_system, file) Marshal.dump($game_switches, file) Marshal.dump($game_variables, file) Marshal.dump($game_self_switches, file) Marshal.dump($game_screen, file) Marshal.dump($game_actors, file) Marshal.dump($game_party, file) Marshal.dump($game_troop, file) Marshal.dump($game_map, file) Marshal.dump($game_player, file) end end This script will automaticaly save your game to the first slot, so yeah, it'll only work on a game that using 1 save file. $scene = Auto_Save.new Put this on script call everytime you change the map location to autosave the game. Edited February 16, 2014 by black mage Share this post Link to post Share on other sites
Saltome 16 Report post Posted February 16, 2014 (edited) Let me make it a wee bit more convenient. I took Lizzie's autosave script and made it to automatically save whenever the player leaves the map. This way you won't have to use any annoying calls to make it work. =beginI. Introduction.II. Instructions.III. Additional information.I. Introduction.This script adds autosaves in your game, additionally it saves the gameautomatically every time the player leaves the map.II. Instructions.To install this script place it below all default scripts and above main.Give the scripters their due credit in your game.Visit the website specified bellow for help.III. Additional information.Website: gdunlimited.netOriginal script: LizzieModded by: SaltomeScript revision: 2=endclass Game_Mapalias old_setup setupdef setup(map_id)old_setup(map_id)Autosave.saveendendmodule Autosavedef self.savefilename = make_filename(0)file = File.open(filename, "wb")write_save_data(file)file.closeenddef self.write_save_data(file)# Make character data for drawing save filecharacters = []for i in 0...$game_party.actors.sizeactor = $game_party.actorscharacters.push([actor.character_name, actor.character_hue])end# Write character data for drawing save fileMarshal.dump(characters, file)# Wrire frame count for measuring play timeMarshal.dump(Graphics.frame_count, file)# Increase save count by 1$game_system.save_count += 1# Save magic number# (A random value will be written each time saving with editor)$game_system.magic_number = $data_system.magic_number# Write each type of game objectMarshal.dump($game_system, file)Marshal.dump($game_switches, file)Marshal.dump($game_variables, file)Marshal.dump($game_self_switches, file)Marshal.dump($game_screen, file)Marshal.dump($game_actors, file)Marshal.dump($game_party, file)Marshal.dump($game_troop, file)Marshal.dump($game_map, file)Marshal.dump($game_player, file)enddef self.make_filename(file_index)return "Save#{file_index + 1}.rxdata"endendclass Window_SaveFile < Window_Basedef refreshself.contents.clearself.contents.font.color = normal_colorif @file_index == 0name = "Autosave"if $scene.is_a?(Scene_Save)self.contents.font.color = disabled_colorendelsename = "File #{@file_index}"self.contents.font.color = normal_colorendself.contents.draw_text(4, 0, 600, 32, name)@name_width = contents.text_size(name).widthif @file_existfor i in 0...@characters.sizebitmap = RPG::Cache.character(@characters[0], @characters[1])cw = bitmap.rect.width / 4ch = bitmap.rect.height / 4src_rect = Rect.new(0, 0, cw, ch)x = 300 - @characters.size * 32 + i * 64 - cw / 2self.contents.blt(x, 68 - ch, bitmap, src_rect)endhour = @total_sec / 60 / 60min = @total_sec / 60 % 60sec = @total_sec % 60time_string = sprintf("%02d:%02d:%02d", hour, min, sec)self.contents.font.color = normal_colorself.contents.draw_text(4, 8, 600, 32, time_string, 2)self.contents.font.color = normal_colortime_string = @time_stamp.strftime("%Y/%m/%d %H:%M")self.contents.draw_text(4, 40, 600, 32, time_string, 2)endendendclass Scene_Save < Scene_Filealias lizzie_autosave_ss_ondec on_decisiondef on_decision(filename)if filename.include?("Save1.rxdata")$game_system.se_play($data_system.buzzer_se)returnendlizzie_autosave_ss_ondec(filename)endend Edited February 16, 2014 by Saltome Share this post Link to post Share on other sites
QuesTMajoR 4 Report post Posted February 18, 2014 Let me make it a wee bit more convenient. I took Lizzie's autosave script and made it to automatically save whenever the player leaves the map. This way you won't have to use any annoying calls to make it work. =begin I. Introduction. II. Instructions. III. Additional information. I. Introduction. This script adds autosaves in your game, additionally it saves the game automatically every time the player leaves the map. II. Instructions. To install this script place it below all default scripts and above main. Give the scripters their due credit in your game. Visit the website specified bellow for help. III. Additional information. Website: gdunlimited.net Original script: Lizzie Modded by: Saltome Script revision: 2 =end class Game_Map alias old_setup setup def setup(map_id) old_setup(map_id) Autosave.save end end module Autosave def self.save filename = make_filename(0) file = File.open(filename, "wb") write_save_data(file) file.close end def self.write_save_data(file) # Make character data for drawing save file characters = [] for i in 0...$game_party.actors.size actor = $game_party.actors characters.push([actor.character_name, actor.character_hue]) end # Write character data for drawing save file Marshal.dump(characters, file) # Wrire frame count for measuring play time Marshal.dump(Graphics.frame_count, file) # Increase save count by 1 $game_system.save_count += 1 # Save magic number # (A random value will be written each time saving with editor) $game_system.magic_number = $data_system.magic_number # Write each type of game object Marshal.dump($game_system, file) Marshal.dump($game_switches, file) Marshal.dump($game_variables, file) Marshal.dump($game_self_switches, file) Marshal.dump($game_screen, file) Marshal.dump($game_actors, file) Marshal.dump($game_party, file) Marshal.dump($game_troop, file) Marshal.dump($game_map, file) Marshal.dump($game_player, file) end def self.make_filename(file_index) return "Save#{file_index + 1}.rxdata" end end class Window_SaveFile < Window_Base def refresh self.contents.clear self.contents.font.color = normal_color if @file_index == 0 name = "Autosave" if $scene.is_a?(Scene_Save) self.contents.font.color = disabled_color end else name = "File #{@file_index}" self.contents.font.color = normal_color end self.contents.draw_text(4, 0, 600, 32, name) @name_width = contents.text_size(name).width if @file_exist for i in 0...@characters.size bitmap = RPG::Cache.character(@characters[0], @characters[1]) cw = bitmap.rect.width / 4 ch = bitmap.rect.height / 4 src_rect = Rect.new(0, 0, cw, ch) x = 300 - @characters.size * 32 + i * 64 - cw / 2 self.contents.blt(x, 68 - ch, bitmap, src_rect) end hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 time_string = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = normal_color self.contents.draw_text(4, 8, 600, 32, time_string, 2) self.contents.font.color = normal_color time_string = @time_stamp.strftime("%Y/%m/%d %H:%M") self.contents.draw_text(4, 40, 600, 32, time_string, 2) end end end class Scene_Save < Scene_File alias lizzie_autosave_ss_ondec on_decision def on_decision(filename) if filename.include?("Save1.rxdata") $game_system.se_play($data_system.buzzer_se) return end lizzie_autosave_ss_ondec(filename) end end Thanks for this! :)) close the topic now .. It's through ! Share this post Link to post Share on other sites
Bigace360 38 Report post Posted February 18, 2014 Thanks for this! :)) close the topic now .. It's through ! Cool! :ok: Closing! Share this post Link to post Share on other sites