I believe it is possible to change the XY coordinates of an NPC, all I ask is what is the variable called, and is it possible to manipulate it?
EDIT: Never mind, but is there a way to retrieve the NPC's direction/distance from Link?
I believe it is possible to change the XY coordinates of an NPC, all I ask is what is the variable called, and is it possible to manipulate it?
EDIT: Never mind, but is there a way to retrieve the NPC's direction/distance from Link?
There's no built-in function for that. Here's the distance function, though, in case you don't know it:
Then the distance is just Distance(Link->X, Link->Y, NPCPtr->X, NPCPtr->Y).Code:float Distance(float x1, float y1, float x2, float y2) { return Sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)); }
As for the direction... Well, there are a few different ways you could find that, depending on what you're trying to accomplish. If you just need up/down/left/right, the easiest way is just to compare the X and Y values. If you need a precise angle, though, you'll probably have to bring trigonometry into it.
Hm... I'm pretty sure there's no arctangent function at the moment, though.
There are currently 1 users browsing this thread. (0 members and 1 guests)