Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Loading Errors...>_>

Juuhou

Sponsor

For some reason, whenever I add a script with a Marshal.Load file, I get an error. I believe if I deleted the load files, it would really ruin the game in one aspect. I have no custom save system except a save add-on being a save prompt but besides that, nothing. I just keep getting the error when I load the game. ((Ive already tried deleting the save file, restarting it...saving another file and loading that one but still there is a problem.)) I was wondering if placements of the scripts could be a reason why Im getting these errors or if there is some way to get around it through a loophole or something. Just in case anyone was wondering, the scripts Im having trouble with is the load file in Trickster's CBS and Seph's Party changer. Like if I delete the marshal.load in Trickster's CBS, I get a marshal.load error in the party changer. T_T I hope someone can help. :|
 

Juuhou

Sponsor

Eh? It doesnt modify the load at all though. Then again, it does have some marshal.dump files that maybe I should add on to using the variables Im getting errors with. =/ I dunno. But here is the script none-the less.

Code:
#First parts in scene file

class Scene_Save < Scene_File
# -----------------------------
  def initialize
    super("Save in which slot?")
    @confirm_window = Window_Base.new(120, 188, 400, 64)
    @confirm_window.contents = Bitmap.new(368, 32)
    string = "Really overwrite this file?"
    @confirm_window.contents.draw_text(4, 0, 368, 32, string)
    @yes_no_window = Window_Command.new(100, ["Yes", "No"])
    @confirm_window.visible = false
    @confirm_window.z = 1500
    @yes_no_window.visible = false
    @yes_no_window.active = false
    @yes_no_window.index = 1
    @yes_no_window.x = 270
    @yes_no_window.y = 252
    @yes_no_window.z = 1500
    @mode = 0
  end
# -----------------------------
  def on_decision(filename)
    if FileTest.exist?(filename)
      @confirm_window.visible = true
      @yes_no_window.visible = true
      @yes_no_window.active = true
      @mode = 1
    else
      $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(0)
    end
  end
# -----------------------------
  def update
    if @mode == 0
      super
    else
      @help_window.update
      @yes_no_window.update
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        if @yes_no_window.index == 0
          filename = make_filename(@file_index)
          $game_system.se_play($data_system.save_se)
          file = File.open(filename, "wb")
          write_save_data(file)
          file.close
          @confirm_window.dispose
          @yes_no_window.dispose
          if $game_temp.save_calling
            $game_temp.save_calling = false
            $scene = Scene_Map.new
          else
            $scene = Scene_Menu.new(0)
          end
        else
          @confirm_window.visible = false
          @yes_no_window.visible = false
          @yes_no_window.active = false
          @yes_no_window.index = 1
          @mode = 0
        end
      end
      if Input.trigger?(Input::B)
        @confirm_window.visible = false
        @yes_no_window.visible = false
        @yes_no_window.active = false
        @yes_no_window.index = 1
        @mode = 0
      return
    end
  end
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(0)
  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
 

Juuhou

Sponsor

Its after, near the very bottom but still over main. Ive already tried deleting this script and saving and loading but it still didnt work. Hence, thats not the source or error.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top