PDA

View Full Version : DTM Tutorial Basics



BobboHobbo
01-26-2008, 08:54 AM
DTM Tutorial - Basics


Last Updated: Sunday 13th of May 2012.

First of all, What is a DTM?

A DTM is a Deformable Template Model, which is used to find objects and other static items in the Runescape Client, by recorded points of colours and size.

Making a DTM.


Firstly, have the item you wish to make the DTM of ready, next go into Simba Tools > DTM Editor.
A window should show up with the Runescape screen on it. Ill be using a yew log for my example.


http://img214.imageshack.us/img214/4819/yewdtmns7.png


Now click the centre of the item you are creating the DTM for (Yew Log for example) and a dot should appear, now go to the tolerance on the right and make it 30 (because items dont have static colours, except for the outline)


Now click the edges of the Item your making the DTM like:


http://img522.imageshack.us/img522/6345/yewdtm2yf8.png


No need for tolerance for the edges is needed.

NOTE* All outlines of ITEMS are constant, meaning you dont need tolerance, this will make your DTM alot more accurate.

Now go DTM > Print DTM to text. You will see letters and numbers in your debug, example:


DTM := DTMFromString('78DA636C6462609064644006C1F65C601A2 6C' +
'A580954A382AA06260B57D30354234F404D17508D2001350D 4035' +
'FC04D49411A1A600A84602BF1A00FCF004DF');

Make a Integer of the name you want to call your DTM. I named mine YewLog.

Using DTM's


Program DTM;
{.include SRL/SRL.simba}
Var
Yewlog:integer; //The Name of the DTM
X,y:integer; // The X and the Y to store the cords for the DTM.

Procedure LoadDTM;
Begin
Yewlog := DTMFromString('78DA636C6462609064644006C1F65C601A2 6C' +
'A580954A382AA06260B57D30354234F404D17508D2001350D 4035' +
'FC04D49411A1A600A84602BF1A00FCF004DF');
end;

Procedure FindItem;
Begin
if FindDTM(Yewlog, x, y, MIX1, MIY1, MIX2, MIY2) then // MI is the cords of the Invent
begin
MMouse(x,y,5,5); // Hovers over log
If Isuptext('Yew Log')then // If text up yew log it will click it
begin
mouse(x,y,5,5,true);
end else
Writeln('No DTM found'); // If cant find DTM it will say this.
end;
end;

Begin
SetupSRL; // MAIN LOOP
ActivateClient;
LoadDTM; // CALL the loading first
FindItem;
end.


Freeing DTM's

Why to free DTM's?
Without freeing your DTM's it will clog up your computer thus slowing its performance down, if you miss FreeDTM's the only way to restore your computer to full performance again is to restart your computer, but to prevent this just use FreeDTM after using the DTM and calling the DTM when you wish to use it again.

Heres an example of how to use it. (Just put the name of the DTM you wish to free, mine was Yewlog, so i would yewlog in between the ().
FreeDTM(DTMNAMEHERE);

Make sure you re-call the loadDTM; before you search a DTM again, or you could just have the DTM seperate before the function of finding and object using DTM.

There you have it.

HayHay89
01-26-2008, 09:30 AM
awesome tut another thing closer to havin all requirments for srl member

Heavenzeyez1
01-26-2008, 09:35 AM
Isn't here in SRL-Forums 1 already?:)
Because i learned it already from here. But awsome and easy to learn TUT. ;)
Eerik.

anoobis
01-27-2008, 11:32 PM
I usually have my computer running in size 800 x 600. Does this mean that Scar wont be able to recognize DTMs taken at 1024 x 768, even if theyre the exact same items? If this is the case i would need to change my size to 1024 x 768.

Great Tutorial By the Way

I also found that when when the mouse is about to hightlight the item the Item name may lag, even for a mili second, causing the DTM not to be found. When i added wait(100) just before the If isuptext, it worked 100% of the time. Is this a good idea or a waste of time.

Thanks, Anoobis

BobboHobbo
01-28-2008, 07:58 AM
Guess its good, glad you like it.

Negaal
01-28-2008, 09:54 AM
Nice tutorial, very understandable, at least for me.
1 Note.
If you use mouse(x,y,5,5) then the area is(may be) like this

:::::::
:::ooo
:::ooo
if you do Mouse(x-5,y-5,10,10) or you make centrepoint to top-left corner then the area is like this

........
:oooo:
:oooo:
''''''''''''''

