Tiger 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,874 
	Threads: 16 
	Joined: Nov 2012
	
 Reputation: 
55
		
	 | 
	
		
			
  
Changing map without a level door? 
			 
			
				So I'm making a custom story where in one part you're supposed to change map by walking on a static_object. I've tried putting a ScriptArea there with the following script: 
 
 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1); 
} 
 
void ChangeMap_1 
{ 
ChangeMap("MyMapName.map", "PlayerStartArea_1, "", "") 
} 
 
 
I've looked on the wiki and tried googling it. I can't find anything about it. Can somebody please help me?
			 
			
			
			
				
(This post was last modified: 11-05-2012, 05:38 PM by Tiger.)
 
				
			 
		 |  
	 
 | 
 
	| 11-04-2012, 06:41 PM  | 
	
		
	 | 
 
 
	
		
		The chaser 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 2,486 
	Threads: 76 
	Joined: Jun 2012
	
 Reputation: 
113
		
	 | 
	
		
			
RE: Changing map without a level door? 
			 
			
				void OnStart() 
 
{ 
 
AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1); 
 
} 
 
 
 
void ChangeMap_1 (string &in asParent, string &in asChild, intalState) 
 
{ 
 
ChangeMap("MyMapName.map", "PlayerStartArea_1, "", "") 
 
} 
 
Every function (or void) has a syntax. You didn't have one.
			 
			
			
 
                              THE OTHERWORLD (WIP) 
 
Aculy iz dolan.  
			
		 |  
	 
 | 
 
	| 11-04-2012, 06:48 PM  | 
	
		
	 | 
 
 
	
		
		Tiger 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,874 
	Threads: 16 
	Joined: Nov 2012
	
 Reputation: 
55
		
	 | 
	
		
			
RE: Changing map without a level door? 
			 
			
				 (11-04-2012, 06:48 PM)The chaser Wrote:  void OnStart() 
 
{ 
 
AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1); 
 
} 
 
 
 
void ChangeMap_1 (string &in asParent, string &in asChild, intalState) 
 
{ 
 
ChangeMap("MyMapName.map", "PlayerStartArea_1, "", "") 
 
} 
 
Every function (or void) has a syntax. You didn't have one. Ah! Thanks a lot!   
			 
			
			
			
		 |  
	 
 | 
 
	| 11-04-2012, 06:50 PM  | 
	
		
	 | 
 
 
	
		
		The chaser 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 2,486 
	Threads: 76 
	Joined: Jun 2012
	
 Reputation: 
113
		
	 | 
	
		
			
RE: Changing map without a level door? 
			 
			
				 (11-04-2012, 06:50 PM)Tigerwaw Wrote:   (11-04-2012, 06:48 PM)The chaser Wrote:  void OnStart() 
 
{ 
 
AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1); 
 
} 
 
 
 
void ChangeMap_1 (string &in asParent, string &in asChild, int alState) 
 
{ 
 
ChangeMap("MyMapName.map", "PlayerStartArea_1, "", "") 
 
} 
 
Every function (or void) has a syntax. You didn't have one. Ah! Thanks a lot!   Sorry, a part of the syntax was wrong. Now it's corrected.
			  
			
			
 
                              THE OTHERWORLD (WIP) 
 
Aculy iz dolan.  
			
		 |  
	 
 | 
 
	| 11-04-2012, 06:52 PM  | 
	
		
	 | 
 
 
	
		
		FlawlessHappiness 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 3,980 
	Threads: 145 
	Joined: Mar 2012
	
 Reputation: 
171
		
	 | 
	
		
			
RE: Changing map without a level door? 
			 
			
			
			
 
Trying is the first step to success. 
			
		 |  
	 
 | 
 
	| 11-04-2012, 06:57 PM  | 
	
		
	 | 
 
 
	
		
		Tiger 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,874 
	Threads: 16 
	Joined: Nov 2012
	
 Reputation: 
55
		
	 | 
	
		
			
RE: Changing map without a level door? 
			 
			
				 (11-04-2012, 06:52 PM)The chaser Wrote:  Sorry, a part of the syntax was wrong. Now it's corrected. Yeah, it didn't work at first. Thanks    
 beecake Wrote:Maybe you can use this: http://www.frictionalgames.com/forum/thread-18368.html 
Thanks. I've wondered what all that means.   
			 
			
			
			
				
(This post was last modified: 11-04-2012, 07:05 PM by Tiger.)
 
				
			 
		 |  
	 
 | 
 
	| 11-04-2012, 07:02 PM  | 
	
		
	 | 
 
 
	
		
		Tiger 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,874 
	Threads: 16 
	Joined: Nov 2012
	
 Reputation: 
55
		
	 | 
	
		
			
RE: Changing map without a level door? 
			 
			
				So this is what my script looks like now: 
 
 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1); 
} 
 
void ChangeMap_1 (string &in asParent, string &in asChild, intalState) 
{ 
ChangeMap("MapName.map", "PlayerStartArea_2", "player_jump6.ogg", "player_bodyfall5.ogg") 
} 
 
Amnesia crashes when I open my custom story. Why?
			 
			
			
			
		 |  
	 
 | 
 
	| 11-04-2012, 11:48 PM  | 
	
		
	 | 
 
 
	
		
		ZeroPie 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 15 
	Threads: 2 
	Joined: Apr 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Changing map without a level door? 
			 
			
				 (11-04-2012, 11:48 PM)Tigerwaw Wrote:  So this is what my script looks like now: 
 
 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1); 
} 
 
void ChangeMap_1 (string &in asParent, string &in asChild, intalState) 
{ 
ChangeMap("MapName.map", "PlayerStartArea_2", "player_jump6.ogg", "player_bodyfall5.ogg") 
} 
 
Amnesia crashes when I open my custom story. Why? On the  ChangeMap("MapName.map", "PlayerStartArea_2", "player_jump6.ogg", "player_bodyfall5.ogg") add a  ;
This must be used after every script is typed out, so use this: 
ChangeMap("MapName.map", "PlayerStartArea_2", "player_jump6.ogg", "player_bodyfall5.ogg");
 
Hope it helps.
			  
			
			
			
		 |  
	 
 | 
 
	| 11-05-2012, 02:11 AM  | 
	
		
	 | 
 
 
	
		
		FlawlessHappiness 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 3,980 
	Threads: 145 
	Joined: Mar 2012
	
 Reputation: 
171
		
	 | 
	
		
			
RE: Changing map without a level door? 
			 
			
				Wrong syntax again    You wrote "intalState" when it should be "int alState" 
Yes spaces are important too!
			  
			
			
 
Trying is the first step to success. 
			
		 |  
	 
 | 
 
	| 11-05-2012, 07:27 AM  | 
	
		
	 | 
 
 
	
		
		Tiger 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,874 
	Threads: 16 
	Joined: Nov 2012
	
 Reputation: 
55
		
	 | 
	
		
			
RE: Changing map without a level door? 
			 
			
				 (11-05-2012, 07:27 AM)beecake Wrote:  Wrong syntax again   You wrote "intalState" when it should be "int alState" 
Yes spaces are important too! Aw cr*p. I thought I had looked through the whole script :c  
Thanks for noticing   
			 
			
			
			
		 |  
	 
 | 
 
	| 11-05-2012, 11:44 AM  | 
	
		
	 | 
 
 
	 
 |