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

Project1

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

[已经过期] 求教如何不使用地图卷动,直接跳转画面到NPC上?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
78 小时
注册时间
2011-9-17
帖子
102
跳转到指定楼层
1
发表于 2012-6-14 17:39:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 ushiromiya 于 2012-6-14 17:44 编辑

我大半经验都奉上了,请一定要帮帮我啊,之前也问过可是莫名其妙就坑了
以前XP上有过一个这样的脚本,设置移动路线脚本,“kds”就可以转向了,可是似乎不兼容,
错误提示如下
下面再度贴上代码,如果能修改能够兼容的话请教教我吧!
  1. #==============================================================================
  2. # ■ 华丽镜头移动脚本 by 黑暗之神Kaiser.DS
  3. #------------------------------------------------------------------------------
  4. #  1-插入此段脚本到Main前面
  5. #   2-功能
  6. #     a-[镜头平滑移动到事件/角色]
  7. #       在事件里的[设置移动路线]里选择需要镜头转向的角色输入脚本kds即可
  8. #     b-[镜头跟随事件]
  9. #       在事件里的[设置移动路线]选择好需要跟随的事件后输入脚本kds_move_start开
  10. #       始跟随,当不想跟随时再输入kds_move_over
  11. #==============================================================================
  12. $平滑移动 = nil
  13. class Scene_Map
  14. alias kds_update update
  15. def update
  16.     kds_update
  17.     if $平滑移动 != nil
  18.       cen_x = (320 - 16) * 4
  19.       cen_y = (240 - 16) * 4
  20.       max_x = ($game_map.width - 20) * 128
  21.       max_y = ($game_map.height - 15) * 128
  22.       display_x = [0, [$平滑移动.x * 128 - cen_x, max_x].min].max
  23.       display_y = [0, [$平滑移动.y * 128 - cen_y, max_y].min].max
  24.       if $game_map.display_x != display_x
  25.          if ($game_map.display_x - display_x).abs < 22
  26.            $game_map.display_x = display_x
  27.          else
  28.            $game_map.display_x += (display_x - $平滑移动.old_display_x)/8
  29.          end
  30.       end
  31.       if $game_map.display_y != display_y
  32.          if ($game_map.display_y - display_y).abs <= 22
  33.             $game_map.display_y = display_y
  34.          else
  35.             $game_map.display_y += (display_y - $平滑移动.old_display_y)/8
  36.          end
  37.       end
  38.       if $game_map.display_x == display_x and $game_map.display_y == display_y
  39.          $平滑移动.center($平滑移动.x, $平滑移动.y)
  40.          $平滑移动 = nil
  41.       end
  42.       return
  43.     end
  44. end
  45. end
  46. class Game_Character
  47. CENTER_X = (320 - 16) * 4
  48. CENTER_Y = (240 - 16) * 4
  49. attr_accessor :old_display_x
  50. attr_accessor :old_display_y
  51. attr_accessor :kds_move
  52. def center(x, y)
  53.     max_x = ($game_map.width - 20) * 128
  54.     max_y = ($game_map.height - 15) * 128
  55.     $game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max
  56.     $game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max
  57. end
  58. def kds
  59.     @old_display_x = $game_map.display_x
  60.     @old_display_y = $game_map.display_y
  61.     case @id
  62.     when 0
  63.       $平滑移动 = $game_player
  64.     else
  65.       $平滑移动 = $game_map.events[@id]
  66.     end
  67. end
  68. def kds_move_start
  69.       @kds_move = ""
  70. end
  71. def kds_move_over
  72.       @kds_move = nil
  73. end
  74. alias kds_update update
  75. def update
  76.     last_real_x = @real_x
  77.     last_real_y = @real_y
  78.     kds_update
  79.     if @kds_move != nil
  80.      if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
  81.        $game_map.scroll_down(@real_y - last_real_y)
  82.      end
  83.      if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
  84.        $game_map.scroll_left(last_real_x - @real_x)
  85.      end
  86.      if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
  87.       $game_map.scroll_right(@real_x - last_real_x)
  88.      end
  89.      if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
  90.        $game_map.scroll_up(last_real_y - @real_y)
  91.      end
  92.     end
  93. end
  94. end
  95. #==============================================================================
