This procedure is mainly for heavy walking script making things a bit neater so your walking procedure isnt a bunch of blob
This function is a combined version of just normal walking types so theres, DDTM, RRW and RW all in one.
First part of script is all to do with radialwalk, like all the stuff to WalkNumber.
Walk number is for your DDTM example:
SCAR Code:
function LoadAllDDTMWalks(WalkNumber: Integer): Integer;var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
case WalkNumber of
0: begin //Walk To Yews Begins
dtmMainPoint.x := 628;
dtmMainPoint.y := 39;
dtmMainPoint.AreaSize := 2;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindGERoadColourBH;
dtmMainPoint.Tolerance := 0;
dtmSubPoints[0].x := 611;
dtmSubPoints[0].y := 32;
dtmSubPoints[0].AreaSize := 1;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindGERoadColourBH;
dtmSubPoints[0].Tolerance := 0;
dtmSubPoints[1].x := 646;
dtmSubPoints[1].y := 28;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindGERoadColourBH;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 605;
dtmSubPoints[2].y := 35;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindGERoadColourBH;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 644;
dtmSubPoints[3].y := 33;
dtmSubPoints[3].AreaSize := 1;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindGERoadColourBH;
dtmSubPoints[3].Tolerance := 0;
dtmSubPoints[4].x := 628;
dtmSubPoints[4].y := 50;
dtmSubPoints[4].AreaSize := 1;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := FindGERoadColourBH;
dtmSubPoints[4].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
end;
That walk number is 0 so yea....
Enjoy!
SCAR Code:
function DoWalk(UsingRadial, RadialWalkoverRRW: boolean; roadcolour, start, endr, radius, rx, ry, walknumber, x1, y1, x2, y2: integer): boolean;
var
Walk: integer;
AngleBH: extended;
begin
if (UsingRadial) then
begin
if (RadialWalkoverRRW) then
begin
Result := RadialWalk(RoadColour, start, endr, radius, rx, ry);
if (Result) then
Exit;
end;
if not (RadialWalkOverRRW) then
begin
Result := RadialRoadWalk(RoadColour, start, endr, radius, rx, ry);
if (Result) then
Exit;
end;
end else
Walk := LoadAllDDTMWalks(WalkNumber);
Writeln('Searching for DDTM');
Result := FindDTMRotated(Walk, X, Y, x1, y1, x2, y2, -Pi, Pi, 0.2, AngleBH);
if (Result) then
begin
Mouse(x, y, 5, 5, true);
FFlag(2);
end;
FreeDTM(Walk);
end;
Use: (using DDTM)
SCAR Code:
DoWalk(False, False, 0, 0, 0, 0, 0, 0, 1, MMx1, MMy1, MMx2, MMy2)
Use (Using rrw):
SCAR Code:
DoWalk(true, true,findroadcolour,324, 534, 43, 1, 1, MMx1,MMy1,MMx2,MMy2)