Project1
标题:
脚本出错...
[打印本页]
作者:
&國際淫爺ゞ
时间:
2008-1-10 00:36
标题:
脚本出错...
这个错误....另附脚本:
#==============================================================================
# ■ 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_hue = @battler.battler_hue
# 获取、设置位图
@battler_name = @battler.battler_name
self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @width / 2
self.oy = @height
# 如果是战斗不能或者是隐藏状态就把透明度设置成 0
if @battler.is_a?(Game_Enemy)
if @battler.dead? or @battler.hidden
#self.opacity = 0
end
end
end
#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#if
@nx += 1
@nx %= 40
@xbit = @nx / 10 * self.bitmap.width/4
self.src_rect.set(@xbit, 0, self.bitmap.width/4, self.bitmap.height)
#end
#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
# 动画 ID 与当前的情况有差异的情况下
if @battler.state_animation_id != @state_animation_id and @battler.damage == nil
@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.is_a?(Game_Actor) and self.xiaoshi != nil and self.xiaoshi > 0
@battler.xiaoshi = 0
self.xiaoshi -= 1
if $status_shu == nil
$status_shu = 0
end
elsif @battler.xiaoshi == 0 and self.xiaoshi <= 0
@battler.xiaoshi = nil
$status_shu = nil
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
# 设置活动块的坐标
if @battler.is_a?(Game_Actor)
self.x = @battler.s_x
self.y = @battler.s_y
self.z = @battler.s_z
else
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end
end
end
复制代码
这个脚本是我从某游戏中拿下来的....所以不知道该怎样设置...如果可以的话,也可以教教我针对这个脚本有什么要注意的地方?
作者:
&國際淫爺ゞ
时间:
2008-1-10 00:36
标题:
脚本出错...
这个错误....另附脚本:
#==============================================================================
# ■ 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_hue = @battler.battler_hue
# 获取、设置位图
@battler_name = @battler.battler_name
self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @width / 2
self.oy = @height
# 如果是战斗不能或者是隐藏状态就把透明度设置成 0
if @battler.is_a?(Game_Enemy)
if @battler.dead? or @battler.hidden
#self.opacity = 0
end
end
end
#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#if
@nx += 1
@nx %= 40
@xbit = @nx / 10 * self.bitmap.width/4
self.src_rect.set(@xbit, 0, self.bitmap.width/4, self.bitmap.height)
#end
#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
# 动画 ID 与当前的情况有差异的情况下
if @battler.state_animation_id != @state_animation_id and @battler.damage == nil
@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.is_a?(Game_Actor) and self.xiaoshi != nil and self.xiaoshi > 0
@battler.xiaoshi = 0
self.xiaoshi -= 1
if $status_shu == nil
$status_shu = 0
end
elsif @battler.xiaoshi == 0 and self.xiaoshi <= 0
@battler.xiaoshi = nil
$status_shu = nil
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
# 设置活动块的坐标
if @battler.is_a?(Game_Actor)
self.x = @battler.s_x
self.y = @battler.s_y
self.z = @battler.s_z
else
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end
end
end
复制代码
这个脚本是我从某游戏中拿下来的....所以不知道该怎样设置...如果可以的话,也可以教教我针对这个脚本有什么要注意的地方?
作者:
精灵使者
时间:
2008-1-10 00:39
你似乎缺了一些函数。
作者:
&國際淫爺ゞ
时间:
2008-1-10 00:48
那啥...脚本盲一只...能说明白点么?
作者:
精灵使者
时间:
2008-1-10 00:51
拷贝脚本的时候不注意,忘记把一些函数拷贝过去导致出错。
作者:
&國際淫爺ゞ
时间:
2008-1-10 00:54
你的意思是不是光有这脚本不行,还得有其他的脚本配合?
作者:
黑鏻
时间:
2008-1-10 00:59
请问你是用哪个游戏的脚本呢?
如果你想要某个脚本,直接在主站上搜索更简便。
作者:
精灵使者
时间:
2008-1-10 01:00
以下引用
&國際淫爺ゞ于2008-1-9 16:54:23
的发言:
你的意思是不是光有这脚本不行,还得有其他的脚本配合?
没错。肯定是修改了默认脚本的其他地方,或者脚本没有拷贝完全。
作者:
&國際淫爺ゞ
时间:
2008-1-10 01:26
问个题外话...为什么我每次点引用别人的话就出现很多的字符啊?
作者:
黑鏻
时间:
2008-1-10 01:43
没字符的话那就不是引用了~~
作者:
&國際淫爺ゞ
时间:
2008-1-10 01:58
我的意思是...
就这些奇怪的字符...是必须的还是可以删的?
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1