PDA

View Full Version : DDTM Walking With Your Own TPAs



TRiLeZ
08-22-2009, 10:40 AM
DDTM Walking With Your Own Auto Color Functions

In this tutorial Im going to teach you how to use DDTM walking with your own TPAs and how to make your TPAs for DDTM walking.

Step one:
After you have decided where you want to walk to, pick your first place of where you want to walk to.
I am going to be walking from the Grand Exchange to the Varrock West Bank.

Now press the "Print Screen" button on your keyboard. Make sure you are in your starting position.

Step 2:

Now go to C:\Program Files\SCAR 3.21\Includes\SRL\Scripting Tools and open up "DDTM_editor.exe".

Click on Image when the program loads up, then select "Paste Image".

Scroll over to view the minimap.

Now click on where you want to walk to in the DDTM editor.

Now you just created a point and its called the "Main Point".

Now click on some colors close to the main point that are unique and should'nt be in the same spot if you move. PS: They dont have to be close but if they're close, the DDTM becomes more accurate. Make sure the colors you pick dont move.

Here is a picture of the points I made with the DDTM Editor.

http://img196.imageshack.us/img196/3266/20137619.th.png (http://img196.imageshack.us/i/20137619.png/)

You should have 2-4 sub points. I like to use 3.

Step 3:

Once you think the points you chose are good then go File > DDTM to Text.

You should have something along the lines of this:


function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 743;
dtmMainPoint.y := 284;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 7568507;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 743;
dtmSubPoints[0].y := 284;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 7568507;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 725;
dtmSubPoints[1].y := 280;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 15658734;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 762;
dtmSubPoints[2].y := 284;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 15658734;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 748;
dtmSubPoints[3].y := 242;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 195836;
dtmSubPoints[3].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;


Dont close the DDTM editor just yet!

Step 4:

The SetDDTM function will only hold one DDTM so lets make it hold multiple DDTMs.

Replace:


function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin


With this:


function DDTMWalk(WalkNumber: Integer): Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
case WalkNumber of
1: begin


At the end of the function add:


end;
end;


Step 5:

Now its time to fix your standerds :)

Go to http://www.villavu.com/forum/showthread.php?t=3293 To learn SCAR Script Official Standards.

Here is my DDTM function at the moment.


function DDTMWalk(WalkNumber: Integer): Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
case WalkNumber of
1: begin
dtmMainPoint.x := 743;
dtmMainPoint.y := 284;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 7568507;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 743;
dtmSubPoints[0].y := 284;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 7568507;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 725;
dtmSubPoints[1].y := 280;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 15658734;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 762;
dtmSubPoints[2].y := 284;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 15658734;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 748;
dtmSubPoints[3].y := 242;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 195836;
dtmSubPoints[3].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
end;
end;


Step 6:

Because the MiniMap moves, you need to set the area size of each subpoint to something like 4. It really depends on how far the subpoints are from the mainpoint. The closer, the less areasize you need, the farther, the more area size you need. It also depends on how much of the color you picked is around that subpoint. But remember, the more areasize, the less acurate and more time it takes to find the DDTM.

Step 7:

Now its time to make a TPA to find the color of each subpoint since colors on the MiniMap change every couple of minutes.

Lets start of with making a TPA to find the color of the mainpoint.

Here would be a TPA function for finding my mainpoint color.


function FindFloorColor: Integer;
var
TPA : TPointArray;
begin
if FindColorsTolerance(TPA, 7568507, MMX1, MMY1, MMX2, MMY2, 10) then
Result:= GetColor(TPA[0].X, TPA[0].Y);
end;


Ill teach you how to make your own TPA function.

First, you have to make a function that gives a result as an integer.

Now you have to add your variables to the function.
Add: TPA : TPointArray; to your vars. This is where all of your points of the color are stored.

Add begin to start adding the contents of the function.

Now you have to find the colors that are close to the color of your point you chose in your DDTM.

