Cage
2014-06-20 10:33:40
Hello all,
I am currently working on my object finding function to find ores within an area.
As far as finding the actual ores goes, it is fine. Debug ATPA shows nice neat little boxes surrounding all of the ores.
However, I have tried two things to try and organise the ores by distance from the centre of the screen (aka me) I have tried FindColorsSpiralTolerence and SortATPAFrom.
With both of these, should't the ATPA be organised on its distance from my character? Because at the moment the first one it appears to finding is pretty far away. See code and Pic Below:
What am I doing wrong guys? :)

I am currently working on my object finding function to find ores within an area.
As far as finding the actual ores goes, it is fine. Debug ATPA shows nice neat little boxes surrounding all of the ores.
However, I have tried two things to try and organise the ores by distance from the centre of the screen (aka me) I have tried FindColorsSpiralTolerence and SortATPAFrom.
With both of these, should't the ATPA be organised on its distance from my character? Because at the moment the first one it appears to finding is pretty far away. See code and Pic Below:
What am I doing wrong guys? :)

Function OreFinder : boolean;
var
X, Y, I, OriginalCTS : Integer;
OriginalHue, OriginalSat: Extended;
TPA: TPointArray;
TPAA: T2DPointArray;
begin
OriginalCTS := GetColorToleranceSpeed;
GetColorspeed2Modifiers(OriginalHue, OriginalSat);
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.08, 0.14);
FindColorsSpiralTolerance(X, Y, TPA, 2767437, MSX1, MSY1, MSX2, MSY2, 17);
ColorToleranceSpeed(OriginalCTS);
SetColorspeed2Modifiers(OriginalHue, OriginalSat);
TPAA := TPAtoATPAEx(TPA, 28, 28);
SortATPAFrom(TPAA, Point(MSCX, MSCY));
SMART_DebugATPA(True, TPAA);
end;