Yet another...base error *weeps silently*

Go down

Yet another...base error *weeps silently*

Post by Peva on Fri Jul 30, 2010 1:10 am

So, I was testing my game. I was in a map, and and event occured that caused a game over. I selected "Resume" using my continue script. Here that is.

Code:

#==============================================================================
# ** Game Over Enhanced
#------------------------------------------------------------------------------
# Author  : puppeto4 (puppeto5@hotmail.com)
# Version : 1.1 revision 1
# Date    : 06 / 06 / 2008
# Note    : Order Pizza Hut, support the rebellion.
# Check RPG RPG Revolution(http://www.rpgrevolution.com) for support
#------------------------------------------------------------------------------
# Function : 
#  This script will enable the player to resume the game or return to title
#  from GameOver screen. When resume option is choosen, the game will
#  automatically load the newest saved game file. Resume option won't
#  show if there is no save file available.This script is best used with
#  my force save script ^^.
#==============================================================================
#==============================================================================
# ** GameOverEnhanced : Configuration
#==============================================================================
#==============================================================================
# ** Puppeto
#------------------------------------------------------------------------------
#  This module handles setup for any script writen by me ^^.
#==============================================================================

module Puppeto
#==============================================================================
# ** GameOver
#------------------------------------------------------------------------------
#  This module handles setup for the game over enhanced script.
#==============================================================================
 
module GameOver
  # Resume text
  Resume_Text = "Resume"
  # Return to title screen text
  Return_To_Title_Text = "Return To Title"
  # Path + Filename for GameOver transition.
  GameOver_Transition = "Graphics/System/Restart"
#==============================================================================
# ** End of GameOver module
#------------------------------------------------------------------------------   
end
#==============================================================================
# ** End of Puppeto module
#------------------------------------------------------------------------------
end 
#==============================================================================
# ** End of GameOverEnhanced : Configuration
#==============================================================================
#==============================================================================
# ** GameOverEnhanced : Script
#------------------------------------------------------------------------------
# ** Class Alias
#==============================================================================
#----------------------------------------------------------------------------
# * Aliased Class(es) : Scene_File, Scene_Gameover, Game_Interpreter
#----------------------------------------------------------------------------
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This class performs the save and load screen processing.
#==============================================================================
#----------------------------------------------------------------------------
# * Aliased Method(s) : main
# * New Method(s)    : resume_load 
#----------------------------------------------------------------------------

class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  # If @new_stack is empty
  if @new_stack.nil?
    # Aliasing main method; hidden method(to avoid SystemStackError)
    alias puppet_resume_main main
    # Set @new_stack to true
    @new_stack = true
  end 
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    if $RESUME                        # If resume
      resume_load                    # Call resume_load method
    else                              # If normal play
      puppet_resume_main              # Usual main processing
    end
  end
  #--------------------------------------------------------------------------
  # * Load From Game Over Screen
  #--------------------------------------------------------------------------
  def resume_load
    # Call start method
    start
    # Set @index to the latest file index
    @index = self.latest_file_index
    # Loading sound
    #Sound.play_load
    # Call do_load method
    do_load
    # Set $RESUME to false to prevent looping
    $RESUME = false
    # Call terminate method
   
    $game_map.setup($game_map.map_id)
    $scene = Scene_Map.new
    terminate
  end 
end
#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
#  This class performs game over screen processing.
#==============================================================================
#----------------------------------------------------------------------------
# * Aliased Method(s) : start, terminate
# * New Method(s)    : check_continue, create_command_window,
#                      dispose_command_window, open_command_window,
#                      close_command_window, command_gameover, resume_scene,
#                      perform_gameover_transition
#----------------------------------------------------------------------------