Write: if FindColorsTolerance(-TPA-, -YOUR POINT'S COLOR-, MMX1, MMY1, MMX2, MMY2, -TOLERANCE-) then
-TPA- should be your TPA which in this case it would be just TPA.
-YOUR POINT'S COLOR- should be your point's color.
MMX1, MMY1, MMX2, MMY2 are the coordinates to search for your point's color.
-TOLERANCE- should be the tolerance... youll have to experiment to find the perfect tolerance.

Add Result:= GetColor(TPA[0].X, TPA[0].Y);
That makes the result of the function the color found for your point.

Now add:
end;

Now you have made your TPA!!

Step 8:

Now make a TPA for all the rest of your points.

Step 9:

Now you have to implament your TPA in your DDTM.

To do this...
Replace:
dtmMainPoint.Color := 7568507;

With:
dtmMainPoint.Color := -Your TPA function name-;
-Your TPA function name- should be your TPA function name.

And Replace:
dtmSubPoints[0].Color := 7568507;

With: dtmSubPoints[0].Color := -Your TPA function name-;
-Your TPA function name- should be your TPA function name.

Do that with all of the subpoints. Make sure to replace [0] with the subpoint number.

Step 10:

Test your DDTM function.

To do that.. call: DDTMWalk(1);

If your DDTM didnt work, try increasing the area size of all the subpoints. If your DDTM still dosnt work, your TPA may be outputting the wrong color. Try re-choosing the color or increase / decrease the tolerance.

Step 11:

Make a DDTM and a TPA for each place to walk to.

To add a new DDTM, add another number to the case WalkNumber.

Remember:
To walk to an area: call DDTMWalk(-WalkNumber-);

Go to Includes\SRL\SRL\Core\AutoColor.scar to find SRL's auto color TPA's.

And now your done!

I hope I helped you. Feel free to ask questions and suggestions.

Rick
08-22-2009, 10:51 AM
Just read through it and it's really easy to follow. Explains everything nicely. Great Tutorial :)
Only suggestion is to enlarge that picture.
Edit: You could also place some of the last step things into code tags, to make it flow better.

TRiLeZ
08-22-2009, 10:53 AM
Just read through it and it's really easy to follow. Explains everything nicely. Great Tutorial :)
Only suggestion is to enlarge that picture.

Click it to enlarge it.

tls
08-22-2009, 11:08 AM
Rename it to DDTM Walking With Your Own AutoColor Functions

Bionicle
09-10-2009, 04:28 AM
thx m8, great tut, helped me with my script alot ;) you might have even given me the last bit of knowlage i need before becoming a SRL memb so tysm :D

spicynachos2
09-13-2009, 09:59 AM
thanks alot. this really helped me. i will be looking into this method.

bullzeye95
09-13-2009, 01:54 PM
Why do you do function FindFloorColor: Integer;
var
TPA : TPointArray;
I, Col : Integer;
begin
if FindColorsTolerance(TPA, 7568507, MMX1, MMY1, MMX2, MMY2, 10) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
end;
end;instead offunction FindFloorColor: Integer;
var
x, y: Integer;
begin
if(FindColorTolerance(x, y, 7568507, MMX1, MMY1, MMX2, MMY2, 10))then
Result:= GetColor(x, y);
end;? As far as I can tell, you never use the rest of the TPA, nor the variable I.

TRiLeZ
09-13-2009, 01:57 PM
I took this function from one of my scripts and forgot to remove all things unnecessary.
Ill edit the unnecessary stuff out.

twobac
03-18-2010, 02:05 AM
Can you expand on step 8?
I am not sure how to make the TPA for the other 3 points.

do i need more var, TPA1, TPA2, TPA3?

