Ha. Okay. lets say you wanted to be lined up perfectly with 2 spots on the mini map. well, you could make a DTM of each Spot. Then Find a Tpoint for each of the DTM's;
By making a line with those two Tpoints, you can find the angle of the line. Then make the compass vertically lined up, related to those two spots.
here's some pictures for a rough example. I need to get photoshop lol.
I couldn't ever get them to upload in pic form, so i had to winrar them. i hope you have it. virus free. If you virus scan them, its not gonna hurt my feelings. lol.
Attachment 8530
Instead of using makeCompass('n'), which is never the same, you could use this, so lets say your radial walking is like super accurate every time. oh by the way, I didn't just need this. I just got bored, and made it lol. That's about it. I've tested the math of it. seems to be working okay. The actual degrees to moveCompass, im not to sure about.
Heres the Procedure:
SCAR Code:
//*********************************************************************
// Uses Trig Functions to find the angle bewtween
// two Tpoints, and makes compass move
// so the two tpoints would be vertical with one tpoint being on top.
// tpoints must be created with FindColor,
// FindBitmap, FindDTM, ect.
//
//*********************************************************************
var tp1,tp2:tpoint;
Procedure MoveCompassTrig(TopTP,BottomTP: Tpoint);
var TTP,BTP:Tpoint;
beginangle, SLOPE:integer;
Begin
TTP := TopTp;
BTP := BottomTP;
//This Takes care of the (divide by 0) error. refrence: vertical slope
If TTP.X = BTP.X Then
Begin
If TTP.y > BTP.y Then
Begin
WriteLn('Compass already set related to TPoints Set');
Exit;
End Else;
Begin
//MoveCompass( 180 );
Exit;
End;
End;
SLOPE := (TTP.Y-BTP.Y/TTP.X-BTP.X);
BeginAngle := Abs((ROUND(Degrees(ArcTan(SLOPE))))); //changes slope to angle threw opposite of tangent
WriteLn('Angle=' + IntToStr(BeginAngle));
WriteLn('Slope=' + IntToStr(TTP.Y-BTP.Y) + '/' + IntToStr(TTP.Y-BTP.Y));
//if positive slope
IF (Slope>0) Then
Begin
If TTP.Y > MMCY Then
Begin
//MoveCompass(-1 * (90-BeginAngle));
Exit;
End Else
Begin
//Movecompass( BeginAngle + 90);
Exit;
End;
End;
//negative slope
If (Slope < 0) Then
Begin
If (TTP.Y > MMCY) Then
Begin
//MoveCompass(90-beginangle);
Exit;
End Else
Begin
//MoveCompass(-1 * (90+ BeginAngle));
Exit;
End;
End;
//horizontal slope
If (Slope=0) then
Begin
If (TTP.X > BTP.X) Then
Begin
//MoveCompass( -90);
Exit;
End Else
Begin
//MoveCompass(90);
Exit;
end;
End;
End;
All of the [//MoveCompass(blah);]'s are just space takers, and notes to myself, about how much to move the compass. ignore them.. and its a bit sloppy right now
okay so would this work
SCAR Code:
StartAngle := (rs_GetCompassAngleDegrees);
//later on in script, example only
MakeCompass((90-BeginAngle)+StartAngle)