03-05-2008, 07:07 AM
(This post was last modified: 11-19-2018, 04:05 AM by DerVVulfman.)
Mimi's Battle Music
Version: 5.0
Version: 5.0
Introduction
Well, I have to hand it over to Mimi-Chan, so I'm naming it AFTER her. She asked for a simple script, and I delivered. So, I took it upon myself to crank this script out on Thursday, August 03, 2006. Only took 1/2 an hour.
This script allows you to play different music based on who your Lead Hero is, or based on the events that have transpired in your game.
Features
- Compatibility with many known battle-systems (except perhaps SABS and similar Zelda-Styled systems)
- Ability to set individual "Theme Music" for each hero to play in battles
- Ability to set battle music to play based on pre-designed events.
- Ability to use "Random Music Selections" for battles.
- Ability to use the "Field Map's Music" for battles.
- Automatically turns off the 'Victory ME' when using Field Map Music.
- Ability to set volume and/or pitch controls for each pre-set music file.
- Will play the default battle music if the list contains missing music files, or will set the battle music to [none] if all called music files are missing.
- As they're stored in global arrays, you're able to change music selections in-game through script calls.
- Works with event-called battles and random encounters
Screenshots
Um... it's called Battle Music for a reason... :D
Demo
Mimi and Dalissa
Instructions
Lots of instructions were built into the code, but it's pretty simple. Within the script itself, there are three hash arrays that store your music filenames. The entry of volume and/or pitch settings are optional.
One hash array allows you to set the 'Theme Music' for each of your heros based on their index value in the database. By default, the first index belongs to Aluxes, the second to Basil... et all.
The second hash array allows you to set the 'Theme Music' for key events in your game, be it based on a value you keep track or change in a 'Mission/Journal' system, or manually change it in a regular map event script.
The third hash array allows you to set 'Random Music' to be played.
Thus, there are three types of battle music that can be played using this system:
* Standard battle music / regular [event changed] music
* Lead Hero's battle theme
* Event battle theme.
* Random battle music
* Field map music (continues to play through battle... no resetting)
Other instructions, such as the manner to change the battlemusic and their hashes are located within their scripts.
FAQ
This has been a very interesting piece to work on. Not something that could have been designed as a single class as I first thought. As I went on, I found that the Interpreter class handled routines called from MAP EVENTS (like the Call Battle command) and that there was a Call Battle def in the Scene_Map class for random battle events. Couple lucky things came from it... I managed to make this a fairly comprehensive system for battle music, adding features as I went along. I also divined how to use the MODULE system in RGSS to shorten my code and how to avoid the dreaded RGSS true/false bug.
Compatibility
Um... I aliased EVERYTHING, so it DAMN well better be compatible with everything.
Credits and Thanks
Well... Thanks to Mimi-Chan who gave me the excuse to crank this script out.
Also, thanks goes out to WithViolence who found a flaw where if 'listed' music didn't exist in either the project's or RTP's music folder, the system could crash if the music was called. Likewise, thanks goes out to Meâ¢'s and Mr.Mo's for their assistance in RGSS Support forum: Detecting files in the RTP itself in... detecting the music files in the RTP. :D And thanks to grimreaper1357 for extensive testing of systems including random map encounters and self switch conflicts.
Author's Notes
Hey. It's a simple script... apart from figuring out where to put the music lists. What's to note?
Terms and Conditions
This system is available royalty-free, and is permitted for commercial use. However, no warranty on this system is expressed or implied.
What is required as conditions for use is due credit. I gotta get listed for this script somewhere... at least in the game's end credits. Also to be listed is Mimi-Chan for initial design (though she's not a scripter, it was her idea). And credit has to go to WithViolence and grimreaper1357 for betatesting, and to Me⢠and Mr.Mo for technical assistance. And now to Nico_14_Ian for finding a strange bug when map events create a battle which has been fixed