Advertisement
Dekita

$D13x - Common Event Keys 1.0

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