Forum Mod Bakery Docs

Custom Music stuff? (Renamed because the initial problem has been resolved)

Posted in Support
Please login to contribute to the conversation.
SO UHHHH.... I added the text in quotes in my Meta.ini file, enabled both my mission mod and the "No Introduction Movies" mod, attempted to launch the game, and it appears that the launcher actually doesn't restrict the game from launching when "No Introduction Movies" is enabled.

It's also worth mentioning that for some weird reason when I enable this mod along with my upcoming mission mod (and just my mission mod), the game freezes and tells me to "Please insert The Simpsons Hit & Run CD 1" after I'm done completing a mission, starting another mission (it can be the same one), and then pausing. Clicking "OK" did nothing, while clicking "Cancel" obviously quits the game. Playing the mission mod without the "No Introduction Movies" mod enabled does not seem to crash. It's the main reason why this post exists.
Did you press "Reload" button in the launcher after adding this to your Meta.ini file? Also why are you even conflicting the mod "No Introduction Movies"? It seems dumb to block it, no offense.

Also have you edited RSD files? If you have, this would be the issue freezing the game and causing the please insert error. There are extra steps that are required than to just edit the RSD file.
Aaaaand looks like it works now after reloading... *facepalms self* I swear, I thought I had already done so...

I already told you: enabling the "No Introduction Movies" mod along with my mission mod has a tendency to freeze. Playing the mission mod without it doesn't crash the same way. In fact, I haven't experienced any crashes after playing my mission mod without the "No Introduction Movies" mod, but it's still kind of early for that to be official, so I'm going to look further into that before I can confidently say that that's my final answer.

And yes, I have edited RSD files. To be specific, almost every original song (including main songs, "pickup" songs, "suspense" songs, etc.) is replaced by other files, although they play the exact same unedited music. (I kept it like this for convenience when replacing the music.) But anyway, some of the sounds, voices, and music tracks were replaced with actual sounds/voices/music tracks from different games.
Ok, as Jake said, blocking this mod is dumb. It's not a solution to your problem, it's a workaround. And it doesn't make any sense anyways that it'd be crashing your mod, it's just broken in some other way that only shows up when that mod is enabled and that should be sorted out. No Introduction Movies is not the problem.

Now, when you edited music did you make sure that your edited files are exactly the same length as the originals? Because that's the only way for that to work properly unless you somehow learned how to hex edit .rms files (which actually isn't that hard, but you'd actually have to know something about those files) (they contain file sizes of every music track, and differing from that screws the game's sound engine).
After a bit of testing, I can finally confirm that "No Introduction Movies" was not causing the problem. I'm guessing the reason why I didn't receive that error after disabling that particular mod was because I didn't give the song a chance to fully finish before transitioning to the "main" part of the song (the first piece of music was the "pickup" part of the song, and yes, it's pretty long). I don't know why, but I thought in one of my runs before this post, I already had the "pickup" part of the song finish, and the game kept playing without crashing.

Now, I didn't do anything to the RMS files as I hardly understood a thing. The only few things I did understand were the soundtracks' file names, and even then, I still didn't know how to play the other soundtracks on different missions nor what invalid data I included, replaced, or forgotten that causes it to crash. I actually have little to no experience with HEX editing (ughhhh...). I know what I can do when HEX editing, I just don't know what does what in the RMS file.
Playing different tracks on different missions isn't exactly the easiest thing. 

If you want to use ANY track used in the game, unfortunately that won't work. The RMS files basically load a couple of select RSDs from the game. Any RSD that isn't loaded by that will not play, and editing it load different RSDs isn't easy to do.

So to put it simply, if the track you want to use isn't normally played in that level, you can't use it.

...Now, if the track you want to use IS used in that Level, then this argument works pretty well:

StageStartMusicEvent("MX_start")
or

StageStartMusicEvent("MX_drama")
In place of the "X" right after the "M", you put the mission number track you want to use. Then, you place this argument into a stage where you want the music to change. The "start" means the game will use that mission's normal track, while "drama" uses the drama variation if it exists (very few tracks have a drama variation, but one example is the first bit of the track that plays in L1M7).

As an example, if you made a modified version of L1M1, and wanted to use L1M6's theme instead, then you'd put this in the first stage:

StageStartMusicEvent("M6_start")
And this would play the Mission 6 theme in that mission. The only issue with it is that getting a  Hit & Run switches back to the track's normal theme. I believe the argument "SetStageMusicAlwaysOn();" works and forces it to keep playing, but I'm not entirely sure about that.

