SRL Archive - OSR Intermediate Scripting Tutorials

DTM Tut by Starblaster100


Starblaster100

2006-05-12 17:13:59

DTM Tut by Starblaster100


What are DTM's?

Deformable Template Models (DTM's) are used a lot like bitmaps in SCAR. Basically they compare colors, and depending on what colors are found and how far away from eachother they are, the DTM will return a boolean. If the boolean is True, it will record its position.

How do i Use them?

With the Functions:
[PHP]
FindDTM(DTM : Longint; Var x, y : integer; xs, ys, xe, ye : integer))
FindDTMRotated(DTM : Longint; Var x, y : integer; xs, ys, xe, ye : integer; StartAngle, EndAngle, AngleStep : Extended; Var Angle : Extended))
[/PHP]

How do i Make them?

Using the DTM editor. Hit Tools and the DTM Editor in Scar to access it.

What are they Best Used for?

I find they are most effective in finding specific Objects in the inventory. We have 'FindText' to look for specific text, 'FindSymbol' to Look for Symbols and 'RadialWalk' and 'LinearWalk' to walk long disances. Looking for Specific Items in the invenotry is basically the only option left!

The Tutorial Link:

Try this Link First
Otherwise this one


If you have any question, do not hesitate to ask me

Starblaster100

phantombmx

2006-05-12 19:26:49

Very Nice tutorial star! Very VERY helpful!

also, may i ask what video system you are using? and how you made the boxes and whatnot?

Starblaster100

2006-05-12 19:35:21

Macromedia Captivate.

I could also make an interactive tutorial with it :D

Thanks for the comments

ub3r |<1||3r*1337*

2006-05-12 19:36:32

I must ask! where, and what screen recorder did you get!? that was very helpful. helped me with the tolerance :)

Nice Video! ++Rep!

Starblaster100

2006-05-12 19:39:44

^^^

My post above

Thanks, ill be making more soon ;)

Avaphi

2006-05-12 23:47:50

Very helpful, Couldnt I use a dtm to find the sparkling color, for fishing? Thanks again

db_cheater

Starblaster100

2006-05-13 07:42:43

Its an idea, but you would have to use DTM rotated with tolerances on all o fthe points, not just the parent. You would also have to increase the area size for each point

ub3r |<1||3r*1337*

2006-05-13 08:12:23

you should sticky all of your vid tuts. they are VERY helpful. or you can put all of the videos in one thread, and there would be a whole list of things!

btw, could you make a declareplayers tut? mabye even a forms tut.

did you buy captivate or did you get it free?

Wizzup?

2006-05-13 08:59:12

From: ub3r |<1||3r
you should sticky all of your vid tuts. they are VERY helpful. or you can put all of the videos in one thread, and there would be a whole list of things!

btw, could you make a declareplayers tut? mabye even a forms tut.

did you buy captivate or did you get it free?


A forms tut would be very nice. :)

timmyboy

2006-05-13 10:37:18

Very helpfull tutorial, now I kinda understand DMT's =P

Starblaster100

2006-05-13 13:01:57

From: ub3r |<1||3r
you should sticky all of your vid tuts. they are VERY helpful. or you can put all of the videos in one thread, and there would be a whole list of things!

btw, could you make a declareplayers tut? mabye even a forms tut.

did you buy captivate or did you get it free?


Thanks, glad i can help you. I may put them into one thread
I have the Trial of captivate

From: Wizzup?
A forms tut would be very nice. :)


lol, im making a HUGE forms tut right now ;)
Looks out for it.

btw, what would you like to see it in?
So far i have:
  • Interactivity - Because we retain 60% of what we do ;)
  • Creating a basic form
  • Implimenting Buttons and making them work
  • Relaying Information from the Form to the script
  • Adding Pictures

Post if you would like anything more

Thanks for the feedback, hope all my tuts help

Star

Avaphi

2006-05-13 13:42:13

