ashtonlp101 Posted April 11, 2021 Posted April 11, 2021 (edited) 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 April 11, 2021 by ashtonlp101
GamerRick Posted April 11, 2021 Posted April 11, 2021 Maybe you could set the XYZ positions, but I think you would need to disable/set XYZ/enable across frames.
madmongo Posted April 12, 2021 Posted April 12, 2021 You are going to need to do some calculations. See the discussion on this page:https://forums.nexusmods.com/index.php?/topic/7320086-how-to-moveto-an-actor-in-front-of-the-player/
dubiousintent Posted April 12, 2021 Posted April 12, 2021 (edited) Final summary of that thread added as "TIP Relocating objects to Player by script" in the "Scripting" section of the wiki "Getting started creating mods using GECK" article. -Dubious- Edited April 12, 2021 by dubiousintent
IntenseMute Posted April 12, 2021 Posted April 12, 2021 (edited) 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 April 12, 2021 by IntenseMute
dubiousintent Posted April 13, 2021 Posted April 13, 2021 Updated the wiki Tip with IntenseMute's info on "SUP NVSE Plugin" function. -Dubious-
Recommended Posts