Want more features on Pastebin? Sign Up, it's FREE!

Play SE On Balloon Pop-Up ~ RGSS2 & RGSS3

By: diamondandplatinum3 on Jul 22nd, 2012  |  syntax: Ruby  |  size: 4.17 KB  |  views: 435  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. #             Play SE On Balloon Pop-Up
  3. #             Version: 1.0
  4. #             Author: DiamondandPlatinum3
  5. #             Date: July 31, 2012
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. #  Description:
  8. #
  9. #    This script allows you to play an SE (Sound Effect) when a ballon icon
  10. #    pops-up above someones head.
  11. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  12. #------------------------------------------------------------------------------
  13. #  Instructions:
  14. #  
  15. #     -  All you have to do is go into the editable region and change the
  16. #        appropriate settings to suit your needs. This includes which SE plays
  17. #        depending on the balloon icon that is being shown.
  18. #
  19. #     -  If you do not wish for an SE to play on any specific balloon icon,
  20. #        simply set the value to nil.
  21. #
  22. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  23. module BalloonSoundOptions
  24.  
  25. # Turn this Switch On if you do not wish for soundeffects to play on balloon
  26. Event_Switch_ID = 10
  27.  
  28.                 # SE to Play, Volume, Pitch
  29. Exclamation_SE  = [ "Raise1",   80,   100 ] # SE played with Exclamation Balloon
  30. Question_SE     = [ "Confuse",  80,   100 ] # SE played with Question Balloon
  31. Music_Note_SE   = [ "Sound1",   80,   100 ] # SE played with Music Note Balloon
  32. Heart_SE        = [ "Recovery", 80,   100 ] # SE played with Heart Balloon
  33. Anger_SE        = [ "Buzzer1",  80,   100 ] # SE played with Anger Balloon
  34. Sweat_SE        = [ "Fall",     80,   100 ] # SE played with Sweat Balloon
  35. Cobweb_SE       = [ "Sand",     80,   100 ] # SE played with Cobweb Balloon
  36. Silence_SE      = [ "Silence",  80,   100 ] # SE played with Silence Balloon
  37. Lightbulb_SE    = [ "Stare",    80,   100 ] # SE played with Lightbulb Balloon
  38. Zzz_SE          = [ nil,        80,   100 ] # SE played with Zzz Balloon
  39.  
  40.  
  41. end
  42. #==============================================================================
  43. # ** Sprite_Character
  44. #------------------------------------------------------------------------------
  45. #  This sprite is used to display characters. It observes an instance of the
  46. # Game_Character class and automatically changes sprite state.
  47. #==============================================================================
  48.  
  49. class Sprite_Character < Sprite_Base
  50.   #--------------------------------------------------------------------------
  51.   # * Start Balloon Icon Display
  52.   #--------------------------------------------------------------------------
  53.   alias dp3_seonballoon_spritecharacter_startballoon_vcxs       start_balloon
  54.   def start_balloon
  55.     unless $game_switches[BalloonSoundOptions::Event_Switch_ID]
  56.     #--------------------------------------------------------
  57.       case @balloon_id
  58.       when 1
  59.         RPG::SE.new(*BalloonSoundOptions::Exclamation_SE).play   if BalloonSoundOptions::Exclamation_SE[0]
  60.       when 2
  61.         RPG::SE.new(*BalloonSoundOptions::Question_SE).play      if BalloonSoundOptions::Question_SE[0]
  62.       when 3
  63.         RPG::SE.new(*BalloonSoundOptions::Music_Note_SE).play    if BalloonSoundOptions::Music_Note_SE[0]
  64.       when 4
  65.         RPG::SE.new(*BalloonSoundOptions::Heart_SE).play         if BalloonSoundOptions::Heart_SE[0]
  66.       when 5
  67.         RPG::SE.new(*BalloonSoundOptions::Anger_SE).play         if BalloonSoundOptions::Anger_SE[0]
  68.       when 6
  69.         RPG::SE.new(*BalloonSoundOptions::Sweat_SE).play         if BalloonSoundOptions::Sweat_SE[0]
  70.       when 7
  71.         RPG::SE.new(*BalloonSoundOptions::Cobweb_SE).play        if BalloonSoundOptions::Cobweb_SE[0]
  72.       when 8
  73.         RPG::SE.new(*BalloonSoundOptions::Silence_SE).play       if BalloonSoundOptions::Silence_SE[0]
  74.       when 9
  75.         RPG::SE.new(*BalloonSoundOptions::Lightbulb_SE).play     if BalloonSoundOptions::Lightbulb_SE[0]
  76.       when 10
  77.         RPG::SE.new(*BalloonSoundOptions::Zzz_SE).play           if BalloonSoundOptions::Zzz_SE[0]
  78.       end
  79.     #--------------------------------------------------------
  80.     end
  81.     dp3_seonballoon_spritecharacter_startballoon_vcxs() # Call Original Method
  82.   end
  83. end
clone this paste RAW Paste Data