| 
		
	
		| tonitoni1998   Member
 
 Posts: 163
 Threads: 54
 Joined: Oct 2012
 Reputation: 
1
 | 
			| LookAtCallback 
 
				actually thought i know how its working, but i always get an error  
(" expected "," or ")" ") i dont knw how to solve. i have this 
 SetEntityPlayerLookAtCallback("diary_look_at", "SetMessage2", false);
 void SetMessage2(string &in "diary_1", int 1)
 {
 SetMessage("map1_messages", "DiaryInfo", 3);
 }
it always tells me there should be "," or" ")" before "diary_1". but when i do that the data type is missing.
 
thanks for helping
			
 When you are looking for someone, to do the scripting for your Custom Story, ask me! |  |  
	| 02-14-2013, 03:55 PM |  |  
	
		| MulleDK19   Senior Member
 
 Posts: 545
 Threads: 21
 Joined: Jun 2009
 Reputation: 
10
 | 
			| RE: LookAtCallback 
 
				 (02-14-2013, 03:55 PM)tonitoni1998 Wrote:  actually thought i know how its working, but i always get an error (" expected "," or ")" ") i dont knw how to solve. i have this
 
 SetEntityPlayerLookAtCallback("diary_look_at", "SetMessage2", false);
 void SetMessage2(string &in "diary_1", int 1)
 {
 SetMessage("map1_messages", "DiaryInfo", 3);
 }
it always tells me there should be "," or" ")" before "diary_1". but when i do that the data type is missing.
 
 thanks for helping
 void SetMessage2(string &in "diary_1", int 1){
 SetMessage("map1_messages", "DiaryInfo", 3);
 }
 
That makes absolutely no sense.
 
It should be something like:
 SetEntityPlayerLookAtCallback("diary1", "SetMessage2", false);
 void SetMessage2(string &in asEntity, int alState)
 {
 SetMessage("map1_messages", "DiaryInfo", 3);
 }
 
 
 |  |  
	| 02-14-2013, 03:56 PM |  |  
	
		| tonitoni1998   Member
 
 Posts: 163
 Threads: 54
 Joined: Oct 2012
 Reputation: 
1
 | 
			| RE: LookAtCallback 
 
				it is working, thanks!
 but how does the game know, what state (int alState) it is? its not given anywhere.
 
 When you are looking for someone, to do the scripting for your Custom Story, ask me! |  |  
	| 02-14-2013, 03:59 PM |  |  
	
		| MulleDK19   Senior Member
 
 Posts: 545
 Threads: 21
 Joined: Jun 2009
 Reputation: 
10
 | 
			| RE: LookAtCallback 
 
				 (02-14-2013, 03:59 PM)tonitoni1998 Wrote:  it is working, thanks!
 but how does the game know, what state (int alState) it is? its not given anywhere.
 
Doesn't matter. The callback will check for both looking at, and not looking at, and pass 1 or -1 respectively to your callback function.
			 
 |  |  
	| 02-14-2013, 04:00 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: LookAtCallback 
 
				If you put it like you did it, it will happen like if you wrote 0 = It will happen both when you look at it, and when you move the cursor out of the object.
 To do it, only when you look at it, you put an if-statement inside the callback like this:
 
 if(alState == 1)
 {
 //Do stuff
 }
 
 this way the game is asking: If the player looks onto the object //Do stuff, otherwise do what you wrote outside the if-statement
 
 Trying is the first step to success. |  |  
	| 02-14-2013, 04:03 PM |  |  |