复制代码

评分

参与人数 1星屑 +400 收起 理由
迷糊的安安 + 400 问题过期,悬赏返还。

查看全部评分

Lv3.寻梦者

梦石
0
星屑
3954
在线时间
132 小时
注册时间
2012-1-7
帖子
208
2
发表于 2012-6-14 17:46:01 | 只看该作者
哥们,你加脚本的时候标题都不加一个,根本看不出哪个脚本出错啊!
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
78 小时
注册时间
2011-9-17
帖子
102
3
 楼主| 发表于 2012-6-14 17:48:24 | 只看该作者
swbxhlh 发表于 2012-6-14 17:46
哥们,你加脚本的时候标题都不加一个,根本看不出哪个脚本出错啊!

就是下面贴的这个脚本没加标题,抱歉了
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3954
在线时间
132 小时
注册时间
2012-1-7
帖子
208
4
发表于 2012-6-14 17:48:55 | 只看该作者
先把额外的脚本标题填上,再运行,然后把出问题的脚本出问题的那行上下几行截图下来


‘‘──swbxhlh于2012-6-14 18:04补充以下内容:

你是什么版本的?

’’
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
78 小时
注册时间
2011-9-17
帖子
102
5
 楼主| 发表于 2012-6-14 18:05:21 | 只看该作者
本帖最后由 ushiromiya 于 2012-6-14 18:06 编辑
swbxhlh 发表于 2012-6-14 17:48
先把额外的脚本标题填上,再运行,然后把出问题的脚本出问题的那行上下几行截图下来 ...




如上
会不会有分辨率方面的问题因为是XP的
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3954
在线时间
132 小时
注册时间
2012-1-7
帖子
208
6
发表于 2012-6-14 18:06:41 | 只看该作者
我在VA里试运行了你的脚本没有问题那
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
78 小时
注册时间
2011-9-17
帖子
102
7
 楼主| 发表于 2012-6-14 18:07:39 | 只看该作者
swbxhlh 发表于 2012-6-14 17:48
先把额外的脚本标题填上,再运行,然后把出问题的脚本出问题的那行上下几行截图下来

什么什么版本?
脚本是XP的
我用的是VA,6R下载的
回复

使用道具 举报

Lv4.逐梦者 (管理员)

砂上描绘的愿想

梦石
15
星屑
4035
在线时间
5071 小时
注册时间
2012-1-15
帖子
4618

开拓者贵宾短篇七成年组亚军剧作品鉴家

8
发表于 2012-6-14 18:20:31 | 只看该作者
最简单的办法是设置移动路线 玩家透明 然后跳跃过去

评分

参与人数 1星屑 +2 收起 理由
Mic_洛洛 + 2 我很赞同

查看全部评分

若后退就皆成谎言。
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3954
在线时间
132 小时
注册时间
2012-1-7
帖子
208
9
发表于 2012-6-14 18:21:08 | 只看该作者
话说脚本根本不兼容。。。


‘‘──swbxhlh于2012-6-14 18:22补充以下内容:

我试过了我开进去虽然没有报错但是脚本功能也无法使用,到这一步的时候就会卡死。
’’


‘‘──swbxhlh于2012-6-14 18:30补充以下内容:

[@]Mic_洛洛[/@]话说还不如重新求一个脚本。。。
’’

点评

话说兼容的话LZ还用提问么?=W=  发表于 2012-6-14 18:27
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
78 小时
注册时间
2011-9-17
帖子
102
10
 楼主| 发表于 2012-6-14 18:42:48 | 只看该作者
swbxhlh 发表于 2012-6-14 18:21
话说脚本根本不兼容。。。

那就从新求个脚本吧……怎么求啊,这样会不会伸手掉了啊
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-30 23:41

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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