Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Explain the simplest way to use "different musics, different areas"
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#6
RE: Explain the simplest way to use "different musics, different areas"

(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

“Life is a game, play it”
06-21-2011, 03:46 PM
Find


Messages In This Thread
RE: Explain the simplest way to use "different musics, different areas" - by HumiliatioN - 06-21-2011, 03:46 PM



Users browsing this thread: 1 Guest(s)