Special Ed
2007-04-16 16:19:01
I've developed a Function in which all you do is put in the coordinates of an object on the Minimap (tree,rock,ect using FindDTM or something) and It will return the coordinates of the Item on the Main Screen. Also returns true if the object is found in case you want to use it for rightclick, leftclick, mining, ect also works well with UpText, to double check. Make sure you have your camera at the highest angle! It has hit its' target 99% of the time for me since I've worked out the bugs, If you find some more please tell me!
Note: if your using a DTM make the parent point as close to the top of the DTM as possible, it will make to MMtoMS more accurate.
FeedBack
[1] Did It Work?
[2] Problems you noticed.
[3] Incorrect measurements.
[4] Any other thoughts / ideas.
Things Its been Tested With
[1] Tree's
[2] Rock's
[3] People [White Dot]
[4] Items [White Dot]
Known Problems
[1] First Problem: Gets Less Accurate farther away from Center [Working on it]
EDIT: Camera Must be at highest angle.
*NEW* Version 1.5
Note: if your using a DTM make the parent point as close to the top of the DTM as possible, it will make to MMtoMS more accurate.
FeedBack
[1] Did It Work?
[2] Problems you noticed.
[3] Incorrect measurements.
[4] Any other thoughts / ideas.
Things Its been Tested With
[1] Tree's
[2] Rock's
[3] People [White Dot]
[4] Items [White Dot]
Known Problems
[1] First Problem: Gets Less Accurate farther away from Center [Working on it]
EDIT: Camera Must be at highest angle.
*NEW* Version 1.5
// Credits to nielsie95 for the conversion idea.
function MMtoMS(MMX, MMY :integer; var x, y :integer):boolean;
var
XX,YY:integer;
Ptx,Pty:extended;
begin
XX:= (MMX - 647);
YY:= (MMY - 84);
Ptx:= (XX * 9.25);
Pty:= (YY * 9.25);
if(Pty < 0)then Pty:= (Pty + (-Pty / 4)) else
x:= Trunc(259.5 + Ptx);
y:= Trunc(170.5 + Pty);
if((MMX < 621) or (MMX > 672))then Result:= false else
if((MMY < 66) or (MMY > 102))then Result:= false else
if((x < 4) or (x > 515))then Result:= false else
if((y < 4) or (y > 337))then Result:= false else
Result:= true;
end;