and then
FindColorsTolerance(TPA1....
FindColorsTolerance(TPA2....
FindColorsTolerance(TPA3....

Thanks for ur help.

i luffs yeww
03-18-2010, 02:14 AM
Nope. :) 'TPA' stands for TPointArray (the T, like in TIntegerArray) means Type, I believe. But the important part is the A(rray). Arrays are specified by brackets, like this: TPA[1].

To go through all of the points in one FindColorsTolerance function, all you need to do is use a loop. A few will work, so I'll show you them. ^^


for i := 0 to High(Colors) do //The High() function just returns how many of something is in the array, so if TPA was TPA := [0, 462, 2];, High(TPA) would return 2. (Remember that it's always best to start your counting from 0, since that's how programs almost always do it! :))
if(FindColorsTolerance(TPA[i], Colors[i], etc. etc.))then
Writeln('Yay! :3');


Sorry, too lazy to get it to work with SCAR and actual colors and everything, but you seem to just be misunderstanding arrays, so I don't see the need to fill EVERY thing out for you. :p


repeat
FindColorsTolerance(TPA[i], etc. etc.);
Inc(i);
until(i = High(Colors));//And instead of using High(), you can just use however many sets of whatever there are in the sequence if you know, of course. :) It's just good to know how things work, in my opinion.


and another..


while i < High(Colors) do
FindColorsTolerance(TPA[i], etc. etc.);


And you could also use a goto, but I'm not exactly sure how to use them. :p but you get the point, hopefully. ^^

twobac
03-18-2010, 02:30 AM
ok very confused as ur answer is different to the steps in the tut.
I have followed step 8 and created a TPA for each point

function MainPoint: Integer;
var
TPA : TPointArray;
begin
if FindColorsTolerance(TPA, 1856094, MMX1, MMY1, MMX2, MMY2, 10) then
Result:= GetColor(TPA[0].X, TPA[0].Y);
end;

function point0: Integer;
var
TPA : TPointArray;
begin
if FindColorsTolerance(TPA, 1856094, MMX1, MMY1, MMX2, MMY2, 10) then
Result:= GetColor(TPA[0].X, TPA[0].Y);
end;
function point1: Integer;
var
TPA : TPointArray;
begin
if FindColorsTolerance(TPA, 1724759, MMX1, MMY1, MMX2, MMY2, 10) then
Result:= GetColor(TPA[0].X, TPA[0].Y);
end;
function point2: Integer;
var
TPA : TPointArray;
begin
if FindColorsTolerance(TPA, 1723735, MMX1, MMY1, MMX2, MMY2, 10) then
Result:= GetColor(TPA[0].X, TPA[0].Y);
end;
function point3: Integer;
var
TPA : TPointArray;
begin
if FindColorsTolerance(TPA, 1725273, MMX1, MMY1, MMX2, MMY2, 10) then
Result:= GetColor(TPA[0].X, TPA[0].Y);
end;

Then step 9 implanted the TPA in your DDTM


function DDTMWalk(WalkNumber: Integer): Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
case WalkNumber of
1: begin
dtmMainPoint.x := 708;
dtmMainPoint.y := 249;
dtmMainPoint.AreaSize := 4;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := MainPoint;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 708;
dtmSubPoints[0].y := 249;
dtmSubPoints[0].AreaSize := 4;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := point0;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 700;
dtmSubPoints[1].y := 254;
dtmSubPoints[1].AreaSize := 4;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := point1;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 715;
dtmSubPoints[2].y := 244;
dtmSubPoints[2].AreaSize := 4;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := point2;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 712;
dtmSubPoints[3].y := 255;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := point3;
dtmSubPoints[3].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
end;
end;


E: I will try to add a loop thanks

i luffs yeww
03-18-2010, 02:35 AM
No, I'm saying the same thing as he is.

Okay, by making a TPA, all you have to do is..


var
TPA: TPointArray;

TPA := [1234, 5678, 9012, 3456, 7890];


Again, it's an array (a set/sequence of integers, extendeds, strings, booleans, variants, bytes), so to access it, it's just TPA[0], TPA[1], TPA[2], TPA[3], or TPA[4].

And to access those all at once, you can just do..


for i := 0 to 4 do
Writeln(IntToStr(PointToInt(TPA[i])));//I dunno if PointToInt is anything, but I hope you understand.. :p


Actually I just looked at the tut, and you don't even need to use a TPA for this. It's not used.

twobac
03-18-2010, 02:54 AM
Right I have seen an example DDTM function and all the color have been replaced with a single TPA function name, cool.

but still struggling as the detailed steps above (step 6) to create the TPA is so different.
[
function FindFloorColor: Integer;
ar
TPA : TPointArray;
begin
if FindColorsTolerance(TPA, 7568507, MMX1, MMY1, MMX2, MMY2, 10) then
Result:= GetColor(TPA[0].X, TPA[0].Y);
end; How i get from this to..


var TPA: TPointArray;
TPA := [7568507, 7568507, 15658734, 15658734, 195836];

for i := 0 to 4 do
Writeln(IntToStr(PointToInt(TPA[i])));

sorry for not getting this?

i luffs yeww
03-18-2010, 02:57 AM
Like my edit says, you don't need a TPA. Look at bullzeye's post. :p


Why do you do function FindFloorColor: Integer;
var
TPA : TPointArray;
I, Col : Integer;
begin
if FindColorsTolerance(TPA, 7568507, MMX1, MMY1, MMX2, MMY2, 10) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
end;
end;instead offunction FindFloorColor: Integer;
var
x, y: Integer;
begin
if(FindColorTolerance(x, y, 7568507, MMX1, MMY1, MMX2, MMY2, 10))then
Result:= GetColor(x, y);
end;? As far as I can tell, you never use the rest of the TPA, nor the variable I.

twobac
03-18-2010, 03:02 AM
thanks, i will give it a go. thanks again

i luffs yeww
03-18-2010, 03:03 AM
Sorry for it being confusing. :< My fault completely.

twobac
03-18-2010, 03:36 AM
Have given up on DDTM walking for the ime being, i have just managed to get the RadialRoadWalk to work. :)

Nava2
03-18-2010, 05:00 AM
eRaidialWalk(ex) is all you need. Ju are not always necesaary. N

Nice turoalial though.st use while..loops wit conditions. obviosly you need some autocolours but thaye

i luffs yeww
03-18-2010, 05:20 AM
Oh, Nava2. :3 you're so great. ^^

twobac
03-18-2010, 08:08 PM
Where can I find out more about eRaidialWalk(ex)? I have searched the forum and it does not appear any where else.

:)

e: RadialWalkEx, found it!

Wyn
12-19-2011, 02:34 PM
Year bump. Sue me.

Thanks for the guide. I've been seeing them everything lately, just curious on how their used.



eRaidialWalk(ex) is all you need. Ju are not always necesaary. N

Nice turoalial though.st use while..loops wit conditions. obviosly you need some autocolours but thaye

Wat.

m34tcode
12-19-2011, 03:02 PM
DTMs are just groups of pixels of certain colors. You can use them to search for icons or sprittes. On the minimap you can use them to figure out where you character is. It is like serching for an image, or part of an image, but uses muuuuch less cpu time.

Wyn
12-19-2011, 04:10 PM
DTMs are just groups of pixels of certain colors. You can use them to search for icons or sprittes. On the minimap you can use them to figure out where you character is. It is like serching for an image, or part of an image, but uses muuuuch less cpu time.

I know what Dtm's are and how to use them...Was just wondering how DDtms were different (Reliable, Speed, etc).

m34tcode
12-19-2011, 04:15 PM
Oh, I believe DDTMs are DTMs you create in run-time. Not before you run the script.

So DDTMs are created on-the-fly. Does that make sense?

You can create a DTM, have the script search for it, then have the script create its own dtm(DDTM), and search for this new DDTM

footballjds
12-19-2011, 04:18 PM
Oh, I believe DDTMs are DTMs you create in run-time. Not before you run the script.

So DDTMs are created on-the-fly. Does that make sense?

You can create a DTM, have the script search for it, then have the script create its own dtm(DDTM), and search for this new DDTM

A DDTM is simply a Dynamic DTM.

m34tcode
12-19-2011, 04:34 PM
Which is what i was explaining right? a script created dtm.

Wyn
12-19-2011, 06:34 PM
Oh, I believe DDTMs are DTMs you create in run-time. Not before you run the script.

So DDTMs are created on-the-fly. Does that make sense?

You can create a DTM, have the script search for it, then have the script create its own dtm(DDTM), and search for this new DDTM

....

The point of op is....? I don't know why you're trying to explain it again.

m34tcode
12-19-2011, 06:47 PM
What? If you mean me explaining after asking whether I make sense, it was because it seemed like I needed to explain more.

P1nky
12-27-2011, 10:38 PM
SIMBA does not support the DDTM editor , or does it? if not where can I find it mate?

Zyt3x
12-27-2011, 10:40 PM
SIMBA does not support the DDTM editor , or does it? if not where can I find it mate?the extension DDTM editor. Turn it on

P1nky
12-28-2011, 07:51 AM
the extension DDTM editor. Turn it on

Thanks and what about RRW tool ?

wait DDTM editor associated with DTM editor?

Kyle Undefined
12-28-2011, 04:29 PM
In Simba, DTM Editor in Menu == DDTM Editor form.

Olly
12-29-2011, 01:14 AM
Isn't this outdated? When i make the DTM it comes up with this
DTM := DTMFromString('mWAAAAHicY2FgYFBkZGDQBGJpIFYG4hgk3A 7EYcG+DH9/fgTjWEN2BnTAiIZBAADdkQmN');

uz3
12-29-2011, 02:59 PM
Isn't this outdated? When i make the DTM it comes up with this
DTM := DTMFromString('mWAAAAHicY2FgYFBkZGDQBGJpIFYG4hgk3A 7EYcG+DH9/fgTjWEN2BnTAiIZBAADdkQmN');

As do I, I feel as if I've that somewhere. Time to search!

Kyle Undefined
12-29-2011, 07:18 PM
No, this isn't outdated. That's the DTM, in a string.

uz3
12-30-2011, 04:17 AM
No, this isn't outdated. That's the DTM, in a string.

So in stead of this
function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 743;
dtmMainPoint.y := 284;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 7568507;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 743;
dtmSubPoints[0].y := 284;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 7568507;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 725;
dtmSubPoints[1].y := 280;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 15658734;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 762;
dtmSubPoints[2].y := 284;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 15658734;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 748;
dtmSubPoints[3].y := 242;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 195836;
dtmSubPoints[3].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;

We can use just the string?

TRiLeZ
12-30-2011, 05:01 AM
So in stead of this
function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 743;
dtmMainPoint.y := 284;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 7568507;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 743;
dtmSubPoints[0].y := 284;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 7568507;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 725;
dtmSubPoints[1].y := 280;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 15658734;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 762;
dtmSubPoints[2].y := 284;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 15658734;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 748;
dtmSubPoints[3].y := 242;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 195836;
dtmSubPoints[3].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;

We can use just the string?

Strings are for DTMs, which has a constant strcuture. DDTMs are dynamic, meaning the points in them can change coordinates, size, colour and tolerance.

For map walking, you should use DDTMs since the colours of the minimap change often.

PS: With the code above, everything seems to be constant, so it could be translated into a DTM/generated from a string.

Sin
12-31-2011, 02:58 AM
Haha i'll probably get a bit confused but i'll try this out in one of my scripts

bud_wis_er_420
02-16-2013, 09:43 AM
Can this be used to make color tolerance 2 DTMs, by adding hue and sat to it?

Xeronate
03-02-2013, 09:24 PM
Ok, I read through the tutorial and I feel like this is a really bad way to walk. You have to set up a DTM manually for every time you click on the minimap and also set up a function each point and subpoint of every array? Maybe I'm not understanding this?


function SetDDTM(WalkNumber: Integer): Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..2] of TDTMPointDef;
MasterTDTM: TDTM;
begin
case WalkNumber of
1:begin
dtmMainPOint.x := 660;
dtmMainPOint.y := 21;
dtmMainPOint.AreaSize := 1;
dtmMainPOint.AreaShape := 0;
dtmMainPOint.Color := 4618874;
dtmMainPOint.Tolerance := 3;

