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

Project1

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

[原创发布] 八方向像素移动 优化版

[复制链接]

Lv4.逐梦者

梦石
7
星屑
650
在线时间
130 小时
注册时间
2011-5-12
帖子
135
跳转到指定楼层
1
发表于 2018-10-9 17:55:34 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 龙夫三拳tan 于 2018-10-9 17:57 编辑

原脚本链接: https://rpg.blue/forum.php?mod=viewthread&tid=382432&highlight=%E5%83%8F%E7%B4%A0%E7%A7%BB%E5%8A%A8
原作者: @Hello``Bubble



优化内容:

1. 修复了 某些情况下, 某(些)个事件当前没有满足出现条件的事件页,于是变量@page的值就是个nil导致报错的情况.

2. 提高了操作灵活性, 半自动纠正移动方向. (尤其是贴着墙走时格外明显, 原版很容易出现卡墙不走的情况)

3. 把默认的"禁止斜触发"改成了 "允许斜触发". 因为大多数情况下物品还是不要斜触发的好, 否则两个事件靠在一起时很容易一次性把两个都触发了导致bug.





关于灵活性的提高方面, 如截图所示. 蓝色方向是玩家按键方向 (→+↑); 红色方向是系统自动纠正的移动方向.

原版本里, 假如你右边是一堵墙时, 你按 →+↑, 它判定你有右上角无法通行后, 就会让你傻傻地站在原地.

现在, 同样情况下, 它判定你右上角无法通行后, 会去判断你的上方和右方是否可通行, 然后把移动方向纠正向 上 或者 右. 在迷宫场景较多的游戏里, 这个改动可以大大提高移动手感. 目前测试暂时没bug

希望这个能帮上大家~


依旧是在Main之前新建一页帖进去即生效~

