I am currently making a a fast travel/world map script and I am having a problem. I can't seem to "save" a certain command status when I save and exit the game. Meaning whenever I unlock "Map 1" via a script call, "Map 1" appears in my World Map, but when I save and exit and continue playing once again, it is not there anymore. I have done edits on DataManager as well but it does not seem to save the data, here is the script:
#==============================================================================#------------------------------------------------------------------------------# *** HSBX World Map# ** Author: Verheffen# ** Version: 0.0.1-pre-alpha#------------------------------------------------------------------------------$imported = {} if $imported.nil?#==============================================================================module HSBX module World_Map #========================================================================== #//////////////////////////// EDITABLE REGION ///////////////////////////// # World Map Settings WORLD_MAP = Cache.picture("WorldMap") MAP_COMMAND_VISIBLE = true # World Map Locations Locations = { :thilonde => ["Thilonde", true, 2, 8, 8 ], :elegiond => ["Elegiond", true, 2, 4, 8 ], :hargothrien => ["Hargothrien", true, 2, 6, 9], :tiressea => ["Tiressea", false, 2, 8, 8], :edheverand => ["Edhevrand", false, 2, 8, 9], } #////////////////////////// END EDITABLE REGION /////////////////////////// #========================================================================== endend#==============================================================================# ** Scene_WorldMap#------------------------------------------------------------------------------# Handles World Map scene#==============================================================================class Scene_WorldMap < Scene_Base include HSBX::World_Map #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start super() create_background create_map_command create_map_header create_map_desc end #-------------------------------------------------------------------------- # * Post-Start Processing #-------------------------------------------------------------------------- def post_start super() end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super() SceneManager.return if Input.trigger?🙂 end #-------------------------------------------------------------------------- # * Pre-Termination Processing #-------------------------------------------------------------------------- def pre_terminate super() end #-------------------------------------------------------------------------- # * Termination Processing #-------------------------------------------------------------------------- def terminate super() dispose_background dispose_map_command dispose_map_header dispose_map_desc end #-------------------------------------------------------------------------- # * Create Background #-------------------------------------------------------------------------- def create_background @background_sprite = Sprite.new @background_sprite.bitmap = WORLD_MAP end #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_map_command @map_command_window = Window_MapCommand.new(Graphics.width - 160, 48) @map_command_window.visible = true #MAP_COMMAND_VISIBLE Locations.each_key do |key| @map_command_window.set_handler(key, method🙂test_map)) end end def test_map p(@map_command_window.current_symbol) @map_command_window.activate end #-------------------------------------------------------------------------- # * Create World Map Header #-------------------------------------------------------------------------- def create_map_header @map_header = Window_MapHeader.new @map_header.x = Graphics.width - 160 @map_header.y = 0 @map_header.set_text("Locations:") end #-------------------------------------------------------------------------- # * Create Map Desc #-------------------------------------------------------------------------- def create_map_desc @map_desc = Window_MapDesc.new @map_desc.x = 0 @map_desc.y = 0 @map_desc.openness = 255 end #-------------------------------------------------------------------------- # * Free Background #-------------------------------------------------------------------------- def dispose_background @background_sprite.dispose end #-------------------------------------------------------------------------- # * Free Map Command #-------------------------------------------------------------------------- def dispose_map_command @map_command_window.dispose unless @map_command_window.disposed? end #-------------------------------------------------------------------------- # * Free World Map Header #-------------------------------------------------------------------------- def dispose_map_header @map_header.dispose unless @map_header.disposed? end #-------------------------------------------------------------------------- # * Free Map Desc #-------------------------------------------------------------------------- def dispose_map_desc @map_desc.dispose unless @map_desc.disposed? endend#==============================================================================# ** Window_MapCommand#------------------------------------------------------------------------------# Window that contains the selectable locations.#==============================================================================class Window_MapCommand < Window_Command include HSBX::World_Map #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return 160 end #-------------------------------------------------------------------------- # * Get Window Height #-------------------------------------------------------------------------- def window_height return Graphics.height - fitting_height(1) end #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- def make_command_list Locations.each_key do |key| next unless Locations[key][1] add_command(Locations[key][0], key) end endend#==============================================================================# ** Window_MapDesc#------------------------------------------------------------------------------# Window that contains the location description.#==============================================================================class Window_MapDesc < Window_Message include HSBX::World_Map #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return Graphics.width - 160 end #-------------------------------------------------------------------------- # * Get Window Height #-------------------------------------------------------------------------- def window_height return Graphics.height end #-------------------------------------------------------------------------- # * Draw Desc Text #-------------------------------------------------------------------------- def draw_text_desc(text) contents.clear draw_text_ex(0, 0, text) end #-------------------------------------------------------------------------- # * Wait After Output of One Character #-------------------------------------------------------------------------- def wait_for_one_character endend#==============================================================================# ** Window_MapHeader#------------------------------------------------------------------------------# This window shows skill and item explanations along with actor status.#==============================================================================class Window_MapHeader < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(line_number = 1) super(0, 0, Graphics.width, fitting_height(line_number)) end #-------------------------------------------------------------------------- # * Set Text #-------------------------------------------------------------------------- def set_text(text) if text != @text @text = text refresh end end #-------------------------------------------------------------------------- # * Clear #-------------------------------------------------------------------------- def clear set_text("") end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh contents.clear draw_text_ex(4, 0, @text) endend#==============================================================================# ** World_Map#------------------------------------------------------------------------------# This class performs World Map crap.#==============================================================================class World_Map include HSBX::World_Map # Enable Map def map_enable(symbol) Locations[symbol][1] = true endend#==============================================================================#------------------------------------------------------------------------------# *** Aliases and Sensitive Overwrites#------------------------------------------------------------------------------#==============================================================================#==============================================================================# ** Scene_Map#------------------------------------------------------------------------------# This class performs the map screen processing.#==============================================================================class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- alias :hsbx_worldmap_scenemap_update :update #-------------------------------------------------------------------------- def update hsbx_worldmap_scenemap_update update_world_map end #-------------------------------------------------------------------------- # * Update World Map #-------------------------------------------------------------------------- def update_world_map call_world_map if Input.trigger?🙂L) end #-------------------------------------------------------------------------- # * Call world map #-------------------------------------------------------------------------- def call_world_map SceneManager.call(Scene_WorldMap) end end#==============================================================================# ** DataManager#------------------------------------------------------------------------------# This module manages the database and game objects. Almost all of the # global variables used by the game are initialized by this module.#==============================================================================module DataManager #------------------------------------------------------------------------- # * Aliases #------------------------------------------------------------------------- class << self alias :hsbx_worldmap_datamanager_creategameobjects :create_game_objects alias :hsbx_worldmap_datamanager_makesavecontents :make_save_contents alias :hsbx_worldmap_datamanager_extractsavecontents :extract_save_contents end #-------------------------------------------------------------------------- # * Create Game Objects #-------------------------------------------------------------------------- def self.create_game_objects hsbx_worldmap_datamanager_creategameobjects() $world_map = World_Map.new end #-------------------------------------------------------------------------- # * Create Save Contents #-------------------------------------------------------------------------- def self.make_save_contents contents = hsbx_worldmap_datamanager_makesavecontents contents[:worldmap] = $world_map contents end #-------------------------------------------------------------------------- # * Extract Save Contents #-------------------------------------------------------------------------- def self.extract_save_contents(contents) hsbx_worldmap_datamanager_extractsavecontents(contents) $world_map = contents[:worldmap] endend
#==============================================================================#------------------------------------------------------------------------------# *** HSBX World Map# ** Author: Verheffen# ** Version: 0.0.1-pre-alpha#------------------------------------------------------------------------------$imported = {} if $imported.nil?#==============================================================================module HSBX module World_Map #========================================================================== #//////////////////////////// EDITABLE REGION ///////////////////////////// # World Map Settings WORLD_MAP = Cache.picture("WorldMap") MAP_COMMAND_VISIBLE = true # World Map Locations Locations = { :thilonde => ["Thilonde", true, 2, 8, 8 ], :elegiond => ["Elegiond", true, 2, 4, 8 ], :hargothrien => ["Hargothrien", true, 2, 6, 9], :tiressea => ["Tiressea", false, 2, 8, 8], :edheverand => ["Edhevrand", false, 2, 8, 9], } #////////////////////////// END EDITABLE REGION /////////////////////////// #========================================================================== endend#==============================================================================# ** Scene_WorldMap#------------------------------------------------------------------------------# Handles World Map scene#==============================================================================class Scene_WorldMap < Scene_Base include HSBX::World_Map #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start super() create_background create_map_command create_map_header create_map_desc end #-------------------------------------------------------------------------- # * Post-Start Processing #-------------------------------------------------------------------------- def post_start super() end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super() SceneManager.return if Input.trigger?🙂 end #-------------------------------------------------------------------------- # * Pre-Termination Processing #-------------------------------------------------------------------------- def pre_terminate super() end #-------------------------------------------------------------------------- # * Termination Processing #-------------------------------------------------------------------------- def terminate super() dispose_background dispose_map_command dispose_map_header dispose_map_desc end #-------------------------------------------------------------------------- # * Create Background #-------------------------------------------------------------------------- def create_background @background_sprite = Sprite.new @background_sprite.bitmap = WORLD_MAP end #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_map_command @map_command_window = Window_MapCommand.new(Graphics.width - 160, 48) @map_command_window.visible = true #MAP_COMMAND_VISIBLE Locations.each_key do |key| @map_command_window.set_handler(key, method🙂test_map)) end end def test_map p(@map_command_window.current_symbol) @map_command_window.activate end #-------------------------------------------------------------------------- # * Create World Map Header #-------------------------------------------------------------------------- def create_map_header @map_header = Window_MapHeader.new @map_header.x = Graphics.width - 160 @map_header.y = 0 @map_header.set_text("Locations:") end #-------------------------------------------------------------------------- # * Create Map Desc #-------------------------------------------------------------------------- def create_map_desc @map_desc = Window_MapDesc.new @map_desc.x = 0 @map_desc.y = 0 @map_desc.openness = 255 end #-------------------------------------------------------------------------- # * Free Background #-------------------------------------------------------------------------- def dispose_background @background_sprite.dispose end #-------------------------------------------------------------------------- # * Free Map Command #-------------------------------------------------------------------------- def dispose_map_command @map_command_window.dispose unless @map_command_window.disposed? end #-------------------------------------------------------------------------- # * Free World Map Header #-------------------------------------------------------------------------- def dispose_map_header @map_header.dispose unless @map_header.disposed? end #-------------------------------------------------------------------------- # * Free Map Desc #-------------------------------------------------------------------------- def dispose_map_desc @map_desc.dispose unless @map_desc.disposed? endend#==============================================================================# ** Window_MapCommand#------------------------------------------------------------------------------# Window that contains the selectable locations.#==============================================================================class Window_MapCommand < Window_Command include HSBX::World_Map #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return 160 end #-------------------------------------------------------------------------- # * Get Window Height #-------------------------------------------------------------------------- def window_height return Graphics.height - fitting_height(1) end #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- def make_command_list Locations.each_key do |key| next unless Locations[key][1] add_command(Locations[key][0], key) end endend#==============================================================================# ** Window_MapDesc#------------------------------------------------------------------------------# Window that contains the location description.#==============================================================================class Window_MapDesc < Window_Message include HSBX::World_Map #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return Graphics.width - 160 end #-------------------------------------------------------------------------- # * Get Window Height #-------------------------------------------------------------------------- def window_height return Graphics.height end #-------------------------------------------------------------------------- # * Draw Desc Text #-------------------------------------------------------------------------- def draw_text_desc(text) contents.clear draw_text_ex(0, 0, text) end #-------------------------------------------------------------------------- # * Wait After Output of One Character #-------------------------------------------------------------------------- def wait_for_one_character endend#==============================================================================# ** Window_MapHeader#------------------------------------------------------------------------------# This window shows skill and item explanations along with actor status.#==============================================================================class Window_MapHeader < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(line_number = 1) super(0, 0, Graphics.width, fitting_height(line_number)) end #-------------------------------------------------------------------------- # * Set Text #-------------------------------------------------------------------------- def set_text(text) if text != @text @text = text refresh end end #-------------------------------------------------------------------------- # * Clear #-------------------------------------------------------------------------- def clear set_text("") end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh contents.clear draw_text_ex(4, 0, @text) endend#==============================================================================# ** World_Map#------------------------------------------------------------------------------# This class performs World Map crap.#==============================================================================class World_Map include HSBX::World_Map # Enable Map def map_enable(symbol) Locations[symbol][1] = true endend#==============================================================================#------------------------------------------------------------------------------# *** Aliases and Sensitive Overwrites#------------------------------------------------------------------------------#==============================================================================#==============================================================================# ** Scene_Map#------------------------------------------------------------------------------# This class performs the map screen processing.#==============================================================================class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- alias :hsbx_worldmap_scenemap_update :update #-------------------------------------------------------------------------- def update hsbx_worldmap_scenemap_update update_world_map end #-------------------------------------------------------------------------- # * Update World Map #-------------------------------------------------------------------------- def update_world_map call_world_map if Input.trigger?🙂L) end #-------------------------------------------------------------------------- # * Call world map #-------------------------------------------------------------------------- def call_world_map SceneManager.call(Scene_WorldMap) end end#==============================================================================# ** DataManager#------------------------------------------------------------------------------# This module manages the database and game objects. Almost all of the # global variables used by the game are initialized by this module.#==============================================================================module DataManager #------------------------------------------------------------------------- # * Aliases #------------------------------------------------------------------------- class << self alias :hsbx_worldmap_datamanager_creategameobjects :create_game_objects alias :hsbx_worldmap_datamanager_makesavecontents :make_save_contents alias :hsbx_worldmap_datamanager_extractsavecontents :extract_save_contents end #-------------------------------------------------------------------------- # * Create Game Objects #-------------------------------------------------------------------------- def self.create_game_objects hsbx_worldmap_datamanager_creategameobjects() $world_map = World_Map.new end #-------------------------------------------------------------------------- # * Create Save Contents #-------------------------------------------------------------------------- def self.make_save_contents contents = hsbx_worldmap_datamanager_makesavecontents contents[:worldmap] = $world_map contents end #-------------------------------------------------------------------------- # * Extract Save Contents #-------------------------------------------------------------------------- def self.extract_save_contents(contents) hsbx_worldmap_datamanager_extractsavecontents(contents) $world_map = contents[:worldmap] endend