设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1643|回复: 2
打印 上一主题 下一主题

[推荐问答] 纵横循环的地图斜着行走的事件会消失

[复制链接]

Lv4.逐梦者

梦石
8
星屑
559
在线时间
65 小时
注册时间
2013-1-1
帖子
67
跳转到指定楼层
1
发表于 2013-8-23 10:48:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
做了个纵横循环的地图,里面很多气球在飞,气球事件穿透,在普通事件上方,路线为右上,重复,无视路障。
但是没一会儿我发现6个气球一个都找不到,后来我摁着ctrl追着一个气球跑,发现在地图边缘附近事件消失了,求怎样能让气球在循环地图循环【左右跑的事件都没问题

评分

参与人数 2星屑 +100 收起 理由
怪蜀黍 + 60 推荐问答可以得到100糖的回馈
Luciffer + 40 回馈

查看全部评分

Lv1.梦旅人

梦石
0
星屑
50
在线时间
10 小时
注册时间
2013-8-20
帖子
26
2
发表于 2013-8-23 11:43:53 | 只看该作者
作一個事件去記氣球的x.y軸值
當氣球到了地圖的末端時瞬移到地圖的另一端
(但是如果待在地圖邊緣看著氣球就會破功)
或者lz你乾脆用複製貼上把地圖弄大一點
再多弄些氣球
balloon80391路過...
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

八宝粥的基叔

梦石
0
星屑
4504
在线时间
5228 小时
注册时间
2009-4-29
帖子
14318

贵宾

3
发表于 2013-9-14 14:35:54 | 只看该作者
感谢LZ发现VX的一个固有BUG,我已经把它修正了。@Luciffer 可以来结帖了,请分类为【推荐问答】喵。


