Project1

标题: Sideview脚本的CP条更新出错 [打印本页]

作者: love4567536    时间: 2012-4-29 22:36
标题: Sideview脚本的CP条更新出错
本帖最后由 love4567536 于 2012-5-12 22:02 编辑
  1. #--------------------------------------------------------------------------
  2.   # ● CP条更新
  3.   #--------------------------------------------------------------------------
  4.   def refresh_cp
  5.     @blank_window.x = 128 - @info_viewport.ox   
  6.     @basepic.x = 144 - @info_viewport.ox   
  7.     for iii in $game_party.members + $game_troop.members
  8.       if iii.is_a?(Game_Actor)
  9.         icon_index = $data_weapons[iii.weapon_id].icon_index
  10.         @cppic[iii].src_rect.set(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  11.       else
  12.         @cppic[iii].src_rect.set(312, 216, 24, 24)
  13.       end
  14.       if iii.hp > 0
  15.         @cppic[iii].visible = $CP可见
  16.       else
  17.         @cppic[iii].visible = false
  18.       end
  19.       @cppic[iii].x = 132 + (iii.cp * 384 / 5000).to_i - @info_viewport.ox
  20.     end
  21.   end
  22.   #--------------------------------------------------------------------------
复制代码
开始战斗后就会弹出:脚本 'Siddeview 3' 的第81行发生了NoMethodError . undefined method 'icon_index'for nil:NilClass

是因为什么原因啊?麻烦大家帮我看看,谢谢啦! dsu_plus_rewardpost_czw




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