Could you add a button that clicks color just like normal scar in your form? Then you can give them directions on what color to click on or what Item, Or even a in game screenshot as form background pointing to what color to grab. heh just an Idea

Starblaster100

2006-05-13 13:57:12

From: db_cheater
Could you add a button that clicks color just like normal scar in your form? Then you can give them directions on what color to click on or what Item, Or even a in game screenshot as form background pointing to what color to grab. heh just an Idea


unfortunately im very confused to what you want here. please explain more, or differently?

Thanks

phantombmx

2006-05-13 17:14:23

i think he means when you click a button named Color Setup, it will pop up another form or a pop-up, with a picture for every color.. as in you can just use a color picker inside the form.. i doubt its possible tho..

CamHart

2006-10-18 21:07:04

Thanks a lot

SoupyBastrd

2006-10-18 21:36:07

WOW

thanx Star

Xorg

2006-10-24 09:38:45

Thank you very much this will help me alot <3

IronTeapot

2006-10-24 19:07:07

Wow, this tutorial is amazing!!! I went from knowing almost nothing, to be being able to use it in most of my scrips :) Great job.

xxlegitxx

2006-12-27 14:07:19

It's very nice. But I must disagree with your opinion that it is only useful for objects in the inventory. Making a procedure to find your location using the minimap would require DTM's; I can't see what else it could use.

Starblaster100

2006-12-27 16:29:52

From: xxlegitxx
It's very nice. But I must disagree with your opinion that it is only useful for objects in the inventory. Making a procedure to find your location using the minimap would require DTM's; I can't see what else it could use.


Yes, i agree actually.

This tut was made quite a while ago :) Many people use it to find locations now

xxlegitxx

2006-12-27 20:40:35

Oh lol good point. From May.

lee666

2006-12-29 15:29:41

Cheers star.

wickedboy141

2007-01-04 09:17:39

its a good tut but i seem to be lost
i did the whole thing with a log and i get a error
i attached the picture with the error and if possible can u plz tell we wht is wronG?
TY

error:
Failed when compiling
Line 8: [Error] (8:39): Invalid number of parameters in script

script:
program New;

var
x,y,LogDTM : integer;

procedure FindDTM;
begin
If(FindDTM(LogDTM,x,y,555,200,705,497))then
Writeln('DTM found');
end;

Procedure LoadDTM;
begin
LogDTM := DTMFromString('78DA632C62626078C68002B2830CC1342394C' +
'F9809547317554D46803EAA9A3CA09A3B0C688011554D09A69A50' +
'27755435354035B70898530B54F388809A46A09AD7A82A0C14145' +
'0D59401D5BC4555D3986C83AA2607A8E603AA9ACA3039CCF07983' +
'AA26CE4914554D3250CD73026E4E03AA7980AA22C4CB1A450D000' +
'8A016D0');
end;

begin
LoadDTM;
FindDTM;
end.

Hobbit

2007-01-22 00:35:11

ummm i know this is a very noob question….but what program do i view it in…ive downloaded and re downloaded everything i can from macromedia and i tried downloading captivate to see if i can open in there….then i researched…but nothing works!@!!!!!!!!!!!!!!!!!!!!!!!!! how do i view the .swf file???????:confused:

madmoon

2007-01-26 17:59:09

From: Hobbit
ummm i know this is a very noob question….but what program do i view it in…ive downloaded and re downloaded everything i can from macromedia and i tried downloading captivate to see if i can open in there….then i researched…but nothing works!@!!!!!!!!!!!!!!!!!!!!!!!!! how do i view the .swf file???????:confused:


I had the same problem, I found that it worked in Internet Explorer.


Would somebody be able to expand on the, X1, Y1, X2, Y2 for me?

Thanks

Hobbit

2007-01-26 18:49:42

ok thnx…they x1, y1,x2,y2 is just the area u need to specify for it too look for the dtm…and so it will look inbetween those and once its found it returns coords as x y

