HumiliatioN 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,179 
	Threads: 64 
	Joined: Dec 2010
	
 Reputation: 
18
		
	 | 
	
		
			
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.   
			 
			
			
 
“Life is a game, play it” 
			
		 |  
	 
 | 
 
	| 07-10-2011, 10:06 AM  | 
	
		
	 | 
 
 
	
		
		TFEF 
 
 
		
			Member 
			
			
			
 
			
	Posts: 143 
	Threads: 0 
	Joined: Feb 2011
	
 Reputation: 
1
		
	 | 
	
		
			
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  | 
	
		
	 | 
 
 
	
		
		HumiliatioN 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,179 
	Threads: 64 
	Joined: Dec 2010
	
 Reputation: 
18
		
	 | 
	
		
			
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   
			 
			
			
 
“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  | 
	
		
	 | 
 
 
	
		
		Unearthlybrutal 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 775 
	Threads: 12 
	Joined: May 2011
	
 Reputation: 
26
		
	 | 
	
		
			
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); 
}
  
			 
			
			
 
			
		 |  
	 
 | 
 
	| 07-10-2011, 10:27 AM  | 
	
		
	 | 
 
 
	
		
		HumiliatioN 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,179 
	Threads: 64 
	Joined: Dec 2010
	
 Reputation: 
18
		
	 | 
	
		
			
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); 
} 
  
Nope. Not working darn.
			  
			
			
 
“Life is a game, play it” 
			
		 |  
	 
 | 
 
	| 07-10-2011, 10:32 AM  | 
	
		
	 | 
 
 
	
		
		Juby 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 290 
	Threads: 2 
	Joined: May 2011
	
 Reputation: 
5
		
	 | 
	
		
			
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   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  | 
	
		
	 | 
 
 
	
		
		HumiliatioN 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,179 
	Threads: 64 
	Joined: Dec 2010
	
 Reputation: 
18
		
	 | 
	
		
			
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   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  | 
	
		
	 | 
 
 
	
		
		Acies 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,643 
	Threads: 60 
	Joined: Feb 2011
	
 Reputation: 
73
		
	 | 
	
		
			
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]](http://i.imgur.com/mZiYnxe.png)  ジ
  
			
		 |  
	 
 | 
 
	| 07-10-2011, 08:26 PM  | 
	
		
	 | 
 
 
	
		
		HumiliatioN 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,179 
	Threads: 64 
	Joined: Dec 2010
	
 Reputation: 
18
		
	 | 
	
		
			
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   
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  | 
	
		
	 | 
 
 
	 
 |