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
How to stop music when going next level on door?
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#1
How to stop music when going next level on door?

How to stop long track on background when reaching door and that is taking you next level. Then other track song coming to play?

My problem this same track plays and not stopping when you move player to the next level on previously level?

How i can solve this?

Cheers. Smile

“Life is a game, play it”
07-10-2011, 10:06 AM
Find
TFEF Offline
Member

Posts: 143
Threads: 0
Joined: Feb 2011
Reputation: 1
#2
RE: How to stop music when going next level on door?

StopMusic(float afFadeTime, int alPrio);

To stop the music. Put that in the .hps of the map that has the music you want to stop when you leave.

Then just add a PlayMusic on the next map. Or set the new map's music to a higher priority.
07-10-2011, 10:11 AM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#3
RE: How to stop music when going next level on door?

(07-10-2011, 10:11 AM)TFEF Wrote: StopMusic(float afFadeTime, int alPrio);

To stop the music. Put that in the .hps of the map that has the music you want to stop when you leave.

Then just add a PlayMusic on the next map. Or set the new map's music to a higher priority.

Not working this is my script:

Forbidden cellar hps. map file:

void MusicControl2(string &in asParent, string &in asChild, int alState)
{
PlayMusic("You Only Live Once.ogg", false, 3, 3, 10, true);
StopMusic(2, 0);
}

Undead house map hps. map file:

void MusicControl(string &in asParent, string &in asChild, int alState)
{
if(alState == 1) PlayMusic("Requim For A Dream.ogg", true, 1.0f, 0, 0, true);
if(alState == -1) StopMusic(2, 0);
}

Still playing when i exit the next map Sad


“Life is a game, play it”
(This post was last modified: 07-10-2011, 10:18 AM by HumiliatioN.)
07-10-2011, 10:18 AM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#4
RE: How to stop music when going next level on door?

void OnLeave()
{
StopMusic(0f, 1);
}

If doesn't work:

void OnLeave()
{
StopMusic(0.5f, 1);
}
Smile

When Life No Longer Exists
Full-conversion mod
07-10-2011, 10:27 AM
Website Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#5
RE: How to stop music when going next level on door?

(07-10-2011, 10:27 AM)Unearthlybrutal Wrote: void OnLeave()
{
StopMusic(0f, 1);
}

If doesn't work:

void OnLeave()
{
StopMusic(0.5f, 1);
}
Smile

Nope. Not working darn.


“Life is a game, play it”
07-10-2011, 10:32 AM
Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#6
RE: How to stop music when going next level on door?

(07-10-2011, 10:18 AM)HumiliatioN Wrote: Not working this is my script:

Forbidden cellar hps. map file:

void MusicControl2(string &in asParent, string &in asChild, int alState)
{
PlayMusic("You Only Live Once.ogg", false, 3, 3, 10, true);
StopMusic(2, 0);
}

Undead house map hps. map file:

void MusicControl(string &in asParent, string &in asChild, int alState)
{
if(alState == 1) PlayMusic("Requim For A Dream.ogg", true, 1.0f, 0, 0, true);
if(alState == -1) StopMusic(2, 0);
}

Still playing when i exit the next map Sad
if you want to do it that way, then it should be...

void MusicControl2(string &in asParent, string &in asChild, int alState)
{
StopMusic(4, 1);
PlayMusic("You Only Live Once.ogg", false, 3, 3, 10, true);
}

void MusicControl(string &in asParent, string &in asChild, int alState)
{
if(alState == 1) PlayMusic("Requim For A Dream.ogg", true, 1.0f, 0, 0, true);
else StopMusic(4, 1);
}





Insanity. Static.
07-10-2011, 01:27 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#7
RE: How to stop music when going next level on door?

(07-10-2011, 01:27 PM)Juby Wrote:
(07-10-2011, 10:18 AM)HumiliatioN Wrote: Not working this is my script:

Forbidden cellar hps. map file:

void MusicControl2(string &in asParent, string &in asChild, int alState)
{
PlayMusic("You Only Live Once.ogg", false, 3, 3, 10, true);
StopMusic(2, 0);
}

Undead house map hps. map file:

void MusicControl(string &in asParent, string &in asChild, int alState)
{
if(alState == 1) PlayMusic("Requim For A Dream.ogg", true, 1.0f, 0, 0, true);
if(alState == -1) StopMusic(2, 0);
}

Still playing when i exit the next map Sad
if you want to do it that way, then it should be...

void MusicControl2(string &in asParent, string &in asChild, int alState)
{
StopMusic(4, 1);
PlayMusic("You Only Live Once.ogg", false, 3, 3, 10, true);
}

void MusicControl(string &in asParent, string &in asChild, int alState)
{
if(alState == 1) PlayMusic("Requim For A Dream.ogg", true, 1.0f, 0, 0, true);
else StopMusic(4, 1);
}

Not working :/ I cant understand why that music never stops?


“Life is a game, play it”
(This post was last modified: 07-10-2011, 03:34 PM by HumiliatioN.)
07-10-2011, 02:40 PM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#8
RE: How to stop music when going next level on door?

The priority of the stopmusic will only stop music played at that "level" of priority. Make sure you set the same priority on the previous playmusic as the stopmusic.

[Image: mZiYnxe.png]


07-10-2011, 08:26 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#9
RE: How to stop music when going next level on door?

(07-10-2011, 08:26 PM)Acies Wrote: The priority of the stopmusic will only stop music played at that "level" of priority. Make sure you set the same priority on the previous playmusic as the stopmusic.

void MusicControl(string &in asParent, string &in asChild, int alState)
{
if(alState == 1) PlayMusic("01_amb_darkness.ogg", true, 1.0f, 0, 0, true);
if(alState == -1) StopMusic(2, 0);
}

void MusicControl2(string &in asParent, string &in asChild, int alState)
{
PlayMusic("You Only Live Once.ogg", false, 1.0f, 0, 0, true);
StopMusic(2, 0);
}

Like this?

EDIT: Nevermind I just make 20s track then It disappears Smile

Thanks anyways to everyone. Now I can finish this release to the end.

“Life is a game, play it”
(This post was last modified: 07-10-2011, 09:15 PM by HumiliatioN.)
07-10-2011, 08:35 PM
Find




Users browsing this thread: 1 Guest(s)