SRL Archive - OSR Help

MakeCompass to coords


Home

2010-03-16 09:16:47

Hey is there function that would make compass to coordinates. (Tried using RotatePoint) But failed.

Thanks in advanced.


~Home

Gu3st...

2010-03-16 09:31:21

It's called MMToMs or something like that :)

Sabzi

2010-03-16 10:39:43

I don't really understand what you want. So you have a point on the mini map and you want to rotate the compass so that the point is in the center of main screen?
Heysus made a function that does that, I will dig it up.

EDIT: Here it is: http://villavu.com/forum/showthread.php?t=53872
Hopes that's what you want.

Wanted

2010-03-16 14:45:01

Assuming your compass is already at north all you would have to do is use the simple maths

Degrees(ArcTan2(Y1- Y2, X1- Y2)) + 90;

i.e.

MakeCompass(Round(Degrees(ArcTan2(MMCY - P.Y, MMCX - P.X)) + 90));

I guess if you're not already at 0d (north) then just

MakeCompass(Round(Degrees(ArcTan2(MMCY - P.Y, MMCX - P.X)) + 90 + rs_GetCompassDegrees));

Home

2010-03-16 15:56:14

From: IceFire908
Assuming your compass is already at north all you would have to do is use the simple maths

Degrees(ArcTan2(Y1- Y2, X1- Y2)) + 90;

i.e.

MakeCompass(Round(Degrees(ArcTan2(MMCY - P.Y, MMCX - P.X)) + 90));

I guess if you're not already at 0d (north) then just

MakeCompass(Round(Degrees(ArcTan2(MMCY - P.Y, MMCX - P.X)) + 90 + rs_GetCompassDegrees));


I think that you got it right :) I mean't that you will rotate compass to the Point :)

~Home

Heysus

2010-03-16 18:08:22

I made this a few months ago.

http://villavu.com/forum/showthread.php?t=53872