RUBY 代码复制
  1. class Game_Temp
  2.   attr_accessor :rgss_move, :dir_4
  3.   #alias rgss_initialize_xxxxxxxxx initialize  默认值???
  4.   #def initialize
  5.   #  rgss_initialize_xxxxxxxxx
  6.   #  @rgss_move = false
  7.   #  @dir_4 = false
  8.   #end
  9. end
  10. class Game_Event < Game_Character
  11.   attr_reader :touch_4
  12.   alias rgss_refresh refresh
  13.   def refresh
  14.     rgss_refresh
  15.     @touch_4 = true
  16.     if list != nil
  17.       for list in @page.list
  18.       if list.code == 108 or list.code == 408
  19.         if list.parameters[0] =~ /允许斜触发/
  20.           @touch_4 = false
  21.           break
  22.         end
  23.       end
  24.     end
  25.   end
  26.  
  27.  
  28.   end
  29. end
  30. class Game_Player < Game_Character
  31.   def x(f=nil)
  32.     return !f ? @x.to_i : @x
  33.   end
  34.   def y(f=nil)
  35.     return !f ? @y.to_i : @y
  36.   end
  37.   def to_i
  38.     @x = @x.to_i if @x.is_a?(Float)
  39.     @y = @y.to_i if @y.is_a?(Float)
  40.   end
  41.   def player_passable?(dir = @direction, px = @x, py = @y)
  42.     case dir
  43.     when 8
  44.       (py - 0.5).to_i == py.to_i or (passable?(px.to_i, py.to_i, 8) and
  45.       passable?((px + 0.5).to_i, py.to_i, 8))
  46.     when 2
  47.       passable?(px.to_i, py.to_i, 2) and
  48.       passable?((px + 0.5).to_i, py.to_i, 2)
  49.     when 4
  50.       (px - 0.5).to_i == px.to_i or (passable?(px.to_i, py.to_i, 4) and
  51.       passable?(px.to_i, (py + 0.5).to_i, 4))
  52.     when 6
  53.       passable?(px.to_i, py.to_i, 6) and
  54.       passable?(px.to_i, (py + 0.5).to_i, 6)
  55.     when 1
  56.       (player_passable?(4) and player_passable?(2, @x - 0.5)) or
  57.       (player_passable?(2) and player_passable?(4, @x, @y + 0.5))
  58.     when 3
  59.       (player_passable?(6) and player_passable?(2, @x + 0.5)) or
  60.       (player_passable?(2) and player_passable?(6, @x, @y + 0.5))
  61.     when 7
  62.       (player_passable?(4) and player_passable?(8, @x - 0.5)) or
  63.       (player_passable?(8) and player_passable?(4, @x, @y - 0.5))
  64.     when 9
  65.       (player_passable?(6) and player_passable?(8, @x + 0.5)) or
  66.       (player_passable?(8) and player_passable?(6, @x, @y - 0.5))
  67.     end
  68.   end
  69.   #--------------------------------------------------------------------------
  70.   # ● 接触事件启动判定
  71.   #--------------------------------------------------------------------------
  72.   def check_event_trigger_touch(x, y)
  73.     result = false
  74.     # 事件执行中的情况下
  75.     if $game_system.map_interpreter.running?
  76.       return result
  77.     end
  78.     # 全事件的循环
  79.     for event in $game_map.events.values
  80.       if event.touch_4
  81.         if (x - 0.5).to_i == x.to_i or
  82.           (y - 0.5).to_i == y.to_i
  83.           next
  84.         end
  85.       end
  86.       # 事件坐标与目标一致的情况下
  87.       if event.x == x.to_i and event.y == y.to_i and [1,2].include?(event.trigger)
  88.         # 跳跃中以外的情况下、启动判定是正面的事件
  89.         if not event.jumping? and not event.over_trigger?
  90.           event.start
  91.           result = true
  92.         end
  93.       end
  94.     end
  95.     return result
  96.   end
  97.   def player_check_event_trigger_touch(dir)
  98.     case dir
  99.     when 8
  100.       check_event_trigger_touch(@x, @y - 1)
  101.       if (@x + 0.5).to_i != @x.to_i
  102.         check_event_trigger_touch(@x + 1, @y - 1)
  103.       end
  104.     when 2
  105.       check_event_trigger_touch(@x, @y + 1)
  106.       if (@x + 0.5).to_i != @x.to_i
  107.         check_event_trigger_touch(@x + 1, @y + 1)
  108.       end
  109.     when 4
  110.       check_event_trigger_touch(@x - 1, @y)
  111.       if (@y + 0.5).to_i != @y.to_i
  112.         check_event_trigger_touch(@x - 1, @y + 1)
  113.       end
  114.     when 6
  115.       check_event_trigger_touch(@x + 1, @y)
  116.       if (@y + 0.5).to_i != @y.to_i
  117.         check_event_trigger_touch(@x + 1, @y + 1)
  118.       end
  119.     when 1
  120.       check_event_trigger_touch(@x - 1, @y + 1)
  121.       if (@x + 0.5).to_i != @x.to_i
  122.         check_event_trigger_touch(@x + 1 - 1, @y + 1)
  123.       end
  124.       check_event_trigger_touch(@x, @y + 1)
  125.       check_event_trigger_touch(@x - 1, @y)
  126.       if (@y + 0.5).to_i != @y.to_i
  127.         check_event_trigger_touch(@x - 1, @y + 1)
  128.       end
  129.     when 3
  130.       check_event_trigger_touch(@x + 1, @y + 1)
  131.       if (@x + 0.5).to_i != @x.to_i
  132.         check_event_trigger_touch(@x + 2, @y + 1)
  133.       end
  134.       check_event_trigger_touch(@x, @y + 1)
  135.       check_event_trigger_touch(@x + 1, @y)
  136.       if (@y + 0.5).to_i != @y.to_i
  137.         check_event_trigger_touch(@x + 1, @y + 1)
  138.       end
  139.     when 7
  140.       check_event_trigger_touch(@x - 1, @y - 1)
  141.       if (@x + 0.5).to_i != @x.to_i
  142.         check_event_trigger_touch(@x + 1 - 1, @y - 1)
  143.       end
  144.       check_event_trigger_touch(@x, @y - 1)
  145.       check_event_trigger_touch(@x - 1, @y)
  146.       if (@y + 0.5).to_i != @y.to_i
  147.         check_event_trigger_touch(@x - 1, @y - 1)
  148.       end
  149.     when 9
  150.       check_event_trigger_touch(@x + 1, @y - 1)
  151.       if (@x + 0.5).to_i != @x.to_i
  152.         check_event_trigger_touch(@x + 2, @y - 1)
  153.       end
  154.       check_event_trigger_touch(@x, @y - 1)
  155.       check_event_trigger_touch(@x + 1, @y)
  156.       if (@y + 0.5).to_i != @y.to_i
  157.         check_event_trigger_touch(@x + 1, @y - 1)
  158.       end
  159.     end
  160.   end
  161.   #--------------------------------------------------------------------------
  162.   # ● 同位置的事件启动判定
  163.   #--------------------------------------------------------------------------
  164.   def check_event_trigger_here(triggers)
  165.     result = false
  166.     # 事件执行中的情况下
  167.     if $game_system.map_interpreter.running?
  168.       return result
  169.     end
  170.     # 全部事件的循环
  171.     for event in $game_map.events.values
  172.       # 事件坐标与目标一致的情况下
  173.       if triggers.include?(event.trigger) and
  174.         ((event.x == @x.to_i and event.y == @y.to_i) or
  175.         (!event.touch_4 and event.x == (@x + 0.5).to_i and event.y == @y.to_i) or
  176.         (!event.touch_4 and event.x == @x.to_i and event.y == (@y + 0.5).to_i))
  177.         # 跳跃中以外的情况下、启动判定是同位置的事件
  178.         if not event.jumping? and event.over_trigger?
  179.           event.start
  180.           result = true
  181.         end
  182.       end
  183.     end
  184.     return result
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ● 正面事件的启动判定
  188.   #--------------------------------------------------------------------------
  189.   def check_event_trigger_there(triggers)
  190.     result = false
  191.     # 事件执行中的情况下
  192.     if $game_system.map_interpreter.running?
  193.       return result
  194.     end
  195.     # 计算正面坐标
  196.     new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
  197.     new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
  198.     # 全部事件的循环
  199.     for event in $game_map.events.values
  200.       if event.touch_4
  201.         if (new_x - 0.5).to_i == new_x.to_i or
  202.           (new_y - 0.5).to_i == new_y.to_i
  203.           next
  204.         end
  205.       end
  206.       # 事件坐标与目标一致的情况下
  207.       if !player_passable? and triggers.include?(event.trigger) and
  208.          ((event.x == new_x.to_i and event.y == new_y.to_i) or
  209.           (!event.touch_4 and event.x == (new_x + 0.5).to_i and event.y == new_y.to_i) or
  210.           (!event.touch_4 and event.x == new_x.to_i and event.y == (new_y + 0.5).to_i))
  211.         # 跳跃中以外的情况下、启动判定是正面的事件
  212.         if not event.jumping? and not event.over_trigger?
  213.           event.start
  214.           result = true
  215.         end
  216.       end
  217.       next if event.touch_4
  218.       case @direction
  219.       when 2
  220.         if triggers.include?(event.trigger) and
  221.           ((event.x == @x.to_i - 1 and event.y == @y.to_i + 1) or
  222.           (event.x == @x.to_i + 1 and event.y == @y.to_i + 1))
  223.           # 跳跃中以外的情况下、启动判定是斜面的事件
  224.           if not event.jumping? and not event.over_trigger?
  225.             event.start
  226.             result = true
  227.           end
  228.         end
  229.       when 4
  230.         next if @x.to_i != (@x + 0.5).to_i
  231.         if triggers.include?(event.trigger) and
  232.           ((event.x == @x.to_i - 1 and event.y == @y.to_i - 1) or
  233.           (event.x == @x.to_i - 1 and event.y == @y.to_i + 1))
  234.           # 跳跃中以外的情况下、启动判定是斜面的事件
  235.           if not event.jumping? and not event.over_trigger?
  236.             event.start
  237.             result = true
  238.           end
  239.         end
  240.       when 6
  241.         next if @x.to_i != (@x + 0.5).to_i
  242.         if triggers.include?(event.trigger) and
  243.           ((event.x == @x.to_i + 1 and event.y == @y.to_i - 1) or
  244.           (event.x == @x.to_i + 1 and event.y == @y.to_i + 1))
  245.           # 跳跃中以外的情况下、启动判定是斜面的事件
  246.           if not event.jumping? and not event.over_trigger?
  247.             event.start
  248.             result = true
  249.           end
  250.         end
  251.       when 8
  252.         if triggers.include?(event.trigger) and
  253.           ((event.x == @x.to_i - 1 and event.y == @y.to_i - 1) or
  254.           (event.x == @x.to_i + 1 and event.y == @y.to_i - 1))
  255.           # 跳跃中以外的情况下、启动判定是斜面的事件
  256.           if not event.jumping? and not event.over_trigger?
  257.             event.start
  258.             result = true
  259.           end
  260.         end
  261.       end
  262.     end
  263.     # 找不到符合条件的事件的情况下
  264.     if result == false
  265.       # 正面的元件是柜台的情况下
  266.       if $game_map.counter?(new_x, new_y)
  267.         # 计算 1 元件里侧的坐标
  268.         new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
  269.         new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
  270.         # 全事件的循环
  271.         for event in $game_map.events.values
  272.           if event.touch_4
  273.             if (new_x - 0.5).to_i == new_x.to_i or
  274.               (new_y - 0.5).to_i == new_y.to_i
  275.               next
  276.             end
  277.           end
  278.           # 事件坐标与目标一致的情况下
  279.           if triggers.include?(event.trigger) and
  280.             ((event.x == new_x.to_i and event.y == new_y.to_i) or
  281.             (!event.touch_4 and event.x == (new_x + 0.5).to_i and event.y == new_y.to_i) or
  282.             (!event.touch_4 and event.x == new_x.to_i and event.y == (new_y + 0.5).to_i))
  283.             # 跳跃中以外的情况下、启动判定是正面的事件
  284.             if not event.jumping? and not event.over_trigger?
  285.               event.start
  286.               result = true
  287.             end
  288.           end
  289.         end
  290.       end
  291.     end
  292.     return result
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● 向上移动
  296.   #     turn_enabled : 本场地位置更改许可标志
  297.   #--------------------------------------------------------------------------
  298.   def move_up(turn_enabled = true)
  299.     if $game_temp.rgss_move then
  300.       to_i ; super ; return
  301.     end
  302.     # 面向上
  303.     if turn_enabled
  304.       turn_up
  305.     end
  306.     # 可以通行的情况下
  307.     if player_passable?(8)
  308.       # 面向上
  309.       turn_up
  310.       # 更新坐标
  311.       @y -= 0.5
  312.       # 歩数増加
  313.       increase_steps
  314.     # 不能通行的情况下
  315.     else
  316.       # 接触事件的启动判定
  317.       player_check_event_trigger_touch(8)
  318.     end
  319.   end
  320.   #--------------------------------------------------------------------------
  321.   # ● 向下移动
  322.   #     turn_enabled : 本场地位置更改许可标志
  323.   #--------------------------------------------------------------------------
  324.   def move_down(turn_enabled = true)
  325.     if $game_temp.rgss_move then
  326.       to_i ; super ; return
  327.     end
  328.     # 面向下
  329.     if turn_enabled
  330.       turn_down
  331.     end
  332.     # 可以通行的场合
  333.     if player_passable?(2)
  334.       # 面向下
  335.       turn_down
  336.       # 更新坐标
  337.       @y += 0.5
  338.       # 增加步数
  339.       increase_steps
  340.     # 不能通行的情况下
  341.     else
  342.       # 接触事件的启动判定
  343.       player_check_event_trigger_touch(2)
  344.     end
  345.   end
  346.   #--------------------------------------------------------------------------
  347.   # ● 向左移动
  348.   #     turn_enabled : 本场地位置更改许可标志
  349.   #--------------------------------------------------------------------------
  350.   def move_left(turn_enabled = true)
  351.     if $game_temp.rgss_move then
  352.       to_i ; super ; return
  353.     end
  354.     # 面向左
  355.     if turn_enabled
  356.       turn_left
  357.     end
  358.     # 可以通行的情况下
  359.     if player_passable?(4)
  360.       # 面向左
  361.       turn_left
  362.       # 更新坐标
  363.       @x -= 0.5
  364.       # 增加步数
  365.       increase_steps
  366.     # 不能通行的情况下
  367.     else
  368.       # 接触事件的启动判定
  369.       player_check_event_trigger_touch(4)
  370.     end
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ● 向右移动
  374.   #     turn_enabled : 本场地位置更改许可标志
  375.   #--------------------------------------------------------------------------
  376.   def move_right(turn_enabled = true)
  377.     if $game_temp.rgss_move then
  378.       to_i ; super ; return
  379.     end
  380.     # 面向右
  381.     if turn_enabled
  382.       turn_right
  383.     end
  384.     # 可以通行的场合
  385.     if player_passable?(6)
  386.       # 面向右
  387.       turn_right
  388.       # 更新坐标
  389.       @x += 0.5
  390.       # 增加步数
  391.       increase_steps
  392.     # 不能通行的情况下
  393.     else
  394.       # 接触事件的启动判定
  395.       player_check_event_trigger_touch(6)
  396.     end
  397.   end
  398.   #--------------------------------------------------------------------------
  399.   # ● 向左下移动
  400.   #--------------------------------------------------------------------------
  401.   def move_lower_left
  402.     if $game_temp.rgss_move then
  403.       to_i ; super ; return
  404.     end
  405.     # 没有固定面向的场合
  406.     unless @direction_fix
  407.       # 朝向是右的情况下适合的面是左面、朝向是上的情况下适合的面是下面
  408.       @direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
  409.     end
  410.     # 下→左、左→下 的通道可以通行的情况下
  411.     if player_passable?(1)
  412.       # 更新坐标
  413.       @x -= 0.5
  414.       @y += 0.5
  415.       # 增加步数
  416.       increase_steps
  417.     else
  418.       # 接触事件的启动判定
  419.       player_check_event_trigger_touch(1)
  420.  
  421.       #向左或下绕路
  422.       if player_passable?(4)
  423.         move_left
  424.       elsif player_passable?(2)
  425.         move_down
  426.       end
  427.       #------------------
  428.  
  429.     end
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # ● 向右下移动
  433.   #--------------------------------------------------------------------------
  434.   def move_lower_right
  435.     if $game_temp.rgss_move then
  436.       to_i ; super ; return
  437.     end
  438.     # 没有固定面向的场合
  439.     unless @direction_fix
  440.       # 朝向是右的情况下适合的面是左面、朝向是上的情况下适合的面是下面
  441.       @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
  442.     end
  443.     # 下→右、右→下 的通道可以通行的情况下
  444.     if player_passable?(3)
  445.       # 更新坐标
  446.       @x += 0.5
  447.       @y += 0.5
  448.       # 增加步数
  449.       increase_steps
  450.     else
  451.       # 接触事件的启动判定
  452.       player_check_event_trigger_touch(3)
  453.  
  454.       #向右或下绕路
  455.       if player_passable?(6)
  456.         move_right
  457.       elsif player_passable?(2)
  458.         move_down
  459.       end
  460.       #------------------
  461.  
  462.     end
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   # ● 向左上移动
  466.   #--------------------------------------------------------------------------
  467.   def move_upper_left
  468.     if $game_temp.rgss_move then
  469.       to_i ; super ; return
  470.     end
  471.     # 没有固定面向的场合
  472.     unless @direction_fix
  473.       # 朝向是右的情况下适合的面是左面、朝向是上的情况下适合的面是下面
  474.       @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
  475.     end
  476.     # 上→左、左→上 的通道可以通行的情况下
  477.     if player_passable?(7)
  478.       # 更新坐标
  479.       @x -= 0.5
  480.       @y -= 0.5
  481.       # 增加步数
  482.       increase_steps
  483.     else
  484.       # 接触事件的启动判定
  485.       player_check_event_trigger_touch(7)
  486.  
  487.       #向左或上绕路
  488.       if player_passable?(4)
  489.         move_left
  490.       elsif player_passable?(8)
  491.         move_up
  492.       end
  493.       #------------------
  494.  
  495.     end
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # ● 向右上移动
  499.   #--------------------------------------------------------------------------
  500.   def move_upper_right
  501.     if $game_temp.rgss_move then
  502.       to_i ; super ; return
  503.     end
  504.     # 没有固定面向的场合
  505.     unless @direction_fix
  506.       # 朝向是右的情况下适合的面是左面、朝向是上的情况下适合的面是下面
  507.       @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
  508.     end
  509.     # 上→右、右→上 的通道可以通行的情况下
  510.     if player_passable?(9)
  511.       # 更新坐标
  512.       @x += 0.5
  513.       @y -= 0.5
  514.       # 增加步数
  515.       increase_steps
  516.     else
  517.       # 接触事件的启动判定
  518.       player_check_event_trigger_touch(9)
  519.  
  520.       #向右或下绕路
  521.       if player_passable?(6)
  522.         move_right
  523.       elsif player_passable?(8)
  524.         move_up
  525.       end
  526.       #------------------
  527.  
  528.  
  529.     end
  530.   end
  531.   #--------------------------------------------------------------------------
  532.   # ● 画面更新
  533.   #--------------------------------------------------------------------------
  534.   alias rgss_update update
  535.   def update
  536.     if $game_temp.dir_4
  537.       rgss_update
  538.       return
  539.     end
  540.     # 本地变量记录移动信息
  541.     last_moving = moving?
  542.     # 移动中、事件执行中、强制移动路线中、
  543.     # 信息窗口一个也不显示的时候
  544.     unless moving? or $game_system.map_interpreter.running? or
  545.            @move_route_forcing or $game_temp.message_window_showing
  546.       # 如果方向键被按下、主角就朝那个方向移动
  547.       case Input.dir8
  548.       when 1
  549.         move_lower_left
  550.       when 2
  551.         move_down
  552.       when 3
  553.         move_lower_right
  554.       when 4
  555.         move_left
  556.       when 6
  557.         move_right
  558.       when 7
  559.         move_upper_left
  560.       when 8
  561.         move_up
  562.       when 9
  563.         move_upper_right
  564.       end
  565.     end
  566.     # 本地变量记忆坐标
  567.     last_real_x = @real_x
  568.     last_real_y = @real_y
  569.     super
  570.     # 角色向下移动、画面上的位置在中央下方的情况下
  571.     if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
  572.       # 画面向下卷动
  573.       $game_map.scroll_down(@real_y - last_real_y)
  574.     end
  575.     # 角色向左移动、画面上的位置在中央左方的情况下
  576.     if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
  577.       # 画面向左卷动
  578.       $game_map.scroll_left(last_real_x - @real_x)
  579.     end
  580.     # 角色向右移动、画面上的位置在中央右方的情况下
  581.     if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
  582.       # 画面向右卷动
  583.       $game_map.scroll_right(@real_x - last_real_x)
  584.     end
  585.     # 角色向上移动、画面上的位置在中央上方的情况下
  586.     if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
  587.       # 画面向上卷动
  588.       $game_map.scroll_up(last_real_y - @real_y)
  589.     end
  590.     # 不在移动中的情况下
  591.     unless moving?
  592.       # 上次主角移动中的情况
  593.       if last_moving
  594.         # 与同位置的事件接触就判定为事件启动
  595.         result = check_event_trigger_here([1,2])
  596.         # 没有可以启动的事件的情况下
  597.         if result == false
  598.           # 调试模式为 ON 并且按下 CTRL 键的情况下除外
  599.           unless $DEBUG and Input.press?(Input::CTRL)
  600.             # 遇敌计数下降
  601.             if @encounter_count > 0
  602.               @encounter_count -= 1
  603.             end
  604.           end
  605.         end
  606.       end
  607.       # 按下 C 键的情况下
  608.       if Input.trigger?(Input::C)
  609.         # 判定为同位置以及正面的事件启动
  610.         check_event_trigger_here([0])
  611.         check_event_trigger_there([0,1,2])
  612.       end
  613.     end
  614.   end
  615. end

