Project1

标题: 存档出现脚本问题,求救~! [打印本页]

作者: bububinghe    时间: 2008-6-2 15:07
标题: 存档出现脚本问题,求救~!
脚本 'Window_SaveFile'的 30 行 发生了EOFError.
End of file reached


PS:30行是     @game_system = Marshal.load(file)
高手帮忙看看,有没有解救的方法啊?


下了个显示错误的脚本 上面提示:
◆ 2008-06-02 07:47:57
错误类型 :
        EOFError
错误信息 :
        End of file reached
错误可能发生的相关位置 :
        Window_SaveFile : 第 30 行 : load
        Window_SaveFile : 第 30 行 : initialize
        Scene_File : 第 25 行 : new
        Scene_File : 第 25 行 : main
        Scene_File : 第 24 行 : each
        Scene_File : 第 24 行 : main
         : 第 37 行 : run
         : 第 151 行
-------------66RPG-------------------


请高手指点迷津,感激不尽! [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: bububinghe    时间: 2008-6-2 15:29
还有其他错误,类型同上,有没有解决办法啊
作者: bububinghe    时间: 2008-6-2 16:03
别沉,高手们还没上线吗?在线等~~~~~ [LINE]1,#dddddd[/LINE]版主对此帖的评论:『先扣你連帖10分,再回答』,积分『-10』。这些被扣积分的一半会用于对本帖正确答案的悬赏。
作者: 禾西    时间: 2008-6-2 16:17
删掉所有的舊記錄重新存取。
作者: bububinghe    时间: 2008-6-2 16:21
删过了,一到那个角色仓库的地方就出问题了
class Interpreter
  #--------------------------------------------------------------------------
  # ● 角色的替换
  #--------------------------------------------------------------------------
  def command_129
    # 获取角色
    actor = $game_actors[@parameters[0]]
    # 角色有效的情况下
    if actor != nil
      # 操作分支
      if @parameters[1] == 0
        if @parameters[2] == 1
          $game_actors[@parameters[0]].setup(@parameters[0])
        end
        if $game_party.actors.size == 4
          $game_party.add_actor(@parameters[0],2)
        else
          $game_party.add_actor(@parameters[0])
        end
      else
        $game_party.remove_actor(@parameters[0],3)
      end
    end
    # 继续
    return true
  end
end
作者: bububinghe    时间: 2008-6-2 16:26
# 写入各种游戏对像
    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)

