Frictional Games Forum (read-only)

Full Version: Explain the simplest way to use "different musics, different areas"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Yep how to use musics like "Big maps" different areas" I want this play to this area and stop and it plays different music like different area Smile

Quick help needed!

EDIT: Somebody help im confused!!! :S

Cheers.
Uh, sorry, but I seem to have no idea what you mean. Could you please rephrase?
(06-21-2011, 02:37 PM)ThePaSch Wrote: [ -> ]Uh, sorry, but I seem to have no idea what you mean. Could you please rephrase?

I mean like how to use "Background sounds several areas" and NOT "Playing them same time if i wanna play 3 different sounds some areas" Smile

Understand now?
(06-21-2011, 02:53 PM)HumiliatioN Wrote: [ -> ]
(06-21-2011, 02:37 PM)ThePaSch Wrote: [ -> ]Uh, sorry, but I seem to have no idea what you mean. Could you please rephrase?

I mean like how to use "Background sounds several areas" and NOT "Playing them same time if i wanna play 3 different sounds some areas" Smile

Understand now?

Are you looking to change the music for different areas? Or have different sounds in the same area play at different times?
You're meaning that you want to use different music in different areas?

In that case, just do a scriptarea and make the function;

PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

Otherwise if you wanna do it like Russ Money said you could use local variables. i.e;

Spoiler below!

DifferentMusic();

void Differentmusic()
{
PlayMusic("", true, 1.0, 4.0, 0, true);

AddTimer("Music", 10, "Music");
}

void Music(string &in asTimer)
{
SetLocalVarInt("music", 1);

AddLocalVarInt("music", RandInt(10, 15));
if(GetLocalVarInt("music") == 1)
{
PlayMusic("", true, 1.0, 4.0, 0, true);
}
else
{
PlayMusic("", true, 1.0, 4.0, 0, true);
}
}

(06-21-2011, 03:23 PM)rojkish Wrote: [ -> ]You're meaning that you want to use different music in different areas?

In that case, just do a scriptarea and make the function;

PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

Otherwise if you wanna do it like Russ Money said you could use local variables. i.e;

Spoiler below!

DifferentMusic();

void Differentmusic()
{
PlayMusic("", true, 1.0, 4.0, 0, true);

AddTimer("Music", 10, "Music");
}

void Music(string &in asTimer)
{
SetLocalVarInt("music", 1);

AddLocalVarInt("music", RandInt(10, 15));
if(GetLocalVarInt("music") == 1)
{
PlayMusic("", true, 1.0, 4.0, 0, true);
}
else
{
PlayMusic("", true, 1.0, 4.0, 0, true);
}
}



Thanks a thousand! Works like a dream. Heart Big Grin
If you like you could add the first function so it plays itself over and over again, I'll just post it all here;

Spoiler below!

DifferentMusic();

void Differentmusic()
{
PlayMusic("", true, 1.0, 4.0, 0, true);

AddTimer("Music", 10, "Music");
}

void Music(string &in asTimer)
{
SetLocalVarInt("music", 1);

AddLocalVarInt("music", RandInt(10, 15));
if(GetLocalVarInt("music") == 1)
{
PlayMusic("", true, 1.0, 4.0, 0, true);
}
else
{
PlayMusic("", true, 1.0, 4.0, 0, true);

DifferentMusic();
}
}


(06-21-2011, 07:36 PM)rojkish Wrote: [ -> ]If you like you could add the first function so it plays itself over and over again, I'll just post it all here;

Spoiler below!

DifferentMusic();

void Differentmusic()
{
PlayMusic("", true, 1.0, 4.0, 0, true);

AddTimer("Music", 10, "Music");
}

void Music(string &in asTimer)
{
SetLocalVarInt("music", 1);

AddLocalVarInt("music", RandInt(10, 15));
if(GetLocalVarInt("music") == 1)
{
PlayMusic("", true, 1.0, 4.0, 0, true);
}
else
{
PlayMusic("", true, 1.0, 4.0, 0, true);

DifferentMusic();
}
}



Cool. Big Grin