Frictional Games Forum (read-only)
Explain the simplest way to use "different musics, different areas" - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Explain the simplest way to use "different musics, different areas" (/thread-8726.html)



Explain the simplest way to use "different musics, different areas" - HumiliatioN - 06-21-2011

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.


RE: Explain the simplest way to use "different musics, different areas" - ThePaSch - 06-21-2011

Uh, sorry, but I seem to have no idea what you mean. Could you please rephrase?


RE: Explain the simplest way to use "different musics, different areas" - HumiliatioN - 06-21-2011

(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?


RE: Explain the simplest way to use "different musics, different areas" - Russ Money - 06-21-2011

(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?


RE: Explain the simplest way to use "different musics, different areas" - rojkish - 06-21-2011

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);
}
}




RE: Explain the simplest way to use "different musics, different areas" - HumiliatioN - 06-21-2011

(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


RE: Explain the simplest way to use "different musics, different areas" - rojkish - 06-21-2011

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();
}
}





RE: Explain the simplest way to use "different musics, different areas" - HumiliatioN - 06-21-2011

(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