问题出在这里,就是在我加入了角色仓库以后出现的这个问题
作者: 禾西    时间: 2008-6-2 16:31
整個腳本貼出來看看...這個問題不止你一個遇見了。
作者: bububinghe    时间: 2008-6-2 16:40
好,麻烦你等一下
作者: bububinghe    时间: 2008-6-2 16:41

  1. 脚本一:人物仓库-chaos-修改
  2. #==============================================================================
  3. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  4. #==============================================================================

  5. #==============================================================================
  6. # ■ chaochao的人物仓库ver1.02正式版
  7. # 修改了Game_Party
  8. # 功能:
  9. # 用来存放角色的仓库……
  10. # 召唤画面用$scene = Chaochao_Scene_Party.new
  11. # 其它使用说明在代码里已经备注。
  12. #------------------------------------------------------------------------------
  13. # 作者:chaochao
  14. # http://zhuchao.go1.icpcn.com
  15. #==============================================================================
  16. class Chaochao_Window_PartyLeft < Window_Selectable
  17.   def initialize
  18.     super(0, 0, 320, 224)
  19.     self.contents = Bitmap.new(width - 32, height - 32)
  20.     self.index = 0
  21.     refresh
  22.   end
  23.   def actor
  24.     return @actors[self.index]
  25.   end
  26.   def refresh
  27.     if self.contents != nil
  28.       self.contents.dispose
  29.       self.contents = nil
  30.     end
  31.     @actors = []
  32.     for i in 0...$game_party.actors.size
  33.       @actors.push($game_party.actors[i])
  34.     end
  35.    
  36.     @item_max = 4
  37.     if @item_max > 0
  38.       self.contents = Bitmap.new(width - 32, (row_max+1) * 32)
  39.       for i in 0...@item_max
  40.         draw_item(i)
  41.       end
  42.     end
  43.   end
  44.   def draw_item(index)
  45.     if @actors[index] != nil
  46.       actor = @actors[index]
  47.       text = @actors[index].name
  48.       lv = @actors[index].level.to_s + " "
  49.       if $game_party.chaochao.include?(actor.id) or $game_party.actors.size <= 1
  50.         self.contents.font.color = Color.new(255, 0, 0) #不能被移动的颜色
  51.       else
  52.         self.contents.font.color = Color.new(0, 255, 0) #可以被移动的颜色
  53.       end
  54.       self.contents.draw_text(4, index * 32 + 32, 288, 32, text)
  55.       self.contents.font.color = normal_color
  56.       self.contents.font.size = 16
  57.       self.contents.draw_text(4, index * 32 + 36, 288, 32,  "Level:   ", 2)
  58.       colorx = [255.0000 - 255.0000/60 * @actors[index].level,0].max
  59.       colory = [255.0000 / 60 * @actors[index].level,255].min
  60.       self.contents.font.color = Color.new(colorx, colory, 0)
  61.       self.contents.draw_text(4, index * 32 + 36, 288, 32,  lv, 2)
  62.       self.contents.font.color = normal_color
  63.       self.contents.font.size = 22
  64.     else
  65.       self.contents.draw_text(4, index * 32 + 32, 288, 32,  "米有人物!")
  66.     end
  67.   end
  68.   def update_cursor_rect
  69.     if @index < 0
  70.       self.cursor_rect.empty
  71.       return
  72.     end
  73.     row = @index / @column_max
  74.     if row < self.top_row
  75.       self.top_row = row
  76.     end
  77.     if row > self.top_row + (self.page_row_max - 1)
  78.       self.top_row = row - (self.page_row_max - 1)
  79.     end
  80.     cursor_width = self.width / @column_max - 32
  81.     x = @index % @column_max * (cursor_width + 32)
  82.     y = @index / @column_max * 32 - self.oy + 32
  83.     self.cursor_rect.set(x, y, cursor_width, 32)
  84.   end
  85.   def item_max
  86.     return @item_max
  87.   end
  88.   def actor?(index)
  89.     return @actors[index] == nil ? false : true
  90.   end
  91.   def set_index(x)
  92.     @index = x
  93.   end
  94. end

  95. #------------------------------------------------------------------------------

  96. class Chaochao_Window_PartyRight < Window_Selectable
  97.   def initialize
  98.     super(320, 0, 320, 224)
  99.     self.contents = Bitmap.new(width - 32, height - 32)
  100.     self.index = -1
  101.     refresh
  102.   end
  103.   def actor
  104.     return @actors[self.index]
  105.   end
  106.   def refresh
  107.     if self.contents != nil
  108.       self.contents.dispose
  109.       self.contents = nil
  110.     end
  111.     @actors = []
  112.     for i in 0...$game_party.actors2.size
  113.       @actors.push($game_party.actors2[i])
  114.     end
  115.    
  116.     @item_max = $game_party.actors2.size
  117.     if @item_max > 0
  118.       self.contents = Bitmap.new(width - 32, row_max * 32)
  119.       for i in 0...@item_max
  120.         draw_item(i)
  121.       end
  122.     elsif @item_max == 0
  123.       
  124.     end
  125.   end
  126.   def draw_item(index)
  127.     actor = @actors[index]
  128.     text = @actors[index].name
  129.     lv = @actors[index].level.to_s + " "
  130.     if $game_party.chaochao2.include?(actor.id) or $game_party.actors.size >= 4
  131.         self.contents.font.color = Color.new(255, 0, 0) #不能被移动的颜色
  132.       else
  133.         self.contents.font.color = Color.new(0, 255, 0) #可以被移动的颜色
  134.       end
  135.     self.contents.draw_text(4, index * 32, 288, 32, text)
  136.     self.contents.font.color = normal_color
  137.     self.contents.font.size = 16
  138.     self.contents.draw_text(4, index * 32 + 4, 288, 32,  "Level:   ", 2)
  139.     colorx = [255.0000 - 255.0000/60 * @actors[index].level,0].max
  140.     colory = [255.0000 / 60 * @actors[index].level,255].min
  141.     self.contents.font.color = Color.new(colorx, colory, 0)
  142.     self.contents.draw_text(4, index * 32 + 4, 288, 32,  lv, 2)
  143.     self.contents.font.color = normal_color
  144.     self.contents.font.size = 22
  145.   end
  146.   def update_cursor_rect
  147.     if @index < 0
  148.       self.cursor_rect.empty
  149.       return
  150.     end
  151.     row = @index / @column_max
  152.     if row < self.top_row
  153.       self.top_row = row
  154.     end
  155.     if row > self.top_row + (self.page_row_max - 1)
  156.       self.top_row = row - (self.page_row_max - 1)
  157.     end
  158.     cursor_width = self.width / @column_max - 32
  159.     x = @index % @column_max * (cursor_width + 32)
  160.     y = @index / @column_max * 32 - self.oy
  161.     self.cursor_rect.set(x, y, cursor_width, 32)
  162.   end
  163.   def item_max
  164.     return @item_max
  165.   end
  166.   def actor?(index)
  167.     return @actors[index] == nil ? false : true
  168.   end
  169.   def set_index(x)
  170.     @index = x
  171.   end
  172. end

  173. #------------------------------------------------------------------------------

  174. class Chaochao_Window_PartyData < Window_Base
  175.   
  176.   def initialize
  177.     super(0, 224, 640, 256)
  178.     self.contents = Bitmap.new(width - 32, height - 32)
  179.     @actor = nil
  180.   end
  181.   
  182.   def set_actor(actor)
  183.     self.contents.clear
  184.     draw_actor_name(actor, 4, 0)
  185.     draw_actor_state(actor, 140, 0)
  186.     draw_actor_hp(actor, 284, 0)
  187.     draw_actor_sp(actor, 460, 0)
  188.     @actor = actor
  189.     self.visible = true
  190.   end
  191.   def clear
  192.     self.contents.clear
  193.   end
  194. end

  195. #------------------------------------------------------------------------------

  196. class Game_Party
  197.   attr_reader   :actors2
  198.   attr_reader   :chaochao#不能从队伍向备用角色移动的角色ID
  199.   attr_reader   :chaochao2#不能从备用角色向队伍移动的角色ID
  200.   def initialize
  201.     @actors = []
  202.     @gold = 0
  203.     @steps = 0
  204.     @items = {}
  205.     @weapons = {}
  206.     @armors = {}
  207.     @actors2 = []
  208.     @chaochao = []
  209.     @chaochao2 = []
  210.   end
  211.   def add_actor(actor_id,type=1)#type为1是向队伍中添加,为2则相反。
  212.     case type
  213.     when 1
  214.       if $game_actors[actor_id] != nil
  215.         actor = $game_actors[actor_id]
  216.         #如果队伍没有满和队伍中没有此角色
  217.         if @actors.size < 4 and not @actors.include?(actor) and not @actors2.include?(actor)
  218.           @actors.push(actor)
  219.           $game_player.refresh
  220.         end
  221.       end
  222.     when 2
  223.       if $game_actors[actor_id] != nil
  224.         actor = $game_actors[actor_id]
  225.         #如果角色不在队伍中和不在备用角色队伍中的情况下
  226.         #向备用角色中添加角色
  227.         if not @actors.include?(actor) and not @actors2.include?(actor)
  228.           @actors2.push(actor)
  229.           $game_player.refresh
  230.         end
  231.       end
  232.     end
  233.   end
  234.   
  235.   def huanren(index,type=1)#type为1是从备用角色向队伍中移动,为2则相反。
  236.     case type
  237.     when 1
  238.       id = @actors2[index].id
  239.       actor = $game_actors[id]
  240.       if @actors.size < 4  and not @chaochao2.include?(index) #and not @actors.include?(actor)
  241.         @actors.push(actor)
  242.         #@actors2.delete(actor)
  243.         @actors2.each do |i|
  244.           @actors2.delete(i) if i.id == actor.id
  245.         end
  246.         $game_system.se_play($data_system.decision_se)
  247.         $game_player.refresh
  248.       end
  249.     when 2
  250.       id = @actors[index].id
  251.       actor = $game_actors[id]
  252.       if actor != nil  and not @chaochao.include?(index)
  253.         @actors2.push(actor)
  254.         @actors.each do |i|
  255.           @actors.delete(i) if i.id == actor.id
  256.         end
  257.         $game_system.se_play($data_system.decision_se)
  258.         $game_player.refresh
  259.       end
  260.     end
  261.   end
  262.   
  263.   #type1,1是操作队伍中的角色能否向备用队伍移动,2则相反。
  264.   #type2,1是添加不能移动的,2是删除不能移动的。
  265.   def yidong(actor_id,type1,type2=1)
  266.     case type2
  267.     when 1
  268.       case type1
  269.       when 1
  270.         @chaochao.push(actor_id)
  271.       when 2
  272.         @chaochao2.push(actor_id)
  273.       end
  274.     when 2
  275.       case type1
  276.       when 1
  277.         @chaochao.delete(actor_id)
  278.       when 2
  279.         @chaochao2.delete(actor_id)
  280.       end
  281.     end
  282.   end
  283.   
  284.   #type,1从队伍中离开,2从备用角色中离开,3从队伍和备用角色中离开。
  285.   def remove_actor(actor_id,type=1)
  286.     actor = $game_actors[actor_id]
  287.     case type
  288.     when 1
  289.       @actors.delete(actor)
  290.       $game_player.refresh
  291.     when 2
  292.       @actors2.delete(actor)
  293.       $game_player.refresh
  294.     when 3
  295.       @actors.delete(actor)
  296.       @actors2.delete(actor)
  297.       $game_player.refresh
  298.     end
  299.   end
  300.   
  301.   def refresh
  302.     new_actors = []
  303.     new_actors2 = []
  304.     for i in [email protected]
  305.       if $game_actors[@actors[i].id] != nil
  306.         new_actors.push($game_actors[@actors[i].id])
  307.       end
  308.     end
  309.     @actors = new_actors
  310.     for i in [email protected]
  311.       if $game_actors[@actors2[i].id] != nil
  312.         new_actors2.push($game_actors[@actors2[i].id])
  313.       end
  314.     end
  315.     @actors2 = new_actors2
  316.   end
  317. end

  318. #------------------------------------------------------------------------------

  319. class Chaochao_Scene_Party
  320.   def main
  321.     @left_temp_command = 0
  322.     @right_temp_command = 0
  323.     @temp = 0
  324.     @left_window = Chaochao_Window_PartyLeft.new
  325.     @left_window.active = true
  326.     @right_window = Chaochao_Window_PartyRight.new
  327.     @right_window.active = false
  328.     @data_window = Chaochao_Window_PartyData.new
  329.     update_data
  330.     Graphics.transition
  331.     loop do
  332.       Graphics.update
  333.       Input.update
  334.       update
  335.       if $scene != self
  336.         break
  337.       end
  338.     end
  339.     Graphics.freeze
  340.     @left_window.dispose
  341.     @right_window.dispose
  342.     @data_window.dispose
  343.   end
  344.   
  345.   def update
  346.     @left_window.update
  347.     @right_window.update
  348.     @data_window.update
  349.     update_command
  350.     update_data
  351.   end
  352.   
  353.   def update_command
  354.     if Input.trigger?(Input::B)
  355.       $game_system.se_play($data_system.cancel_se)
  356.       #画面切换
  357.       $scene = Scene_Map.new
  358.       return
  359.     end
  360.     if @left_window.active
  361.       update_left
  362.       return
  363.     end
  364.     if @right_window.active
  365.       update_right
  366.       return
  367.     end
  368.   end
  369.   
  370.   def update_left
  371.     if Input.trigger?(Input::RIGHT)
  372.       if @right_window.item_max > 0
  373.         @left_temp_command = @left_window.index
  374.         @left_window.set_index(-1)
  375.         $game_system.se_play($data_system.cursor_se)
  376.         @left_window.active = false
  377.         @right_window.active = true
  378.         @left_window.refresh
  379.         @right_window.refresh
  380.         @right_window.set_index(@right_temp_command)
  381.         return
  382.       else
  383.         $game_system.se_play($data_system.buzzer_se)
  384.         return
  385.       end
  386.     end
  387.     if Input.trigger?(Input::C)
  388.       if @left_window.active and @left_window.actor?(@left_window.index) and $game_party.actors.size > 1 and not $game_party.chaochao.include?($game_party.actors[@left_window.index].id)
  389.         $game_party.huanren(@left_window.index,2)#type为1是从备用角色向队伍中移动,为2则相反。
  390.         @left_window.refresh
  391.         @right_window.refresh
  392.       else
  393.         $game_system.se_play($data_system.buzzer_se)
  394.       end
  395.     end
  396.     return
  397.   end
  398.   
  399.   def update_right
  400.     if Input.trigger?(Input::LEFT)
  401.       if @left_window.item_max > 0
  402.         @right_temp_command = @right_window.index
  403.         @right_window.set_index(-1)
  404.         $game_system.se_play($data_system.cursor_se)
  405.         @left_window.active = true
  406.         @right_window.active = false
  407.         @left_window.refresh
  408.         @right_window.refresh
  409.         @left_window.set_index(@left_temp_command)
  410.         return
  411.       else
  412.         $game_system.se_play($data_system.buzzer_se)
  413.         return
  414.       end
  415.     end
  416.     if Input.trigger?(Input::C)
  417.       if $game_party.actors.size >= 4
  418.         $game_system.se_play($data_system.buzzer_se)
  419.         return
  420.       end
  421.       if @right_window.active and @right_window.actor?(@right_window.index) and not $game_party.chaochao2.include?($game_party.actors2[@right_window.index].id)
  422.         $game_party.huanren(@right_window.index,1)#type为1是从备用角色向队伍中移动,为2则相反。
  423.         if $game_party.actors2.size == 0
  424.           @right_temp_command = @right_window.index
  425.           @right_window.set_index(-1)
  426.           $game_system.se_play($data_system.cursor_se)
  427.           @left_window.active = true
  428.           @right_window.active = false
  429.           @left_window.refresh
  430.           @right_window.refresh
  431.           @left_window.set_index(@left_temp_command)
  432.         end
  433.         if @right_window.index > 0
  434.           @right_window.set_index(@right_window.index-1)
  435.         end
  436.         @left_window.refresh
  437.         @right_window.refresh
  438.       else
  439.         $game_system.se_play($data_system.buzzer_se)
  440.       end
  441.     end
  442.     return
  443.   end
  444.   
  445.   def update_data
  446.     if @left_window.active
  447.       if $game_party.actors[@left_window.index] != nil
  448.         @data_window.set_actor($game_party.actors[@left_window.index])
  449.       else
  450.         @data_window.clear
  451.       end
  452.       return
  453.     end
  454.     if @right_window.active
  455.       if $game_party.actors2[@right_window.index] != nil
  456.         @data_window.set_actor($game_party.actors2[@right_window.index])
  457.       else
  458.         @data_window.clear
  459.       end
  460.       return
  461.     end
  462.   end
  463. end

  464. #==============================================================================
  465. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  466. #==============================================================================


  467. #==============================================================================
  468. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  469. #==============================================================================


  470. 脚本2:人物仓库插件

  471. #==============================================================================
  472. # ■ Interpreter (分割定义 4)
  473. #------------------------------------------------------------------------------
  474. #  执行事件命令的解释器。本类在 Game_System 类
  475. # 和 Game_Event 类的内部使用。
  476. #==============================================================================
  477. class Interpreter
  478.   #--------------------------------------------------------------------------
  479.   # ● 角色的替换
  480.   #--------------------------------------------------------------------------
  481.   def command_129
  482.     # 获取角色
  483.     actor = $game_actors[@parameters[0]]
  484.     # 角色有效的情况下
  485.     if actor != nil
  486.       # 操作分支
  487.       if @parameters[1] == 0
  488.         if @parameters[2] == 1
  489.           $game_actors[@parameters[0]].setup(@parameters[0])
  490.         end
  491.         if $game_party.actors.size == 4
  492.           $game_party.add_actor(@parameters[0],2)
  493.         else
  494.           $game_party.add_actor(@parameters[0])
  495.         end
  496.       else
  497.         $game_party.remove_actor(@parameters[0],3)
  498.       end
  499.     end
  500.     # 继续
  501.     return true
  502.   end
  503. end

  504. #==============================================================================
  505. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  506. #==============================================================================
