I think Bart's referring to the z value of the camera. If you have your camera at the highest angle, it shouldn't matter much though. You can use a vector like this:
Simba Code:
type
TRadial = record
Length: Integer;
Angle: Extended;
end;
function RadialFromPts(P1, P2: TPoint): TRadial;
begin
Result.Length := Round(Hypot(P2.x - P1.x, P2.y - P1.y));
Result.Angle := Degrees(FixRad((ArcTan2(P1.y - P2.y, P1.x - P2.x) + Radians(90)) - Pi));
end;
// Somewhere in your tree chopping proc:
//...
FindTree(x, y);
MMouse(x, y, 3, 3);
if WaitUptext('Chop', 500) then
begin
r := RadialFromPts(Point(MSCX, MSCY), Point(x, y));
Dir := Round(r.Angle);
ClickMouse2(mouse_left);
//Result := True;
//Break;
end;
//...
the var Dir should then give you a good approximation of what direction your character is facing.