Project1

标题: 怎样让人物实现自由跳跃 [打印本页]

作者: 北林隐士    时间: 2012-11-11 17:27
标题: 怎样让人物实现自由跳跃
按一个特定的键就能跳跃   怎么让玩家能办到呢   比如按空格 就向所面对的方向跳2格
作者: kittyblain    时间: 2012-11-11 23:21
本帖最后由 kittyblain 于 2012-11-11 23:23 编辑

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

基本上就是这么设置事件了- -   要把上下左右四个方向都做一遍。。。。(另外还需要一个公共事件,设置玩家的坐标的变量)
作者: 北林隐士    时间: 2012-11-15 19:51
问题就是当X键被按下的这个条件要怎么弄啊。。。嗯拜托了
作者: 896409879    时间: 2012-11-16 07:39
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来探测一下通行度)。
作者: kittyblain    时间: 2012-11-16 12:05
本帖最后由 kittyblain 于 2012-11-16 12:10 编辑
北林隐士 发表于 2012-11-15 19:51
问题就是当X键被按下的这个条件要怎么弄啊。。。嗯拜托了



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

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

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




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1