复制代码
我的基础脚本是轩辕美化脚本

上面那部分是:人物仓库-chaos-修改
下面那部分是:人物仓库插件
作者: bububinghe    时间: 2008-6-2 16:50
在线持续等......直到绝望
作者: 禾西    时间: 2008-6-2 16:55
我比較想看看出錯的位置,也就是 Window_SaveFile
另外,你的「連帖行爲」讓我很不爽。善用編輯功能
作者: bububinghe    时间: 2008-6-2 17:03


  1. #==============================================================================
  2. # ■ Window_SaveFile
  3. #------------------------------------------------------------------------------
  4. #  显示存档以及读档画面、保存文件的窗口。
  5. #==============================================================================

  6. class Window_SaveFile < Window_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 定义实例变量
  9.   #--------------------------------------------------------------------------
  10.   attr_reader   :filename                 # 文件名
  11.   attr_reader   :selected                 # 选择状态
  12.   #--------------------------------------------------------------------------
  13.   # ● 初始化对像
  14.   #     file_index : 存档文件的索引 (0~3)
  15.   #     filename   : 文件名
  16.   #--------------------------------------------------------------------------
  17.   def initialize(file_index, filename)
  18.     super(0, 64 + file_index % 4 * 104, 640, 104)
  19.     self.contents = Bitmap.new(width - 32, height - 32)
  20.     @file_index = file_index
  21.     @filename = "Save#{@file_index + 1}.rxdata"
  22.     @time_stamp = Time.at(0)
  23.     @file_exist = FileTest.exist?(@filename)
  24.     if @file_exist
  25.       file = File.open(@filename, "r")
  26.       @time_stamp = file.mtime
  27.       @characters = Marshal.load(file)
  28.       @frame_count = Marshal.load(file)
  29.       @game_system = Marshal.load(file)
  30.       @game_switches = Marshal.load(file)
  31.       @game_variables = Marshal.load(file)
  32.       @total_sec = @frame_count / Graphics.frame_rate
  33.       file.close
  34.     end
  35.     refresh
  36.     @selected = false
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ● 刷新
  40.   #--------------------------------------------------------------------------
  41.   def refresh
  42.     self.contents.clear
  43.     # 描绘文件编号
  44.     self.contents.font.color = normal_color
  45.     name = "文件 #{@file_index + 1}"
  46.     self.contents.draw_text(4, 0, 600, 32, name)
  47.     @name_width = contents.text_size(name).width
  48.     # 存档文件存在的情况下
  49.     if @file_exist
  50.       # 描绘角色
  51.       for i in [email protected]
  52.          bitmap = RPG::Cache.character(@characters[i][0] + "_a", @characters[i][1])
  53.         cw = bitmap.rect.width / 4
  54.         ch = bitmap.rect.height / 4
  55.         src_rect = Rect.new(0, 0, cw, ch)
  56.         x = 300 - @characters.size * 32 + i * 64 - cw / 2
  57.         self.contents.blt(x, 68 - ch, bitmap, src_rect)
  58.       end
  59.       # 描绘游戏时间
  60.       hour = @total_sec / 60 / 60
  61.       min = @total_sec / 60 % 60
  62.       sec = @total_sec % 60
  63.       time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  64.       self.contents.font.color = normal_color
  65.       self.contents.draw_text(4, 8, 600, 32, time_string, 2)
  66.       # 描绘时间标记
  67.       self.contents.font.color = normal_color
  68.       time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  69.       self.contents.draw_text(4, 40, 600, 32, time_string, 2)
  70.     end
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # ● 设置选择状态
  74.   #     selected : 新的选择状态 (true=选择 false=不选择)
  75.   #--------------------------------------------------------------------------
  76.   def selected=(selected)
  77.     @selected = selected
  78.     update_cursor_rect
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # ● 刷新光标矩形
  82.   #--------------------------------------------------------------------------
  83.   def update_cursor_rect
  84.     if @selected
  85.       self.cursor_rect.set(0, 0, @name_width + 8, 32)
  86.     else
  87.       self.cursor_rect.empty
  88.     end
  89.   end
  90. end
