赞 | 40 |
VIP | 559 |
好人卡 | 234 |
积分 | 47 |
经验 | 251834 |
最后登录 | 2024-12-5 |
在线时间 | 5240 小时 |
Lv3.寻梦者 (版主) 八宝粥的基叔
- 梦石
- 0
- 星屑
- 4694
- 在线时间
- 5240 小时
- 注册时间
- 2009-4-29
- 帖子
- 14318
|
感谢LZ发现VX的一个固有BUG,我已经把它修正了。@Luciffer 可以来结帖了,请分类为【推荐问答】喵。
刚写的补丁,补充修订了VX_非官方补丁 2 [地图循环相关修正] —— By 赵云 & 诡异の猫
范例在此:
VX地图循环相关修正补丁.rar
(241.12 KB, 下载次数: 19)
补丁脚本在下面,复制到你的工程即可使用:- #==============================================================================
- # ■ 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
复制代码 |
评分
-
查看全部评分
|