Advertisement
Dekita

$D13x - Common Event Keys 1.1

May 21st, 2013
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.11 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Common Event Keys
  5. # -- Author : Dekita
  6. # -- Version : 1.1
  7. # -- Level : Easy / Normal
  8. # -- Requires : $D13x Core v1.6
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Common_Ev_Keys]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 17/o5/2o13 - Update, (Key Menu HUD now shows Event Keys)
  21. # o4/o4/2o13 - Started, Finished,
  22. #
  23. #===============================================================================
  24. # ☆ Introduction
  25. #-------------------------------------------------------------------------------
  26. # This script simply allows for common events to be triggered when a key has
  27. # been triggered (initially pressed), you can have as many common event keys
  28. # as you wish.
  29. # Option to disable each common event key with its own switch.
  30. # And the option to disable all common event keys while moving.
  31. #
  32. #===============================================================================
  33. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  34. #===============================================================================
  35. # 1. You MUST give credit to "Dekita" !!
  36. # 2. You are NOT allowed to repost this script.(or modified versions)
  37. # 3. You are NOT allowed to convert this script.
  38. # 4. You are NOT allowed to use this script for Commercial games.
  39. # 5. ENJOY!
  40. #
  41. # "FINE PRINT"
  42. # By using this script you hereby agree to the above terms and conditions,
  43. # if any violation of the above terms occurs "legal action" may be taken.
  44. # Not understanding the above terms and conditions does NOT mean that
  45. # they do not apply to you.
  46. # If you wish to discuss the terms and conditions in further detail you can
  47. # contact me at http://dekitarpg.wordpress.com/
  48. #
  49. #===============================================================================
  50. # ☆ Instructions
  51. #-------------------------------------------------------------------------------
  52. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  53. #
  54. #===============================================================================
  55. # ☆ HELP
  56. #-------------------------------------------------------------------------------
  57. # For a list of possible key symbols check the help section of the
  58. # $D13x core script.
  59. #
  60. #===============================================================================
  61. module CMN_Ev_Keys
  62. #===============================================================================
  63. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  64. # ☆ General Settings
  65. #-----------------------------------------------------------------------------
  66. # Make this false to dis-allow common events to be triggered
  67. # while player is moving.
  68. Trigger_While_Move = true
  69.  
  70. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  71. # ☆ Event Key Settings
  72. #-----------------------------------------------------------------------------
  73. # :ID = the id of the key to press for the event to trigger.
  74. # event = is the id of the common event to trigger
  75. # switch = the id of the switch to enable/disable the key trigger
  76. # ^- leave switch 0 to always allow the key to trigger the event.
  77. # show, x, y, icon && hue are only used if using my key menu HUD script.
  78. Triggers=[
  79. # [ :ID , Event , switch , show?, x , y , icon , hue]
  80. [ :T , 1 , 7 , true , 184, 2 , 114 , 0 ],
  81. [ :V , 2 , 8 , true , 210, 2 , 4 , 0 ],
  82. [ :B , 3 , 9 , true , 236, 2 , 9 , 0 ],
  83. # << Add more [key,event,switch], here.
  84. ]# << Keep
  85. #####################
  86. # CUSTOMISATION END #
  87. end #####################
  88. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  89. # #
  90. # http://dekitarpg.wordpress.com/ #
  91. # #
  92. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  93. #===============================================================================#
  94. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  95. # YES?\.\. #
  96. # OMG, REALLY? \| #
  97. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  98. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  99. #===============================================================================#
  100. module CMN_Ev_Keys
  101. #===============================================================================
  102. #--------------------------------------------------------------------------
  103. # Update Method For Common Event Triggers
  104. #--------------------------------------------------------------------------
  105. def update_cmn_ev_keys
  106. return unless !$game_map.interpreter.running?
  107. return if $game_player.moving? unless Trigger_While_Move
  108. Triggers.each do |block|
  109. next if (block[2] != 0) && (!$game_switches[block[2]])
  110. if (Keys.trigger?(Keys::Key[block[0]])) && (block[1] != 0)
  111. $game_temp.reserve_common_event( block[1] )
  112. end
  113. end
  114. end
  115.  
  116. end
  117.  
  118. #===============================================================================
  119. class Scene_Map < Scene_Base
  120. #===============================================================================
  121. #--------------------------------------------------------------------------
  122. # Included Modules
  123. #--------------------------------------------------------------------------
  124. include CMN_Ev_Keys
  125. #--------------------------------------------------------------------------
  126. # Alias List
  127. #--------------------------------------------------------------------------
  128. alias :update_deki_cmnevs :update
  129. #--------------------------------------------------------------------------
  130. # Frame Update
  131. #--------------------------------------------------------------------------
  132. def update
  133. update_deki_cmnevs
  134. update_cmn_ev_keys
  135. end
  136.  
  137. end
  138.  
  139. #==============================================================================#
  140. # http://dekitarpg.wordpress.com/ #
  141. #==============================================================================#
  142. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement