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
Stop Music ?
Janni1234 Offline
Member

Posts: 134
Threads: 24
Joined: Jan 2011
Reputation: 1
#1
Stop Music ?

How can i stop music on an area and play new music?
02-04-2011, 11:37 AM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#2
RE: Stop Music ?

To stop music, you need a script. An example I used:
StopMusic(3.0f, 100);
3.0f is the fade out time for the music
100 is the music priority. If your music has the priority of 1, just change 100 to 1.
And to start music:
PlayMusic("18_amb", true, 1, 1, 1, true);

These two codes are an example

And a normal script:
AddEntityCollideCallback("Player", "ScriptArea_1", "Whatever", true, 1);

void Whatever(string &in asParent, string &in asChild, int alState)
{
    StopMusic(3.0f, 100);
    PlayMusic("18_amb", true, 1, 1, 1, true);
}
This is how it should appear in a script file. Just in case you didn't know how to script well.

Make sure the Script Area you want the player to collide with is ScriptArea_1, just like in the AddEntityCollideCallback.

Hope it works. That is the way I do it with music and works fine.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 02-04-2011, 12:14 PM by Robby.)
02-04-2011, 12:09 PM
Website Find
Janni1234 Offline
Member

Posts: 134
Threads: 24
Joined: Jan 2011
Reputation: 1
#3
RE: Stop Music ?

Okay thanks!
02-04-2011, 08:04 PM
Find




Users browsing this thread: 1 Guest(s)