QQ图片20181009202615.png (9.04 KB, 下载次数: 13)

自动纠正方向

自动纠正方向

QQ图片20181009202619.png (6.69 KB, 下载次数: 14)

自动拐弯

自动拐弯

QQ截图20181009202529.png (109.3 KB, 下载次数: 17)

原帖

原帖

评分

参与人数 1+1 收起 理由
真·可乐 + 1 塞糖

查看全部评分

Lv2.观梦者

梦石
0
星屑
786
在线时间
53 小时
注册时间
2018-1-1
帖子
50
2
发表于 2018-12-2 14:57:54 | 只看该作者
不能跟 人物跟随系统 一起用呀~ 角色走的时候队友傻傻的站着不动
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
7
星屑
650
在线时间
130 小时
注册时间
2011-5-12
帖子
135
3
 楼主| 发表于 2018-12-5 23:27:47 | 只看该作者
2224573639 发表于 2018-12-2 14:57
不能跟 人物跟随系统 一起用呀~ 角色走的时候队友傻傻的站着不动

这个应该原版脚本也不能来着, 我改的部分应该不涉及那些的说
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
189
在线时间
18 小时
注册时间
2020-5-23
帖子
18
4
发表于 2020-5-31 02:28:37 | 只看该作者
第544行发生了NoMethodError
Undefind method "map_interpreter" for #<Game_system:0x1e0d878>
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
296
在线时间
149 小时
注册时间
2012-8-26
帖子
41
5
发表于 2020-8-30 14:27:09 | 只看该作者
很好用,比原版行走丝滑多了
想问下,如果我想让事件(不是主角)行走八方向和半格,应该怎么设置?
还有,这个八方向能换行走图吗,就是奔跑状态的八个方向
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-19 20:32

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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