Jump to content

Home

Music script


Mindtwistah

Recommended Posts

You know, I could've sworn there was a tutorial on this...:(

 

Nevertheless, you should be able to stop the music using the

MusicBackgroundStop(001EBO)

script function. Just replace 001EBO with the relevant module.

 

Also, KotOR Tool's Text Editor does come with a script function search, so you can find them more easily than by poring over nwscript.nss. :)

Link to comment
Share on other sites

Thanks InSidious

 

By the way, found a little script by Stoffe.

void main() {
   object oArea = GetArea(OBJECT_SELF);

   // Index in ambientmusic.2da
   int nAmbientMusic = 3;
   int nBattleMusic = 47;

   MusicBattleStop(oArea);
   MusicBattleChange(oArea, nBattleMusic);
   //MusicBattlePlay(oArea);

   MusicBackgroundStop(oArea);
   MusicBackgroundChangeDay(oArea, nAmbientMusic);
   MusicBackgroundChangeNight(oArea, nAmbientMusic);
   MusicBackgroundPlay(oArea);
}

 

Now since I am a total sucker in scripting I have a "few" questions about the script.

1.Will it play a certain soundfile just like that if i trigger it?

2.If I trigger it and a certain music plays, will battle music start playing if you engage in a battle?

3.Will it return to the main backround music when the song is over, or will it loop?

4.Will it go back to the main sound file if I step in and out of the module?

5.And most importantly, will it work for K1?

 

Yes, I know. I have a lot of questions :p

Link to comment
Share on other sites

For some reason, my script doesn't work :S It only makes the original music go away, but doesn't play my track :S

 

void main() {
   object oArea = GetArea(OBJECT_SELF);

   // Index in ambientmusic.2da
   int nAmbientMusic = #2DAMEMORY1#;
   int nBattleMusic = #2DAMEMORY1#;

   MusicBattleStop(oArea);
   MusicBattleChange(oArea, nBattleMusic);
   //MusicBattlePlay(oArea);

   MusicBackgroundStop(oArea);
   MusicBackgroundChangeDay(oArea, nAmbientMusic);
   MusicBackgroundChangeNight(oArea, nAmbientMusic);
   MusicBackgroundPlay(oArea);
}

 

I've put all the sound files in the streammusic folder, they are in MP3 format. Why doesn't it work?? :(

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...