BobboHobbo
01-28-2008, 02:04 PM
Nice tutorial, very understandable, at least for me.
1 Note.
If you use mouse(x,y,5,5) then the area is(may be) like this

if you do Mouse(x-5,y-5,10,10) or you make centrepoint to top-left corner then the area is like this

Yup, i added randomness forgot about it -.-

The Intern
01-31-2008, 09:50 AM
Ty.. this was well needed, gona use this very soon :)

Edit: rep ++ :)

Jezzie Frizzle
03-18-2008, 01:40 PM
Is it essential that you always make your start point the middle? What would happen if you made all the outside points go towards the same direction? The reason I say this is because Ive tried making DTMs and have been successful with finding them in the inventory but not on the minimap. Actually I managed to get one on the minimap but that was by luck. Im using the rotate DTM function also just for the record. Anyway great job. :)

BobboHobbo
03-24-2008, 12:15 PM
Shouldnt use DTM's on main screen anyway really unreliable.

AzulDrake
08-25-2008, 05:50 AM
Thanx for the tut, help fill in the gaps I still had about DTMs

wired357
11-29-2008, 04:31 AM
Shouldnt use DTM's on main screen anyway really unreliable.

What should be used to locate things on the main screen? I only ask here because I haven't found it elsewhere yet and I am trying to figure out if my script idea is workable or not.

Huckleberry
03-04-2009, 04:03 PM
Great Tut! One of the best. keep it up.

BobboHobbo
05-13-2012, 06:03 AM
Updated to be a little nicer :).

Leyser
05-15-2012, 05:15 PM
Very helpful guide,
Thanks a bunch!

:D

BadKarma
11-19-2012, 12:00 AM
Easy read and easy to understand. Thank you very much for the help.

elmostreet
11-21-2012, 01:03 AM
If MIX1, MIY1, MIX2, MIY2 is used for inventory and MIS1, MIS1, MIS2, MIS2 for the main screen. How about the mini-map portion?

thanks.

riwu
11-21-2012, 01:10 AM
if mix1, miy1, mix2, miy2 is used for inventory and mis1, mis1, mis2, mis2 for the main screen. How about the mini-map portion?

Thanks.
mmx1, mmy1,....

euphemism
11-21-2012, 01:11 AM
If MIX1, MIY1, MIX2, MIY2 is used for inventory and MIS1, MIS1, MIS2, MIS2 for the main screen. How about the mini-map portion?

thanks.

Main Screen: MSX1, MSY1, MSX2, MSY2

Inventory: MIX1, MIY1, MIX2, MIY2

Minimap: MMX1, MMY1, MMX2, MMY2

Chatbox: MCX1, MCY1, MCX2, MCY2

elmostreet
11-21-2012, 02:02 AM
Thanks for the quick response. I copied your script and compiled it but it brings this error out. 'Duplicate identifier 'FINDITEM' at line 14 Compiling failed.'

riwu
11-21-2012, 02:07 AM
Thanks for the quick response. I copied your script and compiled it but it brings this error out. 'Duplicate identifier 'FINDITEM' at line 14 Compiling failed.'
Rename it to something else, FindItem2 or anything that doesn't already exist in the include.

elmostreet
11-21-2012, 02:21 AM
Thanks it worked. ;)

rj
11-23-2012, 04:02 PM
err what if your simba does not have a dtm editer? mine is up to date

danny2010
11-23-2012, 11:42 PM
You need to enable the extension for the dtm editor to show ( View-> Extensions->dtm_editor ) click it and select enable then you will find the dtm editor it in the tools menu

mounty
11-27-2012, 12:13 PM
Nice tut. I love DTMs, they are so easy to make and use (and in my case overuse).

chongc
12-09-2012, 11:38 PM
just a question about dtms in general, why do some dtms appear as long sequences but others are like xxx+yy+zzz with a few sequences?

GetHyper
03-06-2013, 09:53 AM
Thank you for this, im still getting my head around it all but it helps :)

JYG
04-09-2013, 06:28 AM
Thanks for this tutorial!

However, I am unable to see the picture describing:



Now click the edges of the Item your making the DTM like:


http://img522.imageshack.us/img522/6345/yewdtm2yf8.png


No need for tolerance for the edges is needed.



Anyone that has an alternate picture describing the process or can explain it in words.

Thanks

Sjoe
04-09-2013, 07:41 AM
Thanks for this tutorial!

However, I am unable to see the picture describing:



Anyone that has an alternate picture describing the process or can explain it in words.

Thanks

Check Yohojo's video on DTM's