Jagsrs28 
 
 
		
			Member 
			
			
			
 
			
	Posts: 101 
	Threads: 25 
	Joined: Jun 2012
	
 Reputation: 
0
		
	 | 
	
		
			
SetEntityPlayerInteractCallback!?!?!? 
			 
			
				So I have been trying to make sort of a dramatic moment in my custom story, and It is not working. So basically there is a knife on the floor and you have to find it all drugged. When you pick it up a bunch of stuff happens. 
Here is the script: 
 
 
 
SetEntityPlayerInteractCallback("Knife_1", "Murder", true); 
} 
 
void Murder(string &in asParent, string &in asChild, int alState) 
{ 
	StopMusic(1, 0); 
	FadeIn(1); 
	AddTimer("Timer2", 4, "Into2"); 
	GetPlayerSpeed(); 
	SetPlayerJumpDisabled(false); 
	SetPlayerMoveSpeedMul(0) 
} 
 
void Into2(string &in asTimer) 
{ 
	FadeOut(1); 
	AddTimer("Timer3", 2, "Sounds1"); 
} 
 
void Sounds1(string &in asTimer) 
{ 
	PlaySoundAtEntity("", "24_cut.snt", "Player", 0, false); 
	PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false); 
	AddTimer("Timer4", 27, "Neworld1"); 
} 
 
void Neworld1(string &in asTimer) 
{ 
	ChangeMap("02.map", "PlayerStartArea_1", "", "");  
} 
 
 
I have the OnStart(), OnEnter(), OnLeave() 
Have any questions I will be happy to answer them. 
 
 
EDIT: 
In the Level Editor, I named the knife, "Knife_1" 
I also went into the .lang and put: 
 
 
 
<Entry Name="ItemDesc_knife_1">Knife to cut.</Entry> 
	<Entry Name="ItemName_knife_1">Knife</Entry>
			 
			
			
 
Special Custom Story for 2 special people!
 
   
 
 
 
			
				
(This post was last modified: 07-02-2012, 02:52 PM by Jagsrs28.)
 
				
			 
		 |  
	 
 | 
 
	| 07-02-2012, 02:47 PM  | 
	
		
	 | 
 
 
	
		
		Your Computer 
 
 
		
			SCAN ME! 
			
			
			
 
			
	Posts: 3,456 
	Threads: 32 
	Joined: Jul 2011
	
 Reputation: 
235
		
	 | 
	
		
			
RE: SetEntityPlayerInteractCallback!?!?!? 
			 
			
				You have the wrong interact callback syntax.
			 
			
			
 
			
		 |  
	 
 | 
 
	| 07-02-2012, 02:50 PM  | 
	
		
	 | 
 
 
	
		
		Adny 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,766 
	Threads: 6 
	Joined: Mar 2012
	
 Reputation: 
173
		
	 | 
	
		
			
RE: SetEntityPlayerInteractCallback!?!?!? 
			 
			
				The callback syntax for the function "Murder" is incorrect; it should be (string &in asEntity) instead of the callback you currently have.
			 
			
			
 
I rate it 3 memes. 
			
		 |  
	 
 | 
 
	| 07-02-2012, 02:50 PM  | 
	
		
	 | 
 
 
	
		
		EXAWOLT 
 
 
		
			Member 
			
			
			
 
			
	Posts: 113 
	Threads: 14 
	Joined: Apr 2012
	
 Reputation: 
3
		
	 | 
	
		
			
RE: SetEntityPlayerInteractCallback!?!?!? 
			 
			
				SetEntityPlayerInteractCallback will be called when "walking" on or touch the item. 
SetEntityCallbackFunc("knife", "OnPickup"); = iwill be called when picking up the item. 
void OnPickup(string &in asEntity, string &in type) 
{ 
	StopMusic(1, 0); 
FadeIn(1); 
AddTimer("Timer2", 4, "Into2"); 
GetPlayerSpeed(); 
SetPlayerJumpDisabled(false); 
SetPlayerMoveSpeedMul(0)}
			 
			
			
 
simply nuff said 
 
 
 
 
 
			
		 |  
	 
 | 
 
	| 07-02-2012, 02:53 PM  | 
	
		
	 | 
 
 
	
		
		Your Computer 
 
 
		
			SCAN ME! 
			
			
			
 
			
	Posts: 3,456 
	Threads: 32 
	Joined: Jul 2011
	
 Reputation: 
235
		
	 | 
	
		
			
RE: SetEntityPlayerInteractCallback!?!?!? 
			 
			
				 (07-02-2012, 02:53 PM)EXAWOLT Wrote:  SetEntityPlayerInteractCallback will be called when "walking" on or touch the item. 
Walking on an object is not a form of interaction.
			  
			
			
 
			
		 |  
	 
 | 
 
	| 07-02-2012, 03:13 PM  | 
	
		
	 | 
 
 
	
		
		EXAWOLT 
 
 
		
			Member 
			
			
			
 
			
	Posts: 113 
	Threads: 14 
	Joined: Apr 2012
	
 Reputation: 
3
		
	 | 
	
		
			
RE: SetEntityPlayerInteractCallback!?!?!? 
			 
			
				my wrong sorry, but i cant seem to edit my comment, somethings wrong:/
			 
			
			
 
simply nuff said 
 
 
 
 
 
			
		 |  
	 
 | 
 
	| 07-02-2012, 03:45 PM  | 
	
		
	 | 
 
 
	
		
		Jagsrs28 
 
 
		
			Member 
			
			
			
 
			
	Posts: 101 
	Threads: 25 
	Joined: Jun 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: SetEntityPlayerInteractCallback!?!?!? 
			 
			
				Finished! Yeah, It was the wrong syntax thank you guys SO MUCH!
			 
			
			
 
Special Custom Story for 2 special people!
 
   
 
 
 
			
		 |  
	 
 | 
 
	| 07-02-2012, 03:48 PM  | 
	
		
	 | 
 
 
	
		
		LulleBulle 
 
 
		
			Member 
			
			
			
 
			
	Posts: 101 
	Threads: 33 
	Joined: Feb 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: SetEntityPlayerInteractCallback!?!?!? 
			 
			
				 (07-02-2012, 03:48 PM)Jagsrs28 Wrote:  Finished! Yeah, It was the wrong syntax thank you guys SO MUCH! Incase you want to make stuff happend when you walk on it put a small script area over it and use AddEntityCollideCallback.
			  
			
			
			
		 |  
	 
 | 
 
	| 07-02-2012, 06:25 PM  | 
	
		
	 | 
 
 
	
		
		Jagsrs28 
 
 
		
			Member 
			
			
			
 
			
	Posts: 101 
	Threads: 25 
	Joined: Jun 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: SetEntityPlayerInteractCallback!?!?!? 
			 
			
				 (07-02-2012, 06:25 PM)LulleBulle Wrote:   (07-02-2012, 03:48 PM)Jagsrs28 Wrote:  Finished! Yeah, It was the wrong syntax thank you guys SO MUCH! Incase you want to make stuff happend when you walk on it put a small script area over it and use AddEntityCollideCallback. I know ,but thanks anyways!
			  
			
			
 
Special Custom Story for 2 special people!
 
   
 
 
 
			
		 |  
	 
 | 
 
	| 07-02-2012, 07:28 PM  | 
	
		
	 | 
 
 
	 
 |