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.

Window_Savefile error! [RESOLVED]

When I playtest my game I've been working on for hours and hours and hours and hours and hours and hours and hours and hours and hours, and I try to save the game, this pops up. I've replace the whole script file with the one from two different games, both just started in RMXP and nothing edited.

http://i38.tinypic.com/2wnohar.jpg[/img]

Please help!
 
It's nearly impossible to help you if you don't tell us the scripts you are using. Also this should be in RGSS Support.

Anything you might've done before you playtested the game that one time? Try backtracking, maybe you accidentally messed with something. But like I said, pretty hard unless you tell us what other scripts you have.

Unless you're not using any other scripts? Which would be really weird.
 
That is really weird then...you are absolutely sure you didn't mess with a savefile or anything like that? No scripts meddled with?

Right now I can't think of anything...maybe someone with more scripting expertise? Try posting your "Window_SaveFile" script here, I just want to check something.
 
Code:
#==============================================================================
# ** Window_SaveFile
#------------------------------------------------------------------------------
#  This window displays save files on the save and load screens.
#==============================================================================

class Window_SaveFile < Window_Base
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :filename                 # file name
  attr_reader   :selected                 # selected
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     file_index : save file index (0-3)
  #     filename   : file name
  #--------------------------------------------------------------------------
  def initialize(file_index, filename)
    super(0, 64 + file_index % 4 * 104, 640, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.rxdata"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@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)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
    @selected = false
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    # Draw file number
    self.contents.font.color = normal_color
    name = "File#{@file_index + 1}"
    self.contents.draw_text(4, 0, 600, 32, name)
    @name_width = contents.text_size(name).width
    # If save file exists
    if @file_exist
      # Draw character
      for i in 0...@characters.size
        bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
        cw = bitmap.rect.width / 4
        ch = bitmap.rect.height / 4
        src_rect = Rect.new(0, 0, cw, ch)
        x = 300 - @characters.size * 32 + i * 64 - cw / 2
        self.contents.blt(x, 68 - ch, bitmap, src_rect)
      end
      # Draw play time
      hour = @total_sec / 60 / 60
      min = @total_sec / 60 % 60
      sec = @total_sec % 60
      time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 8, 600, 32, time_string, 2)
      # Draw timestamp
      self.contents.font.color = normal_color
      time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
      self.contents.draw_text(4, 40, 600, 32, time_string, 2)
    end
  end
  #--------------------------------------------------------------------------
  # * Set Selected
  #     selected : new selected (true = selected, false = unselected)
  #--------------------------------------------------------------------------
  def selected=(selected)
    @selected = selected
    update_cursor_rect
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @selected
      self.cursor_rect.set(0, 0, @name_width + 8, 32)
    else
      self.cursor_rect.empty
    end
  end
end

There's my savefile script... It pops up every time, and I have replaced the Scripts.rxdata to Scripts.rxdata from a new project. :shades:
 
Huh. I am at a loss. I've checked over the whole script, and it seems to be the exact same as mine. This is a weird error. You didn't happen to have RMXP open while you restarted the computer? I heard that doing that can mess up the whole game. Only other things that I can think of is you're either using Postality Knights, started in PK and switched over to XP, or restarted while RMXP was open. If it isn't any of these then I'm sorry but I can't help you.

I think you could get some help if you reported this to a moderator to get this moved over to RGSS/RGSS2 support.
 
The thing that baffles me is that there seems to be no mention whatsoever of that class/module. Are there any current savefiles in your folder? If so, try deleting them and then try again. There might be something weird in one of the savefiles that's causing it to figuratively crap itself when it tries to access the data
 

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