以下引用★_茄孓于2008-8-3 20:51:27的发言:
敌人的待机动作没有设定
也就是脚本里没有写好敌人战斗图刷新以4分之一刷新位图的
以下引用关重7于2008-8-4 6:07:21的发言:
以下引用★_茄孓于2008-8-3 20:51:27的发言:
敌人的待机动作没有设定
也就是脚本里没有写好敌人战斗图刷新以4分之一刷新位图的
看不懂
以下引用★_茄孓于2008-8-3 20:51:27的发言:
敌人的待机动作没有设定
也就是脚本里没有写好敌人战斗图刷新以4分之一刷新位图的
以下引用飞翔的MJ于2008-8-4 12:00:41的发言:
就是说敌人的战斗图有四帧一张.分成4等分.刷新.一等分一等分的变化.
if @battler.is_a?(Game_Actor)
@nx += 1
@nx %= 40 #每帧+1,40帧一个循环
@xbit = @nx / 10 * self.bitmap.width/4 #获得当前的图像坐标
self.src_rect.set(@xbit, 0, self.bitmap.width/4, self.bitmap.height) #设置当前战斗图的图像
end
@nx += 1
@nx %= 40 #每帧+1,40帧一个循环
@xbit = @nx / 10 * self.bitmap.width/4 #获得当前的图像坐标
self.src_rect.set(@xbit, 0, self.bitmap.width/4, self.bitmap.height) #设置当前战斗图的图像
以下引用zhong于2008-8-6 17:27:17的发言:
你该过之后的Sprite_Battler脚本应该有这么一段
if @battler.is_a?(Game_Actor)
@nx += 1
@nx %= 40 #每帧+1,40帧一个循环
@xbit = @nx / 10 * self.bitmap.width/4 #获得当前的图像坐标
self.src_rect.set(@xbit, 0, self.bitmap.width/4, self.bitmap.height) #设置当前战斗图的图像
end
把那个判断去掉了~~~
@nx += 1
@nx %= 40 #每帧+1,40帧一个循环
@xbit = @nx / 10 * self.bitmap.width/4 #获得当前的图像坐标
self.src_rect.set(@xbit, 0, self.bitmap.width/4, self.bitmap.height) #设置当前战斗图的图像
以下引用zhong于2008-8-6 22:37:26的发言:
帮你看了下脚本...我改的地方没错...不过你脚本似乎多了一些不必要的东西,而且最后少了个class的end....那个八十行的错误就是因为你在中间加了一个end,脚本end的个数对了,但其实你那个end的位置错了.....使方法定义提前结束,所以出错了.....帮你改了下...你看看会不会出错...
#==============================================================================
# ■ Sprite_Battler
#------------------------------------------------------------------------------
# 战斗显示用活动块。Game_Battler 类的实例监视、
# 活动块的状态的监视。
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :battler # 战斗者
#--------------------------------------------------------------------------
# ● 初始化对像
# viewport : 显示端口
# battler : 战斗者 (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@battler_visible = false
#★★★★★★★★★★★★
@nx = 0
@xbit = 0
#★★★★★★★★★★★★
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 战斗者为 nil 的情况下
if @battler == nil
self.bitmap = nil
loop_animation(nil)
return
end
# 文件名和色相与当前情况有差异的情况下
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue
# 获取、设置位图
@battler_name = @battler.battler_name
@battler_hue = @battler.battler_hue
self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @width / 2 -130
self.oy = @height +0
# 如果是战斗不能或者是隐藏状态就把透明度设置成 0
if @battler.dead? or @battler.hidden
self.opacity = 0
end
end
#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
@nx += 1
@nx %= 40
@xbit = @nx / 10 * self.bitmap.width/4
self.src_rect.set(@xbit, 0, self.bitmap.width/4, self.bitmap.height)
#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
# 动画 ID 与当前的情况有差异的情况下
if @battler.damage == nil and
@battler.state_animation_id != @state_animation_id
@state_animation_id = @battler.state_animation_id
loop_animation($data_animations[@state_animation_id])
end
# 应该被显示的角色的情况下
if @battler.is_a?(Game_Actor) and @battler_visible
# 不是主状态的时候稍稍降低点透明度
if $game_temp.battle_main_phase
self.opacity += 3 if self.opacity < 255
else
self.opacity -= 3 if self.opacity > 207
end
end
# 明灭
if @battler.blink
blink_on
else
blink_off
end
# 不可见的情况下
unless @battler_visible
# 出现 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
if not @battler.hidden and not @battler.dead? and
(@battler.damage == nil or @battler.damage_pop)
if @battler.is_a?(Game_Enemy)
appear
else
@battler.battler_name = @battler.battler_name.split(/★/)[0]
end
@battler_visible = true
end
end
# 可见的情况下
if @battler_visible
# 逃跑
if @battler.hidden
$game_system.se_play($data_system.escape_se)
escape
@battler_visible = false
end
# 白色闪烁
if @battler.white_flash
whiten
@battler.white_flash = false
end
# 动画
if @battler.animation_id != 0
animation = $data_animations[@battler.animation_id]
animation(animation, @battler.animation_hit)
@battler.animation_id = 0
end
# 伤害
if @battler.damage_pop
damage(@battler.damage, @battler.critical)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
end
# korapusu★★★★★★★★★★★★★★★★★★★★★★★★★★★★
if @battler.damage == nil and @battler.dead?
if @battler.is_a?(Game_Enemy)
$game_system.se_play($data_system.enemy_collapse_se)
collapse
else
$game_system.se_play($data_system.actor_collapse_se)
@battler.battler_name = @battler.battler_name.split(/★/)[0]
@battler.battler_name = @battler.battler_name + "★2"
end
@battler_visible = false
end
end
# 设置活动块的坐标
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end
end #class
[本贴由作者于 2008-8-6 22:38:44 最后编辑]
以下引用zhong于2008-8-6 22:37:26的发言:
帮你看了下脚本...我改的地方没错...不过你脚本似乎多了一些不必要的东西,而且最后少了个class的end....那个八十行的错误就是因为你在中间加了一个end,脚本end的个数对了,但其实你那个end的位置错了.....使方法定义提前结束,所以出错了.....帮你改了下...你看看会不会出错...
#==============================================================================
# ■ Sprite_Battler
#------------------------------------------------------------------------------
# 战斗显示用活动块。Game_Battler 类的实例监视、
# 活动块的状态的监视。
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :battler # 战斗者
#--------------------------------------------------------------------------
# ● 初始化对像
# viewport : 显示端口
# battler : 战斗者 (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@battler_visible = false
#★★★★★★★★★★★★
@nx = 0
@xbit = 0
#★★★★★★★★★★★★
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 战斗者为 nil 的情况下
if @battler == nil
self.bitmap = nil
loop_animation(nil)
return
end
# 文件名和色相与当前情况有差异的情况下
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue
# 获取、设置位图
@battler_name = @battler.battler_name
@battler_hue = @battler.battler_hue
self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @width / 2 -130
self.oy = @height +0
# 如果是战斗不能或者是隐藏状态就把透明度设置成 0
if @battler.dead? or @battler.hidden
self.opacity = 0
end
end
#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
@nx += 1
@nx %= 40
@xbit = @nx / 10 * self.bitmap.width/4
self.src_rect.set(@xbit, 0, self.bitmap.width/4, self.bitmap.height)
#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
# 动画 ID 与当前的情况有差异的情况下
if @battler.damage == nil and
@battler.state_animation_id != @state_animation_id
@state_animation_id = @battler.state_animation_id
loop_animation($data_animations[@state_animation_id])
end
# 应该被显示的角色的情况下
if @battler.is_a?(Game_Actor) and @battler_visible
# 不是主状态的时候稍稍降低点透明度
if $game_temp.battle_main_phase
self.opacity += 3 if self.opacity < 255
else
self.opacity -= 3 if self.opacity > 207
end
end
# 明灭
if @battler.blink
blink_on
else
blink_off
end
# 不可见的情况下
unless @battler_visible
# 出现 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
if not @battler.hidden and not @battler.dead? and
(@battler.damage == nil or @battler.damage_pop)
if @battler.is_a?(Game_Enemy)
appear
else
@battler.battler_name = @battler.battler_name.split(/★/)[0]
end
@battler_visible = true
end
end
# 可见的情况下
if @battler_visible
# 逃跑
if @battler.hidden
$game_system.se_play($data_system.escape_se)
escape
@battler_visible = false
end
# 白色闪烁
if @battler.white_flash
whiten
@battler.white_flash = false
end
# 动画
if @battler.animation_id != 0
animation = $data_animations[@battler.animation_id]
animation(animation, @battler.animation_hit)
@battler.animation_id = 0
end
# 伤害
if @battler.damage_pop
damage(@battler.damage, @battler.critical)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
end
# korapusu★★★★★★★★★★★★★★★★★★★★★★★★★★★★
if @battler.damage == nil and @battler.dead?
if @battler.is_a?(Game_Enemy)
$game_system.se_play($data_system.enemy_collapse_se)
collapse
else
$game_system.se_play($data_system.actor_collapse_se)
@battler.battler_name = @battler.battler_name.split(/★/)[0]
@battler.battler_name = @battler.battler_name + "★2"
end
@battler_visible = false
end
end
# 设置活动块的坐标
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end
end #class
[本贴由作者于 2008-8-6 22:38:44 最后编辑]
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |