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

Project1

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

[已经解决] 怎样让人物实现自由跳跃

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
79 小时
注册时间
2012-1-21
帖子
57
跳转到指定楼层
1
发表于 2012-11-11 17:27:11 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
按一个特定的键就能跳跃   怎么让玩家能办到呢   比如按空格 就向所面对的方向跳2格

Lv1.梦旅人

梦石
0
星屑
109
在线时间
65 小时
注册时间
2012-9-28
帖子
99
2
发表于 2012-11-11 23:21:31 | 只看该作者
本帖最后由 kittyblain 于 2012-11-11 23:23 编辑

如果按钮 X 被按下 时
如果玩家面朝向 XX  时
设置移动路线 玩家 (忽略障碍 等待结束) 跳跃 +x  +x

基本上就是这么设置事件了- -   要把上下左右四个方向都做一遍。。。。(另外还需要一个公共事件,设置玩家的坐标的变量)
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
79 小时
注册时间
2012-1-21
帖子
57
3
 楼主| 发表于 2012-11-15 19:51:35 | 只看该作者
问题就是当X键被按下的这个条件要怎么弄啊。。。嗯拜托了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
616 小时
注册时间
2010-10-29
帖子
463
4
发表于 2012-11-16 07:39:34 | 只看该作者
Yanfly万能流 或 用Falcao的http://www.rpgmakervxace.net/top ... ls/page__hl__falcao(国内下载不了范例),或者VE的:http://victorscripts.wordpress.c ... nt/moving-platform/(国内下不了)。鉴于大部分下不了,只能用yanfly的了⋯⋯
脚本在此!
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Button Common Events v1.00
  4. # -- Last Updated: 2012.01.09
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-ButtonCommonEvents"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.09 - Started Script and Finished.
  15. #
  16. #==============================================================================
  17. # ▼ Introduction
  18. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  19. # RPG Maker VX Ace supports 8 different action buttons to use. However, only
  20. # 3 of those are used (A, B, and C) on the field map. The rest of them aren't
  21. # used at all. This script allows usage of the L, R, X, Y, and Z buttons by
  22. # binding them to common events.
  23. #
  24. #==============================================================================
  25. # ▼ Instructions
  26. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  27. # To install this script, open up your script editor and copy/paste this script
  28. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  29. #
  30. # Modify the COMMON_EVENT hash in the script module to adjust which common
  31. # events are used for each button.
  32. #
  33. #==============================================================================
  34. # ▼ Compatibility
  35. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  36. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  37. # it will run with RPG Maker VX without adjusting.
  38. #
  39. #==============================================================================

  40. module YEA
  41.   module BUTTON_EVENT
  42.    
  43.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  44.     # - Button Settings -
  45.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  46.     # This sets the common events that are to run when the particular button
  47.     # is pressed. The following chart shows the respective keyboard buttons.
  48.     #
  49.     #   :Button    Default Keyboard Button
  50.     #      :L        Q
  51.     #      :R        W
  52.     #      :X        A
  53.     #      :Y        S
  54.     #      :Z        D
  55.     #
  56.     # If you do not wish to associate a button with a common event, set the
  57.     # common event for that button to 0.
  58.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  59.     COMMON_EVENT ={
  60.     # :Button => Common Event,
  61.            :L =>   0,    # Does not run a common event.
  62.            :R =>   0,    # Does not run a common event.
  63.            :X =>   1,    # Runs common event 1.
  64.            :Y =>   2,    # Runs common event 2.
  65.            :Z =>   3,    # Runs common event 3.
  66.     } # Do not remove this.
  67.    
  68.   end # BUTTON_EVENT
  69. end # YEA

  70. #==============================================================================
  71. # ▼ Editting anything past this point may potentially result in causing
  72. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  73. # halitosis so edit at your own risk.
  74. #==============================================================================

  75. #==============================================================================
  76. # ■ Scene_Map
  77. #==============================================================================

  78. class Scene_Map < Scene_Base
  79.   
  80.   #--------------------------------------------------------------------------
  81.   # alias method: update_scene
  82.   #--------------------------------------------------------------------------
  83.   alias scene_map_update_scene_bce update_scene
  84.   def update_scene
  85.     scene_map_update_scene_bce
  86.     update_button_common_events unless scene_changing?
  87.   end
  88.   
  89.   #--------------------------------------------------------------------------
  90.   # new method: update_button_common_events
  91.   #--------------------------------------------------------------------------
  92.   def update_button_common_events
  93.     for key in YEA::BUTTON_EVENT::COMMON_EVENT
  94.       next unless Input.trigger?(key[0])
  95.       next if key[1] <= 0
  96.       $game_temp.reserve_common_event(key[1])
  97.     end
  98.   end
  99.   
  100. end # Scene_Map

  101. #==============================================================================
  102. #
  103. # ▼ End of File
  104. #
  105. #==============================================================================
复制代码
用法,修改Button Settings中的哈西表,将一个键位设置为一个公共事件,事件内容:分歧+跳跃(可以用$game_map来探测一下通行度)。

评分

参与人数 1梦石 +1 收起 理由
Mic_洛洛 + 1 认真回复的脚本党!

查看全部评分

我命令你给我点下面的东西!

LBQ Works
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
109
在线时间
65 小时
注册时间
2012-9-28
帖子
99
5
发表于 2012-11-16 12:05:38 | 只看该作者
本帖最后由 kittyblain 于 2012-11-16 12:10 编辑
北林隐士 发表于 2012-11-15 19:51
问题就是当X键被按下的这个条件要怎么弄啊。。。嗯拜托了



这个是猫自己用公共事件做的- - 因为不懂脚本,也是纯事件党- -  

猫还加入了体力消耗的限制,如果不需要可以把消耗的部分去掉就行了- -

ps:补充一下- -   va的按键判断,除了上下左右是一样的,其他的字母和键盘其实是不一样的- - (比如R其实默认的是键盘的W)  不过可以自己设置- -

评分

参与人数 1梦石 +1 收起 理由
Mic_洛洛 + 1 认真回答的事件党!

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-7 07:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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