kuertee Posted September 19, 2012 Share Posted September 19, 2012 Was wondering if a math genius can help me out. I need to find the x,y of the point a certain distance (e.g. 2000) in front of the player. Using the limitations of the Skyrim world and the limitations of Papyrus, I would be thankful of anyone would explain a process of how this could be achieved. Is it one formula? Or do we need to have a Quest/Magic/ObjectReference combo? I plan on continually moving an invisible marker to that point. Thanks! Link to comment Share on other sites More sharing options...
Sjogga Posted September 19, 2012 Share Posted September 19, 2012 You have to import math and then use the sin() and cos() functions. I have a script that does exactly what you are looking, so I'll post a code snippet when I'm back home. Link to comment Share on other sites More sharing options...
Sjogga Posted September 19, 2012 Share Posted September 19, 2012 Scriptname someScript extends <something> import math float property distance = 2000 auto event someEvent() actor player = game.getplayer() float posX = player.x float posY = player.y float posZ = player.z ; optional if you want to include the up/down angle float angZ = player.getangleZ() float angX = player.getangleX() ; optional if you want to include the up/down angle posX += (sin(angZ) * distance) posY += (cos(angZ) * distance) posZ -= (sin(angX) * distance) ; optional if you want to include the up/down angle endEvent Here you go :) Link to comment Share on other sites More sharing options...
kuertee Posted September 19, 2012 Author Share Posted September 19, 2012 Thank you VERY much, Sjogga! Link to comment Share on other sites More sharing options...
Recommended Posts