Hi,
I am using the Message Window SE Script by FenixFyreX that adds a typewriter effect to the message window text and also adds a sound for it. It works fine, but I don't want to have this effect for every message window. Is there a way to write a switch for it so that I can turn it off for some of the messages (for instance, dialogues)?
Here is the script:
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # # Message Window SEs v1.0 # FenixFyreX # RPG Maker VxAce # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # # This script adds sound effects to the characters and control characters drawn # in the message window. You can choose for the character to wait with the se, # or just for the se to wait, thus not slowing the text any. # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # module FyxA module LetterSE # How long should each respective type of characte wait? In frames. Waits = { :char => 3, :line => 4, 😛age => 22, } # Should the respective type of character wait for its alotted time above, # or should just the SE wait? CharsWait = { :char => true, :line => true, 😛age => true, } # RPG::SE.new(name,volume,pitch) # volume and pitch can be left out, or included. # Set to nil for no sound effect at all. SEs = { :char => RPG::SE.new("Switch1",60), :line => nil, 😛age => nil, :gold => nil, :wait => nil, :input => nil, :fast => nil, :slow => nil, :skip => nil, :color => nil, :icon => nil, :big => nil, :small => nil, } end end class Window_Message < Window_Base alias initialize_char_se_wait initialize def initialize(*a,& @fyx_waits = {:char => fyx_wait🙂char), :line => fyx_wait🙂line), 😛age => fyx_wait🙂page), } initialize_char_se_wait(*a,& end alias new_page_se_fyx new_page def new_page(*a,& new_page_char_wait new_page_se_fyx(*a,& end alias process_new_line_se_fyx process_new_line def process_new_line(*a,& new_line_char_wait process_new_line_se_fyx(*a,& end alias process_escape_se_fyx process_escape_character def process_escape_character(*a,& fyx_escape_se(a[0].upcase).play rescue nil process_escape_se_fyx(*a,& end alias process_norm_char_se_fyx process_normal_character def process_normal_character(*a,& normal_char_wait process_norm_char_se_fyx(*a,& end alias close_n_wait_se_fyx close_and_wait def close_and_wait(*a,& close_n_wait_se_fyx(*a,& self.contents.clear end def obtain_escape_param_!(text) text.slice(/^\[\d+\]/)[/\d+/].to_i rescue 0 end def char_wait_se?(sym) (b = FyxA::LetterSE::CharsWait[sym]).nil? ? false : b end def fyx_wait(sym) (n = FyxA::LetterSE::Waits[sym]).nil? ? 0 : n end def reset_fyx_wait(sym) @fyx_waits[sym] = fyx_wait(sym) end def fyx_escape_se(code) case code when '$'; fyx_char_se🙂gold) when '.','|'; fyx_char_se🙂wait) when '!'; fyx_char_se🙂input) when '>'; fyx_char_se🙂fast) when '<'; fyx_char_se🙂slow) when '^'; fyx_char_se🙂skip) when 'C'; fyx_char_se🙂color) when 'I'; fyx_char_se🙂icon) when '{'; fyx_char_se🙂big) when '}'; fyx_char_se🙂small) end end def fyx_char_se(sym) (se = FyxA::LetterSE::SEs[sym]).nil? ? RPG::SE.new : se end def normal_char_wait if char_wait_se?🙂char) wait(fyx_wait🙂char)) fyx_char_se🙂char).play rescue nil else update_normal_char_wait end end def new_line_char_wait if char_wait_se?🙂line) wait(fyx_wait🙂line)) fyx_char_se🙂line).play rescue nil else update_line_char_wait end end def new_page_char_wait self.contents.clear if char_wait_se?🙂page) wait(fyx_wait🙂page)) fyx_char_se🙂page).play rescue nil else update_page_char_wait end end def update_normal_char_wait @fyx_waits[:char] -= 1 if @fyx_waits[:char] <= 0 fyx_char_se🙂char).play rescue nil reset_fyx_wait🙂char) end end def update_line_char_wait @fyx_waits[:line] -= 1 if @fyx_waits[:line] <= 0 fyx_char_se🙂line).play rescue nil reset_fyx_wait🙂line) end end def update_page_char_wait @fyx_waits[😛age] -= 1 if @fyx_waits[😛age] <= 0 fyx_char_se🙂page).play rescue nil reset_fyx_wait🙂page) end end endHow and where would I integrate the switch?
I am using the Message Window SE Script by FenixFyreX that adds a typewriter effect to the message window text and also adds a sound for it. It works fine, but I don't want to have this effect for every message window. Is there a way to write a switch for it so that I can turn it off for some of the messages (for instance, dialogues)?
Here is the script:
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # # Message Window SEs v1.0 # FenixFyreX # RPG Maker VxAce # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # # This script adds sound effects to the characters and control characters drawn # in the message window. You can choose for the character to wait with the se, # or just for the se to wait, thus not slowing the text any. # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # module FyxA module LetterSE # How long should each respective type of characte wait? In frames. Waits = { :char => 3, :line => 4, 😛age => 22, } # Should the respective type of character wait for its alotted time above, # or should just the SE wait? CharsWait = { :char => true, :line => true, 😛age => true, } # RPG::SE.new(name,volume,pitch) # volume and pitch can be left out, or included. # Set to nil for no sound effect at all. SEs = { :char => RPG::SE.new("Switch1",60), :line => nil, 😛age => nil, :gold => nil, :wait => nil, :input => nil, :fast => nil, :slow => nil, :skip => nil, :color => nil, :icon => nil, :big => nil, :small => nil, } end end class Window_Message < Window_Base alias initialize_char_se_wait initialize def initialize(*a,& @fyx_waits = {:char => fyx_wait🙂char), :line => fyx_wait🙂line), 😛age => fyx_wait🙂page), } initialize_char_se_wait(*a,& end alias new_page_se_fyx new_page def new_page(*a,& new_page_char_wait new_page_se_fyx(*a,& end alias process_new_line_se_fyx process_new_line def process_new_line(*a,& new_line_char_wait process_new_line_se_fyx(*a,& end alias process_escape_se_fyx process_escape_character def process_escape_character(*a,& fyx_escape_se(a[0].upcase).play rescue nil process_escape_se_fyx(*a,& end alias process_norm_char_se_fyx process_normal_character def process_normal_character(*a,& normal_char_wait process_norm_char_se_fyx(*a,& end alias close_n_wait_se_fyx close_and_wait def close_and_wait(*a,& close_n_wait_se_fyx(*a,& self.contents.clear end def obtain_escape_param_!(text) text.slice(/^\[\d+\]/)[/\d+/].to_i rescue 0 end def char_wait_se?(sym) (b = FyxA::LetterSE::CharsWait[sym]).nil? ? false : b end def fyx_wait(sym) (n = FyxA::LetterSE::Waits[sym]).nil? ? 0 : n end def reset_fyx_wait(sym) @fyx_waits[sym] = fyx_wait(sym) end def fyx_escape_se(code) case code when '$'; fyx_char_se🙂gold) when '.','|'; fyx_char_se🙂wait) when '!'; fyx_char_se🙂input) when '>'; fyx_char_se🙂fast) when '<'; fyx_char_se🙂slow) when '^'; fyx_char_se🙂skip) when 'C'; fyx_char_se🙂color) when 'I'; fyx_char_se🙂icon) when '{'; fyx_char_se🙂big) when '}'; fyx_char_se🙂small) end end def fyx_char_se(sym) (se = FyxA::LetterSE::SEs[sym]).nil? ? RPG::SE.new : se end def normal_char_wait if char_wait_se?🙂char) wait(fyx_wait🙂char)) fyx_char_se🙂char).play rescue nil else update_normal_char_wait end end def new_line_char_wait if char_wait_se?🙂line) wait(fyx_wait🙂line)) fyx_char_se🙂line).play rescue nil else update_line_char_wait end end def new_page_char_wait self.contents.clear if char_wait_se?🙂page) wait(fyx_wait🙂page)) fyx_char_se🙂page).play rescue nil else update_page_char_wait end end def update_normal_char_wait @fyx_waits[:char] -= 1 if @fyx_waits[:char] <= 0 fyx_char_se🙂char).play rescue nil reset_fyx_wait🙂char) end end def update_line_char_wait @fyx_waits[:line] -= 1 if @fyx_waits[:line] <= 0 fyx_char_se🙂line).play rescue nil reset_fyx_wait🙂line) end end def update_page_char_wait @fyx_waits[😛age] -= 1 if @fyx_waits[😛age] <= 0 fyx_char_se🙂page).play rescue nil reset_fyx_wait🙂page) end end endHow and where would I integrate the switch?