| 
		
	
		| Statyk   Schrödinger's Mod
 
 Posts: 4,390
 Threads: 72
 Joined: Sep 2011
 Reputation: 
241
 | 
			| How Do I Get the Player to Look at an Entity? 
 
				So I've been making a map, but I want the character to look up since he's laying down, and away so the player can control the character afterward.. I've tried scripting this:
 ______________________
 void OnStart()
 {
 StartPlayerLookAt("lookatrock1", 0, 1.0, "lookawaycall");
 AddTimer("lookawaycall", 11.0, "lookaway");
 }
 void lookaway(string &in asTimer)
 {
 StopPlayerLookAt();
 }
 
 ______________________
 
 But the character doesn't turn to the entity, which is "lookatrock1"
 Does anyone know what I'm doing wrong here? =[
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 and also, If anyone can help me with another scripting issue, I'm trying to push the character into another spot using:
 
 ______________________
 void playerpush(string &in asTimer)
 {
 AddPlayerBodyForce(6000, 0, 0, false);
 }
 
 ______________________
 Note that a timer is being used so the player will be pushed during a blackscreen. The AddTimer has a callback for "playerpush". But the character doesn't get pushed.. should I just have him teleport further while the screen is black? It'd be like in the beginning of the actual game.
 
 If anyone can help, I'd greatly appreciate it!
 
 
				
(This post was last modified: 09-30-2011, 12:31 AM by Statyk.)
 |  |  
	| 09-30-2011, 12:22 AM |  |  
	
		| Juby   Senior Member
 
 Posts: 290
 Threads: 2
 Joined: May 2011
 Reputation: 
5
 | 
			| RE: How Do I Get the Player to Look at an Entity? 
 
				 (09-30-2011, 12:22 AM)Statyk Wrote:  void OnStart(){
 StartPlayerLookAt("lookatrock1", 0, 1.0, "lookawaycall");
 The speed is set to 0    
I would have something like "StartPlayerLookAt("lookatrock1", 3, 3, "lookawaycall");"
 
As for problem number 2, there is no bool in the parameters, the last parameter should be "world"
			 
 Insanity. Static. 
				
(This post was last modified: 09-30-2011, 12:36 AM by Juby.)
 |  |  
	| 09-30-2011, 12:34 AM |  |  
	
		| Statyk   Schrödinger's Mod
 
 Posts: 4,390
 Threads: 72
 Joined: Sep 2011
 Reputation: 
241
 | 
			| RE: How Do I Get the Player to Look at an Entity? 
 
				 (09-30-2011, 12:34 AM)Juby Wrote:  The speed is set to 0  
 I would have something like "StartPlayerLookAt("lookatrock1", 3, 3, "lookawaycall");"
 Really O.o?? Fixed it in the script, lemme give it a shot!
 
  (09-30-2011, 12:34 AM)Juby Wrote:  The speed is set to 0  
 I would have something like "StartPlayerLookAt("lookatrock1", 3, 3, "lookawaycall");"
 
 As for problem number 2, there is no bool in the parameters, the last parameter should be "world"
 It worked! XD thank you so much, I can't believe I didn't see that!
			 
				
(This post was last modified: 09-30-2011, 12:40 AM by Statyk.)
 |  |  
	| 09-30-2011, 12:35 AM |  |  |