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
240
Reaction score
167
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 Posts

Latest Profile Posts

Today we be doing an unscheduled stream! Lets get some work done on the titlescreen for Lightestone! <3
www.twitch.tv/riazey
I can't believe it... my mom is going to sign me up for the Planet Fitness down the street! I need to lower my cholesterol according to my doctor, and I'll need to lose some weight to fit into Helen Henny's skirt (I ordered a skirt for my mascot outfit and realized it was a bit too small). My doctor says I need to lose weight anyway.
I blame my lilest bro for the duck suit. Sketched it and realized it had to be added to a mock fashion magazine cover. The titles are actually inside jokes about the place this NPC is from.
EvKECQJVEAw3Qux
Kes
After a few hectic months, my hiatus is over, and I'm now back. Good to see so many familiar names posting. And a forum update while I was away.
V1.3 of Demo, a new concept artist on the team, character voices are coming into light more... I'm happy to say that the fangame is making good progress.

Forum statistics

Threads
108,855
Messages
1,040,096
Members
141,300
Latest member
Torcham
Top