Jump to content

X,Y in front of player


kuertee

Recommended Posts

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

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

  • Recently Browsing   0 members

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