Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Stop Music?
Author Message
Cetex1337 Offline
Junior Member

Posts: 21
Joined: Jun 2012
Reputation: 0
Post: #1
Stop Music?
Hey Guys!

I have used this script, and it is some music starting when the player enters a room. But my issue is that when the player leaves the room / loading a new map, then it keeps going
Quote:void OnEnter()
Quote:{
Quote:PlayMusic("20_event_darkness.ogg", true, 4, 0, 10, true);
Quote:}
Is there any scripts like StopPlayerMusic(); ?
06-25-2012 02:51 PM
Find all posts by this user Quote this message in a reply
Cruzore Offline
Senior Member

Posts: 304
Joined: Jun 2012
Reputation: 37
Post: #2
RE: Stop Music?
void StopMusic(float afFadeTime, int alPrio);

Stops music.

afFadeTime - time in seconds until music stops
alPrio -
the priority of the music that should stop (in this case, 10)
06-25-2012 02:58 PM
Find all posts by this user Quote this message in a reply
Cetex1337 Offline
Junior Member

Posts: 21
Joined: Jun 2012
Reputation: 0
Post: #3
RE: Stop Music?
So how should the full script be like?
07-24-2012 02:16 PM
Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #4
RE: Stop Music?
PlayMusic("20_event_darkness.ogg", true, 4, 0, 10, true);

the 10 is the priority of the music I usually have it on 1 (or more depends if 1 is used by another PlayMusic) but it doesn't really matter but to stop music you must use

StopMusic(1, 10);

first is how long time you want it to fade out and the second needs to have the same priority as the music you want to stop which is in this case 10.

(This post was last modified: 07-24-2012 02:24 PM by SilentStriker.)
07-24-2012 02:24 PM
Find all posts by this user Quote this message in a reply
Cetex1337 Offline
Junior Member

Posts: 21
Joined: Jun 2012
Reputation: 0
Post: #5
RE: Stop Music?
(07-24-2012 02:24 PM)SilentStriker Wrote:  PlayMusic("20_event_darkness.ogg", true, 4, 0, 10, true);

the 10 is the priority of the music I usually have it on 1 (or more depends if 1 is used by another PlayMusic) but it doesn't really matter but to stop music you must use

StopMusic(1, 10);

first is how long time you want it to fade out and the second needs to have the same priority as the music you want to stop which is in this case 10.
Thanks man +1
07-24-2012 02:42 PM
Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #6
RE: Stop Music?
You're welcome Smile

07-24-2012 02:45 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)