class Scene_Gameover < Scene_Base
  #--------------------------------------------------------------------------
  # * Include Puppeto::GameOver modules
  #-------------------------------------------------------------------------- 
  include Puppeto::GameOver
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias puppet_resume_start start
  alias puppet_resume_terminate terminate
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    # Check if save file exist or not
    check_continue
    # Create menu background
    create_menu_background
    # Create command window
    create_command_window
    # The usual
    puppet_resume_start
  end
  #--------------------------------------------------------------------------
  # * Post-Start Processing
  #--------------------------------------------------------------------------
  def post_start
    super
    # Call open_command_window method
    open_command_window
  end
  #--------------------------------------------------------------------------
  # * Pre-termination Processing
  #--------------------------------------------------------------------------
  def pre_terminate
    super
    # Call close_command_window method   
    close_command_window
  end 
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    # The usual
    puppet_resume_terminate
    # Dispose command window
    dispose_command_window
    # Dispose menu background
    dispose_menu_background
    # If next scene is Scene_File
    if $scene.is_a?(Scene_File)
      # Call perform_gameover_transition method
      perform_gameover_transition
    end 
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    # Update menu background
    update_menu_background
    # Update command window
    @command_window.update
    # If Input::C is triggered
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0 
        # If save file exist
        if @continue_enabled
          # Create [resume] command
          command_gameover(true)
        else
          # Create [to title] command
          command_gameover(false)
        end
        # Create [to title] command
      when 1;  command_gameover(false)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update Background for Menu Screen
  #--------------------------------------------------------------------------
  def update_menu_background
    super
    # Set tome for menuback_sprite
    @menuback_sprite.tone.set(0, 0, 0, 128) 
  end 
  #--------------------------------------------------------------------------
  # * Determine if Continue is Enabled
  #--------------------------------------------------------------------------
  def check_continue
    # Check the availablity of save file
    @continue_enabled = (Dir.glob('Save*.rvdata').size > 0)
  end 
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Resume_Text
    s2 = Return_To_Title_Text
    # If save file exist
    if @continue_enabled
      # Include s1 and s2 in the option
      @command_window = Window_Command.new(172, [s1, s2])
    else
      # Include s2 in the option
      @command_window = Window_Command.new(172, [s2])
    end 
    @command_window.x = (544 - @command_window.width) / 2
    @command_window.y = 288
    # Draw item with center alignment
    @command_window.draw_item(0,true, 1)
    @command_window.draw_item(1,true, 1)
    # Set openness to 0
    @command_window.openness = 0
    @command_window.open   
  end
  #--------------------------------------------------------------------------
  # * Dispose of Command Window
  #--------------------------------------------------------------------------
  def dispose_command_window
    @command_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Open Command Window
  #--------------------------------------------------------------------------
  def open_command_window
    @command_window.open
    begin
      @command_window.update
      Graphics.update
    end until @command_window.openness == 255
  end
  #--------------------------------------------------------------------------
  # * Close Command Window
  #--------------------------------------------------------------------------
  def close_command_window
    @command_window.close
    begin
      @command_window.update
      Graphics.update
    end until @command_window.openness == 0
  end
  #--------------------------------------------------------------------------
  # * Process When Choosing [Resume] or [To Title] Command
  #--------------------------------------------------------------------------
  def command_gameover(resume = false)
    # Set resume to @resume
    @resume = resume
    # Call resume_scene method
    resume_scene
    Sound.play_decision
    RPG::BGM.fade(800)
    RPG::BGS.fade(800)
    RPG::ME.fade(800)   
    close_command_window
  end 
  #--------------------------------------------------------------------------
  # * Resume Scene
  #--------------------------------------------------------------------------
  def resume_scene
    # If @resume is true
    if @resume
      # Go to Scene_File(load type)
      $scene = Scene_File.new(false, true, false)
      # Set $RESUME to true to enable Scene_File to initialize resume_load
      $RESUME = true
    else
      # Go to Scene_Title
      $scene = Scene_Title.new
      Graphics.fadeout(60)
    end
  end 
  #--------------------------------------------------------------------------
  # * Execute Pre-battle Transition
  #--------------------------------------------------------------------------
  def perform_gameover_transition
    @trans_name = GameOver_Transition
    Graphics.transition(80, @trans_name, 80)
    Graphics.freeze
  end 
end
#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
#  An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================
#----------------------------------------------------------------------------
# * Aliased Class(es) : command_353
#----------------------------------------------------------------------------

class Game_Interpreter
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias puppet_resume_command_353 command_353
  #--------------------------------------------------------------------------
  # * Game Over
  #--------------------------------------------------------------------------
  def command_353
    # The usual
    puppet_resume_command_353
    # Add 1 to @index
    @index += 1
  end
end
#==============================================================================
# ** End of Class Alias
#------------------------------------------------------------------------------
# ** Class Rewrite
#==============================================================================
#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================
#----------------------------------------------------------------------------
# * Rewrite Method(s) : draw_item(Adding alignment function)
#----------------------------------------------------------------------------