刚写的补丁,补充修订了VX_非官方补丁 2 [地图循环相关修正]    —— By 赵云 & 诡异の猫
范例在此: VX地图循环相关修正补丁.rar (241.12 KB, 下载次数: 19)
补丁脚本在下面,复制到你的工程即可使用:
  1. #==============================================================================
  2. # ■ VX_非官方补丁 2 [地图循环相关修正]    —— By 赵云 & 诡异の猫
  3. # (protosssonny修订版)
  4. #------------------------------------------------------------------------------
  5. #    补丁内容: 修正地图循环时,事件启动和坐标判定存在的相关问题.
  6. #    protosssonny修订内容:修正地图循环时,事件斜向移动导致事件消失的BUG。
  7. #==============================================================================
  8. class Game_Character
  9.   #--------------------------------------------------------------------------
  10.   # ● 移动类型 : 接近
  11.   #--------------------------------------------------------------------------
  12.   def move_type_toward_player
  13.     sx = distance_x_from_player
  14.     sy = distance_y_from_player
  15.     if sx.abs + sy.abs >= 20
  16.       move_random
  17.     else
  18.       case rand(6)
  19.       when 0..3;  move_toward_player
  20.       when 4;     move_random
  21.       when 5;     move_forward
  22.       end
  23.     end
  24.   end
  25. end

  26. class Game_Event
  27.   #--------------------------------------------------------------------------
  28.   # ● 判断接触事件启动
  29.   #--------------------------------------------------------------------------
  30.   def check_event_trigger_touch(x, y)
  31.     return if $game_map.interpreter.running?
  32.     if $game_map.loop_horizontal?
  33.       if x == $game_map.width
  34.         x -= $game_map.width
  35.       elsif x == -1
  36.         x += $game_map.width
  37.       end
  38.     end
  39.     if $game_map.loop_vertical?
  40.       if y == $game_map.height
  41.         y -= $game_map.height
  42.       elsif y == -1
  43.         y += $game_map.height
  44.       end
  45.     end  
  46.     if @trigger == 2 and $game_player.pos?(x, y)
  47.       start if not jumping? and @priority_type == 1
  48.     end
  49.   end
  50. end

  51. class Game_Player
  52.   #--------------------------------------------------------------------------
  53.   # ● 判断接触事件的启动
  54.   #     x : X 坐标
  55.   #     y : Y 坐标
  56.   #--------------------------------------------------------------------------
  57.   def check_event_trigger_touch(x, y)
  58.     return false if $game_map.interpreter.running?
  59.     if $game_map.loop_horizontal?
  60.       if x == $game_map.width
  61.         x -= $game_map.width
  62.       elsif x == -1
  63.         x += $game_map.width
  64.       end
  65.     end
  66.     if $game_map.loop_vertical?
  67.       if y == $game_map.height
  68.         y -= $game_map.height
  69.       elsif y == -1
  70.         y += $game_map.height
  71.       end
  72.     end
  73.     result = false
  74.     for event in $game_map.events_xy(x, y)
  75.       if [1,2].include?(event.trigger) and event.priority_type == 1
  76.         event.start
  77.         result = true
  78.       end
  79.     end
  80.     return result
  81.   end
  82. end

  83. #==============================================================================
  84. # 以下为protosssonny修订的内容
  85. #=============================================================================
  86. class Game_Character
  87.   #--------------------------------------------------------------------------
  88.   # ● 向左下移动
  89.   #--------------------------------------------------------------------------
  90.   def move_lower_left
  91.     unless @direction_fix
  92.       @direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
  93.     end
  94.     if (passable?(@x, @y+1) and passable?(@x-1, @y+1)) or
  95.        (passable?(@x-1, @y) and passable?(@x-1, @y+1))
  96.       @x = $game_map.round_x(@x-1)
  97.       @y = $game_map.round_y(@y+1)
  98.       @real_x = (@x+1)*256
  99.       @real_y = (@y-1)*256
  100.       increase_steps
  101.       @move_failed = false
  102.     else
  103.       @move_failed = true
  104.     end
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● 向右下移动
  108.   #--------------------------------------------------------------------------
  109.   def move_lower_right
  110.     unless @direction_fix
  111.       @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
  112.     end
  113.     if (passable?(@x, @y+1) and passable?(@x+1, @y+1)) or
  114.        (passable?(@x+1, @y) and passable?(@x+1, @y+1))
  115.       @x = $game_map.round_x(@x+1)
  116.       @y = $game_map.round_y(@y+1)
  117.       @real_x = (@x-1)*256
  118.       @real_y = (@y-1)*256
  119.       increase_steps
  120.       @move_failed = false
  121.     else
  122.       @move_failed = true
  123.     end
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● 向左上移动
  127.   #--------------------------------------------------------------------------
  128.   def move_upper_left
  129.     unless @direction_fix
  130.       @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
  131.     end
  132.     if (passable?(@x, @y-1) and passable?(@x-1, @y-1)) or
  133.        (passable?(@x-1, @y) and passable?(@x-1, @y-1))
  134.       @x = $game_map.round_x(@x-1)
  135.       @y = $game_map.round_y(@y-1)
  136.       @real_x = (@x+1)*256
  137.       @real_y = (@y+1)*256
  138.       increase_steps
  139.       @move_failed = false
  140.     else
  141.       @move_failed = true
  142.     end
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # ● 向右上移动
  146.   #--------------------------------------------------------------------------
  147.   def move_upper_right
  148.     unless @direction_fix
  149.       @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
  150.     end
  151.     if (passable?(@x, @y-1) and passable?(@x+1, @y-1)) or
  152.        (passable?(@x+1, @y) and passable?(@x+1, @y-1))
  153.       @x = $game_map.round_x(@x+1)
  154.       @y = $game_map.round_y(@y-1)
  155.       @real_x = (@x-1)*256
  156.       @real_y = (@y+1)*256
  157.       increase_steps
  158.       @move_failed = false
  159.     else
  160.       @move_failed = true
  161.     end
  162.   end
  163. end
复制代码

评分

参与人数 1星屑 +100 梦石 +1 收起 理由
Luciffer + 100 + 1 还真是个有趣的BUG

查看全部评分

《逝去的回忆3:四叶草之梦》真情发布,欢迎点击图片下载试玩喵。

《逝去的回忆3》的讨论群:
一群:192885514
二群:200460747
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-23 23:44

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表