Project1
标题:
纵横循环的地图斜着行走的事件会消失
[打印本页]
作者:
朽木布可凋夜
时间:
2013-8-23 10:48
标题:
纵横循环的地图斜着行走的事件会消失
做了个纵横循环的地图,里面很多气球在飞,气球事件穿透,在普通事件上方,路线为右上,重复,无视路障。
但是没一会儿我发现6个气球一个都找不到,后来我摁着ctrl追着一个气球跑,发现在地图边缘附近事件消失了,求怎样能让气球在循环地图循环【左右跑的事件都没问题
作者:
balloon80391
时间:
2013-8-23 11:43
作一個事件去記氣球的x.y軸值
當氣球到了地圖的末端時瞬移到地圖的另一端
(但是如果待在地圖邊緣看著氣球就會破功)
或者lz你乾脆用複製貼上把地圖弄大一點
再多弄些氣球
balloon
80391路過...
作者:
怪蜀黍
时间:
2013-9-14 14:35
感谢LZ发现VX的一个固有BUG,我已经把它修正了。
@Luciffer
可以来结帖了,请分类为【推荐问答】喵。
刚写的补丁,补充修订了
VX_非官方补丁 2 [地图循环相关修正] —— By 赵云 & 诡异の猫
范例在此:
VX地图循环相关修正补丁.rar
(241.12 KB, 下载次数: 19)
2013-9-14 14:31 上传
点击文件名下载附件
补丁脚本在下面,复制到你的工程即可使用:
#==============================================================================
# ■ VX_非官方补丁 2 [地图循环相关修正] —— By 赵云 & 诡异の猫
# (protosssonny修订版)
#------------------------------------------------------------------------------
# 补丁内容: 修正地图循环时,事件启动和坐标判定存在的相关问题.
# protosssonny修订内容:修正地图循环时,事件斜向移动导致事件消失的BUG。
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# ● 移动类型 : 接近
#--------------------------------------------------------------------------
def move_type_toward_player
sx = distance_x_from_player
sy = distance_y_from_player
if sx.abs + sy.abs >= 20
move_random
else
case rand(6)
when 0..3; move_toward_player
when 4; move_random
when 5; move_forward
end
end
end
end
class Game_Event
#--------------------------------------------------------------------------
# ● 判断接触事件启动
#--------------------------------------------------------------------------
def check_event_trigger_touch(x, y)
return if $game_map.interpreter.running?
if $game_map.loop_horizontal?
if x == $game_map.width
x -= $game_map.width
elsif x == -1
x += $game_map.width
end
end
if $game_map.loop_vertical?
if y == $game_map.height
y -= $game_map.height
elsif y == -1
y += $game_map.height
end
end
if @trigger == 2 and $game_player.pos?(x, y)
start if not jumping? and @priority_type == 1
end
end
end
class Game_Player
#--------------------------------------------------------------------------
# ● 判断接触事件的启动
# x : X 坐标
# y : Y 坐标
#--------------------------------------------------------------------------
def check_event_trigger_touch(x, y)
return false if $game_map.interpreter.running?
if $game_map.loop_horizontal?
if x == $game_map.width
x -= $game_map.width
elsif x == -1
x += $game_map.width
end
end
if $game_map.loop_vertical?
if y == $game_map.height
y -= $game_map.height
elsif y == -1
y += $game_map.height
end
end
result = false
for event in $game_map.events_xy(x, y)
if [1,2].include?(event.trigger) and event.priority_type == 1
event.start
result = true
end
end
return result
end
end
#==============================================================================
# 以下为protosssonny修订的内容
#=============================================================================
class Game_Character
#--------------------------------------------------------------------------
# ● 向左下移动
#--------------------------------------------------------------------------
def move_lower_left
unless @direction_fix
@direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
end
if (passable?(@x, @y+1) and passable?(@x-1, @y+1)) or
(passable?(@x-1, @y) and passable?(@x-1, @y+1))
@x = $game_map.round_x(@x-1)
@y = $game_map.round_y(@y+1)
@real_x = (@x+1)*256
@real_y = (@y-1)*256
increase_steps
@move_failed = false
else
@move_failed = true
end
end
#--------------------------------------------------------------------------
# ● 向右下移动
#--------------------------------------------------------------------------
def move_lower_right
unless @direction_fix
@direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
end
if (passable?(@x, @y+1) and passable?(@x+1, @y+1)) or
(passable?(@x+1, @y) and passable?(@x+1, @y+1))
@x = $game_map.round_x(@x+1)
@y = $game_map.round_y(@y+1)
@real_x = (@x-1)*256
@real_y = (@y-1)*256
increase_steps
@move_failed = false
else
@move_failed = true
end
end
#--------------------------------------------------------------------------
# ● 向左上移动
#--------------------------------------------------------------------------
def move_upper_left
unless @direction_fix
@direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
end
if (passable?(@x, @y-1) and passable?(@x-1, @y-1)) or
(passable?(@x-1, @y) and passable?(@x-1, @y-1))
@x = $game_map.round_x(@x-1)
@y = $game_map.round_y(@y-1)
@real_x = (@x+1)*256
@real_y = (@y+1)*256
increase_steps
@move_failed = false
else
@move_failed = true
end
end
#--------------------------------------------------------------------------
# ● 向右上移动
#--------------------------------------------------------------------------
def move_upper_right
unless @direction_fix
@direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
end
if (passable?(@x, @y-1) and passable?(@x+1, @y-1)) or
(passable?(@x+1, @y) and passable?(@x+1, @y-1))
@x = $game_map.round_x(@x+1)
@y = $game_map.round_y(@y-1)
@real_x = (@x-1)*256
@real_y = (@y+1)*256
increase_steps
@move_failed = false
else
@move_failed = true
end
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1