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
168
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

Have spent too much time hammering out with a friend just how to make a reoccurring enemy that permanently learns skills you use against her.
I know what I want in a loose sense. Maybe I should just make a post asking for opinions and suggestions.
Shoot Enemy Off-Screen, Run RPG Maker Game as a Web Server, & Thai Keyboard | RPG Maker News #109

Some people have too strong of an opinion about what maker is the best, I've seen discussions like:
- I prefer VXAce because I like the style of the RTP better than the older releases
- You're worse than Hitler
My number one take away from this game jam is to make small games that are as polished and bug free as possible. Far less dev time, and if the game flops, it matters less because my time investment is much lower. Also, whatever ambitions I have... aim for about 10% of them. They are clearly too high, and will involve stuff that likely won't matter.

Forum statistics

Threads
113,732
Messages
1,077,021
Members
147,760
Latest member
anitalains
Top