class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # * Draw Item
  #    index  : item number
  #    enabled : enabled flag. When false, draw semi-transparently.
  #    align  : alignment flag.
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true, align = 0)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    @align = align
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    if @align == 0
      self.contents.draw_text(rect, @commands[index])
    elsif @align == 1
      self.contents.draw_text(rect, @commands[index], 1)
    else
      self.contents.draw_text(rect, @commands[index], 2)
    end 
  end
end
#==============================================================================
# ** End of Class Rewrite
#------------------------------------------------------------------------------
# ** End of GameOverEnhanced : Script
#==============================================================================

Then I resumed in that map thanks to Autosave VX by BulletXT. Here that it.

Code:
=begin
                                  AutoSave VX
                                 
Author: BulleXt(bulletxt@gmail.com)
Version: 0.1
Date: 06/07/2009

Description:
This script by default will automatically save when you do a map transfer,
after winning a battle and after exiting menu.
You can also manually call an autosave inside an event by simply doing a
call script like this:
Auto_Save.new
The script doesn't disable normal saving system so player can still save on his
slots, he will not be able to overwrite the autosave slot.
The script also lets you set how many saving slots you want.
=end

#This is the autosave slot number
SAVE_NUMBER = 4

#this is the number of how many saving slots you want
NUMBER_OF_SAVE_SLOTS = 4

#This is an ID switch, if ON it disables the autosave on map transfer
SAVE_ON_MAP_TRANSFER = 0

#This is an ID switch, if ON it disables the autosave after winning a battle
SAVE_AFTER_WINNING_BATTLE = 0

#This is an ID switch, if ON it disables the autosave after closing Menu
SAVE_AFTER_CLOSING_MENU = 0

############################### END CONFIGURATION ##############################

SAVING_FILE = "Save" + SAVE_NUMBER.to_s() + ".rvdata"
SAVE_NUMBER = 1 if SAVE_NUMBER > NUMBER_OF_SAVE_SLOTS
SAVE_NUMBER = 1 if SAVE_NUMBER < 1

class Auto_Save < Scene_File
  def initialize
    do_save
  end
end



class Scene_File < Scene_Base
 
  alias auto_save_bulletxt_initialize initialize
  def initialize(saving, from_title, from_event)
    auto_save_bulletxt_initialize(saving, from_title, from_event)
    @saving_inside_menu = false
  end
 
  def start 
    super
    @file_max = NUMBER_OF_SAVE_SLOTS
    create_menu_background
    @help_window = Window_Help.new
    create_savefile_windows
    if @saving
      @index = $game_temp.last_file_index
      @help_window.set_text(Vocab::SaveMessage)
    else
      @index = self.latest_file_index
      @help_window.set_text(Vocab::LoadMessage)
    end
    @savefile_windows[@index].selected = true
    @page_file_max = ((416 - @help_window.height) / 90).truncate
    for i in 0...@file_max
      window = @savefile_windows[i]
      if @index > @page_file_max - 1
        if @index < @file_max - @page_file_max - 1
          @top_row = @index
          window.y -= @index * window.height
        elsif @index >= @file_max - @page_file_max
          @top_row = @file_max - @page_file_max
          window.y -= (@file_max - @page_file_max) * window.height
        else
          @top_row = @index
          window.y -= @index * window.height
        end
      end
      window.visible = (window.y >= @help_window.height and
      window.y < @help_window.height + @page_file_max * window.height)
    end
  end
 
  #create window slots
  def create_savefile_windows
    @top_row = 0
    @savefile_windows = []
    for i in 0..(NUMBER_OF_SAVE_SLOTS - 1)
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
    end
    @item_max = NUMBER_OF_SAVE_SLOTS
  end
 
  #handle going down
  def cursor_down(wrap)
    @file_max = NUMBER_OF_SAVE_SLOTS
    if @index < @file_max - 1 or wrap
      @index = (@index + 1) % @file_max
      for i in 0...@file_max
        window = @savefile_windows[i]
        if @index == 0
          @top_row = 0
          window.y = @help_window.height + i % @file_max * window.height
        elsif @index - @top_row > @page_file_max - 1
          window.y -= window.height
        end
        window.visible = (window.y >= @help_window.height and
          window.y < @help_window.height + @page_file_max * window.height)
      end
      if @index - @top_row > @page_file_max - 1
        @top_row += 1
      end
    end
  end
  #handle going up
  def cursor_up(wrap)
    @file_max = NUMBER_OF_SAVE_SLOTS
    if @index > 0 or wrap
      @index = (@index - 1 + @file_max) % @file_max
      for i in 0...@file_max
        window = @savefile_windows[i]
        if @index == @file_max - 1
          @top_row = @file_max - @page_file_max
          window.y = @help_window.height + i % @file_max * window.height
          window.y -= (@file_max - @page_file_max) * window.height
        elsif @index - @top_row < 0
          window.y += window.height
        end
        window.visible = (window.y >= @help_window.height and
          window.y < @help_window.height + @page_file_max * window.height)
      end
      if @index - @top_row < 0
        @top_row -= 1
      end
    end
  end
 
 
  alias auto_save_bulletxt_determine_savefile determine_savefile
  def determine_savefile
    #if true, player has selected autosave slot so he must not save
    if @savefile_windows[@index].filename == SAVING_FILE
      saving_not_allowed if @saving
      return  if @saving
    end
    #if here player can save
    @saving_inside_menu = true if @saving
    auto_save_bulletxt_determine_savefile
  end
 
  #window warning player can't save on auto save slot
  def saving_not_allowed
    Sound.play_buzzer
    b = Bitmap.new(340,60)
    b.draw_text(0, 20,340, 20, "You can't save on the Auto Save slot.")
    w = Window_Message.new
    w.contents = b
    w.width = 380
    w.height = 100
    w.visible = true
    w.openness = 255
    w.x = 100
    w.y = 180
    w.back_opacity = 255
    w.opacity = 255
    w.update
    Graphics.wait(180)
    b.dispose
    w.dispose
    w = nil
    b = nil
  end 

 
  def do_save
    #if true, player is saving from inside menu
    if @saving_inside_menu
      file = File.open(@savefile_windows[@index].filename, "wb")
    else
      #if here player has done a manual Auto_Save.new call from event
      file = File.open(SAVING_FILE, "wb")
    end
    write_save_data(file)
    file.close
    return_scene if @saving_inside_menu
    #$scene = Scene_Map.new if @saving_inside_menu == false
    @saving_inside_menu = false
  end
 
