查看: 13668|回复: 26

[原创发布] 全方向 像素移动

[复制链接]
梦石
0
星屑
2270
在线时间
125 小时
注册时间
2015-8-14
回帖
17
发表于 2015-8-14 11:02:18 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 Hello``Bubble 于 2015-8-18 08:55 编辑

说明事件指令“禁止斜触发”,用来制作传送,门,宝箱等事件。
使用时,在当前执行的事件页中的“任意”位置加入注释“禁止斜触发”即可。
PS  将移动处理、事件刷新、player刷新等方法,使用alias以提高兼容性。

其实就是让角色一次走半格,支持八方向。
rgss1默认走(默认关闭)
  1. $game_temp.rgss_move = true# 默认走
  2. $game_temp.dir_4 = true# 四方向走
复制代码
半格走(默认开启)
  1. $game_temp.rgss_move = false# 半格走
  2. $game_temp.dir_4 = false# 八方向走
复制代码
半格移动截图(4图) 半格走01.jpg
半格走02.jpg
半格走03.jpg
半格走04.jpg

触发截图(11图)柜台
柜台01.jpg
柜台02.jpg
柜台03.jpg
柜台04.jpg
一般
触发01.jpg
触发02.jpg
触发03.jpg
触发04.jpg
触发05.jpg
触发06.jpg
触发07.jpg

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

附件完整基础版
像素移动 基础版.zip (231.03 KB, 下载次数: 188)
更完整的斜向触发判断
像素移动 更完整斜触发.zip (231.21 KB, 下载次数: 274)

评分

参与人数 4星屑 +200 赞 +1 收起 理由
龙夫三拳tan + 1 塞糖
RyanBern + 100 精品文章+图书馆收录
·雾逝者· + 70 GJ
imsy + 30 塞糖

查看全部评分

梦石
0
星屑
320
在线时间
3601 小时
注册时间
2012-2-29
回帖
3320

黄金编剧

发表于 2015-8-15 11:16:35 | 显示全部楼层
{:2_270:}使用状况反馈——
左上、左下、右下这三组键每当有一组被同时按下,C键(包括其他可触发事件的按键)将失效
{:2_249:}不知LZ可有解决的方法?如能提供,感激不尽

点评

简单修改了下,兼容四方向图(如果是八方向图还要再修改下<其实就是把4方向图判断条件分开而已>)  发表于 2015-8-15 23:02
简化 高效 简约 便捷,为用户体验而思考。
回复

使用道具 举报

梦石
7
星屑
655
在线时间
131 小时
注册时间
2011-5-12
回帖
120
发表于 2018-5-28 19:57:16 | 显示全部楼层
不知道这算不算挖坟qwq
我尝试使用了这个脚本,但无论在我的哪个游戏中,都会打开游戏瞬间报错

脚本''的16行发生了NoMehtodError。
undefined method 'list' for nil:NilClass

我尝试把主角的出生点丢到别的地图去,又可以运行了,但把原本那个地图的事件搬过来以后还是会报错。

而且似乎有任何 自动处理 的事件在运行时,它就会报错,目前因为不知道这里的 list 是指什么,所以不知如何处理qwq

点评

请选择性放弃,我试过,冲突太多作者又不在了……好吧是未持续提供技术支持。这种脚本请慎重使用。  发表于 2018-6-1 10:22
回复 1 0

使用道具 举报

梦石
0
星屑
9726
在线时间
2775 小时
注册时间
2008-9-5
回帖
3458

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

发表于 2018-6-1 13:38:17 | 显示全部楼层
龙夫三拳tan 发表于 2018-5-28 19:57
不知道这算不算挖坟qwq
我尝试使用了这个脚本,但无论在我的哪个游戏中,都会打开游戏瞬间报错

在15行和16行之间插入一句
  1. return if @page.nil?
复制代码

评分

参与人数 1赞 +1 收起 理由
89444640 + 1 我很赞同

查看全部评分

回复

使用道具 举报

梦石
0
星屑
35258
在线时间
4171 小时
注册时间
2007-12-15
回帖
9490
发表于 2018-6-1 13:59:42 | 显示全部楼层
cinderelmini 发表于 2018-6-1 13:38
在15行和16行之间插入一句


试了一下,成功了,
原来我也因为这个跳出直接把此脚本定义为不能用。
但是脚本有个严重缺陷,没有开关控制,脚本一直在生效,造成影响ACT那段模拟的基础操作,请问有办法增加个开关,在不需要的时候关闭吗?
回复

