超八方向脚本专用人物跟随脚本(转自66RPG)
当前离线
126451 帖子
706 阅读权限
20 性别
男 在线时间
230 小时 注册时间
2009-10-1 Lv.24
706 精华
1671 点 金钱
18517 G RP
6 点 字体大小:
发表于 2009-10-2 11:23
超八方向脚本专用人物跟随脚本(转自66RPG)
脚本功能
本人物跟随脚本是基于超八方向脚本定做的脚本,跟非超八方向的系统核心有严重冲突
超八方向套装下载:
使用方法
复制全部脚本内容,在Main脚本之前按i ert,插入此脚本全部内容。
相关截图
-------------------------------------------------------------------------------- 脚本内容
#==============================================================================
# 本脚本来自
,使用和转载请保留此信息
#==============================================================================
#超八方向脚本专用人物跟随脚本 by IKKI
#注意:本人物跟随脚本是基于超八方向脚本定做的脚本,
#跟非超八方向的系统核心有严重冲突。
# ————————————————————————————————————
# ▼▲▼ XRXS13. パーティ列車移動 ver.1.02 ▼▲▼
# by fukuyama
# Train_Actor
module Train_Actor
#是否使用停止跟随的方法,也就是说,这里false改为true的时候,如果TRANSPARENT_SWITCHES_INDEX
#开关打开,跟随的人物就消失了(其实只是变成透明而已)
TRANSPARENT_SWITCH = true
TRANSPARENT_SWITCHES_INDEX = 20
#举例:第一个为true,第二个为20,则打开20号开关,后面的人都没了。
#跟随人数的最大数目,可以更改为2、3什么的。
TRAIN_ACTOR_SIZE_MAX = 4
#I ut::DOWN = 2
#I ut::LEFT = 4
#I ut::RIGHT = 6
#I ut::UP = 6
DOWN_LEFT = 1
DOWN_RIGHT = 3
UP_LEFT = 7
UP_RIGHT = 9
JUMP = 5
cla Game_Party_Actor Game_Character
def initialize
super()
@through = true
def setup(actor)
# キャラクターのファイル名と色相を設定
if actor != nil
@character_name = actor.character_name
@character_hue = actor.character_hue
if moving?
if @character_name. lit(/△/)[1] == nil if @character_name. lit(/▲/)[1] == nil
@character_name = ▲+@character_name
if @character_name. lit(/△/)[1] == nil
if @character_name. lit(/▲/)[1] != nil
@character_name = @character_name. lit(/▲/)[1]
@character_name =
@character_hue = 0
# 不透明度と合成方法を初期化
@opacity = 255
@blend_type = 0
def screen_z(height = 0)
if $game_player.x == @x and $game_player.y == @y
return $game_player.screen_z(height) - 1
super(height)
#--------------------------------------------------------------------------
# ● 下に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_down(turn_enabled = true)
# 下を向く
if turn_enabled
turn_down
# 通行可能な場合
if pa able?(@x, @y, I ut::DOWN)
# 下を向く
turn_down
# 座標を更新
@y += 1
#--------------------------------------------------------------------------
# ● 左に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_left(turn_enabled = true)
# 左を向く
if turn_enabled
turn_left
# 通行可能な場合
if pa able?(@x, @y, I ut::LEFT)
# 左を向く
turn_left
# 座標を更新
@x -= 1
#--------------------------------------------------------------------------
# ● 右に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_right(turn_enabled = true)
# 右を向く
if turn_enabled
turn_right
# 通行可能な場合
if pa able?(@x, @y, I ut::RIGHT)
# 右を向く
turn_right
# 座標を更新
@x += 1
#--------------------------------------------------------------------------
# ● 上に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_up(turn_enabled = true)
# 上を向く
if turn_enabled
turn_up
# 通行可能な場合
if pa able?(@x, @y, I ut::UP)
# 上を向く
turn_up
# 座標を更新
@y -= 1
#--------------------------------------------------------------------------
# ● 左下に移動
#--------------------------------------------------------------------------
def move_lower_left
# 向き固定でない場合
unle @direction_fix
# 右向きだった場合は左を、上向きだった場合は下を向く
@direction = 1#(@direction == I ut::RIGHT ? I ut::LEFT : @direction == I ut::UP ? I ut::DOWN : @direction)
# 下→左、左→下 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::DOWN) and pa able?(@x, @y + 1, I ut::LEFT)) or
(pa able?(@x, @y, I ut::LEFT) and pa able?(@x - 1, @y, I ut::DOWN))
# 座標を更新
@x -= 1
@y += 1
#--------------------------------------------------------------------------
# ● 右下に移動
#--------------------------------------------------------------------------
def move_lower_right
# 向き固定でない場合
unle @direction_fix
# 左向きだった場合は右を、上向きだった場合は下を向く
@direction = 3#(@direction == I ut::LEFT ? I ut::RIGHT : @direction == I ut::UP ? I ut::DOWN : @direction)
# 下→右、右→下 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::DOWN) and pa able?(@x, @y + 1, I ut::RIGHT)) or
(pa able?(@x, @y, I ut::RIGHT) and pa able?(@x + 1, @y, I ut::DOWN))
# 座標を更新
@x += 1
@y += 1
#--------------------------------------------------------------------------
# ● 左上に移動
#--------------------------------------------------------------------------
def move_u er_left
# 向き固定でない場合
unle @direction_fix
# 右向きだった場合は左を、下向きだった場合は上を向く
@direction = 7#(@direction == I ut::RIGHT ? I ut::LEFT : @direction == I ut::DOWN ? I ut::UP : @direction)
# 上→左、左→上 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::UP) and pa able?(@x, @y - 1, I ut::LEFT)) or
(pa able?(@x, @y, I ut::LEFT) and pa able?(@x - 1, @y, I ut::UP))
# 座標を更新
@x -= 1
@y -= 1
#--------------------------------------------------------------------------
# ● 右上に移動
#--------------------------------------------------------------------------
def move_u er_right
# 向き固定でない場合
unle @direction_fix
# 左向きだった場合は右を、下向きだった場合は上を向く
@direction = 9#(@direction == I ut::LEFT ? I ut::RIGHT : @direction == I ut::DOWN ? I ut::UP : @direction)
# 上→右、右→上 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::UP) and pa able?(@x, @y - 1, I ut::RIGHT)) or
(pa able?(@x, @y, I ut::RIGHT) and pa able?(@x + 1, @y, I ut::UP))
# 座標を更新
@x += 1
@y -= 1
attr_writer :move_ eed
attr_writer :step_anime
module Spriteset_Map_Module
def setup_actor_character_ rites?
return @setup_actor_character_ rites_flag != nil
def setup_actor_character_ rites(characters)
if !setup_actor_character_ rites?
index_game_player = 0
@character_ rites.each_index do |i|
if @character_ rites
.character.i tance_of?(Game_Player)
index_game_player = i
for character in characters.reverse
@character_ rites.u hift(
Sprite_Character.new(@viewport1, character)
@setup_actor_character_ rites_flag = true
module Scene_Map_Module
def setup_actor_character_ rites(characters)
@ riteset.setup_actor_character_ rites(characters)
module Game_Party_Module
def set_tra arent_actors(tra arent)
@tra arent = tra arent
def setup_actor_character_ rites
if @characters == nil
@characters = []
for i in 1 ... TRAIN_ACTOR_SIZE_MAX
@characters.push(Game_Party_Actor.new)
for i in 1 ... TRAIN_ACTOR_SIZE_MAX
@characters[i - 1].setup(actors
if $scene.cla .method_defined?('setup_actor_character_ rites')
$scene.setup_actor_character_ rites(@characters)
def update_party_actors
setup_actor_character_ rites
tra arent = $game_player.tra arent
if tra arent == false
if TRANSPARENT_SWITCH
tra arent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
for character in @characters
character.tra arent = tra arent
character.move_ eed = $game_player.move_ eed
character.step_anime = $game_player.step_anime
character.update
def moveto_party_actors( x, y )
setup_actor_character_ rites
for character in @characters
character.moveto( x, y )
if @move_list == nil
@move_list = []
move_list_setup
def move_party_actors
if @move_list == nil
@move_list = []
move_list_setup
@move_list.each_index do |i|
if @characters
case @move_list
when I ut::DOWN
@characters
.move_down(@move_list
.args[0])
when I ut::LEFT
@characters
.move_left(@move_list
.args[0])
when I ut::RIGHT
@characters
.move_right(@move_list
.args[0])
when I ut::UP
@characters
.move_up(@move_list
.args[0])
when DOWN_LEFT
@characters
.move_lower_left
when DOWN_RIGHT
@characters
.move_lower_right
when UP_LEFT
@characters
.move_u er_left
when UP_RIGHT
@characters
.move_u er_right
when JUMP
@characters
.jump(@move_list
.args[0],@move_list
.args[1])
cla Move_List_Element
def initialize(type,args)
@type = type
@args = args
def type() return @type end
def args() return @args end
def move_list_setup
for i in 0 .. TRAIN_ACTOR_SIZE_MAX
@move_list
def add_move_list(type,*args)
@move_list.u hift(Move_List_Element.new(type,args)).pop
def move_down_party_actors(turn_enabled = true)
move_party_actors
add_move_list(I ut::DOWN,turn_enabled)
def move_left_party_actors(turn_enabled = true)
move_party_actors
add_move_list(I ut::LEFT,turn_enabled)
def move_right_party_actors(turn_enabled = true)
move_party_actors
add_move_list(I ut::RIGHT,turn_enabled)
def move_up_party_actors(turn_enabled = true)
move_party_actors
add_move_list(I ut::UP,turn_enabled)
def move_lower_left_party_actors
move_party_actors
add_move_list(DOWN_LEFT)
def move_lower_right_party_actors
move_party_actors
add_move_list(DOWN_RIGHT)
def move_u er_left_party_actors
move_party_actors
add_move_list(UP_LEFT)
def move_u er_right_party_actors
move_party_actors
add_move_list(UP_RIGHT)
def jump_party_actors(x_plus, y_plus)
move_party_actors
add_move_list(JUMP,x_plus, y_plus)
module Game_Player_Module
def update
$game_party.update_party_actors
def moveto( x, y )
$game_party.moveto_party_actors( x, y )
super( x, y )
def move_down(turn_enabled = true)
if pa able?(@x, @y, I ut::DOWN)
$game_party.move_down_party_actors(turn_enabled)
super(turn_enabled)
def move_left(turn_enabled = true)
if pa able?(@x, @y, I ut::LEFT)
$game_party.move_left_party_actors(turn_enabled)
super(turn_enabled)
def move_right(turn_enabled = true)
if pa able?(@x, @y, I ut::RIGHT)
$game_party.move_right_party_actors(turn_enabled)
super(turn_enabled)
def move_up(turn_enabled = true)
if pa able?(@x, @y, I ut::UP)
$game_party.move_up_party_actors(turn_enabled)
super(turn_enabled)
def move_lower_left
# 下→左、左→下 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::DOWN) and pa able?(@x, @y + 1, I ut::LEFT)) or
(pa able?(@x, @y, I ut::LEFT) and pa able?(@x - 1, @y, I ut::DOWN))
$game_party.move_lower_left_party_actors
def move_lower_right
# 下→右、右→下 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::DOWN) and pa able?(@x, @y + 1, I ut::RIGHT)) or
(pa able?(@x, @y, I ut::RIGHT) and pa able?(@x + 1, @y, I ut::DOWN))
$game_party.move_lower_right_party_actors
def move_u er_left
# 上→左、左→上 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::UP) and pa able?(@x, @y - 1, I ut::LEFT)) or
(pa able?(@x, @y, I ut::LEFT) and pa able?(@x - 1, @y, I ut::UP))
$game_party.move_u er_left_party_actors
def move_u er_right
# 上→右、右→上 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::UP) and pa able?(@x, @y - 1, I ut::RIGHT)) or
(pa able?(@x, @y, I ut::RIGHT) and pa able?(@x + 1, @y, I ut::UP))
$game_party.move_u er_right_party_actors
def jump(x_plus, y_plus)
# 新しい座標を計算
new_x = @x + x_plus
new_y = @y + y_plus
# 加算値が (0,0) の場合か、ジャンプ先が通行可能な場合
if (x_plus == 0 and y_plus == 0) or pa able?(new_x, new_y, 0)
$game_party.jump_party_actors(x_plus, y_plus)
super(x_plus, y_plus)
attr_reader :move_ eed
attr_reader :step_anime
end # module Train_Actor
cla Game_Party
include Train_Actor::Game_Party_Module
cla Game_Player
include Train_Actor::Game_Player_Module
cla Spriteset_Map
include Train_Actor::Spriteset_Map_Module
cla Scene_Map
include Train_Actor::Scene_Map_Module
#==============================================================================
# 本脚本来自
,使用和转载请保留此信息
#==============================================================================
当前离线
909390 帖子
16 阅读权限
10 在线时间
3 小时 注册时间
2009-10-11 Lv.2
16 精华
59 点 金钱
1196 G RP
0 点 发表于 2009-10-11 16:07
……这种东西果然不适合我们这些头脑简单的人看= =
2001-2009谁看过这篇博文
加载中…
字体大小:
RPG Maker XP脚本-人物跟随
(2010-06-24 15:49:33)
标签:
分类:
# ————————————————————————————————————
# 本脚本来自
,转载自
,转载请保留此信息
# ————————————————————————————————————
# ▼ #9650 #9660; XRXS13. パーティ列车移动 ver.1.02 ▼ #9650 #9660;
# by fukuyama
# Train_Actor
module Train_Actor #是否使用停止跟随的方法,也就是说,这里false改为true的时候,如果TRANSPARENT_SWITCHES_INDEX
#开关打开,跟随的人物就消失了(其实只是变成透明而已)
TRANSPARENT_SWITCH = true
TRANSPARENT_SWITCHES_INDEX = 50
#举例:第一个为true,第二个为50,则打开50号开关,后面的人都没了。 #跟随人数的最大数目,可以更改为2、3什么的。
TRAIN_ACTOR_SIZE_MAX = 4 # 定数
#I ut::DOWN = 2
#I ut::LEFT = 4
#I ut::RIGHT = 6
#I ut::UP = 6
DOWN_LEFT = 1
DOWN_RIGHT = 3
UP_LEFT = 7
UP_RIGHT = 9
JUMP = 5
cla Game_Party_Actor Game_Character
def initialize
super()
@through = true
def setup(actor)
# キャラクターのファイル名と色相を设定
if actor != nil
@character_name = actor.character_name
@character_hue = actor.character_hue
@character_name = ""
@character_hue = 0
# 不透明度と合成方法を初期化
@opacity = 255
@blend_type = 0
def screen_z(height = 0)
if $game_player.x == @x and $game_player.y == @y
return $game_player.screen_z(height) - 1
super(height)
#--------------------------------------------------------------------------
# ● 下に移动
# turn_enabled : その场での向き変更を许可するフラグ
#--------------------------------------------------------------------------
def move_down(turn_enabled = true)
# 下を向く
if turn_enabled
turn_down
# 通行可能な场合
if pa able?(@x, @y, I ut::DOWN)
# 下を向く
turn_down
# 座标を更新
@y += 1
#--------------------------------------------------------------------------
# ● 左に移动
# turn_enabled : その场での向き変更を许可するフラグ
#--------------------------------------------------------------------------
def move_left(turn_enabled = true)
# 左を向く
if turn_enabled
turn_left
# 通行可能な场合
if pa able?(@x, @y, I ut::LEFT)
# 左を向く
turn_left
# 座标を更新
@x -= 1
#--------------------------------------------------------------------------
# ● 右に移动
# turn_enabled : その场での向き変更を许可するフラグ
#--------------------------------------------------------------------------
def move_right(turn_enabled = true)
# 右を向く
if turn_enabled
turn_right
# 通行可能な场合
if pa able?(@x, @y, I ut::RIGHT)
# 右を向く
turn_right
# 座标を更新
@x += 1
#--------------------------------------------------------------------------
# ● 上に移动
# turn_enabled : その场での向き変更を许可するフラグ
#--------------------------------------------------------------------------
def move_up(turn_enabled = true)
# 上を向く
if turn_enabled
turn_up
# 通行可能な场合
if pa able?(@x, @y, I ut::UP)
# 上を向く
turn_up
# 座标を更新
@y -= 1
#--------------------------------------------------------------------------
# ● 左下に移动
#--------------------------------------------------------------------------
def move_lower_left
# 向き固定でない场合
unle @direction_fix
# 右向きだった场合は左を、上向きだった场合は下を向く
@direction = (@direction == I ut::RIGHT ? I ut::LEFT : @direction
== I ut::UP ? I ut::DOWN : @direction)
# 下→左、左→下 のどちらかのコースが通行可能な场合
if (pa able?(@x, @y, I ut::DOWN) and pa able?(@x, @y + 1,
I ut::LEFT)) or
(pa able?(@x, @y, I ut::LEFT) and pa able?(@x - 1, @y,
I ut::DOWN))
# 座标を更新
@x -= 1
@y += 1
#--------------------------------------------------------------------------
# ● 右下に移动
#--------------------------------------------------------------------------
def move_lower_right
# 向き固定でない场合
unle @direction_fix
# 左向きだった场合は右を、上向きだった场合は下を向く
@direction = (@direction == I ut::LEFT ? I ut::RIGHT : @direction
== I ut::UP ? I ut::DOWN : @direction)
# 下→右、右→下 のどちらかのコースが通行可能な场合
if (pa able?(@x, @y, I ut::DOWN) and pa able?(@x, @y + 1,
I ut::RIGHT)) or
(pa able?(@x, @y, I ut::RIGHT) and pa able?(@x + 1, @y,
I ut::DOWN))
# 座标を更新
@x += 1
@y += 1
#--------------------------------------------------------------------------
# ● 左上に移动
#--------------------------------------------------------------------------
def move_u er_left
# 向き固定でない场合
unle @direction_fix
# 右向きだった场合は左を、下向きだった场合は上を向く
@direction = (@direction == I ut::RIGHT ? I ut::LEFT : @direction
== I ut::DOWN ? I ut::UP : @direction)
# 上→左、左→上 のどちらかのコースが通行可能な场合
if (pa able?(@x, @y, I ut::UP) and pa able?(@x, @y - 1,
I ut::LEFT)) or
(pa able?(@x, @y, I ut::LEFT) and pa able?(@x - 1, @y,
I ut::UP))
# 座标を更新
@x -= 1
@y -= 1
#--------------------------------------------------------------------------
# ● 右上に移动
#--------------------------------------------------------------------------
def move_u er_right
# 向き固定でない场合
unle @direction_fix
# 左向きだった场合は右を、下向きだった场合は上を向く
@direction = (@direction == I ut::LEFT ? I ut::RIGHT : @direction
== I ut::DOWN ? I ut::UP : @direction)
# 上→右、右→上 のどちらかのコースが通行可能な场合
if (pa able?(@x, @y, I ut::UP) and pa able?(@x, @y - 1,
I ut::RIGHT)) or
(pa able?(@x, @y, I ut::RIGHT) and pa able?(@x + 1, @y,
I ut::UP))
# 座标を更新
@x += 1
@y -= 1
attr_writer :move_ eed
attr_writer :step_anime
module Spriteset_Map_Module
def setup_actor_character_ rites?
return @setup_actor_character_ rites_flag != nil
def setup_actor_character_ rites(characters)
if !setup_actor_character_ rites?
index_game_player = 0
@character_ rites.each_index do |i|
if @character_ rites[i].character.i tance_of?(Game_Player)
index_game_player = i
for character in characters.reverse
@character_ rites.u hift(
Sprite_Character.new(@viewport1, character)
@setup_actor_character_ rites_flag = true
module Scene_Map_Module
def setup_actor_character_ rites(characters)
@ riteset.setup_actor_character_ rites(characters)
module Game_Party_Module
def set_tra arent_actors(tra arent)
@tra arent = tra arent
def setup_actor_character_ rites
if @characters == nil
@characters = []
for i in 1 ... TRAIN_ACTOR_SIZE_MAX
@characters.push(Game_Party_Actor.new)
for i in 1 ... TRAIN_ACTOR_SIZE_MAX
@characters[i - 1].setup(actors[i])
$scene.cla .method_defined?('setup_actor_character_ rites')
$scene.setup_actor_character_ rites(@characters)
def update_party_actors
setup_actor_character_ rites
tra arent = $game_player.tra arent
if tra arent == false
if TRANSPARENT_SWITCH
tra arent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
for character in @characters
character.tra arent = tra arent
character.move_ eed = $game_player.move_ eed
character.step_anime = $game_player.step_anime
character.update
def moveto_party_actors( x, y )
setup_actor_character_ rites
for character in @characters
character.moveto( x, y )
if @move_list == nil
@move_list = []
move_list_setup
def move_party_actors
if @move_list == nil
@move_list = []
move_list_setup
@move_list.each_index do |i|
if @characters[i] != nil
case @move_list[i].type
when I ut::DOWN
@characters[i].move_down(@move_list[i].args[0])
when I ut::LEFT
@characters[i].move_left(@move_list[i].args[0])
when I ut::RIGHT
@characters[i].move_right(@move_list[i].args[0])
when I ut::UP
@characters[i].move_up(@move_list[i].args[0])
when DOWN_LEFT
@characters[i].move_lower_left
when DOWN_RIGHT
@characters[i].move_lower_right
when UP_LEFT
@characters[i].move_u er_left
when UP_RIGHT
@characters[i].move_u er_right
when JUMP
@characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
cla Move_List_Element
def initialize(type,args)
@type = type
@args = args
def type() return @type end
def args() return @args end
def move_list_setup
for i in 0 .. TRAIN_ACTOR_SIZE_MAX
@move_list[i] = nil
def add_move_list(type,*args)
@move_list.u hift(Move_List_Element.new(type,args)).pop
def move_down_party_actors(turn_enabled = true)
move_party_actors
add_move_list(I ut::DOWN,turn_enabled)
def move_left_party_actors(turn_enabled = true)
move_party_actors
add_move_list(I ut::LEFT,turn_enabled)
def move_right_party_actors(turn_enabled = true)
move_party_actors
add_move_list(I ut::RIGHT,turn_enabled)
def move_up_party_actors(turn_enabled = true)
move_party_actors
add_move_list(I ut::UP,turn_enabled)
def move_lower_left_party_actors
move_party_actors
add_move_list(DOWN_LEFT)
def move_lower_right_party_actors
move_party_actors
add_move_list(DOWN_RIGHT)
def move_u er_left_party_actors
move_party_actors
add_move_list(UP_LEFT)
def move_u er_right_party_actors
move_party_actors
add_move_list(UP_RIGHT)
def jump_party_actors(x_plus, y_plus)
move_party_actors
add_move_list(JUMP,x_plus, y_plus)
module Game_Player_Module
def update
$game_party.update_party_actors
def moveto( x, y )
$game_party.moveto_party_actors( x, y )
super( x, y )
def move_down(turn_enabled = true)
if pa able?(@x, @y, I ut::DOWN)
$game_party.move_down_party_actors(turn_enabled)
super(turn_enabled)
def move_left(turn_enabled = true)
if pa able?(@x, @y, I ut::LEFT)
$game_party.move_left_party_actors(turn_enabled)
super(turn_enabled)
def move_right(turn_enabled = true)
if pa able?(@x, @y, I ut::RIGHT)
$game_party.move_right_party_actors(turn_enabled)
super(turn_enabled)
def move_up(turn_enabled = true)
if pa able?(@x, @y, I ut::UP)
$game_party.move_up_party_actors(turn_enabled)
super(turn_enabled)
def move_lower_left
# 下→左、左→下 のどちらかのコースが通行可能な场合
if (pa able?(@x, @y, I ut::DOWN) and pa able?(@x, @y + 1,
I ut::LEFT)) or
(pa able?(@x, @y, I ut::LEFT) and pa able?(@x - 1, @y,
I ut::DOWN))
$game_party.move_lower_left_party_actors
def move_lower_right
# 下→右、右→下 のどちらかのコースが通行可能な场合
if (pa able?(@x, @y, I ut::DOWN) and pa able?(@x, @y + 1,
I ut::RIGHT)) or
(pa able?(@x, @y, I ut::RIGHT) and pa able?(@x + 1, @y,
I ut::DOWN))
$game_party.move_lower_right_party_actors
def move_u er_left
# 上→左、左→上 のどちらかのコースが通行可能な场合
if (pa able?(@x, @y, I ut::UP) and pa able?(@x, @y - 1,
I ut::LEFT)) or
(pa able?(@x, @y, I ut::LEFT) and pa able?(@x - 1, @y,
I ut::UP))
$game_party.move_u er_left_party_actors
def move_u er_right
# 上→右、右→上 のどちらかのコースが通行可能な场合
if (pa able?(@x, @y, I ut::UP) and pa able?(@x, @y - 1,
I ut::RIGHT)) or
(pa able?(@x, @y, I ut::RIGHT) and pa able?(@x + 1, @y,
I ut::UP))
$game_party.move_u er_right_party_actors
def jump(x_plus, y_plus)
# 新しい座标を计算
new_x = @x + x_plus
new_y = @y + y_plus
# 加算値が (0,0) の场合か、ジャンプ先が通行可能な场合
if (x_plus == 0 and y_plus == 0) or pa able?(new_x, new_y,
$game_party.jump_party_actors(x_plus, y_plus)
super(x_plus, y_plus)
attr_reader :move_ eed
attr_reader :step_anime
end # module Train_Actor
cla Game_Party
include Train_Actor::Game_Party_Module
cla Game_Player
include Train_Actor::Game_Player_Module
cla Spriteset_Map
include Train_Actor::Spriteset_Map_Module
cla Scene_Map
include Train_Actor::Scene_Map_Module
已投稿到:
加载中,请稍候......
前一篇:
后一篇:
评论 评论加载中,请稍候...
发评论 登录名:
密码:
记住登录状态
昵 称:
分享到微博 评论并转载此博文
验证码:
匿名评论
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。
< 前一篇
后一篇 gt;
***:4006900000 提示音后按1键(按当地市话标准计费) 欢迎批评指正
Copyright © 1996 - 2011 SINA Corporation,
All Rights Reserved
新浪公司本站论坛 ※ 站内搜索
栏&em 目:
搜索制作教程
搜索文章作品
搜索原创游戏
搜索制作素材
搜索周边下载
方&em 式:
以标题来查询
以内容来查询
关键词: ※ 教程分类
&em RMXP 图文教学
&em &em &em &em &em RMXP 录像教学
&em &em &em &em 周边教学
&em &em RMXP 脚本发布
&em &em &em &em &em &em RMVX 制作教学
&em &em &em &em ※ 无图目录 (按点击量横排序) 作者
未知(日本) 版本与更新 2005年4月更新 相关网址 范例工程
脚本功能
实现了让自己的队友跟在你后面的效果,以前的勇者斗恶龙是这样子的吧……还有仙剑1等经典游戏
使用方法
复制全部脚本内容,在Main脚本之前按i ert,插入此脚本全部内容。 注意!如果要在游戏中关闭跟随,请参考脚本注释!
相关截图
无 脚本内容
#==============================================================================
# 本脚本来自
,使用和转载请保留此信息
#==============================================================================
# ————————————————————————————————————
# ▼▲▼ XRXS13. パーティ列車移動 ver.1.02 ▼▲▼
# by fukuyama
# Train_Actor
module Train_Actor #是否使用停止跟随的方法,也就是说,这里false改为true的时候,如果TRANSPARENT_SWITCHES_INDEX
#开关打开,跟随的人物就消失了(其实只是变成透明而已)
TRANSPARENT_SWITCH = false
TRANSPARENT_SWITCHES_INDEX = 20
#举例:第一个为true,第二个为20,则打开20号开关,后面的人都没了。 #跟随人数的最大数目,可以更改为2、3什么的。
TRAIN_ACTOR_SIZE_MAX = 4 # 定数
#I ut::DOWN = 2
#I ut::LEFT = 4
#I ut::RIGHT = 6
#I ut::UP = 6
DOWN_LEFT = 1
DOWN_RIGHT = 3
UP_LEFT = 7
UP_RIGHT = 9
JUMP = 5
cla Game_Party_Actor Game_Character
def initialize
super()
@through = true
def setup(actor)
# キャラクターのファイル名と色相を設定
if actor != nil
@character_name = actor.character_name
@character_hue = actor.character_hue
@character_name = ""
@character_hue = 0
# 不透明度と合成方法を初期化
@opacity = 255
@blend_type = 0
def screen_z(height = 0)
if $game_player.x == @x and $game_player.y == @y
return $game_player.screen_z(height) - 1
super(height)
#--------------------------------------------------------------------------
# ● 下に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_down(turn_enabled = true)
# 下を向く
if turn_enabled
turn_down
# 通行可能な場合
if pa able?(@x, @y, I ut::DOWN)
# 下を向く
turn_down
# 座標を更新
@y += 1
#--------------------------------------------------------------------------
# ● 左に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_left(turn_enabled = true)
# 左を向く
if turn_enabled
turn_left
# 通行可能な場合
if pa able?(@x, @y, I ut::LEFT)
# 左を向く
turn_left
# 座標を更新
@x -= 1
#--------------------------------------------------------------------------
# ● 右に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_right(turn_enabled = true)
# 右を向く
if turn_enabled
turn_right
# 通行可能な場合
if pa able?(@x, @y, I ut::RIGHT)
# 右を向く
turn_right
# 座標を更新
@x += 1
#--------------------------------------------------------------------------
# ● 上に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_up(turn_enabled = true)
# 上を向く
if turn_enabled
turn_up
# 通行可能な場合
if pa able?(@x, @y, I ut::UP)
# 上を向く
turn_up
# 座標を更新
@y -= 1
#--------------------------------------------------------------------------
# ● 左下に移動
#--------------------------------------------------------------------------
def move_lower_left
# 向き固定でない場合
unle @direction_fix
# 右向きだった場合は左を、上向きだった場合は下を向く
@direction = (@direction == I ut::RIGHT ? I ut::LEFT : @direction == I ut::UP ? I ut::DOWN : @direction)
# 下→左、左→下 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::DOWN) and pa able?(@x, @y + 1, I ut::LEFT)) or
(pa able?(@x, @y, I ut::LEFT) and pa able?(@x - 1, @y, I ut::DOWN))
# 座標を更新
@x -= 1
@y += 1
#--------------------------------------------------------------------------
# ● 右下に移動
#--------------------------------------------------------------------------
def move_lower_right
# 向き固定でない場合
unle @direction_fix
# 左向きだった場合は右を、上向きだった場合は下を向く
@direction = (@direction == I ut::LEFT ? I ut::RIGHT : @direction == I ut::UP ? I ut::DOWN : @direction)
# 下→右、右→下 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::DOWN) and pa able?(@x, @y + 1, I ut::RIGHT)) or
(pa able?(@x, @y, I ut::RIGHT) and pa able?(@x + 1, @y, I ut::DOWN))
# 座標を更新
@x += 1
@y += 1
#--------------------------------------------------------------------------
# ● 左上に移動
#--------------------------------------------------------------------------
def move_u er_left
# 向き固定でない場合
unle @direction_fix
# 右向きだった場合は左を、下向きだった場合は上を向く
@direction = (@direction == I ut::RIGHT ? I ut::LEFT : @direction == I ut::DOWN ? I ut::UP : @direction)
# 上→左、左→上 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::UP) and pa able?(@x, @y - 1, I ut::LEFT)) or
(pa able?(@x, @y, I ut::LEFT) and pa able?(@x - 1, @y, I ut::UP))
# 座標を更新
@x -= 1
@y -= 1
#--------------------------------------------------------------------------
# ● 右上に移動
#--------------------------------------------------------------------------
def move_u er_right
# 向き固定でない場合
unle @direction_fix
# 左向きだった場合は右を、下向きだった場合は上を向く
@direction = (@direction == I ut::LEFT ? I ut::RIGHT : @direction == I ut::DOWN ? I ut::UP : @direction)
# 上→右、右→上 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::UP) and pa able?(@x, @y - 1, I ut::RIGHT)) or
(pa able?(@x, @y, I ut::RIGHT) and pa able?(@x + 1, @y, I ut::UP))
# 座標を更新
@x += 1
@y -= 1
attr_writer :move_ eed
attr_writer :step_anime
module Spriteset_Map_Module
def setup_actor_character_ rites?
return @setup_actor_character_ rites_flag != nil
def setup_actor_character_ rites(characters)
if !setup_actor_character_ rites?
index_game_player = 0
@character_ rites.each_index do |i|
if @character_ rites[i].character.i tance_of?(Game_Player)
index_game_player = i
for character in characters.reverse
@character_ rites.u hift(
Sprite_Character.new(@viewport1, character)
@setup_actor_character_ rites_flag = true
module Scene_Map_Module
def setup_actor_character_ rites(characters)
@ riteset.setup_actor_character_ rites(characters)
module Game_Party_Module
def set_tra arent_actors(tra arent)
@tra arent = tra arent
def setup_actor_character_ rites
if @characters == nil
@characters = []
for i in 1 ... TRAIN_ACTOR_SIZE_MAX
@characters.push(Game_Party_Actor.new)
for i in 1 ... TRAIN_ACTOR_SIZE_MAX
@characters[i - 1].setup(actors[i])
if $scene.cla .method_defined?('setup_actor_character_ rites')
$scene.setup_actor_character_ rites(@characters)
def update_party_actors
setup_actor_character_ rites
tra arent = $game_player.tra arent
if tra arent == false
if TRANSPARENT_SWITCH
tra arent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
for character in @characters
character.tra arent = tra arent
character.move_ eed = $game_player.move_ eed
character.step_anime = $game_player.step_anime
character.update
def moveto_party_actors( x, y )
setup_actor_character_ rites
for character in @characters
character.moveto( x, y )
if @move_list == nil
@move_list = []
move_list_setup
def move_party_actors
if @move_list == nil
@move_list = []
move_list_setup
@move_list.each_index do |i|
if @characters[i] != nil
case @move_list[i].type
when I ut::DOWN
@characters[i].move_down(@move_list[i].args[0])
when I ut::LEFT
@characters[i].move_left(@move_list[i].args[0])
when I ut::RIGHT
@characters[i].move_right(@move_list[i].args[0])
when I ut::UP
@characters[i].move_up(@move_list[i].args[0])
when DOWN_LEFT
@characters[i].move_lower_left
when DOWN_RIGHT
@characters[i].move_lower_right
when UP_LEFT
@characters[i].move_u er_left
when UP_RIGHT
@characters[i].move_u er_right
when JUMP
@characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
cla Move_List_Element
def initialize(type,args)
@type = type
@args = args
def type() return @type end
def args() return @args end
def move_list_setup
for i in 0 .. TRAIN_ACTOR_SIZE_MAX
@move_list[i] = nil
def add_move_list(type,*args)
@move_list.u hift(Move_List_Element.new(type,args)).pop
def move_down_party_actors(turn_enabled = true)
move_party_actors
add_move_list(I ut::DOWN,turn_enabled)
def move_left_party_actors(turn_enabled = true)
move_party_actors
add_move_list(I ut::LEFT,turn_enabled)
def move_right_party_actors(turn_enabled = true)
move_party_actors
add_move_list(I ut::RIGHT,turn_enabled)
def move_up_party_actors(turn_enabled = true)
move_party_actors
add_move_list(I ut::UP,turn_enabled)
def move_lower_left_party_actors
move_party_actors
add_move_list(DOWN_LEFT)
def move_lower_right_party_actors
move_party_actors
add_move_list(DOWN_RIGHT)
def move_u er_left_party_actors
move_party_actors
add_move_list(UP_LEFT)
def move_u er_right_party_actors
move_party_actors
add_move_list(UP_RIGHT)
def jump_party_actors(x_plus, y_plus)
move_party_actors
add_move_list(JUMP,x_plus, y_plus)
module Game_Player_Module
def update
$game_party.update_party_actors
def moveto( x, y )
$game_party.moveto_party_actors( x, y )
super( x, y )
def move_down(turn_enabled = true)
if pa able?(@x, @y, I ut::DOWN)
$game_party.move_down_party_actors(turn_enabled)
super(turn_enabled)
def move_left(turn_enabled = true)
if pa able?(@x, @y, I ut::LEFT)
$game_party.move_left_party_actors(turn_enabled)
super(turn_enabled)
def move_right(turn_enabled = true)
if pa able?(@x, @y, I ut::RIGHT)
$game_party.move_right_party_actors(turn_enabled)
super(turn_enabled)
def move_up(turn_enabled = true)
if pa able?(@x, @y, I ut::UP)
$game_party.move_up_party_actors(turn_enabled)
super(turn_enabled)
def move_lower_left
# 下→左、左→下 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::DOWN) and pa able?(@x, @y + 1, I ut::LEFT)) or
(pa able?(@x, @y, I ut::LEFT) and pa able?(@x - 1, @y, I ut::DOWN))
$game_party.move_lower_left_party_actors
def move_lower_right
# 下→右、右→下 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::DOWN) and pa able?(@x, @y + 1, I ut::RIGHT)) or
(pa able?(@x, @y, I ut::RIGHT) and pa able?(@x + 1, @y, I ut::DOWN))
$game_party.move_lower_right_party_actors
def move_u er_left
# 上→左、左→上 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::UP) and pa able?(@x, @y - 1, I ut::LEFT)) or
(pa able?(@x, @y, I ut::LEFT) and pa able?(@x - 1, @y, I ut::UP))
$game_party.move_u er_left_party_actors
def move_u er_right
# 上→右、右→上 のどちらかのコースが通行可能な場合
if (pa able?(@x, @y, I ut::UP) and pa able?(@x, @y - 1, I ut::RIGHT)) or
(pa able?(@x, @y, I ut::RIGHT) and pa able?(@x + 1, @y, I ut::UP))
$game_party.move_u er_right_party_actors
def jump(x_plus, y_plus)
# 新しい座標を計算
new_x = @x + x_plus
new_y = @y + y_plus
# 加算値が (0,0) の場合か、ジャンプ先が通行可能な場合
if (x_plus == 0 and y_plus == 0) or pa able?(new_x, new_y, 0)
$game_party.jump_party_actors(x_plus, y_plus)
super(x_plus, y_plus)
attr_reader :move_ eed
attr_reader :step_anime
end # module Train_Actor
cla Game_Party
include Train_Actor::Game_Party_Module
cla Game_Player
include Train_Actor::Game_Player_Module
cla Spriteset_Map
include Train_Actor::Spriteset_Map_Module
cla Scene_Map
include Train_Actor::Scene_Map_Module
#==============================================================================
# 本脚本来自
,使用和转载请保留此信息
#============================================================================== 脚本使用的通用说明
约定:本脚本来源于网络,任何人不得随意将本脚本应用于商业用途,如需转载,必须保留所有版权信息,如果是国内作者,最好征求作者同意——否则发生任何后果,66RPG不予负责。使用此脚本表示您默认接受上述约定。
不同脚本之间、尤其是不同作者脚本之间会有冲突
,本站会对已知脚本冲突进行简单说明。测试新脚本请下载本站提供的测试文件或者新建工程测试。脚本不要贪多,否则可能会互相冲突对您的游戏造成未知的影响。如果脚本内或者本站内提供了解释,请务必完全看完解释后再使用,如有问题,请到论坛讨论。 上一篇: 下一篇:
关于我们
支援本站
友情连接
站点目录
站内搜索
WWW.66RPG.COM,2005-2013 ^o^
&em Web
www.66rpg.com .66rpg.com