end



class Scene_Battle < Scene_Base
  #save after winning a battle
  alias auto_save_bulletxt_process_victory process_victory
  def process_victory
    auto_save_bulletxt_process_victory
    Auto_Save.new if $BTEST == false && $game_switches[SAVE_AFTER_WINNING_BATTLE] == false
  end
end



class Scene_Map < Scene_Base
  #save on map transfer
  alias auto_save_bulletxt_update_transfer_player  update_transfer_player
  def update_transfer_player
    return unless $game_player.transfer?
    auto_save_bulletxt_update_transfer_player
    Auto_Save.new if $game_switches[SAVE_ON_MAP_TRANSFER] == false
  end
end



class Scene_Menu < Scene_Base
  #save when exiting menu
  alias auto_save_bulletxt_update_command_selection update_command_selection
  def update_command_selection   
    if Input.trigger?(Input::B)
      Auto_Save.new if $game_switches[SAVE_AFTER_CLOSING_MENU] == false
    end
    auto_save_bulletxt_update_command_selection
  end
end


class Window_SaveFile < Window_Base

  def initialize(file_index, filename)
    super(0, 56 + file_index % NUMBER_OF_SAVE_SLOTS * 90, 544, 90)
    @file_index = file_index
    @filename = filename
    load_gamedata
    refresh
    @selected = false
  end
 
  #change autoslave slot string "File $n"
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    name = Vocab::File + " #{@file_index + 1}"  if @file_index != SAVE_NUMBER - 1
    self.contents.draw_text(4, 0, 200, WLH, name)
    @name_width = contents.text_size(name).width
    @autosaveslot = "Auto Save Slot"
    self.contents.draw_text(6, 0, 200, WLH, @autosaveslot) if @file_index == SAVE_NUMBER - 1
    if @file_exist
      draw_party_characters(152, 58)
      draw_playtime(0, 34, contents.width - 4, 2)
    end
  end
 
  #handle cursor width when going on autosave slot
 def update_cursor
    if @selected
      self.cursor_rect.set(0, 0, @name_width + 8, WLH)  if @file_index != SAVE_NUMBER - 1
      self.cursor_rect.set(0, 0, 140, WLH)  if @file_index == SAVE_NUMBER - 1
    else
      self.cursor_rect.empty
    end
  end

end

Then, I continued to play. However, when I reached a map transfer, I got this error...



That as well corrupted the save data. <_< So what should I do? I already got Yanfly core fixes and upgrades, but do I need to place that above all other scripts? Thanks in advance!