使用道具 举报

梦石
0
星屑
42345
在线时间
6022 小时
注册时间
2006-11-10
回帖
6975
发表于 2018-6-1 15:08:19 | 显示全部楼层
本帖最后由 灯笼菜刀王 于 2018-6-1 15:10 编辑
89444640 发表于 2018-6-1 13:59
试了一下,成功了,
原来我也因为这个跳出直接把此脚本定义为不能用。
但是脚本有个严重缺陷,没有开关控 ...


其实作者已经提供开关了,而且人家第一行就说了~~

看不懂的话

插入下面的插件, 然后事件脚本里写  走半格  走默认  走四方  走八方  这样就会用了吧=。=

  1. class Interpreter
  2.    def 走半格
  3.       $game_temp.rgss_move = false
  4.   end
  5.   def 走默认
  6.       $game_temp.rgss_move = true
  7.   end
  8.   def 走四方
  9.      $game_temp.dir_4 = true
  10. end
  11. def 走八方
  12.     $game_temp.dir_4 = false
  13. end
  14. end
复制代码


点评

各种跳出- -b准是我复制哪里错了,还是算了,至少不乱加现在能正常运行,加了反而异常了  发表于 2018-6-1 16:51
然后找到game player 的 def update 这句,塞到下面去  发表于 2018-6-1 16:45
空格键加速那个,复制到哪里?  发表于 2018-6-1 16:44
所以官方这回出了个横版卷轴ACT游戏制作大师~,默认素材大小的对话必须给对准了位置,所以默认方式还是挺靠谱的,超过默认的全得执行设置事件位  发表于 2018-6-1 16:43
按键加速你还是把它整合到默认里吧,省得动不动就给你罢工,把那个脚本 unless 到 # 呼び戻す 之前那段复制下来,  发表于 2018-6-1 16:43
回复

使用道具 举报

梦石
0
星屑
9726
在线时间
2775 小时
注册时间
2008-9-5
回帖
3458

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

发表于 2018-6-1 15:15:19 | 显示全部楼层
89444640 发表于 2018-6-1 13:59
试了一下,成功了,
原来我也因为这个跳出直接把此脚本定义为不能用。
但是脚本有个严重缺陷,没有开关控 ...

脚本自带开关来着,我下的是那个完整斜移动的附件包,
那个工程的脚本前边把Game_Temp里新定义变量初始化的代码注释掉了,
需要初始化的话就把那些#删掉,就跟1楼的说明那样,不需要8方向的话就把dir4改成true,
默认关闭这个走半格的话,就把rgss_move改成true。
然后,在游戏里要用默认移动的时候就用【脚本】输入:
  1. $game_temp.rgss_move = true
复制代码

要用走半格的时候就用【脚本】输入:
  1. $game_temp.rgss_move = nil # 至于为什么不是false而是nil呢~~你猜~~
复制代码

四方向和8方向的更替也是一样的操作,上边两个脚本的rgss_move改成dir4就行了。

PS:由于作者把操控变量写在Game_Temp里了,所以这个开关状态不会保存在存档里。

点评

非常感谢耐心详细的解释,一会慢慢测试。刚才试了一下默认地图的,走起来手感顺溜多了。还需要慢慢试明雷、NPC对话、重力脚本兼容性  发表于 2018-6-1 15:49
回复

使用道具 举报

梦石
7
星屑
655
在线时间
131 小时
注册时间
2011-5-12
回帖
120
发表于 2018-6-13 15:49:18 | 显示全部楼层
cinderelmini 发表于 2018-6-1 13:38
在15行和16行之间插入一句

谢谢~不过我这边已经解决了
我尝试性在报错那个地方前面加上 if list != nil 问题就解决了,似乎只在个别场景里,会找不到list的值。

点评

准确的说是某(些)个事件当前没有满足出现条件的事件页,于是变量@page的值就是个nil,于是就导致无法调用.list方法啦~  发表于 2018-6-14 14:09
回复

使用道具 举报

梦石
0
星屑
301
在线时间
149 小时
注册时间
2012-8-26
回帖
37
发表于 2020-8-30 14:22:13 | 显示全部楼层
想请问大家,如果我要事件(不是主角)移动的时候走半格时应该怎么设置。
试了事件页插入脚本、注释啥的,好像没用。
挖坟贴
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部