LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   Holowan Laboratories (http://www.lucasforums.com/forumdisplay.php?f=324)
-   -   Changing Music (http://www.lucasforums.com/showthread.php?t=146726)

Emperor Devon 03-24-2005 09:10 PM

Changing Music
 
TSL is supposed to be a much darker game than KOTOR, and has some very dark music. The only problem is that the dark music isn't used enough. What I want to do is:

Replace the music of the first two areas in Onderon with the Dxun music.

Replace the area with Dhagon Ghent's and the Cantina's music with the Harbinger music.

Replace the Ravager bridge music with the Darth Nihilus theme music.

Replace the Royal palace music with the Sith tomb music.

Replace the Khoonda planes, Khoonda, and Enclave courtyard music with the Sith music.

Replace the music from the area on the Harbinger where you meet Sion with the Sion's theme music.

Replace the Enclave sublevel music with the Sith music.

Replace the Trayus Core music with the Kreia's dark theme music.

How can I do this? It'll give TSL a much darker feel.

Emperor Devon 03-24-2005 11:12 PM

No answers? I'd really like to do this.

Emperor Devon 03-25-2005 08:46 PM

NO ANSWERS!? :confused:

Lundquist 03-26-2005 07:49 AM

I think a way to do it is to first rename the extension of musicfiles in the streammusic folder to mp3 (then they can be played without just hearing static) to find out the names of the musicpieces.
then when you've found the name of the music pieces you want to change you just rename them.
e.g. if we say darth Nihilus theme is mus_nihilus and the nameof the music played on the ravager is mus_sith, you just rename mus_nihilus to mus_sith - ofcourse you might want to rename a copy of mus_nihilus, so that there will still be a mus_nihilus file.

Hope this makes sense, I'm very tired as I write this, which tends to make my english kind of groggy.

Emperor Devon 03-26-2005 11:41 AM

Thanks. But one thing - if I replace the Sith music on the Ravager bridge with the Darth Nihilus music, would that replace all the Sith music on the other area of the Ravager? I don't want to do that.

Lundquist 03-26-2005 03:38 PM

Oh, now I see the bigger problem. Yes it would replace the music on the enire ravager - assuming that it is the same music playing, which I can't remember if it is.
Sorry, with that I can't help you.

Xcom 03-26-2005 04:09 PM

I think there are a few ways of doing it.
1. You need to unpack <modulename>.git (Dynamic Area File) for a specific area, look at AreaProperties and change its MusicDay, MusicNight values. Those values point to a rownumber in ambientmusic.2da. Then you need to repack all this back into a rim file. It's not a good idea to dump GIT into Override.

2. I *think* you can also do that with scripts.

There are following commands available
Code:

// 425: Play the background music for oArea.
void MusicBackgroundPlay(object oArea);

// 426: Stop the background music for oArea.
void MusicBackgroundStop(object oArea);

// 427: Set the delay for the background music for oArea.
// - oArea
// - nDelay: delay in milliseconds
void MusicBackgroundSetDelay(object oArea, int nDelay);

// 428: Change the background day track for oArea to nTrack.
// - oArea
// - nTrack
void MusicBackgroundChangeDay(object oArea, int nTrack, int nStreamingMusic = FALSE);

// 429: Change the background night track for oArea to nTrack.
// - oArea
// - nTrack
void MusicBackgroundChangeNight(object oArea, int nTrack, int nStreamingMusic = FALSE);

I think you utilize OnEnter script for certain area and start the music you want. Not 100% sure, but I'm guessing it will probably override the defaults in the GIT file. The good thing if that it works, you can simply put the scripts in Override folder.

stoffe 03-26-2005 04:13 PM

Quote:

Originally posted by Emperor Devon
Thanks. But one thing - if I replace the Sith music on the Ravager bridge with the Darth Nihilus music, would that replace all the Sith music on the other area of the Ravager? I don't want to do that.
The music an area plays is set in the properties of that area. To change it, find the area code of the area/module you wish to change, and open that under the RIM-->Modules category in KotorTool.

For example, to change the bridge of the Ravager, open 852NIH.rim. Under the "Dynamic Area Info" heading, extract the GIT file there, in this example 852nih.git.

Open the GIT file with a GFF Editor, find the catecory called "AreaProperties". Under that category there are three fields to modify. MusicDay and MusicNight is the ambient music played while exploring. MusicBattle is the track played when in combat. The numbers here refer to the row index in the ambientmusic.2da file. To use Nihilus theme set the value to 4.

Note however that it is somewhat risky to modify GIT files since they are not always uniquely named. If you edit one with a name that is used in several RIM files and put it in the override folder, things will probably break, badly.

It's probably safer to change this via scripting instead, if you know how to modify scripts in a module. This script example would change the ambient music track to the Nihilus theme in the current area:

Code:

void main() {
        object oArea = GetArea(GetPartyLeader());
       
        MusicBackgroundStop(oArea);
        MusicBackgroundChangeDay(oArea, 4);
        MusicBackgroundChangeNight(oArea, 4);
        MusicBackgroundPlay(oArea);
}

The number 4 in the script above also references the row index in ambientmusic.2da, where 4 is Nihilus theme. Since KotOR has no Day/Night transitions, set both to the same value, just to be safe.

The naming conflict thing might apply to area scripts as well though. They are not always uniquely named so be careful when you override them.

EDIT: Too slow. What Xcom already said. :)

Xcom 03-26-2005 04:40 PM

Well, you explained it in greater detail anyway. :)