Last edited by Peva on Fri Jul 30, 2010 11:47 am; edited 2 times in total

__________________________________
New to OmegaDev? Read the OmegaDev Official Rules.

Peva
Spoiler:





Well, happy RMing Wink
avatar
Peva
Development Moderator
Development Moderator

Posts : 1281
Gald : 4414

Stats
Cookies: 0

View user profile

Back to top Go down

Re: Yet another...base error *weeps silently*

Post by Light on Fri Jul 30, 2010 7:31 am

I have never seen that i cant help sorry...
avatar
Light
Banned
Banned

Posts : 790
Gald : 2129

Stats
Cookies: 0

View user profile http://www.light.site11.com/

Back to top Go down

Re: Yet another...base error *weeps silently*

Post by mitchi.exe on Fri Jul 30, 2010 8:13 am

Have you tried refreshing your default scripts? Have you done something to them? Have you tried commenting out scripts one by one?
avatar
mitchi.exe
Resource Moderator
Resource Moderator

Posts : 409
Gald : 1920

Stats
Cookies: 10

View user profile

Back to top Go down

Re: Yet another...base error *weeps silently*

Post by HopeEsthiem on Fri Jul 30, 2010 8:31 am

We should get IMP1!!!
avatar
HopeEsthiem
Cookie Baker
Cookie Baker

Posts : 277
Gald : 776

Stats
Cookies: 0

View user profile

Back to top Go down

Re: Yet another...base error *weeps silently*

Post by Vectomon on Fri Jul 30, 2010 8:35 am

He's camping isn't he? Anyway, here's my scene_file, unedited and straight out of a new project:
Spoiler:
Code:
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This class performs the save and load screen processing.
#==============================================================================

