Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Fade out BGM

Tindy

Sponsor

Here's the scenario:  You're in a castle.  As you walk down the stairs to the dungeon (or, y'know....get teleported down them :x)  the beautiful harpsichordian background music fades out, and a depressing tune takes its place.  Sounds easy, no?  Well, while I have technically done it, it doesn't actually work. The way I did it that works is to set a parallele process (that also controls the fog and darkness level) and then have the BGM fade out in 10 seconds and wait 130 seconds for the new music to take its place.  It sounds great!...until 10 seconds later, when the new music choice stops and then restarts again.  Also, the lag is TERRIBLE when I do it that way - like, my character barely MOVES. 

Another way I tried was to instead make an autorun - when you hit the map, everything starts.  Except there's a nice half second or so where the dungeon looks normal >.<.  Also, it makes the player stand and wait if I keep the 130 frame wait - you can't move.  If I get rid of the wait, it automatically shifts to the new song, even when I put it on another page with a self-switch.  When I try to autorun it from the first teleport spot, it works more hunky-dory but then the fog doesn't load (because you're on a different map, natch.)  Changing the map properties doesn't work, either - it's too abrupt for my tastes.

So, all that backstory aside, my slimmed down question is this:  How do I get BGM from another map to automatically fade out, and then be replaced by a new song?
 
Okay, that was kind of long and a little confusing, but I think I get what you mean. I'm pretty sure you were on the right track with your first attempt using the parallel process, but perhaps you don't have a thorough understanding of switches and the like? If it were me, here's what I would do for my event:

---Invisible PARALLEL PROCESS EVENT---
-Fade out BGM 10 seconds
-Wait 200 frames (wait 10 seconds)
-Play "new" BGM
-Erase Event

The last event, Erase Event, is the key event in this and I'm guessing this is what you were missing. If that were not there, the event would keep looping, and thus the song would replay after every 10 seconds. "Erase Event" is kind of misleading; what this really does is erase the event only for the duration which you are in the map, that is, if you re-enter that map, that event WILL come back again. This is a VERY useful feature.

Let us know if that helps or not.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top