Changing music in an area

Can you make the music change in an interior area ? I know you can but not the whole area, just a part of it and the music goes back to what it was once you leave the area.

I’ve got an underground tavern but the bards and dancers will look silly jigging about to the moody music playing in the area. So can you walk in, play some tavern music and walk out to doom and gloom again ?

I know I can do it with a conversation script and have done it before but I wanted it to keep swapping when you go in and out. Then kill the swapping completely when it all goes off in the tavern a lot later after quite a few visits. For example on a trigger in the tavern that you destroy when the fighting starts.

It’s no big deal and I can just have a miserable tavern with no bards etc. if it’s way too much hassle and could be even more wrong with happy tavern music everywhere.

1 Like

Yes, you can. But unfortunately the main music and the music for just the part of the area will play simultaneously. Like a bard group playing, like I did in my latest module.

But you can have a script that if you want it in the whole area, that changes music and when leaving changes back with a trigger. Maybe that was what you wanted? I’ll take a look at the script I used.

To be honest, I’m not exactly sure what you want here. Do you want, when you go into a certain section of the tavern, that the music for the area changes completly, and when you leave the trigger area it goes back to what it was before?

angalf… Wow ! Your post just changed as I was writing !

Sounds like it’s doable so that’s good…

What I’m after is the music for the whole area ( the one you hear all the time ) changes when you enter the tavern ( so only one music track is playing ) but it changes back to the normal area music when you leave. Not just when you get close to the band etc.

Ok, I think I have a solution. Make two scripts, like this:

#include "ginc_sound"

void main()
{

object oPC = GetEnteringObject();

object oArea = GetArea(oPC);
	
if(!GetIsPC(oPC)) return;

MusicBackgroundChangeDay(oArea,95);
MusicBackgroundChangeNight(oArea, 95);
	
}

and this:

#include "ginc_sound"

void main()
{

object oPC = GetExitingObject();

object oArea = GetArea(oPC);
	
if(!GetIsPC(oPC)) return;

MusicBackgroundChangeDay(oArea,94);
MusicBackgroundChangeNight(oArea, 94);
	
}

Place one on OnEnter and the other OnExit. I think it should work. I haven’t tested it.

EDIT: Change the number to the corresponding tracks that you want to use.

2 Likes

Wait a minute…you still said that the tavern was part of a larger area, right? In that case, just do a trigger around the area that is the tavern and again, place these two scripts on the trigger’s OnEnter and OnExit instead (the first on OnEnter and the other OnExit, I’m sure you get it).

2 Likes

angalf… Got it thanks, yes you’re right the tavern is part of a larger area. It’s pretty complicated and I don’t know why I wrote myself into a mess like this !

Let me know if it worked the way you wanted it to. I think it should work.

I quickly put it in and It worked perfectly, many thanks for that. My bards will be very happy now that they don’t have to play moody music all the time ! Your name is heading to the top of the scripts… Again !

1 Like