Rickvs 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 2 
	Threads: 1 
	Joined: Feb 2013
	
 Reputation: 
0
		
	 | 
	
		
			
  
Using the PlayerInteractCallBack func 
			 
			
				Hello guys, my name is Rick and I'm a complete noob when it comes to scripting, therefore help would be highly appreciated. 
 
Situation I have in mind: 
The player walks to a (locked) door, interacts with it, and suddenly a hallucinated monster appears behind him. 
 
What I've got so far: 
The player can interact with the door, the locked sound plays and obviously the door doesn't open, but nothing else happens... 
 
Problem: 
In the level editor, I clicked on the door and set the PlayerInteractCallBack tag to MonsterAppears. 
In (mapname).hps I have this, copied from the wiki: 
 
void MonsterAppears(string &in asParent, string &in asChild, int alState) 
{ 
	SetEntityActive("servant_brute_1", true);  
} 
 
And of course the enter, leave, and startup fuctions. 
 
This doesn't work. You might me thinking I'm seriously stupid if you see the problem, but I honestly can't find it. Do I need to add more code?
			 
			
			
			
				
(This post was last modified: 02-16-2013, 07:12 PM by Rickvs.)
 
				
			 
		 |  
	 
 | 
	| 02-16-2013, 06:52 PM  | 
	
		
	 | 
	
		
		NaxEla 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 415 
	Threads: 5 
	Joined: Dec 2012
	
 Reputation: 
28
		
	 | 
	
		
			
RE: Using the PlayerInteractCallBack func 
			 
			
				Change: 
void MonsterAppears(string &in asParent, string &in asChild, int alState) 
 
 
To:
 void MonsterAppears(string &in asEntity) 
 
  
			 
			
			
 
			
		 |  
	 
 | 
	| 02-16-2013, 06:55 PM  | 
	
		
	 | 
	
		
		Rickvs 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 2 
	Threads: 1 
	Joined: Feb 2013
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Using the PlayerInteractCallBack func 
			 
			
				 (02-16-2013, 06:55 PM)NaxEla Wrote:  Change: 
void MonsterAppears(string &in asParent, string &in asChild, int alState) 
 
  
To: 
void MonsterAppears(string &in asEntity) 
 
  THANK YOU! Ooh, I can't believe it was that small... You made my day!
			  
			
			
			
		 |  
	 
 | 
	| 02-16-2013, 07:03 PM  | 
	
		
	 |