dtmSubPoints[0].x := 646;
dtmSubPoints[0].y := 19;
dtmSubPoints[0].AreaSize := 1;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 5338726;
dtmSubPoints[0].Tolerance := 3;

dtmSubPoints[1].x := 669;
dtmSubPoints[1].y := 23;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 4418677;
dtmSubPoints[1].Tolerance := 3;

dtmSubPoints[2].x := 658;
dtmSubPoints[2].y := 27;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 4487024;
dtmSubPoints[2].Tolerance := 3;

MasterTDTM.MainPoint := dtmMainPoint;
MasterTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(MasterTDTM);
end;
end;
end;

function FindFloorColor: Integer;
var
TPA: TPointArray;
begin
if FindColorsTolerance(TPA, 4618874, P07_MMX1, P07_MMY1, P07_MMX2, P07_MMY2, 3) then
Result:= GetColor(TPA[0].X, TPA[0].y);
end;


This is what I've done so far. I have the TPA for my main point of my first minimap walk. Do I really have to make a function for each subpoint as well? This is just my first walking point of maybe 6 o.O.

footballjds
03-04-2013, 03:28 PM
Xeronate,

Yes, one would have to create a new DDTM for each point he/she would like to walk to.

klinnks
03-04-2013, 03:34 PM
how can i do ddtm to text if there isnt the option in dtm editor?:confused:

