Difference between revisions of "GetHeadingAngle"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
 
imported>DragoonWraith
m (Reverted edits by Susie (Talk); changed back to last version by Vswe)
 
(6 intermediate revisions by 6 users not shown)
Line 5: Line 5:




Returns the angle between the caller's heading and the ObjectRefID.  
Returns the angle between the caller's heading and the ObjectRefID in a range from -180 to 180.  


For example, say the player is facing due north. The object StrangeStatue is due west of the player. The command:  
For example, say the player is facing due north. The object StrangeStatue is due west of the player. The command:  
Line 11: Line 11:
   player.GetHeadingAngle StrangeStatue  
   player.GetHeadingAngle StrangeStatue  


would return 270.  
would return -90.  
 
 
When you add this value to the player's current heading angle, he will face the statue:
  set angle to player.getangle z + player.GetHeadingAngle StrangeStatue
  player.setangle z angle
 
 


[[Category: Functions]]
[[Category: Functions]]
[[Category:Functions (CS)]]
[[Category: Functions (CS 1.0)]]
[[Category: Condition Functions]]
[[Category: Condition Functions (CS 1.0)]]
[[Category: Movement Functions]]
[[Category: Movement Functions]]
[[Category: Condition Functions]]
[[Category: Movement Functions (CS 1.0)]]
 
 
 
<!-- Begin Search Terms
Get
Heading
Angle
End Search Terms -->

Latest revision as of 11:38, 16 July 2010

Syntax:

GetHeadingAngle ObjectRefID

Example:

GetHeadingAngle StrangeStatue 


Returns the angle between the caller's heading and the ObjectRefID in a range from -180 to 180.

For example, say the player is facing due north. The object StrangeStatue is due west of the player. The command:

  player.GetHeadingAngle StrangeStatue 

would return -90.


When you add this value to the player's current heading angle, he will face the statue:

  set angle to player.getangle z + player.GetHeadingAngle StrangeStatue
  player.setangle z angle