PDA

View Full Version : DoWalk Procedure :)



BobboHobbo
03-11-2008, 11:27 AM
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:

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!

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)
DoWalk(False, False, 0, 0, 0, 0, 0, 0, 1, MMx1, MMy1, MMx2, MMy2)

Use (Using rrw):
DoWalk(true, true,findroadcolour,324, 534, 43, 1, 1, MMx1,MMy1,MMx2,MMy2)

ShowerThoughts
03-11-2008, 11:30 AM
Example? ow i get it nice work!

BobboHobbo
03-11-2008, 11:34 AM
Ye i added a example :P

P1nky
03-11-2008, 05:02 PM
oh i like it :) good job BOBBOSHOBBO

:P liek your new name hehe

Naum
03-11-2008, 05:11 PM
Nice BH. But a little complecated,no?

+rep btw.

BobboHobbo
03-12-2008, 07:29 AM
Nice BH. But a little complecated,no?

+rep btw.

Not complicated in my eyes :)

Dan Cardin
03-12-2008, 11:12 AM
looks pretty nifty :).

code isnt complicated but personally i'd rather do it myself :p

gerauchert
03-12-2008, 11:31 AM
good idea dude, syntax is kinda long so i probably wouldnt use lol...pet peev of mine :p

good job and keep it up dude ;)