Paramecium Save Extensions
This is a small script that allows multiple other scripts to change what the game does upon saving, loading, and starting a new game without interfering with one-another. For example, a script could use this to make the game save and load a global variable defined in that script and to initialize it when a new game is started.
Script
Usage
To extend what the game does when starting a new game, add a new Proc to SaveExtensions::New_Game_Procs.
To extend what the game does when saving a game, add a new Proc that takes an argument consisting of the data that will be saved to SaveExtensions::Save_Procs.
To extend what the game does when loading a game, add a new Proc that takes an argument consisting of the data that was loaded to SaveExtensions::Load_Procs.
Used In
Paramecium Core
This is a small script that allows multiple other scripts to change what the game does upon saving, loading, and starting a new game without interfering with one-another. For example, a script could use this to make the game save and load a global variable defined in that script and to initialize it when a new game is started.
Script
($imported||={})["Paramecium Save Extensions"] = truemodule SaveExtensions New_Game_Procs = [] Save_Procs = [] Load_Procs = []endmodule DataManager def self.setup_new_game create_game_objects $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 Graphics.frame_count = 0 SaveExtensions::New_Game_Procs.each{|fn| fn.call() } end def self.make_save_contents contents = {} SaveExtensions::Save_Procs.each{|fn| fn.call(contents) } contents[:system] = $game_system contents[:timer] = $game_timer contents[:message] = $game_message contents[:switches] = $game_switches contents[:variables] = $game_variables contents[:self_switches] = $game_self_switches contents[:actors] = $game_actors contents[😛arty] = $game_party contents[:troop] = $game_troop contents[:map] = $game_map contents[😛layer] = $game_player contents end def self.extract_save_contents(contents) $game_system = contents[:system] $game_timer = contents[:timer] $game_message = contents[:message] $game_switches = contents[:switches] $game_variables = contents[:variables] $game_self_switches = contents[:self_switches] $game_actors = contents[:actors] $game_party = contents[😛arty] $game_troop = contents[:troop] $game_map = contents[:map] $game_player = contents[😛layer] SaveExtensions::Load_Procs.each{|fn| fn.call(contents) } endend
To extend what the game does when starting a new game, add a new Proc to SaveExtensions::New_Game_Procs.
To extend what the game does when saving a game, add a new Proc that takes an argument consisting of the data that will be saved to SaveExtensions::Save_Procs.
To extend what the game does when loading a game, add a new Proc that takes an argument consisting of the data that was loaded to SaveExtensions::Load_Procs.
Used In
Paramecium Core