Polraudio 122 Report post Posted May 29, 2008 This script allows you to have up to 399,999,996 save files. You get to pick your own number so you have your own 4 save slots and no one else can see them unless they know your number The demo is your best bet so don't ask questions till you try the demo its easier to follow #--------------------- # Personal Save Files # By: Polraudio # Version: 1.0 #--------------------- =begin #---------------------------------------------------- Features: - Allows you to have up to 399,999,996 save files - Replaces the title with the player start map Instructions: This script will bring you straight to the start map For loading/Saving please put an input number before Opening the load or save menu. To open the load menu use this into a call script "$scene = Scene_Load.new" Without quotes Contact: If you have any questions or comments you can find me at www.rmxpunlimited.net(Best Method) Or email me polraudio@gmail.com #---------------------------------------------------- =end #---------------------------------------- # Replace the "1" with the variable you # would like to use for the slot numbers $var = 1 #---------------------------------------- class Window_SaveFile < Window_Base attr_reader :filename attr_reader :selected def initialize(file_index, filename) super(0, 64 + file_index % 4 * 104, 640, 104) self.contents = Bitmap.new(width - 32, height - 32) @file_index = file_index @filename = "Save#{@file_index + 1}." + $game_variables[$var].to_s @time_stamp = Time.at(0) @file_exist = FileTest.exist?(@filename) if @file_exist file = File.open(@filename, "r") @time_stamp = file.mtime @characters = Marshal.load(file) @frame_count = Marshal.load(file) @game_system = Marshal.load(file) @game_switches = Marshal.load(file) @game_variables = Marshal.load(file) @total_sec = @frame_count / Graphics.frame_rate file.close end refresh @selected = false end def refresh self.contents.clear self.contents.font.color = normal_color name = "Record #{@file_index + 1}" 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[i][0], @characters[i][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 def selected=(selected) @selected = selected update_cursor_rect end def update_cursor_rect if @selected self.cursor_rect.set(0, 0, @name_width + 8, 32) else self.cursor_rect.empty end end end class Scene_File def initialize(help_text) @help_text = help_text end def main @help_window = Window_Help.new @help_window.set_text(@help_text) @savefile_windows = [] for i in 0..3 @savefile_windows.push(Window_SaveFile.new(i, make_filename(i))) end @file_index = $game_temp.last_file_index @savefile_windows[@file_index].selected = true Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @help_window.dispose for i in @savefile_windows i.dispose end end def update @help_window.update for i in @savefile_windows i.update end if Input.trigger?(Input::C) on_decision(make_filename(@file_index)) $game_temp.last_file_index = @file_index return end if Input.trigger?(Input::B) on_cancel return end if Input.repeat?(Input::DOWN) if Input.trigger?(Input::DOWN) or @file_index < 3 $game_system.se_play($data_system.cursor_se) @savefile_windows[@file_index].selected = false @file_index = (@file_index + 1) % 4 @savefile_windows[@file_index].selected = true return end end if Input.repeat?(Input::UP) if Input.trigger?(Input::UP) or @file_index > 0 $game_system.se_play($data_system.cursor_se) @savefile_windows[@file_index].selected = false @file_index = (@file_index + 3) % 4 @savefile_windows[@file_index].selected = true return end end end def make_filename(file_index) return "Save#{file_index + 1}." + $game_variables[$var].to_s end end class Scene_Save < Scene_File def initialize super("Which file would you like to save to?") end def on_decision(filename) $game_system.se_play($data_system.save_se) file = File.open(filename, "wb") write_save_data(file) file.close if $game_temp.save_calling $game_temp.save_calling = false $scene = Scene_Map.new return end $scene = Scene_Menu.new(4) end def on_cancel $game_system.se_play($data_system.cancel_se) if $game_temp.save_calling $game_temp.save_calling = false $scene = Scene_Map.new return end $scene = Scene_Menu.new(4) end def write_save_data(file) characters = [] for i in 0...$game_party.actors.size actor = $game_party.actors[i] characters.push([actor.character_name, actor.character_hue]) end Marshal.dump(characters, file) Marshal.dump(Graphics.frame_count, file) $game_system.save_count += 1 $game_system.magic_number = $data_system.magic_number 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 class Scene_Load < Scene_File def initialize $game_temp = Game_Temp.new $game_temp.last_file_index = 0 latest_time = Time.at(0) for i in 0..3 filename = make_filename(i) if FileTest.exist?(filename) file = File.open(filename, "r") if file.mtime > latest_time latest_time = file.mtime $game_temp.last_file_index = i end file.close end end super("Which file would you like to load?") end def on_decision(filename) unless FileTest.exist?(filename) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.load_se) file = File.open(filename, "rb") read_save_data(file) file.close $game_system.bgm_play($game_system.playing_bgm) $game_system.bgs_play($game_system.playing_bgs) $game_map.update $scene = Scene_Map.new end def on_cancel $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new end def read_save_data(file) characters = Marshal.load(file) Graphics.frame_count = Marshal.load(file) $game_system = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = Marshal.load(file) $game_screen = Marshal.load(file) $game_actors = Marshal.load(file) $game_party = Marshal.load(file) $game_troop = Marshal.load(file) $game_map = Marshal.load(file) $game_player = Marshal.load(file) if $game_system.magic_number != $data_system.magic_number $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end $game_party.refresh end end class Scene_Title def main if $BTEST battle_test return end $data_actors = load_data("Data/Actors.rxdata") $data_classes = load_data("Data/Classes.rxdata") $data_skills = load_data("Data/Skills.rxdata") $data_items = load_data("Data/Items.rxdata") $data_weapons = load_data("Data/Weapons.rxdata") $data_armors = load_data("Data/Armors.rxdata") $data_enemies = load_data("Data/Enemies.rxdata") $data_troops = load_data("Data/Troops.rxdata") $data_states = load_data("Data/States.rxdata") $data_animations = load_data("Data/Animations.rxdata") $data_tilesets = load_data("Data/Tilesets.rxdata") $data_common_events = load_data("Data/CommonEvents.rxdata") $data_system = load_data("Data/System.rxdata") $game_system = Game_System.new $game_system.bgm_play($data_system.title_bgm) Audio.bgm_stop Graphics.frame_count = 0 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new $game_party.setup_starting_members $game_map.setup($data_system.start_map_id) $game_player.moveto($data_system.start_x, $data_system.start_y) $game_player.refresh $game_map.autoplay $game_map.update $scene = Scene_Map.new Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end end def update end def battle_test $data_actors = load_data("Data/BT_Actors.rxdata") $data_classes = load_data("Data/BT_Classes.rxdata") $data_skills = load_data("Data/BT_Skills.rxdata") $data_items = load_data("Data/BT_Items.rxdata") $data_weapons = load_data("Data/BT_Weapons.rxdata") $data_armors = load_data("Data/BT_Armors.rxdata") $data_enemies = load_data("Data/BT_Enemies.rxdata") $data_troops = load_data("Data/BT_Troops.rxdata") $data_states = load_data("Data/BT_States.rxdata") $data_animations = load_data("Data/BT_Animations.rxdata") $data_tilesets = load_data("Data/BT_Tilesets.rxdata") $data_common_events = load_data("Data/BT_CommonEvents.rxdata") $data_system = load_data("Data/BT_System.rxdata") Graphics.frame_count = 0 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new $game_party.setup_battle_test_members $game_temp.battle_troop_id = $data_system.test_troop_id $game_temp.battle_can_escape = true $game_map.battleback_name = $data_system.battleback_name $game_system.se_play($data_system.battle_start_se) $game_system.bgm_play($game_system.battle_bgm) $scene = Scene_Battle.new end end Demo Share this post Link to post Share on other sites
RMXPirate 0 Report post Posted June 1, 2008 Wow that is a really huge amount of save slots!! May I ask why would you need it lol? Great script though!! Share this post Link to post Share on other sites
Rose Skye 0 Report post Posted June 1, 2008 That'd fock up someones hard drive if they actually have enough time and dedication to use them all. Share this post Link to post Share on other sites
Wyzrd 12 Report post Posted June 1, 2008 That is one of the most ridiculous things I've ever heard. No one needs that many save spots. Share this post Link to post Share on other sites
Polraudio 122 Report post Posted June 2, 2008 The only reason i made it is. I hate when someone comes over my house and plays a RMXP game and overwrights my files. so this way people can have there own 4 personal save slots. Its nice if you want a place where you can store your files without people knowing your number If you can find a way to get the variables past 99999999 you could have more than 399 million save files Share this post Link to post Share on other sites
Raxus 0 Report post Posted June 6, 2008 I can't tell you how disapointed I am! I wanted the 300 million! You lied to me! All of you! :P Just kidding, Nice script. I wouldn't want 300 millin or what ever but, I'm still going to save it, just in case. ;) § Raxus § Share this post Link to post Share on other sites