Jump to content

Messing with Angles and Positions


ashtonlp101

Recommended Posts

So I'm working on a feature where I want an object to be placed right in front of me when I activate an ingestible. I have everything figured out except out to place the object in front of me no matter which direction I face. Moveto doesn't work because no matter which direction I face, the X, Y and Z axis stay the same, so say my character is facing a Z rotation of 45 degrees, and I type moveto 100 0 0. It will place it 100 degrees X of me no matter where I face. Does the GECK have a command that can get around this issue, or am I going to have to do some calculations within my script?

Edited by ashtonlp101
Link to comment
Share on other sites

TommInfinite's new NVSE plugin (SUP NVSE Plugin) has a function for this.

 

GetCalculatedPos

Float AngleVar
Float DistanceVar
Float fOutX
Float fOutY
			
Begin GameMode
	Set AngleVar To Player.GetAngle Z
	Set DistanceVar To 100 ;Modify this value to determine distance from player
	Player.GetCalculatedPos AngleVar DistanceVar fOutX fOutY
	Let fOutX -= Player.GetPos X
	Let fOutY -= Player.GetPos Y
	<REFERENCE>.MoveTo Player fOutX fOutY 0
End
Edited by IntenseMute
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...