复制代码



作者: bububinghe    时间: 2008-6-2 17:03
以下引用禾西于2008-6-2 8:55:22的发言:

我比較想看看出錯的位置,也就是 Window_SaveFile
另外,你的「連帖行爲」讓我很不爽。善用編輯功能

抱歉,马上改正
作者: 禾西    时间: 2008-6-2 17:46
初步嘗試,這兩個腳本基本上沒有衝突,也不會引發你手上的問題。查看有沒有修改其他的地方或者插入其他腳本
但是軒轅劒系統使用了截圖存檔。改寫了儲存腳本...
作者: bububinghe    时间: 2008-6-2 17:49
以下引用禾西于2008-6-2 9:46:55的发言:

初步嘗試,這兩個腳本基本上沒有衝突,也不會引發你手上的問題。查看有沒有修改其他的地方或者插入其他腳本

可是出问题的地方就只有在加入队员那里冲突.....
作者: 禾西    时间: 2008-6-2 17:52
不一定。我在懷疑你是否還有其他會改寫儲存腳本的插件。比如自動存檔甚麽的,不然很少會在 System 那個位置到達 文件尾

簡單地講解一下出現這個錯誤的原理:
出現時機:讀檔的時候
錯誤原因1:到達文件的末尾,但是仍然進行存取行爲
錯誤表現:
Marshal.dump( )語句不能與 Marshal.load( )語句一一對應

