RPG Maker Forums

Good day everyone!

I am having a heck of a time making custom variables and hashes (for scripts I've made) initiated upon beginning the game, saved, and then extracted properly. Thanks to help I received, I was able to figure out where to begin, but now I'm getting an error that I haven't been able to figure out how to fix myself.

This is the error I receive.

It only happens when including the line $lureobjects = contents[:lureobj] when extracting the save contents. The variable $lure_food isn't exactly the same as when I supposedly save it upon continuing the game, but it still serves its purpose so I won't worry about that at the moment.

Here is how the script currently looks:
Code:
  #--------------------------------------------------------------------------
  # * Create Game Objects
  #-------------------------------------------------------------------------- 
  def self.create_game_objects
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_timer         = Game_Timer.new
    $game_message       = Game_Message.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.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
    
    #MY OBJECTS (NO ERROR)
    #==========
    $lureobjects        = { }
    $lure_food          = "food"
    $event_to_erase     = 0
  end
 
  #--------------------------------------------------------------------------
  # * Create Save Contents
  #--------------------------------------------------------------------------
  def self.make_save_contents
    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[:party]         = $game_party
    contents[:troop]         = $game_troop
    contents[:map]           = $game_map
    contents[:player]        = $game_player
    
    #MY OBJECTS (NO ERROR)
    #==========
    contents[:lureobj]       = $lureobjects
    contents[:lurefood]      = $lure_food
    contents[:event2erase]   = $event_to_erase
    #----------
    contents
  end
 
  #--------------------------------------------------------------------------
  # * Extract Save Contents
  #--------------------------------------------------------------------------
  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[:party]
    $game_troop         = contents[:troop]
    $game_map           = contents[:map]
    $game_player        = contents[:player]
    
    #MY OBJECTS
    #==========   
    $lureobjects        = contents[:lureobj] #(CAUSES ERROR)
    $lure_food          = contents[:lurefood] #(NO ERROR)
    $event_to_erase     = contents[:event2erase] #(NO ERROR)
  end

I've got a lead on something about a "marshal dump" and I have heard about marshal dump in regards to RPGMVXA before, but I have not yet dealt with it myself. I'm still researching.

Thank you for your time!

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,472
Members
137,822
Latest member
madelbylz
Top