I just remembered that editing GIT file is somewhat undesired because of cameras . The GFFEdit will corrupt Camera Entries, so you'll need to use tk102 camedit tool to reimport original camera data. If you don't do that, most cinematics (if there are any) will be messed up.

Also, maybe it's possible to simply change the entries in ambientmusic.2da. Don't know if they are uniquely used though.

stoffe 03-26-2005 04:52 PM

Quote:

Originally posted by Xcom

Also, maybe it's possible to simply change the entries in ambientmusic.2da. Don't know if they are uniquely used though.

Doing that would have the same effect as renaming the sound files though, changing the music for all areas using that particular track and not just the one you are interested in. Unless I misunderstand what you meant...

Emperor Devon 03-26-2005 05:26 PM

Quote:

Originally posted by Lundquist
[B]I think a way to do it is to first rename the extension of musicfiles in the streammusic folder to mp3 (then they can be played without just hearing static) to find out the names of the musicpieces. B]
What do you mean? Should I just add mp3 to the names of the music?

Quote:

Originally posted by Xcom
[B] There are following commands available

*edited for space*

B]
AAAAAAHH! :freakout: SCRIPTING! *hides in a corner* F**k, looks like I'll have to settle for Nihilus music on both Ravager areas. Ah, well. It would suit the ship more anyway.

Emperor Devon 03-26-2005 08:03 PM

Quote:

Originally posted by Lundquist
I think a way to do it is to first rename the extension of musicfiles in the streammusic folder to mp3 (then they can be played without just hearing static) to find out the names of the musicpieces.
then when you've found the name of the music pieces you want to change you just rename them.
e.g. if we say darth Nihilus theme is mus_nihilus and the nameof the music played on the ravager is mus_sith, you just rename mus_nihilus to mus_sith - ofcourse you might want to rename a copy of mus_nihilus, so that there will still be a mus_nihilus file.

Hope this makes sense, I'm very tired as I write this, which tends to make my english kind of groggy.

I did that, but there is one problem: I replaced the music in the Khoonda planes with the Sion theme music, but when I load the level, it plays the Khoonda and Sion music at the same time. Is there any way I can fix this?

dmmm123 01-31-2013 10:42 AM

I have a question regarding the MusicDay and MusicNight tracks, if I may.
Let me explain my situation first.

I entered a few custom songs into the list in ambientmusic.2da, and then I copied and renamed the tracks to the "streammusic" folder. I extracted each and every one of the .GIT files for the levels and changed the values for the MusicNight tracks, leaving the MusicDay values alone. The delay when repeating the same track, or when changing between tracks was too long for me, so I set the MusicDelay values to 0 in every .git file. The results were:
1. All of the custom tracks work, and there are no camera problems.
2. There is no delay when changing tracks, either from MusicDay to MusicNight and vice-versa, or from the area track to the MusicBattle track and vice-versa, which is what I wanted anyway.
3. The MusicNight track for the area ALWAYS PLAYS FIRST, when entering/loading an area, and it repeats at least 5-6 times before it switches to the MusicDay track for the area.

My question is: Is there a way to control how many times the MusicDay/MusicNight track repeats before switching to the alternate track? I'd like to set it to NOT repeat at all, just play once and switch to the next track, and for the next track to switch back after playing once. I'm not that good with scripting, so If the solution is somewhere in the .nss file, I need some help.

Fair Strides 2 01-31-2013 09:37 PM

Show spoiler


This is purely abstract theory, so take it if you think it'll help you. When I opened a map file for map editing in KT(after downloading it from the site, which is no longer up. Use Deadlystream.com) a while back, I found an option that set how long a "game hour" is in real-time minutes. I am going out on a limb here and will say that your night track is "X" minutes long(where "X" is an unknown number) and there are six times as many minutes available during a night cycle. And whether the module starts in day/night time is in the .IFO, .ARE, or .GIT files, if I were to guess.

Now a scripting solution you might examine is the PlaySound function and a counter, like this:

Show spoiler


Then use the with ExecuteScript() for the module load script.

dmmm123 02-01-2013 06:21 AM

Thank you for all the help. I'll try to get it to work somehow.


All times are GMT -4. The time now is 12:40 PM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.