正常情况下,只要有
$game_map           = Marshal.load(file)
語句就一定會有
Marshal.dump($game_map, file)

如果Marshal.load的數量大於(可以小於)Marshal.dump的數量,就會出錯。
解决方法:把出錯的語句注釋掉,直到可以正常讀檔。
此時可以取得一個沒有出錯(沒有被注釋掉)的
××× = Marshal.load(file)
語句
全局查找Marshal.load(
找到位於最底下的Marshal.load($×××,file) 或者 Marshal.load(×××,file)
語句。檢查是否缺少了儲存被注釋掉的變量。
Marshal.load(×××,file)
的格式補上有一定幾率治愈


出現時機:存檔的時候
錯誤原因2:儲存的文件大小小於需求
錯誤表現:
沒有,但是删除存檔重來會有一定幾率治愈。否則就是發生了上面的錯誤。 [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: 忧伤的小猫    时间: 2008-6-2 18:25
以下引用bububinghe于2008-6-2 7:07:57的发言:


本贴悬赏额度如下:VIP:0   积分:105   
脚本 'Window_SaveFile'的 30 行 发生了EOFError.
End of file reached


PS:30行是     @game_system = Marshal.load(file)
高手帮忙看看,有没有解救的方法啊?


下了个显示错误的脚本 上面提示:
◆ 2008-06-02 07:47:57
错误类型 :
   EOFError
错误信息 :
   End of file reached
错误可能发生的相关位置 :
   Window_SaveFile : 第 30 行 : load
   Window_SaveFile : 第 30 行 : initialize
   Scene_File : 第 25 行 : new
   Scene_File : 第 25 行 : main
   Scene_File : 第 24 行 : each
   Scene_File : 第 24 行 : main
    : 第 37 行 : run
    : 第 151 行
-------------66RPG-------------------


请高手指点迷津,感激不尽!


[本贴由作者于 2008-6-2 7:50:59 最后编辑]

你是用了扩展存档数的脚本吗?




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1