mcscottyG

Villager
Member
Joined
Mar 22, 2016
Messages
9
Reaction score
0
First Language
english
Primarily Uses
Hello everyone!  I'm a long time lurker, but first time contributor to the forums.  To get the point, I've been playing around with a weather system that relies on temperature, dewpoint, and weather chance.  Basically, if the temperature is lower than the dewpoint and the weather chance is above a certain amount (weather==ON), it will rain/storm/snow.  The temperature changes every day and night, allowing the system to switch from rain to snow or vice versa if the conditions are right.  What I'm having trouble with is when rain switches to snow, I want the rain BGS to stop, but the wind BGS to keep playing.  Instead, the BGS stops completely, as the fadeout BGS function affects all BGS's instead of a specific one.  I've looked a little into working it as script, but the commands seem to offer the same function, fading out all BGS's rather than a specific one.  Any thoughts how to do this? 
 

Lightness

Veteran
Veteran
Joined
May 11, 2012
Messages
37
Reaction score
4
First Language
English
Primarily Uses
By default, RMXP only allows one BGS to be playing at a time which is why there's no option to stop a specific one. I'm guessing the ability to play more than one is being added by the script that you're using for this weather system. If that is the case, could you provide a link to the script you're using (and we may want to get this thread moved to the script support forum)?
 

mcscottyG

Villager
Member
Joined
Mar 22, 2016
Messages
9
Reaction score
0
First Language
english
Primarily Uses
By default, RMXP only allows one BGS to be playing at a time which is why there's no option to stop a specific one. I'm guessing the ability to play more than one is being added by the script that you're using for this weather system. If that is the case, could you provide a link to the script you're using (and we may want to get this thread moved to the script support forum)?

I'm not using any script that allows that. That would explain why the functionality doesn't exist haha. Since that's the case, I'm sure there's a spot in my Common Event that falls short on accomplishing my goal.  I'll have to comb through it more thoroughly.  Thank you for your response.
 

Heretic86

Veteran
Veteran
Joined
Nov 30, 2014
Messages
253
Reaction score
181
First Language
Engrish
Primarily Uses
Try this:


#==============================================================================
#
#     Background Sound Playing?
#
#  ---  Instructions  ---
#
#  Run a Script, usually from Conditional Branch -> Script, or from custom methods:
#
#  - bgs_playing?
#   * Evaluates to True if any Background Sound is playing
#
#  - bgs_playing?('005-Rain01')
#   * Evaluates to True if the current Background Sound is this file name
#
#  NOTE: Untested on RMVX or RMVX Ace
#
#==============================================================================


#==============================================================================
# ** Game_System - Class
#==============================================================================
class Game_System
  #--------------------------------------------------------------------------
  # * BGS Playing? - Game_System
  #      sound : name
  #   Example: bgs_playing? returns true if there is ANY Background Sound
  #            bgs_playing?('005-Rain01') returns true if the name matches
  #--------------------------------------------------------------------------
  def bgs_playing?(sound = nil)
    # If a Background Sound is Playing
    if @playing_bgs
      # Return true that Background Sound is Playing when not specifying sound
      return true if not sound
      # Return true if a Bacground Sound matches the specified sound
      return true if @playing_bgs.name == sound
    end
    # Default - Sound is not playing or file does not match specified sound
    return false
  end
end


#==============================================================================
# ** Interpreter - Class
#  NOTE: Rename this to Game_Interpreter for VX+, wont work with RMMV


#


#  - This just allows people to put "bgs_playing?(sound_name)" in a Script or Conditional Branch


#    without having to put in "$game_system.bgs_playing('sound_name')" so its shorter.
#==============================================================================
class Interpreter
  #--------------------------------------------------------------------------
  # * BGS Playing? - Interpreter
  #--------------------------------------------------------------------------
  def bgs_playing?(sound = nil)
    # Call same method in Game_System
    return $game_system.bgs_playing?(sound)
  end
end


In your Event inside your Conditional Branch, after you see that a specific sound is playing, just put in a "Fade Out BGS..." command.  After "Fade Out BGS..." is called, this won't evaluate to true.


NOTE:  I tested this with some other scripts as I was writing it, but it appears to not work with Ryexs Dynamic Sounds without additional modifications to the script.  There is another script by ForeverZer0 called Ambient SFX which does allow multiple backgrounds to play at the same time.  This quick script also wont detect Ambient SFX if your sound is Ambient.
 

Latest Threads

Latest Profile Posts

Grading the last exams for this semester and I need a break because I am laughing too hard xD
edit: Video link removed due to well Internet problems making it essentially nothing anyway. :kaoswt:
Sleep logic:
4 hours or less = I feel like I'm dying
5-6 hours: Feeling well rested
More than 6 hours: I feel like I'm dying
Women always say "I want to be spoiled" then get mad when I spoil them. Why would you say that if you didnt actually want to know the ending?


decided to have subclasses work differently in my game. They summon in a partner when you select one. this took some work tho as I had to get the class scene to pop up as a common event instead of straight from the menu. it was the only way to add/remove party members while on the menu screens.

Forum statistics

Threads
131,543
Messages
1,220,682
Members
173,220
Latest member
ZecaVn
Top