Project1
标题:
求救
[打印本页]
作者:
liuyuhan1104
时间:
2013-1-26 22:01
标题:
求救
本帖最后由 hcm 于 2013-2-10 14:00 编辑
脚本“window-battlestaus”的27行发生了nomethodError
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
# 显示战斗画面同伴状态的窗口。
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(0, 320, 640, 160)
[url=home.php?mod=space&uid=133944]@w[/url] = []
for i in 0..$game_party.actors.size-1
@w[i] = Window_Base.new(0,320,160*i,160)
@w[i].back_opacity = 0
end
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
refresh
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
super
@w.dispose (就是这里)
end
end
#--------------------------------------------------------------------------
# ● 设置升级标志
# actor_index : 角色索引
#--------------------------------------------------------------------------
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 32, 120)
draw_actor_sp(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 主界面的不透明度下降
if $game_temp.battle_main_phase
self.contents_opacity -= 4 if self.contents_opacity > 191
else
self.contents_opacity += 4 if self.contents_opacity < 255
end
end
end
复制代码
作者:
774741359
时间:
2013-1-26 23:00
看@w.dispose下面还遗留一个end
所以说是脚本残缺
估计是这样的
def dispose
super
for i in 0..$game_party.actors.size-1
@w[i].dispose (就是这里)
end
end
复制代码
作者:
liuyuhan1104
时间:
2013-1-27 10:16
本帖最后由 hcm 于 2013-2-10 14:00 编辑
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
# 显示战斗画面同伴状态的窗口。
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(0, 320, 640, 160)
[url=home.php?mod=space&uid=133944]@w[/url] = []
for i in 0..$game_party.actors.size-1
@w[i] = Window_Base.new(0,320,160*i,160)
@w[i].back_opacity = 0
end
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
refresh
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
super
for i in 0..$game_party.actors.size-1
@w[i].dispose
end
#--------------------------------------------------------------------------
# ● 设置升级标志
# actor_index : 角色索引
#--------------------------------------------------------------------------
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 32, 120)
draw_actor_sp(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 主界面的不透明度下降
if $game_temp.battle_main_phase
self.contents_opacity -= 4 if self.contents_opacity > 191
else
self.contents_opacity += 4 if self.contents_opacity < 255
end
end
end
复制代码
(68)
但是68行又发生了syntax Error了。。。。。。。
作者:
Wind2010
时间:
2013-1-27 12:01
def refresh那段在最后接一个end
def refresh
...
for i in ...
...
if ...
else...
end
end
end←
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1