Advertisement
Dekita

$D13x Msg Sfx v1.0

May 21st, 2013
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.62 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Message SFX
  5. # -- Author : Dekita
  6. # -- Version : 1.0
  7. # -- Level : Easy
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:MSG_SFX]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 19/o5/2o13 - Started, Finished,
  21. #
  22. #===============================================================================
  23. # ☆ Introduction
  24. #-------------------------------------------------------------------------------
  25. # Very simple script to play a sound effect for each character displayed
  26. # in message window's.
  27. #
  28. #===============================================================================
  29. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  30. #===============================================================================
  31. # 1. You MUST give credit to "Dekita" !!
  32. # 2. You are NOT allowed to repost this script.(or modified versions)
  33. # 3. You are NOT allowed to convert this script.
  34. # 4. You are NOT allowed to use this script for Commercial games.
  35. # 5. ENJOY!
  36. #
  37. # "FINE PRINT"
  38. # By using this script you hereby agree to the above terms and conditions,
  39. # if any violation of the above terms occurs "legal action" may be taken.
  40. # Not understanding the above terms and conditions does NOT mean that
  41. # they do not apply to you.
  42. # If you wish to discuss the terms and conditions in further detail you can
  43. # contact me at http://dekitarpg.wordpress.com/
  44. #
  45. #===============================================================================
  46. # ☆ Instructions
  47. #-------------------------------------------------------------------------------
  48. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  49. #
  50. #===============================================================================
  51. module Message_SFX
  52. #===============================================================================
  53.  
  54. Settings={
  55. :sound => "Audio\\SE\\Book1", # Sound Effect
  56. :volume => 60, # Volume
  57. :pitch => [80, 50], # [ base pitch, rand pitch ]
  58. :freq => 2, # Frequency of SFX (every :freq characters)
  59. :wait => 2, # Message Display Wait Time (between chars)
  60. :switch => 0, # Switch to stop / start message sfx
  61. }
  62.  
  63. #####################
  64. # CUSTOMISATION END #
  65. end #####################
  66. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  67. # #
  68. # http://dekitarpg.wordpress.com/ #
  69. # #
  70. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  71. #===============================================================================#
  72. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  73. # YES?\.\. #
  74. # OMG, REALLY? \| #
  75. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  76. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  77. #===============================================================================#
  78. class Window_Message < Window_Base
  79. #===============================================================================
  80. #-----------------------------------------------------------------------------
  81. # Alias List
  82. #-----------------------------------------------------------------------------
  83. alias :msg_sfx_init :initialize
  84. alias :msg_sfx_pnch :process_normal_character
  85. alias :msg_sfx_pnln :process_new_line
  86. alias :msg_sfx_pnpg :process_new_page
  87. #-----------------------------------------------------------------------------
  88. # Initialization
  89. #-----------------------------------------------------------------------------
  90. def initialize
  91. msg_sfx_init
  92. @char_ind = 0
  93. end
  94. #-----------------------------------------------------------------------------
  95. # Trigger Character Processing
  96. #-----------------------------------------------------------------------------
  97. def process_normal_character(c, pos)
  98. msg_sfx_pnch(c, pos)
  99. play_message_sound(c)
  100. end
  101. #-----------------------------------------------------------------------------
  102. # Trigger New Line
  103. #-----------------------------------------------------------------------------
  104. def process_new_line(text, pos)
  105. msg_sfx_pnln(text, pos)
  106. wait(Message_SFX::Settings[:wait])
  107. end
  108. #-----------------------------------------------------------------------------
  109. # Trigger New Page
  110. #-----------------------------------------------------------------------------
  111. def process_new_page(text, pos)
  112. msg_sfx_pnpg(text, pos)
  113. @char_ind = 0
  114. end
  115. #-----------------------------------------------------------------------------
  116. # Play Message Sound
  117. #-----------------------------------------------------------------------------
  118. def play_message_sound(char)
  119. @char_ind += 1
  120. switch = Message_SFX::Settings[:switch]
  121. return unless $game_switches[switch] if switch > 0
  122. return unless @char_ind % Message_SFX::Settings[:freq] == 0
  123. return unless (!@show_fast) && (!@line_show_fast)
  124. s = Message_SFX::Settings[:sound]
  125. v = Message_SFX::Settings[:volume]
  126. p = Message_SFX::Settings[:pitch][0]+rand(Message_SFX::Settings[:pitch][1])
  127. Audio.se_play(s, v, p) unless char == (" "||"\\"||"["||"]")
  128. Message_SFX::Settings[:wait].times { wait_for_one_character }
  129. end
  130.  
  131. end
  132.  
  133. #==============================================================================#
  134. # http://dekitarpg.wordpress.com/ #
  135. #==============================================================================#
  136. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement