laser50 
 
 
		
			Member 
			
			
			
 
			
	Posts: 242 
	Threads: 22 
	Joined: Apr 2011
	
 Reputation: 
0
		
	 | 
	
		
			
Teleport Problem 
			 
			
				hey guys, since my previous works on a custom story got corrupted in a Crash, I decided to make a new Story. Now scarier as Ever! 
BUT. I came onto a problem with teleporting.
 
here is my code:
 void OnStart() 
{   
    AddEntityCollideCallback("Player", "ScriptArea_1", "TeleportDream1", true, 1); 
    AddEntityCollideCallback("Player", "ScriptArea_6", "TeleportOutOfDream1", true, 1); 
 
    AddEntityCollideCallback("Player", "ScriptArea_2", "TriggerEnemy0", true, 1); 
    AddEntityCollideCallback("Player", "ScriptArea_3", "TriggerEnemy1", true, 1);  
    AddEntityCollideCallback("Player", "ScriptArea_4", "TriggerEnemy2", true, 1);  
    AddEntityCollideCallback("Player", "ScriptArea_5", "TriggerEnemy3", true, 1);  
} 
 
void TeleportDream1(string &in asParent, string &in asChild, string &in asTimer, int alState) 
{ 
AddTimer("LetsTeleport", 2, "TeleportPlayer"); 
TeleportPlayer("PlayerStartArea_2"); 
GiveSanityDamage(65, true); 
SetEntityActive("ScriptArea_1", false);     
FadeOut(0); 
} 
 
void TeleportPlayer(string &in asParent, string &in asChild, string &in asTimer, int alState) 
{ 
FadeIn(5); 
TeleportPlayer("PlayerStartArea_2"); 
}
 Nothing happens when i enter the Area I've made. It's pretty annoying.
			  
			
			
			
		 |  
	 
 | 
 
	| 05-24-2011, 08:31 PM  | 
	
		
	 | 
 
 
	
		
		Tanshaydar 
 
 
		
			From Beyond 
			
			
			
 
			
	Posts: 3,085 
	Threads: 17 
	Joined: Mar 2009
	
 Reputation: 
67
		
	 | 
	
		
			
RE: Teleport Problem 
			 
			
				void TeleportDream1(string &in asParent, string &in asChild, string &in asTimer, int alState) 
 
What the? What is that asTimer in there? 
Should be: 
void TeleportDream1(string &in asParent, string &in asChild, int alState)
			 
			
			
 
			
		 |  
	 
 | 
 
	| 05-24-2011, 08:42 PM  | 
	
		
	 | 
 
 
	
		
		laser50 
 
 
		
			Member 
			
			
			
 
			
	Posts: 242 
	Threads: 22 
	Joined: Apr 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Teleport Problem 
			 
			
				Sorry, I get mixed in some codes at some moments. But it works now! Thanks   
			 
			
			
			
		 |  
	 
 | 
 
	| 05-25-2011, 07:35 AM  | 
	
		
	 | 
 
 
	
		
		Kyle 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 911 
	Threads: 36 
	Joined: Sep 2010
	
 Reputation: 
7
		
	 | 
	
		
			
RE: Teleport Problem 
			 
			
				Naturally, I don't think you need to carry over the string &in asParent, string &in asChild, and the int alState for function TeleportPlayer. 
 
Try this: 
 
void TeleportPlayer(string &in asTimer)
			 
			
			
 
			
				
(This post was last modified: 05-25-2011, 12:16 PM by Kyle.)
 
				
			 
		 |  
	 
 | 
 
	| 05-25-2011, 12:15 PM  | 
	
		
	 | 
 
 
	
		
		laser50 
 
 
		
			Member 
			
			
			
 
			
	Posts: 242 
	Threads: 22 
	Joined: Apr 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Teleport Problem 
			 
			
				 (05-25-2011, 12:15 PM)Kyle Wrote:  Naturally, I don't think you need to carry over the string &in asParent, string &in asChild, and the int alState for function TeleportPlayer. 
 
Try this: 
 
void TeleportPlayer(string &in asTimer) 
Thanks,but since Tanshaydar's code worked. I removed the timer so it would be a instant teleport.
			  
			
			
			
		 |  
	 
 | 
 
	| 05-25-2011, 03:03 PM  | 
	
		
	 | 
 
 
	 
 |