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

Project1

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

[已经解决] ACE有没有伪·八方向行走的脚本?

[复制链接]

Lv2.观梦者

梦石
0
星屑
775
在线时间
924 小时
注册时间
2006-6-26
帖子
1529
跳转到指定楼层
1
发表于 2012-9-25 20:09:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 1243852 于 2012-9-26 19:09 编辑

求伪·八方向行走的脚本,就是用四方向行走图斜着走的脚本。

点评

试试你要的是哪个。一样的话就用的我= =|||(捂脸)  发表于 2012-9-26 17:21
我是不是可以签名了?

Lv1.梦旅人

梦石
0
星屑
55
在线时间
177 小时
注册时间
2011-6-7
帖子
88
2
发表于 2012-9-25 22:25:11 | 只看该作者
  1. #==============================================================================
  2. #  ■8方向移动 for RGSS3 Ver1.01 by 星潟
  3. #
  4. #     功能: 1.可以设置角色往8方向移动.
  5. #           2.可以设置关于移动的一部分功能.
  6. #==============================================================================
  7. # 使用说明:
  8. #   ★通过开关操作切换8方向移动的ON/OFF和能够设置一切移动的禁止.
  9. #   ★根据开关操作调转奔跑判定键.
  10. #   ★根据变量操作实行奔跑速度的强化.
  11. #   ★根据开关切换追加奔跑禁止功能.
  12. #
  13. #==============================================================================

  14. module MOVE_CONTROL
  15.   #--------------------------------------------------------------------------
  16.   # ● 基本设置(新增定义)
  17.   #--------------------------------------------------------------------------
  18.   # 这个开关ON的时候禁止8方向移动,只能4方向移动
  19.   FOUR_MOVE_SWITCH = 41
  20.   
  21.   # 这个开关ON的时候禁止操作角色
  22.   MOVE_SEAL_SWITCH = 42
  23.   
  24.   # 这个开关ON的时候调转奔跑判定键
  25.   # 平时奔跑时按下奔跑键的状态变成通常行走
  26.   DASH_REV = 43
  27.   
  28.   # 这个开关ON的时候奔跑不能使用
  29.   # 开关切换使同一地图能够奔跑的场所和不能奔跑的场所区别开来
  30.   DASH_SEAL = 44
  31.   
  32.   # 这个变量比0大的时候奔跑速度会再次增加
  33.   DASH_PLUS = 15
  34.   
  35. end

  36. class Game_CharacterBase
  37.   #--------------------------------------------------------------------------
  38.   # ● 取得移动速度(考虑奔跑状态)(重定义)
  39.   #--------------------------------------------------------------------------
  40.   alias real_move_speed_8direction real_move_speed
  41.   def real_move_speed
  42.     if $game_variables[MOVE_CONTROL::DASH_PLUS] > 0
  43.       dash_plus = 1 + ($game_variables[MOVE_CONTROL::DASH_PLUS] * 0.1)
  44.       @move_speed + (dash? ? dash_plus : 0)
  45.     else
  46.       real_move_speed_8direction
  47.     end
  48.   end
  49. end

  50. class Game_Player < Game_Character
  51.   #--------------------------------------------------------------------------
  52.   # ● 判定奔跑状态(重定义)
  53.   #--------------------------------------------------------------------------
  54.   alias dash_rev? dash?
  55.   def dash?
  56.     return false if $game_switches[MOVE_CONTROL::DASH_SEAL] == true
  57.     if $game_switches[MOVE_CONTROL::DASH_REV] == true
  58.       return false if @move_route_forcing
  59.       return false if $game_map.disable_dash?
  60.       return false if vehicle
  61.       return false if Input.press?(:A)
  62.       return true
  63.     else
  64.       dash_rev?
  65.     end
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● 处理方向键输入作出的移动(重定义)
  69.   #--------------------------------------------------------------------------
  70.   alias move_by_input_8direction move_by_input
  71.   def move_by_input
  72.     return if $game_switches[MOVE_CONTROL::MOVE_SEAL_SWITCH] == true
  73.     if $game_switches[MOVE_CONTROL::FOUR_MOVE_SWITCH] == true
  74.       move_by_input_8direction
  75.       return
  76.     end
  77.     return if !movable? || $game_map.interpreter.running?
  78.     if Input.press?(:LEFT) && Input.press?(:DOWN)
  79.       if passable?(@x, @y, 4) && passable?(@x, @y, 2) &&
  80.         passable?(@x - 1, @y, 2) && passable?(@x, @y + 1, 4) &&
  81.         passable?(@x - 1, @y + 1, 6) && passable?(@x - 1, @y + 1, 8)
  82.         move_diagonal(4, 2)
  83.       elsif @direction == 4
  84.         if passable?(@x, @y, 2) && passable?(@x, @y + 1, 8)
  85.           move_straight(2)
  86.         elsif passable?(@x, @y, 4) && passable?(@x - 1, @y, 6)
  87.           move_straight(4)
  88.         end
  89.       elsif @direction == 2
  90.         if passable?(@x, @y, 4) && passable?(@x - 1, @y, 6)
  91.           move_straight(4)
  92.         elsif passable?(@x, @y, 2) && passable?(@x, @y + 1, 8)
  93.           move_straight(2)
  94.         else
  95.           move_straight(Input.dir4) if Input.dir4 > 0
  96.         end
  97.       else
  98.         move_straight(Input.dir4) if Input.dir4 > 0
  99.       end
  100.     elsif Input.press?(:RIGHT) && Input.press?(:DOWN)
  101.       if passable?(@x, @y, 6) && passable?(@x, @y, 2) &&
  102.         passable?(@x + 1, @y, 2) && passable?(@x, @y + 1, 6) &&
  103.         passable?(@x + 1, @y + 1, 4) && passable?(@x + 1, @y + 1, 8)
  104.         move_diagonal(6, 2)
  105.       elsif @direction == 6
  106.         if passable?(@x, @y, 2) && passable?(@x, @y + 1, 8)
  107.           move_straight(2)
  108.         elsif passable?(@x, @y, 6) && passable?(@x + 1, @y, 4)
  109.           move_straight(6)
  110.         end
  111.       elsif @direction == 2
  112.         if passable?(@x, @y, 6) && passable?(@x + 1, @y, 4)
  113.           move_straight(6)
  114.         elsif passable?(@x, @y, 2) && passable?(@x, @y + 1, 8)
  115.           move_straight(2)
  116.         else
  117.           move_straight(Input.dir4) if Input.dir4 > 0
  118.         end
  119.       else
  120.         move_straight(Input.dir4) if Input.dir4 > 0
  121.       end
  122.     elsif Input.press?(:LEFT) && Input.press?(:UP)
  123.       if passable?(@x, @y, 4) && passable?(@x, @y, 8) &&
  124.         passable?(@x - 1, @y, 8) && passable?(@x, @y - 1, 4) &&
  125.         passable?(@x - 1, @y - 1, 2) && passable?(@x - 1, @y - 1, 6)
  126.         move_diagonal(4, 8)
  127.       elsif @direction == 4
  128.         if passable?(@x, @y, 8) && passable?(@x, @y - 1, 2)
  129.           move_straight(8)
  130.         elsif passable?(@x, @y, 4) && passable?(@x - 1, @y, 6)
  131.           move_straight(4)
  132.         else
  133.           move_straight(Input.dir4) if Input.dir4 > 0
  134.         end
  135.       elsif @direction == 8
  136.         if passable?(@x, @y, 4) && passable?(@x - 1, @y, 6)
  137.           move_straight(4)
  138.         elsif passable?(@x, @y, 8) && passable?(@x, @y - 1, 2)
  139.           move_straight(8)
  140.         else
  141.           move_straight(Input.dir4) if Input.dir4 > 0
  142.         end
  143.       else
  144.         move_straight(Input.dir4) if Input.dir4 > 0
  145.       end
  146.     elsif Input.press?(:RIGHT) && Input.press?(:UP)
  147.       if passable?(@x, @y, 6) && passable?(@x, @y, 8) &&
  148.         passable?(@x + 1, @y, 8) && passable?(@x, @y - 1, 6) &&
  149.         passable?(@x + 1, @y - 1, 2) && passable?(@x + 1, @y - 1, 4)
  150.         move_diagonal(6, 8)
  151.       elsif @direction == 6
  152.         if passable?(@x, @y, 8) && passable?(@x, @y - 1, 2)
  153.           move_straight(8)
  154.         elsif passable?(@x, @y, 6) && passable?(@x + 1, @y, 4)
  155.           move_straight(6)
  156.         else
  157.           move_straight(Input.dir4) if Input.dir4 > 0
  158.         end
  159.       elsif @direction == 8
  160.         if passable?(@x, @y, 6) && passable?(@x + 1, @y, 4)
  161.           move_straight(6)
  162.         elsif passable?(@x, @y, 8) && passable?(@x, @y - 1, 2)
  163.           move_straight(8)
  164.         else
  165.           move_straight(Input.dir4) if Input.dir4 > 0
  166.         end
  167.       else
  168.         move_straight(Input.dir4) if Input.dir4 > 0
  169.       end
  170.     else
  171.       move_straight(Input.dir4) if Input.dir4 > 0
  172.     end
  173.     unless moving?
  174.       @direction = Input.dir4 unless Input.dir4 == 0
  175.     end
  176.   end
  177. end
