Metroid386
Member
I recently added text to the Save/Load menu that displays the name of the main actor and the name of the area they are in:
This code works for saving... but when I return (via F12) to the title screen and choose continue: every thing works fine...
BUT when I exit and reload the game... the continue on the menu does not work...
I get an error that says, "undefined method 'map_id' for nil class."
I am very perplexed by this...
Code:
class Window_SaveFile < Window_Base
def initialize(file_index, 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)
   @game_self_switches = Marshal.load(file)
   @game_screen = Marshal.load(file)
   @game_actors = Marshal.load(file)
   @game_party = Marshal.load(file)
   @game_map = Marshal.load(file)
   @total_sec = @frame_count / Graphics.frame_rate
   file.close
  end
...
end
...
def refresh
...
if @file_exist
  # Draw Actor Name
  self.contents.draw_text(60, 0, 600, 32, @game_party.actors[0].name)
  # Draw Map Name
  self.contents.draw_text(10, 32, 600, 32, $data_map_names.parent($game_map.map_id))
...
This code works for saving... but when I return (via F12) to the title screen and choose continue: every thing works fine...
BUT when I exit and reload the game... the continue on the menu does not work...
I get an error that says, "undefined method 'map_id' for nil class."
I am very perplexed by this...