When I built Storm Point in Tears of the King, I built a magical grove attached to the city, rather like a park. All of the groves in the game have the same music except the one in Storm Point; since the Grove is part of Storm Point, it plays the town’s music. So this week I wanted to see if it was possible to tie the music into a map’s region. A bit of research revealed that yes, it’s totally possible! Here’s how you do it.
First, you need to set up the region you want the music to play in, like this.
As you can see, I’ve made the Storm Point grove into Region 1.
Next you need an event. Here’s the one I have for this particular case:
You’ll notice that this is triggered only after the Lava Cavern Switch is turned on. If it’s not on, this event does nothing.
Once the event is triggered, you’re going to use a conditional branch (that’s found under Flow Control, just like Loop from last time). Go to the fourth page, where you’ll find Script.
Now you’re going to type in $game_player.region_id == 1 as your script. The number will be whatever region you used (so in this case, since I used Region 1, I have to use a 1). Click OK, then fill in what you want to happen when the Player is in that region. I used Play BGM, which is under Picture and Sounds, and selected the music I wanted whenever the Player stepped into the Grove. Under Else, I said to play the BGM that normally plays in Storm Point. Make sure this event runs as either an Auto Run event or a Parallel Process if you have another event going on at the same time as this one (which I do).
And here’s what you end up with:
I’d like to give a big thank you to LoneWolfDon on the RPG Maker forums for his demo of region controlled events. You can find his discussion and a link to the demo here. That’s where I got the script I used from.