The RPG Maker Resource Kit

RMRK RPG Maker Creation => XP => Topic started by: Some1 on September 17, 2009, 12:23:55 PM

Title: [RMXP] Request - Temporarily remove music from maps (Resolved)
Post by: Some1 on September 17, 2009, 12:23:55 PM
I've reached a point in my game where there's... Crisis, chaos, something like that. So I want to temporarily remove the music from all the maps, because it just doesn't sound good when there's chaos and a nice and calm town-ish music is playing. I had the idea of making a Common Event (Parallel Process) triggered by a switch, and its event will be: Play BGM: None. It works, it stops the music in every map from playing, but it lags the game too much. I've added a Wait 1 frame command... It stops the lags, but every time you go to a new map, the music plays for half a second and then stops, that's just ridiculous. If anyone will tell me how to stop the music in every map from playing, i'll greatly appreciate it, thanks.
Title: Re: [RMXP] Request - Temporarily remove music from maps
Post by: Mjustin on September 17, 2009, 09:32:24 PM
First way that comes to mind is to make every map not have an auto BGM. Then put an autorun event triggered by a switch or variable that plays the music and then erases the event in every map. When you want there to be no music, just turn the switch off and use Play BGM: None. Then turn the switch on when you want the music back.
Title: Re: [RMXP] Request - Temporarily remove music from maps
Post by: Grafikal on September 18, 2009, 12:54:09 AM
Use parallel process, not autorun here. If you want music to stop for a time period, I bet you'd want something to happen within that time period and if you're running autorun, everything stops just to handle some music mumbo-jumbo.
Title: Re: [RMXP] Request - Temporarily remove music from maps
Post by: modern algebra on September 18, 2009, 01:01:43 AM
Well, MJustin's solution wouldn't cause any severe problems. It erases itself after a single frame. I doubt 1/60 of a second will cause much harm.

I also think it is better than the original solution of making a global common event that always stops music from playing.
Title: Re: [RMXP] Request - Temporarily remove music from maps
Post by: Grafikal on September 18, 2009, 01:03:11 AM
I'm just saying. He said temporarily. If he wants it to come back while on the same map, don't erase it and use a parallel to stop it for a time period.
Title: Re: [RMXP] Request - Temporarily remove music from maps
Post by: modern algebra on September 18, 2009, 01:07:33 AM
Well, given the situation, it doesn't make much difference whether it is parallel or autorun, because it doesn't sound like a cutscene dependent on a waiting period. Parallel might be better since it initiates earlier. Either way though, it is erased after a single frame, and it really makes no significant difference. Based on the request though, I don't think there is a Wait frames issue involved, simply because the problem he mentions is precisely going to other maps and wanting to remove the music.
Title: Re: [RMXP] Request - Temporarily remove music from maps
Post by: Some1 on September 18, 2009, 09:21:33 AM
Thanks a lot people! I think i'm gonna use Mjustin's solution.