Project1

标题: 求救 [打印本页]

作者: liuyuhan1104    时间: 2013-1-26 22:01
标题: 求救
本帖最后由 hcm 于 2013-2-10 14:00 编辑

脚本“window-battlestaus”的27行发生了nomethodError
  1. #==============================================================================
  2. # ■ Window_BattleStatus
  3. #------------------------------------------------------------------------------
  4. #  显示战斗画面同伴状态的窗口。
  5. #==============================================================================

  6. class Window_BattleStatus < Window_Base
  7.   #--------------------------------------------------------------------------
  8. # ● 初始化对像
  9. #--------------------------------------------------------------------------
  10. def initialize
  11.    super(0, 320, 640, 160)
  12.    [url=home.php?mod=space&uid=133944]@w[/url] = []
  13.    for i in 0..$game_party.actors.size-1
  14.      @w[i] = Window_Base.new(0,320,160*i,160)
  15.      @w[i].back_opacity = 0
  16.    end
  17.    self.contents = Bitmap.new(width - 32, height - 32)
  18.    @level_up_flags = [false, false, false, false]
  19.    refresh
  20. end
  21. #--------------------------------------------------------------------------
  22. # ● 释放
  23. #--------------------------------------------------------------------------
  24. def dispose
  25.    super
  26. @w.dispose (就是这里)
  27. end
  28. end
  29.   #--------------------------------------------------------------------------
  30.   # ● 设置升级标志
  31.   #     actor_index : 角色索引
  32.   #--------------------------------------------------------------------------
  33.   def level_up(actor_index)
  34.     @level_up_flags[actor_index] = true
  35.   end
  36.   #--------------------------------------------------------------------------
  37.   # ● 刷新
  38.   #--------------------------------------------------------------------------
  39.   def refresh
  40.     self.contents.clear
  41.     @item_max = $game_party.actors.size
  42.     for i in 0...$game_party.actors.size
  43.       actor = $game_party.actors[i]
  44.       actor_x = i * 160 + 4
  45.       draw_actor_name(actor, actor_x, 0)
  46.       draw_actor_hp(actor, actor_x, 32, 120)
  47.       draw_actor_sp(actor, actor_x, 64, 120)
  48.       if @level_up_flags[i]
  49.         self.contents.font.color = normal_color
  50.         self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
  51.       else
  52.         draw_actor_state(actor, actor_x, 96)
  53.       end
  54.     end
  55.   #--------------------------------------------------------------------------
  56.   # ● 刷新画面
  57.   #--------------------------------------------------------------------------
  58.   def update
  59.     super
  60.     # 主界面的不透明度下降
  61.     if $game_temp.battle_main_phase
  62.       self.contents_opacity -= 4 if self.contents_opacity > 191
  63.     else
  64.       self.contents_opacity += 4 if self.contents_opacity < 255
  65.     end
  66.   end
  67. end
复制代码

作者: 774741359    时间: 2013-1-26 23:00
看@w.dispose下面还遗留一个end
所以说是脚本残缺
估计是这样的
  1. def dispose
  2.    super
  3.    for i in 0..$game_party.actors.size-1
  4. @w[i].dispose (就是这里)
  5. end
  6. end
复制代码

作者: liuyuhan1104    时间: 2013-1-27 10:16
本帖最后由 hcm 于 2013-2-10 14:00 编辑
  1. #==============================================================================
  2. # ■ Window_BattleStatus
  3. #------------------------------------------------------------------------------
  4. #  显示战斗画面同伴状态的窗口。
  5. #==============================================================================

  6. class Window_BattleStatus < Window_Base
  7.   #--------------------------------------------------------------------------
  8. # ● 初始化对像
  9. #--------------------------------------------------------------------------
  10. def initialize
  11.    super(0, 320, 640, 160)
  12.    [url=home.php?mod=space&uid=133944]@w[/url] = []
  13.    for i in 0..$game_party.actors.size-1
  14.      @w[i] = Window_Base.new(0,320,160*i,160)
  15.      @w[i].back_opacity = 0
  16.    end
  17.    self.contents = Bitmap.new(width - 32, height - 32)
  18.    @level_up_flags = [false, false, false, false]
  19.    refresh
  20. end
  21. #--------------------------------------------------------------------------
  22. # ● 释放
  23. #--------------------------------------------------------------------------
  24. def dispose
  25.   super
  26.     for i in 0..$game_party.actors.size-1
  27.   @w[i].dispose
  28. end
  29.   #--------------------------------------------------------------------------
  30.   # ● 设置升级标志
  31.   #     actor_index : 角色索引
  32.   #--------------------------------------------------------------------------
  33.   def level_up(actor_index)
  34.     @level_up_flags[actor_index] = true
  35.   end
  36.   #--------------------------------------------------------------------------
  37.   # ● 刷新
  38.   #--------------------------------------------------------------------------
  39.   def refresh
  40.     self.contents.clear
  41.     @item_max = $game_party.actors.size
  42.     for i in 0...$game_party.actors.size
  43.       actor = $game_party.actors[i]
  44.       actor_x = i * 160 + 4
  45.       draw_actor_name(actor, actor_x, 0)
  46.       draw_actor_hp(actor, actor_x, 32, 120)
  47.       draw_actor_sp(actor, actor_x, 64, 120)
  48.       if @level_up_flags[i]
  49.         self.contents.font.color = normal_color
  50.         self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
  51.       else
  52.         draw_actor_state(actor, actor_x, 96)
  53.       end
  54.     end
  55.   #--------------------------------------------------------------------------
  56.   # ● 刷新画面
  57.   #--------------------------------------------------------------------------
  58.   def update
  59.     super
  60.     # 主界面的不透明度下降
  61.     if $game_temp.battle_main_phase
  62.       self.contents_opacity -= 4 if self.contents_opacity > 191
  63.     else
  64.       self.contents_opacity += 4 if self.contents_opacity < 255
  65.     end
  66.   end
  67. end
复制代码
(68)
但是68行又发生了syntax Error了。。。。。。。

作者: Wind2010    时间: 2013-1-27 12:01
def refresh那段在最后接一个end
  1. def refresh
  2.   ...
  3.   for i in ...
  4.     ...
  5.     if ...
  6.     else...
  7.     end
  8.   end
  9. end←
复制代码





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