Heya. So I had to make up something like this in one of my projects I've been working on lately. Just feed the function a point on the MM and it'll turn your camera to that point as well as return the degree of the point. It works really nicely for SPS as well.
Procedure TurnToMMPoint(P: TPoint);
CAng := (Round(rs_GetCompassAngleDegrees)-90);
if (CAng < 0) then
CAng := (360+CAng);
BaseRad := (ArcTan2((P.Y - MMCY),(P.X - MMCX)) + Radians(CAng));
FinalAn := Round(Degrees(fixRad(BaseRad-Pi)));
You can see it uses similar math to SRL's 'rs_GetCompassAngleRadians'. Maybe some of you will find the use out of this for things like rotating to the nearest NPC/Object on the MM to get a better camera view for a higher chance of finding the MS object, ect...
For use with SPS just do something like this:
I'd also like to bring up to an SRL dev a updated 'rs_GetCompassAngleRadians'. This modified version is mathematically correct therefore more accurate: Already added to the include.
Function rs_GetCompassAngleRadians: Extended;
B := IntToBox(524, 5, 562, 43);
with B do
FindColorsSpiralTolerance(T.x, T.y, TPA, 65536, x1, y1, x2, y2, 0);
if Length(TPA) < 1 then
T := MiddleTPA(TPA);
Result := ArcTan2(-(T.Y - 24), T.X - 543) + Radians(90);
Result := fixRad(Result - Pi);