- 注册时间
- 2007-1-13
- 最后登录
- 2007-7-20
⑤进阶
- 积分
- 662
|
这个比超级横版脚本好多了,超级横版脚本规定所有的图帧数都要一样,这个不用,比较好
用了这个脚本后,首先要把所有待机,防御,挨打,死亡动态,死亡静态,胜利动态,胜利静态的的画面在动画里面做成动画,动画名称与帧数可以任定
然后战斗图做成透明图。大少要跟待机画面的大少差不多。大一点都可以
注意改战斗图的名字。要改成这样的格式
战斗角色名字★待机ID★防御ID★挨打ID★死亡动态ID★死亡静态ID★胜利动态ID★胜利静态ID
如果是设置敌人的话,那么就变成
名字★待机ID★防御ID★挨打ID★死亡动态ID★死亡静态ID★★
所谓死亡动态就是人物死亡的整个过程,静态就是死亡动态的最后一个画面(通常是已经倒地的画面)死亡静态只需要一帧,坐标跟动态坐标一样。
胜利静态与死亡静态原理一样。
#==============================================================================
# ■ Sprite_Battler
#------------------------------------------------------------------------------
# 战斗显示用活动块。Game_Battler 类的实例监视、
# 活动块的状态的监视。
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ● 处理角色动作
#--------------------------------------------------------------------------
def update_actor_animation
if @battler.is_a?(Game_Actor)
if @battler.show_damage_value != nil
self.damage(@battler.show_damage_value, false)
@battler.show_damage(nil)
@battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
@battler.setup_battler_hurt_ani(1)
end
if @battler.current_action.kind == 0 and @battler.current_action.basic == 1
else
if @hits == 1 and not @battler.dead? and @battler.battler_hurt_ani != 1 and @battler.damage.is_a?(Numeric) and @battler.damage > 0
@battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
@battler.setup_battler_hurt_ani(1)
elsif @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
for actor in $game_party.actors
if @battler != actor
actor.add_state(6)
end
end
@battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
@battler.setup_battler_dead_ani(1)
end
end
end
end
#--------------------------------------------------------------------------
# ● 处理敌人动作
#--------------------------------------------------------------------------
def update_enemy_animation
if @battler.is_a?(Game_Enemy)
if @battler.show_damage_value != nil
self.damage(@battler.show_damage_value, false)
@battler.show_damage(nil)
@battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
@battler.setup_battler_hurt_ani(1)
end
if @battler.current_action.kind == 0 and @battler.current_action.basic == 1
else
if @hits == 1 and not @battler.dead? and @battler.battler_hurt_ani != 1 and @battler.damage.is_a?(Numeric) and @battler.damage > 0
@battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
@battler.setup_battler_hurt_ani(1)
elsif @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
@battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
@battler.setup_battler_dead_ani(1)
collapse
end
end
end
end
end
然后到这里好需要一个设置战斗坐标的脚本(好像不是战斗的动画都可以在这里设置),具体看脚本蓝色字眼。根据那里设置就好了。主要是设置敌人的普通攻击,挨打,待机,死亡,招式,和自己主角的招式,这个脚本要插在Interpreter 7下面,改名可以是Interpreter 8
#==============================================================================
# ■ Interpreter (分割定义 8)
#------------------------------------------------------------------------------
# 执行事件命令的解释器。本类在 Game_System 类
# 和 Game_Event 类的内部使用。
#==============================================================================
class Interpreter
#--------------------------------------------------------------------------
# ● 动画突破_A
#--------------------------------------------------------------------------
def ani_set_a
id = 166
a = 2
b = 16
first_x = 540
first_y = 347
frame_x = [523,525,524,528,545,567,591,255,188,171,171,71,175,285,300]
frame_y = [331,327,327,329,330,357,358,186,182,158,141,76,143,173,268]
ani_set(id,a,b,first_x,first_y,frame_x,frame_y,150,150)
end
#先举个例子
#魔王_挨打(敌人来的)
def ani_set_186
id = 186
a = 2
b = 5
first_x = 379
first_y = 257
frame_x = [370,338,346,368]
frame_y = [235,225,229,235]
ani_set(id,a,b,first_x,first_y,frame_x,frame_y) #--------------------------------------------------------------------------
# ● 动画突破
#--------------------------------------------------------------------------
def ani_set(id, a, b, first_x, first_y, frame_x, frame_y, frame_x_w = 0, frame_y_w = 0)
h = 0
# 循环指定id号动画的帧
for @frame in $data_animations[id].frames
if h == a - 2
for i in 0...$data_animations[id].frames[h].cell_data.xsize
$data_animations[id].frames[h].cell_data[i, 1] += frame_x_w
$data_animations[id].frames[h].cell_data[i, 2] += frame_y_w
end
end
if h >= a - 1 and h <= b - 1
d_x = frame_x[h - a + 1] - first_x + frame_x_w
d_y = frame_y[h - a + 1] - first_y + frame_y_w
# 循环帧的单元
for i in 0...$data_animations[id].frames[h].cell_data.xsize
# 0:式样、1:X 座标,2:Y 座标,3:放大率,4:旋转角度
# 5:左右反转,6:不透明度,7:合成方式
m = $data_animations[id].frames[h].cell_data[i, 1]
n = $data_animations[id].frames[h].cell_data[i, 2]
$data_animations[id].frames[h].cell_data[i, 1] += d_x
$data_animations[id].frames[h].cell_data[i, 2] += d_y
#if m != $data_animations[id].frames[h].cell_data[i, 1] or n != $data_animations[id].frames[h].cell_data[i, 2]
# p h,m,n,$data_animations[id].frames[h].cell_data[i, 1],$data_animations[id].frames[h].cell_data[i, 2]
#end
end
end
h += 1
end
# 储存数据
save_data($data_animations,"Data/Animations.rxdata")
p "Over"
end
end
总体看起来像很麻烦的,但不是很难的,细心地看一看的话,会明白,如果知道脚本说什么的人,请发帖吧,这样其他人就可以知道了,我也不是很明白脚本的具体内容。(脚本转自石焚刃暖游戏) |
|