pyryny
03-05-2013, 10:33 PM
how can i do ddtm to text if there isnt the option in dtm editor?:confused:

I'd like to know this also.

x[Warrior]x3500
03-05-2013, 10:44 PM
because we are not talking about DTMs. this guide is on DDTMs. so naturally, a DTM editor wont necessarily help with DDTMs. Download neilsie's DDTM editor if creating a DDTM.

okokokok
06-11-2013, 08:55 AM
Great guide, but one question.

I have around 40 points to autocolor in my total walking procedure.
Now somewhere in the comments I read that it's possible to create the multiple TPA's in one function.
I guess it kinda works the same as with the DTMs (for example: GuardDTM[i]).

Now I'm kinda confused about the Autocolor TPA function (Do I need to add an array?)
Added the questions in the boxes underneath.


Function GetDaColor: Integer;
var
TPA : TPointArray;
I, Col : Integer;
//I guess here should come something like: TPA: Array .. of Integer; ?????)
begin
if FindColorsTolerance(TPA, 7568507, MMX1, MMY1, MMX2, MMY2, 10) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
end;

if FindColorsTolerance(TPA, DifferentColor, MMX1, MMY1, MMX2, MMY2, 10) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
end;
end;

Now when I call the TPA's in the DDTM how should I add them?
Like this?


Function LoadWalkToBankDDTMS(WalkNumber: Integer): Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
case WalkNumber of
1: begin
dtmMainPoint.x := 648;
dtmMainPoint.y := 153;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := GetDaColor;
dtmMainPoint.Tolerance := 40;

dtmSubPoints[0].x := 648;
dtmSubPoints[0].y := 153;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := GetDaColor;
dtmSubPoints[0].Tolerance := 40;

dtmSubPoints[1].x := 627;
dtmSubPoints[1].y := 133;
dtmSubPoints[1].AreaSize := 4;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := GetDaColor;
dtmSubPoints[1].Tolerance := 40;

dtmSubPoints[2].x := 662;
dtmSubPoints[2].y := 162;
dtmSubPoints[2].AreaSize := 3;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := GetDaColor;
dtmSubPoints[2].Tolerance := 40;

dtmSubPoints[3].x := 628;
dtmSubPoints[3].y := 201;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := GetDaColor;
dtmSubPoints[3].Tolerance := 40;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
end;

So how far off am I? :D