class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    saving    : save flag (if false, load screen)
  #    from_title : flag: it was called from "Continue" on the title screen
  #    from_event : flag: it was called from the "Call Save Screen" event
  #--------------------------------------------------------------------------
  def initialize(saving, from_title, from_event)
    @saving = saving
    @from_title = from_title
    @from_event = from_event
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    @help_window = Window_Help.new
    create_savefile_windows
    if @saving
      @index = $game_temp.last_file_index
      @help_window.set_text(Vocab::SaveMessage)
    else
      @index = self.latest_file_index
      @help_window.set_text(Vocab::LoadMessage)
    end
    @savefile_windows[@index].selected = true
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @help_window.dispose
    dispose_item_windows
  end
  #--------------------------------------------------------------------------
  # * Return to Original Screen
  #--------------------------------------------------------------------------
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(4)
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @help_window.update
    update_savefile_windows
    update_savefile_selection
  end
  #--------------------------------------------------------------------------
  # * Create Save File Window
  #--------------------------------------------------------------------------
  def create_savefile_windows
    @savefile_windows = []
    for i in 0..3
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
    end
    @item_max = 4
  end
  #--------------------------------------------------------------------------
  # * Dispose of Save File Window
  #--------------------------------------------------------------------------
  def dispose_item_windows
    for window in @savefile_windows
      window.dispose
    end
  end
  #--------------------------------------------------------------------------
  # * Update Save File Window
  #--------------------------------------------------------------------------
  def update_savefile_windows
    for window in @savefile_windows
      window.update
    end
  end
  #--------------------------------------------------------------------------
  # * Update Save File Selection
  #--------------------------------------------------------------------------
  def update_savefile_selection
    if Input.trigger?(Input::C)
      determine_savefile
    elsif Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    else
      last_index = @index
      if Input.repeat?(Input::DOWN)
        cursor_down(Input.trigger?(Input::DOWN))
      end
      if Input.repeat?(Input::UP)
        cursor_up(Input.trigger?(Input::UP))
      end
      if @index != last_index
        Sound.play_cursor
        @savefile_windows[last_index].selected = false
        @savefile_windows[@index].selected = true
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Confirm Save File
  #--------------------------------------------------------------------------
  def determine_savefile
    if @saving
      Sound.play_save
      do_save
    else
      if @savefile_windows[@index].file_exist
        Sound.play_load
        do_load
      else
        Sound.play_buzzer
        return
      end
    end
    $game_temp.last_file_index = @index
  end
  #--------------------------------------------------------------------------
  # * Move cursor down
  #    wrap : Wraparound allowed
  #--------------------------------------------------------------------------
  def cursor_down(wrap)
    if @index < @item_max - 1 or wrap
      @index = (@index + 1) % @item_max
    end
  end
  #--------------------------------------------------------------------------
  # * Move cursor up
  #    wrap : Wraparound allowed
  #--------------------------------------------------------------------------
  def cursor_up(wrap)
    if @index > 0 or wrap
      @index = (@index - 1 + @item_max) % @item_max
    end
  end
  #--------------------------------------------------------------------------
  # * Create Filename
  #    file_index : save file index (0-3)
  #--------------------------------------------------------------------------
  def make_filename(file_index)
    return "Save#{file_index + 1}.rvdata"
  end
  #--------------------------------------------------------------------------
  # * Select File With Newest Timestamp
  #--------------------------------------------------------------------------
  def latest_file_index
    index = 0
    latest_time = Time.at(0)
    for i in 0...@savefile_windows.size
      if @savefile_windows[i].time_stamp > latest_time
        latest_time = @savefile_windows[i].time_stamp
        index = i
      end
    end
    return index
  end
  #--------------------------------------------------------------------------
  # * Execute Save
  #--------------------------------------------------------------------------
  def do_save
    file = File.open(@savefile_windows[@index].filename, "wb")
    write_save_data(file)
    file.close
    return_scene
  end
  #--------------------------------------------------------------------------
  # * Execute Load
  #--------------------------------------------------------------------------
  def do_load
    file = File.open(@savefile_windows[@index].filename, "rb")
    read_save_data(file)
    file.close
    $scene = Scene_Map.new
    RPG::BGM.fade(1500)
    Graphics.fadeout(60)
    Graphics.wait(40)
    @last_bgm.play
    @last_bgs.play
  end
  #--------------------------------------------------------------------------
  # * Write Save Data
  #    file : write file object (opened)
  #--------------------------------------------------------------------------
  def write_save_data(file)
    characters = []
    for actor in $game_party.members
      characters.push([actor.character_name, actor.character_index])
    end
    $game_system.save_count += 1
    $game_system.version_id = $data_system.version_id
    @last_bgm = RPG::BGM::last
    @last_bgs = RPG::BGS::last
    Marshal.dump(characters,          file)
    Marshal.dump(Graphics.frame_count, file)
    Marshal.dump(@last_bgm,            file)
    Marshal.dump(@last_bgs,            file)
    Marshal.dump($game_system,        file)
    Marshal.dump($game_message,        file)
    Marshal.dump($game_switches,      file)
    Marshal.dump($game_variables,      file)
    Marshal.dump($game_self_switches,  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
  #--------------------------------------------------------------------------
  # * Read Save Data
  #    file : file object for reading (opened)
  #--------------------------------------------------------------------------
  def read_save_data(file)
    characters          = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    @last_bgm            = Marshal.load(file)
    @last_bgs            = Marshal.load(file)
    $game_system        = Marshal.load(file)
    $game_message        = Marshal.load(file)
    $game_switches      = Marshal.load(file)
    $game_variables      = Marshal.load(file)
    $game_self_switches  = Marshal.load(file)
    $game_actors        = Marshal.load(file)
    $game_party          = Marshal.load(file)
    $game_troop          = Marshal.load(file)
    $game_map            = Marshal.load(file)
    $game_player        = Marshal.load(file)
    if $game_system.version_id != $data_system.version_id
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
  end
end

__________________________________

...if you know what I mean. Wink

Vectomon
Resource Moderator
Resource Moderator

Posts : 1029
Gald : 3025

Stats
Cookies: 0

View user profile

Back to top Go down

Re: Yet another...base error *weeps silently*

Post by mitchi.exe on Fri Jul 30, 2010 8:40 am

It's probably done by an old code syntax.
Some other scripts might affect it well...

Give us updates, Peva~
avatar
mitchi.exe
Resource Moderator
Resource Moderator

Posts : 409
Gald : 1920

Stats
Cookies: 10

View user profile

Back to top Go down

Re: Yet another...base error *weeps silently*

Post by Peva on Fri Jul 30, 2010 11:45 am

Ok, I never touched my scene file. But I'll update initial post.

__________________________________
New to OmegaDev? Read the OmegaDev Official Rules.

Peva
Spoiler:





Well, happy RMing Wink
avatar
Peva
Development Moderator
Development Moderator

Posts : 1281
Gald : 4414

Stats
Cookies: 0

View user profile

Back to top Go down

Re: Yet another...base error *weeps silently*

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum