Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - Message SFX
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:MSG_SFX]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 19/o5/2o13 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # Very simple script to play a sound effect for each character displayed
- # in message window's.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- #
- #===============================================================================
- module Message_SFX
- #===============================================================================
- Settings={
- :sound => "Audio\\SE\\Book1", # Sound Effect
- :volume => 60, # Volume
- :pitch => [80, 50], # [ base pitch, rand pitch ]
- :freq => 2, # Frequency of SFX (every :freq characters)
- :wait => 2, # Message Display Wait Time (between chars)
- :switch => 0, # Switch to stop / start message sfx
- }
- #####################
- # CUSTOMISATION END #
- end #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- class Window_Message < Window_Base
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- alias :msg_sfx_init :initialize
- alias :msg_sfx_pnch :process_normal_character
- alias :msg_sfx_pnln :process_new_line
- alias :msg_sfx_pnpg :process_new_page
- #-----------------------------------------------------------------------------
- # Initialization
- #-----------------------------------------------------------------------------
- def initialize
- msg_sfx_init
- @char_ind = 0
- end
- #-----------------------------------------------------------------------------
- # Trigger Character Processing
- #-----------------------------------------------------------------------------
- def process_normal_character(c, pos)
- msg_sfx_pnch(c, pos)
- play_message_sound(c)
- end
- #-----------------------------------------------------------------------------
- # Trigger New Line
- #-----------------------------------------------------------------------------
- def process_new_line(text, pos)
- msg_sfx_pnln(text, pos)
- wait(Message_SFX::Settings[:wait])
- end
- #-----------------------------------------------------------------------------
- # Trigger New Page
- #-----------------------------------------------------------------------------
- def process_new_page(text, pos)
- msg_sfx_pnpg(text, pos)
- @char_ind = 0
- end
- #-----------------------------------------------------------------------------
- # Play Message Sound
- #-----------------------------------------------------------------------------
- def play_message_sound(char)
- @char_ind += 1
- switch = Message_SFX::Settings[:switch]
- return unless $game_switches[switch] if switch > 0
- return unless @char_ind % Message_SFX::Settings[:freq] == 0
- return unless (!@show_fast) && (!@line_show_fast)
- s = Message_SFX::Settings[:sound]
- v = Message_SFX::Settings[:volume]
- p = Message_SFX::Settings[:pitch][0]+rand(Message_SFX::Settings[:pitch][1])
- Audio.se_play(s, v, p) unless char == (" "||"\\"||"["||"]")
- Message_SFX::Settings[:wait].times { wait_for_one_character }
- end
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement