Hello,
I've followed YoHoJo's DTM+DDTM's tut, and i understand them quite well.
Ive made this to find the 'dirt' road above Varrock West Bank (the road to GE):
SCAR Code:
program DDTMs;
{.include srl\srl.scar}
{.include srl\srl\misc\path.scar}
var YRoadDTM: Integer;
RoadMP: TDTMPointDef;
RoadSP: array[0..3] of TDTMPointDef;
RoadDTMSkel: TDTM;
x, y, I : Integer;
RDTMTol, RDTMArea : Integer;
procedure Load;
begin
RDTMTol :=40;
RDTMArea:=1;
RoadMP.x := 932;
RoadMP.y := 238;
RoadMP.areasize := RDTMArea;
RoadMP.areashape := 0;
RoadMP.color := 5401472;
RoadMP.tolerance := RDTMTol;
RoadSP[0].x := 935;
RoadSP[0].y := 241;
RoadSP[0].areasize := RDTMArea;
RoadSP[0].areashape := 0;
RoadSP[0].color := 5401472;
RoadSP[0].tolerance := RDTMTol;
RoadSP[1].x := 929;
RoadSP[1].y := 925;
RoadSP[1].areasize := RDTMArea;
RoadSP[1].areashape := 0;
RoadSP[1].color := 5401472;
RoadSP[1].tolerance := RDTMTol;
RoadSP[2].x := 935;
RoadSP[2].y := 241;
RoadSP[2].areasize := RDTMArea;
RoadSP[2].areashape := 0;
RoadSP[2].color := 5401472;
RoadSP[2].tolerance := RDTMTol;
RoadSP[3].x := 930;
RoadSP[3].y := 240;
RoadSP[3].areasize := RDTMArea;
RoadSP[3].areashape := 0;
RoadSP[3].color := 5401472;
RoadSP[3].tolerance := RDTMTol;
RoadDTMSkel.MainPoint := RoadMP;
RoadDTMSkel.SubPoints := RoadSP;
YRoadDTM := AddDTM(RoadDTMSkel);
end;
procedure FindRoad;
begin
for I := 1 to 10 do
begin
RDTMTol := RDTMTol+5;
RDTMArea:= RDTMArea+1;
if (FindDTM(YRoadDTM, x, y, 1, 1, 1280, 1024)) Then
begin
Writeln('Found DTM at a tolerance of '+IntToStr(RDTMTol)+
'and an area of '+IntToStr(RDTMArea))
exit;
end else
end;
Writeln('DTM Not Found')
end;
begin
SetUpSRL;
ActivateClient;
Load;
FindRoad;
end.
But it just won't work..
I am sure the colors are set well..