复制代码
回复 支持 反对

使用道具 举报

Lv3.寻梦者

伴侣:北岛谜烟

梦石
0
星屑
2892
在线时间
3547 小时
注册时间
2012-8-7
帖子
12181

贵宾

3
发表于 2012-9-26 13:36:18 | 只看该作者
  1. #==============================================================================
  2. # ■ VXAce-RGSS3-26 8方向移動 [Ver.1.0.0]          by Claimh
  3. #------------------------------------------------------------------------------
  4. # 8方向の移動が可能となります。
  5. # 斜め移動ができない時に縦or横に移動できる場合は縦or横に移動するようになります。
  6. #==============================================================================

  7. class Game_Player < Game_Character
  8.   #--------------------------------------------------------------------------
  9.   # ● 方向ボタン入力による移動処理
  10.   #--------------------------------------------------------------------------
  11.   def move_by_input
  12.     return if !movable? || $game_map.interpreter.running?
  13.     if [1, 3, 7, 9].include?(Input.dir8)
  14.       case Input.dir8
  15.       when 1; move_diagonal(4, 2)
  16.       when 3; move_diagonal(6, 2)
  17.       when 7; move_diagonal(4, 8)
  18.       when 9; move_diagonal(6, 8)
  19.       end
  20.       return if @move_succeed
  21.     end
  22.     move_straight(Input.dir4) if Input.dir4 > 0
  23.   end
  24. end


  25. class Game_CharacterBase
  26.   #--------------------------------------------------------------------------
  27.   # ● 斜めに移動
  28.   #     horz : 横方向(4 or 6)
  29.   #     vert : 縦方向(2 or 8)
  30.   #--------------------------------------------------------------------------
  31.   alias move_diagonal_8dir move_diagonal
  32.   def move_diagonal(horz, vert)
  33.     if !passable?(@x, @y, horz) and !passable?(@x, @y, vert)
  34.       @move_succeed = false
  35.       return
  36.     end
  37.     return move_straight(horz) if passable?(@x, @y, horz) and !passable?(@x, @y, vert)
  38.     return move_straight(vert) if !passable?(@x, @y, horz) and passable?(@x, @y, vert)
  39.     move_diagonal_8dir(horz, vert)
  40.   end
  41. end
复制代码
嗯哼 ?

点评

怎么你这个比2楼的短那么多?  发表于 2012-9-26 13:58
本人收不到提醒(点评|回复|@人),总之有事情到空间留言一起普通普通
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-8 04:51

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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