SilentStriker 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 950 
	Threads: 26 
	Joined: Jul 2011
	
 Reputation: 
43
		
	 | 
	
		
			
Leaving map script 
			 
			
				I need help with something (if it's possible) 
 
I want the character's vision to fade to black and then I want to change map. Is that possible? So it's going to be like he like faints and then wake up in another place.
			 
			
			
			
				
(This post was last modified: 08-28-2011, 12:55 PM by SilentStriker.)
 
				
			 
		 |  
	 
 | 
 
	| 08-28-2011, 12:54 PM  | 
	
		
	 | 
 
 
	
		
		JenniferOrange 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 424 
	Threads: 43 
	Joined: Jun 2011
	
 Reputation: 
33
		
	 | 
	
		
			
RE: Leaving map script 
			 
			
				It is very possible! 
You just have to use ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound); and void FadeOut(float afTime);.  
Create a script area that the player will collide with to trigger your blackout. Use AddEntityCollideCallback making the entity Player and the entity it collides with the name of your script area. Name the function anything you'd like. Under void FunctionName, add FadeOut and ChangeMap. You can find every function I mentioned in the script functions page.    (also your holy bible)  http://wiki.frictionalgames.com/hpl2/amn...me_scripts
			 
			
			
 
Ba-da bing, ba-da boom. 
 
			
		 |  
	 
 | 
 
	| 08-28-2011, 02:11 PM  | 
	
		
	 | 
 
 
	
		
		SilentStriker 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 950 
	Threads: 26 
	Joined: Jul 2011
	
 Reputation: 
43
		
	 | 
	
		
			
RE: Leaving map script 
			 
			
				Will this work?   
void CollideCorridorFive(string &in asParent, string &in asChild, int alState) 
{ 
	FadeOut(1); 
	PlaySoundAtEntity("Fade_Screen_Sound", "grunt/enabled", "Player", 0, true); 
	AddTimer("Loadmap", 1.5f, "Loadmap" 
} 
 
void Loadmap(string &in asParent, string &in asChild, int alState) 
{ 
	ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound); 
}
			  
			
			
			
				
(This post was last modified: 08-28-2011, 02:48 PM by SilentStriker.)
 
				
			 
		 |  
	 
 | 
 
	| 08-28-2011, 02:48 PM  | 
	
		
	 | 
 
 
	
		
		MegaScience 
 
 
		
			Member 
			
			
			
 
			
	Posts: 213 
	Threads: 1 
	Joined: Aug 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Leaving map script 
			 
			
				You forgot the ); at the end of your AddTimer.
			 
			
			
			
		 |  
	 
 | 
 
	| 08-28-2011, 03:14 PM  | 
	
		
	 | 
 
 
	
		
		SilentStriker 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 950 
	Threads: 26 
	Joined: Jul 2011
	
 Reputation: 
43
		
	 | 
	
		
			
RE: Leaving map script 
			 
			
				Yes I know i changed it in the script but I strange enough still can't get it to change map.. :/ this is how my script looks like 
void CollideCorridorSix(string &in asParent, string &in asChild, int alState) 
{ 
	FadeOut(1); 
	PlaySoundAtEntity("Fade_Screen_Sound", "grunt/enabled", "Player", 0, true); 
	AddTimer("Loadmap", 1.5f, "Loadmap"); 
} 
 
void Loadmap(string &in asParent, string &in asChild, int alState) 
{ 
	ChangeMap("floor", "PlayerStartArea_2", "", ""); 
}
			 
			
			
			
		 |  
	 
 | 
 
	| 08-28-2011, 03:18 PM  | 
	
		
	 | 
 
 
	
		
		Kyle 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 911 
	Threads: 36 
	Joined: Sep 2010
	
 Reputation: 
7
		
	 | 
	
		
			
RE: Leaving map script 
			 
			
				It appears some people don't know how to tell what to do correctly... :/ 
void CollideCorridorSix(string &in asParent, string &in asChild, int alState) 
{ 
     FadeOut(1); 
     PlaySoundAtEntity("", "enabled01.snt", "Player", 0, false); 
     AddTimer("", 1.5, "Loadmap"); 
} 
void Loadmap(string &in asTimer) 
{ 
     ChangeMap("floor.map", "PlayerStartArea_2", "", ""); 
}
 
If the rest of your script is right, then it should work.
			  
			
			
 
			
				
(This post was last modified: 08-28-2011, 03:23 PM by Kyle.)
 
				
			 
		 |  
	 
 | 
 
	| 08-28-2011, 03:21 PM  | 
	
		
	 | 
 
 
	
		
		SilentStriker 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 950 
	Threads: 26 
	Joined: Jul 2011
	
 Reputation: 
43
		
	 | 
	
		
			
RE: Leaving map script 
			 
			
				Now i got it to work   
			 
			
			
			
		 |  
	 
 | 
 
	| 08-28-2011, 03:21 PM  | 
	
		
	 | 
 
 
	
		
		Henriksen 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 308 
	Threads: 71 
	Joined: Dec 2010
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Leaving map script 
			 
			
				 (08-28-2011, 03:18 PM)SilentStriker Wrote:  Yes I know i changed it in the script but I strange enough still can't get it to change map.. :/ this is how my script looks like 
void CollideCorridorSix(string &in asParent, string &in asChild, int alState) 
{ 
	FadeOut(1); 
	PlaySoundAtEntity("Fade_Screen_Sound", "grunt/enabled", "Player", 0, true); 
	AddTimer("Loadmap", 1.5f, "Loadmap"); 
} 
 
void Loadmap(string &in asParent, string &in asChild, int alState) 
{ 
	ChangeMap("floor", "PlayerStartArea_2", "", ""); 
} 
Is the new map called "floor"? Or is the PlayerStartArea in the same map as the one you fade out in?
			  
			
			
			
		 |  
	 
 | 
 
	| 08-28-2011, 03:23 PM  | 
	
		
	 | 
 
 
	
		
		SilentStriker 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 950 
	Threads: 26 
	Joined: Jul 2011
	
 Reputation: 
43
		
	 | 
	
		
			
RE: Leaving map script 
			 
			
				floor was the name of the new map   
			 
			
			
			
		 |  
	 
 | 
 
	| 08-28-2011, 03:27 PM  | 
	
		
	 | 
 
 
	
		
		MegaScience 
 
 
		
			Member 
			
			
			
 
			
	Posts: 213 
	Threads: 1 
	Joined: Aug 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Leaving map script 
			 
			
				Can't wait to play the level Floor.   
			 
			
			
			
		 |  
	 
 | 
 
	| 08-28-2011, 03:39 PM  | 
	
		
	 | 
 
 
	 
 |