The RPG Maker Resource Kit

RMRK RPG Maker Creation => XP => XP Scripts Database => Topic started by: Ashtoro on July 04, 2008, 09:46:47 AM

Title: How to make battle BGM start before the actual battle does.
Post by: Ashtoro on July 04, 2008, 09:46:47 AM
Okay...  I'm making a risk by posting this, since I don't know if it's in the right place or not...  it's not a request or anything, and it BARELY qualifies as scripting.  But after searching the site for a while I've never been able to find an answer, and after tentatively poking around with the scripting, I may have found my own.  However, in advance, sorry if this is already done or if I'm indeed posting this in the wrong place... >_<

I've seen asked a few times how to make it so that the battle music and the field music is and stays the same when you enter the battle, without that music starting over from the beginning and sounding bad.  So, for example, the bad guy says "It's time for you to die," and the battle music starts playing.  Then the player presses "Enter" and whatever events trigger up to Enemy Encounter, THEN the scene transitions into the battle mode, with the battle music still playing.  A lot of professionally developed games do this, a lot of people have asked how to do this, I've never seen an answer, and think I've found.  Or another example, the party is fighting one large battle against several enemies and the battle music keeps playing after each battle so events can have another wave of enemies approach the party before entering the next battle.

However, it might not qualify as a "script" since I didn't actually add anything.  All I did was remove one line, and it seems to work perfectly, with only a few limitations.

All I've done to make it work is, in the Script Editor, go to Scene_Map and scroll down to line 168.  Written there should be:

Code: [Select]
$game_system.bgm_stop

Deleting this line should be all it takes.  Then, if the Map BGM is the same as the Battle BGM, the music will not be interrupted and restarted.  Plus, if the Map BGM is different from the Battle BGM, the map music will still stop and the battle music will still start.  Much like in changing between maps, it's not limited by volume.  It won't fade louder or quieter attractively, but it still won't start over.

Limitations:

If the music is meant to change to the battle music like a normal encounter with this system, the Map music will stop playing very slightly later than it previously would.  Specifically, the last note of .mid file plays at the same time that the transition music starts.  Overall it's only barely noticable and shouldn't be a real problem.

However, the big limitation is that there's no easy way to change the field music back to what it should be when you win the battle.  If you use Play BGM in an event right after the Enemy Encounter button, whatever music will play when you exit the battle, but if you doddle after the ME victory tune plays and don't exit the battle, the battle music will fade back in.  I can only think of one workaround, and that's to keep the battle music going and fade it out with events after the battle, perhaps with the enemy going "Ugh no way" or whatever.  You should probably before the battle turn the victory ME effect, too.  However, some scenarios lose its artistic and/or dramatic strength if you have the music fade out after the battle is over, even if you the bad guy just disappaers without doing any action anyway.



Other than that, though, I don't see anything wrong with it.  Hopefully (repeats most of the first paragraph).
Title: Re: How to make battle BGM start before the actual battle does.
Post by: Falcon on July 04, 2008, 01:34:37 PM
This isn't really a script, but I'll throw it in the database because it's useful.
Title: Re: How to make battle BGM start before the actual battle does.
Post by: Leventhan on July 04, 2008, 02:29:41 PM
Sweet.