madmoon

2007-01-26 21:24:07

From: Hobbit
ok thnx…they x1, y1,x2,y2 is just the area u need to specify for it too look for the dtm…and so it will look inbetween those and once its found it returns coords as x y


So, X1 and Y1 should be the top left corner? and X2 and Y2 should be the bottom left corner?

Hobbit

2007-01-27 00:49:15

From: madmoon
So, X1 and Y1 should be the top left corner? and X2 and Y2 should be the bottom left corner?


ok i think its liek this….you know how in like paint or something to make a box…u click 1 point then drag diagonally to the other point..then it makes a box? i think its like that x1,y1 is the top left corner of the box and x2,y2 are the bottom right corner…that how i've been suing it in my scripts….if it isnt like that…then its a mirical that my scripts run lol;)

madmoon

2007-01-27 00:56:36

From: Hobbit
ok i think its liek this….you know how in like paint or something to make a box…u click 1 point then drag diagonally to the other point..then it makes a box? i think its like that x1,y1 is the top left corner of the box and x2,y2 are the bottom right corner…that how i've been suing it in my scripts….if it isnt like that…then its a mirical that my scripts run lol;)


Sorry that was a typo, I did mean bottom right corner. Thanks for the help :)

Hobbit

2007-01-27 01:00:55

your welcome im glad i could help…i kinda thought it might be a typo but wasnt sure ;)

gsquare567

2007-03-16 23:57:52

sorry for reviving this but i downloaded the tut and wanna watch it but i dunno how to run it. i just dled flash player but how do i open it with it?

Mjordan

2007-03-17 00:00:11

From: gsquare567
sorry for reviving this but i downloaded the tut and wanna watch it but i dunno how to run it. i just dled flash player but how do i open it with it?


hey no worries about bumping this, its an awesome tut. and to run it, just click on the link and it will download and open in media player or whatever your default player is.

Hobbit

2007-03-17 01:47:32

thats not how it worked for me…cause he made it in adobe captiveate and saved as an animation file (.svf or something like that) so what i had to do was get adobe captivate 2 make a 1 slide project then i added it in as a animation and did view project and it played..

gsquare567

2007-03-17 10:20:37

ok thanks i'll try that hobbit. i tried in wmp but no good.

Mjordan

2007-03-17 21:10:56

well it played in media player for me.

lefamaster

2007-03-20 14:47:13

error:
Failed when compiling
Line 8: [Error] (8:39): Invalid number of parameters in script

script:
program New;

var
x,y,LogDTM : integer;

procedure FindDTM;
begin
If(FindDTM(LogDTM,x,y,555,200,705,497))then
Writeln('DTM found');
end;



same problem here. Nice tut, went through just as it said, but there is something qrong with line 8. Please advise.

EL_TYCHO

2007-04-17 12:51:17

I love your tut, but Im trying to make a dtm of Lowe's head (the varrock arrowshop guy) but the prob is, he doesnt have any black lines on his head :s
What should I do?

Starblaster100

2007-04-17 13:03:59

Make all the points have a decent tolerance. About 20-40 i would say (Trial and error)

Increase the area size of each point to about 2-5 (Trial and error again)

Try then and see what you get.

DTMs are all about trial and error

EL_TYCHO

2007-04-17 13:50:20

Ok ill try that :) Ty, but maybe I could use the brown floor color in stead of the black?

alfonso1024

2007-08-04 22:04:23

the video wont work it says want to open with what?
intrnet
amd program

XabdullahX

2009-05-29 23:31:11

Just being clear :)

If you cant open it: OPEN with firefox (or ie lol)

btw. thx for tut :)
but what is finddtmrotated ?

jakeyboy29

2009-05-30 00:01:03

when the mini map rotates, isent it?
not looked into it, only guessing.

XabdullahX

2009-05-30 01:16:33

lol @ warning :(:(:(

At least i search :(