If you'd like to use any other Level's tracks in another Level, then you can use FileRedirection to point to a different RMS file.
I once did that method, but it seems to return back to the original/intended theme when I enter or reenter a vehicle, and one of my custom missions involves leaving the vehicle, and this one soundtrack that plays on a certain mission doesn't fit any of the missions. It's kind of the reason why I'm using custom music.
You might want to try to use "SetStageMusicAlwaysOn();" in every stage to see if that helps. That forces the music to always keep playing even when outside your car (this is how they keep the music playing in L1M1 when you enter the school to talk to Lisa) and should work in your case.

I haven't experimented with it as much as I should, but here's hoping it works!

Edit: Disregard. This does work if you exit your car, but the music switches back to the normal track afterwards.

Double edit for some slightly more helpful advice:
The best you can do it seems is to just keep placing the "StageStartMusicEvent" in every stage, so it switches back to the track you want to use in the next stage if it for whatever reason changes. Alternatively, you can design the mission around this or set the timer to get back into your car to 0 (this way the player instantly fails the mission and the sudden music change is less likely to happen), but the issue with this is that getting a Hit & Run will still change the music. 

So the best solution without CustomMusic is to use StageStartMusicEvent in every stage, and setting the getting out of your car timer to 0 (or designing your mission so it's pointless to go outside). This makes it so that the player cannot exit their car and change the music, and if the player gets a Hit & Run, the track will be switched back in the next stage.
So back to the topic about the problem regarding my custom soundtrack. Do any of you mind teaching me and others who might have the interest what parts of an RMS file changes what since accurately editing RMS files "isn't hard" to you?
There's a bunch of information in .rms files relating to a bunch of .rsd files (7 out of the 8 .rms files are for music). The game uses this information about the files when it is more efficient to do so.

The information in the files includes but is not limited to the format and file size of the .rsd files. This is really the only information that matters in this case, but we believe it contains much more than this. The Simpsons Hit & Run's .rms files are binary, but some of Radical's other games contain plain text .rms files, and these are what lead us to believe there is much more stored in these files. Here is one such example.

Lucas doesn't understand the format enough to make an editor for it, the format and file size are the only thing he's sure of in this game's .rms files. And that is the reason why we must HEX Edit them.

Essentially you need the file size of the original file in bytes and the file size of the new file in bytes, both converted to hexadecimal. Then you open up the .rms files (all of them, some tracks are referenced in more than one, like the Hit and Run theme), search for the original file size in hex and replace it with the new file size in hex. That's the quick and dirty explanation, but if you need me to go into detail I can. I also highly recommend you keep track of your changes since it might be hard to undo them if you don't.

EDIT:
You also have to pad the Hex value to 4 bytes (which is 8 digits in Hex). And then you have to split it into groups of 2, and reverse the order of the groups. If you just lost me I totally get it. So I'll write a little bit better of a guide and edit my reply or post a new one if you've replied since then.

EDIT 2:
Here's a much better guide, that at some point I'll turn into a tutorial with more pictures.

Step 1: Make an RSD of your new music track (you need to extract one of the game's and edit it with RSD Converter for this). To import into an RSD it must be a 24000z Stereo .wav file. 
Step 2: Place the track in the appropriate place in the CustomFiles/sound/music folder of your mod (most likely just in this folder).
Step 3: Open music01.rcf in RCF Explorer and extract all of the .rms files into CustomFiles/sound/music in your mod.
Step 4: Open l1_music.rms in a Hex Editor (I use HxD, but you can use whatever you want).
Step 5: Find the track you want to replace in this list and search for the Hex Size in your Hex Editor, make sure you're searching for Hex Values.
Step 6: We'll need to replace this with the hex value of the replacement value.
Step 7: Once you've found it, you'll need to replace it with the Hex Size of the new replacement file.
Step 7A: Open up Calculator. Go to the view menu and select programmer. Picture
Step 7B: Now with the calculator set to Dec, input the filesize of your custom .rsd file. In this example, let's say our file size is 345,678 bytes. Picture
Step 7C: Now change the mode to Hex from Dec, and you'll get the Hex size... sort of. We need to do a little bit more to get what we need. Picture
Step 7D: First we'll pad it with 0 until it's 8 characters long. So in this case 5464E becomes 0005464E.
Step 7E: Now break the padded bytes into groups forming 4 bytes, in this case 00 05 45 4E. Then reverse these groups. In this case, 4E 45 05 00.
Step 7F: Now that we have this padded, grouped, and reversed set of bytes, we can replace the bytes in the .rms file in the hex editor.
Step 8: Now you've successfully edited an .rms file. Repeat Steps 5 to 7 for every .rms file to make sure you replace all references to the file's original file size.
Step 9: Optionally, delete any RMS files you didn't edit to increase compatibility with other music mods.