Results 1 to 23 of 23

Thread: Complete pictionary guide to DTMs and DDTMs.

  1. #1
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Complete pictionary guide to DTMs and DDTMs.

    COMPLETE PICTIONARY GUIDE TO DTM'S AND DDTM'S

    I know what you're thinking: "Oh, here he goes again! Something else about what many people have talked about!" But have those guides contained FLAMETHROWERS or NINJAS? Well, don't get your hopes up, mine doesn't either. What it does have is one of the most comprehensive tutorials on D/DTM's available. So lets have a look, shall we?


    TABLE OF CONTENTS - (ctrl + f to search for them)

    1. What? - The explanation
    2. D/DTM's - the scenario
    3. DTM's - the creation
    4. DTM's - the code
    5. Interlude
    6. DDTM's - the creation
    7. DDTM's - the code
    8. Closing




    1. What? - the explaination

    You've heard of searching for colors, if you haven't I don't know where you've been. You *may* have heard of searching for bitmaps, I don't think thats done too much anymore -- its still very effective -- but what dominates the scene today is D/DTM's. What theses are, if you do not know, are a collection of points with a known distance in between. You can try to match only crucial points, something you can't do with bitmaps, to speed up the search. They're very useful, so try to use them whenever you can. This DOES NOT mean you should use them all the time. Use them when appropriate, because sometimes even the lowly color finding statement can debase a whole setup of D/DTM's.



    2. D/DTM's - the scenario
    Well, when considering when to use a DTM, you must consider the following things:


    • Area to search
    • Type of search
    • Colors around the search area
    • Are there clashes (multiple finds) when using?

    This is why: (1) If you've already narrowed the place to search to a 100x100 area, there may be no reason to use a DTM. You might do better with a color search or TPA search. (2) Are you searching for an object? A place on the map? Something in the bank? Sometimes these things can be found more effectively with a bitmap or TPA search. I'll include some of this stuff later. (3) Are there lots of repeat colors? If you, for example, run a test script which shows all the matches of a color in a TPA and you get way to many results for the main color of a DTM, think again. You might not be able to use it because the DTM may collide with other combinations in the scenery. (4) PLEASE PLEASE PLEASE test an area using a FindColorTPA first look at your results. If there seems to be too many, approach it much differently.

    Thus, choose carefully.



    3. DTM's - the creation

    Creating DTM's is surprisingly simple. I'll show you a fairly quick way. This will be with the main screen, but you should get the idea.

    1. Open up SCAR, be sure to have runescape selected with your crosshair.


    2. Open up the DTM editor, make sure there is nothing covering runescape.


    3. Determine what you will make it of, I am doing it of the World Select button.

    4. There isn't really a way to describe this, you simply click where you want the point to be returned - if its on an item, do it near the center perhaps.

    5. You then click around the area of the main point, try to get specific areas - if its an item, use the black out line. It always work. (Notice red spider web near the bottom)


    6. Save your DTM!


    7. To retrieve the code to put it to use, load it!

    4. DTM's - the code

    Now, I know, you want to know how to use it. Nothing is more simple! (I'm posting pictures so you must type it yourself, you can't copy and modify the code, you learn more by typing yourself.)

    1. Load your DTM (I'll be using mine) and copy the code.


    2. Make a variable declaration (var DTM: Integer;), and create an empty procedure. Fill it with the code from the debug box, changing the name if you want.


    3. Noticing the increased Access Violations with the more complex scripts, here is how you can help reduce that. Change that new procedure to this!


    4. Now, create another procedure. This will free the DTM's. SCAR is known to cause massive memory leaks because of the programmer! So clean up! (It won't need a try..except)

    5. Interlude

    To take a break, go play with what you've learned! I'd suggest exploring the interface of the DTM editor, make a few DTM's.

    Some things you should know, however, is that to the right of the DTM "pointing" screen there are some selectable boxes. Say your doing an item. You'd click first in the center of the object, and then look over to the right. You'll see a few boxes...



    RED: The area you should be looking at.
    VIOLET: These are mainly used in DDTM's as these are auto-generated when you make a regular DTM.
    BLUE: Change the tolerance of the color that the point is on.
    GREEN: Mainly used in DDTM's, this is automatically set to the color of point you click on...

    Look at the blue box. Now, because colors in runescape change quite a bit (except for the black outline) you should set this to 255 on the main point. Now you'd go and click on a few places on the outline of the object -- make sure its the black outline. You'd leave this tolerance at 5 or what is usually there, or you might possibly set it to zero.

    And now... I will be adding to this section any other information I deem useful. Back to the other things, shall we?




    6. DDTM's - the creation

    Okay, I won't lie to you. This is the hardest thing in the world!

    . . . Joking!

    I don't understand why people think this is hard, its truly not. All you really need it the starting template -- the psuedo code -- to begin making DDTM's.

    Well, the only thing I have in this section is a picture. Create a DTM as usual, but don't do anything else!





    7. DDTM's - the code

    The code is pretty simple: you have a Mainpoint, and a variety of Subpoints. These derived from the record TDTMPointDef.


    1. Create all of the variables... Name them something that makes sense. Lines 5 & 6 are the ones you will set the variables on by hand, the lines 7 & 8 contain the two records that assemble the DTM.


    2. Start defining the variables, I'll supply you with how to do that. You'll first create a procedure called something like the one below, then you'll fill it with your settings like those in the box. REMEMBER: The topmost is the MainPoint, those following it are not required to be in any specific order. The values marked on the MainPoint must be the value specified, but the subs can have a different values...


    3. Now, you finish it with this. It will finish it up and allocate memory. You *might* want to add a try..catch, but it'll do. Remember to free it!




    8. Closing

    Whats important is you've learned something. You better have. Or else.

    Now, if you've got any questions (Hope you don't, it means that I haven't explained something enough) please check the IRC channel #srl @ irc.freenode.net. Next you could PM me, or contact me at R030t1@gmail.com.

    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  2. #2
    Join Date
    Mar 2007
    Posts
    128
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow, I can't wait until this is finished, it looks really helpful so far .

  3. #3
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Great! I got it finished. Should be up-to-date.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  4. #4
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Nice. "Tutorial for Beginners" IMO Beginners don't need to know DDTM's.. anyways, looks nice.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  5. #5
    Join Date
    Oct 2007
    Location
    If (Online) then Loc := ('On comp') else Loc := ('Somewhere else!');
    Posts
    2,020
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ver nice tut well done and grats i think this should be intermediates too but gj

  6. #6
    Join Date
    Apr 2008
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hi good Tut

    is this right?

    SCAR Code:
    procedure DropRocks;
    begin
        DTM := DTMFromString('78DA637466626078C180028E171A826946289' +
           'FD10FA8E60DAA1A0305055435C640354F18D00023AA1A77A09A1B' +
           '04D4D803D57C2660972D50CD4D02E60401D53CC46F0E00483F0AE' +
           'F');
        Result:= True;

    end;

    this is my var you can ignore the x and y bit thats something else

    SCAR Code:
    var x, y, Tries: integer;
    DTM: integer;

    someone said i should use it for my power miner to drop the rocks.

    if i want it to work on any ore i have in my inventory do i just make lots of these?

  7. #7
    Join Date
    Nov 2007
    Location
    The Netherlands
    Posts
    1,490
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice guide
    maybe tell them when making dtms.. they should take outlines = black color
    and set the tolerance from teh mainpoint not higher than 25
    very nice done
    rep++

  8. #8
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Ok, thanks. Well, for objects, its generally advisable to set it to 255 so it matches more often, but both work fine.


    Oh, and sunny, select the outline and make it the DTM's anchorpoints. That usually works. You can often get better help than I can give you.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  9. #9
    Join Date
    Apr 2008
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    Ok, thanks. Well, for objects, its generally advisable to set it to 255 so it matches more often, but both work fine.


    Oh, and sunny, select the outline and make it the DTM's anchorpoints. That usually works. You can often get better help than I can give you.
    ok what does it mean when you said "free DTMs"

  10. #10
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Well, when you create and initialize a DTM it takes up memory. The memory does not automatically get freed when SCAR closes, so you need to do it youself.

    This is called Freeing the DTM.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  11. #11
    Join Date
    Apr 2008
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    Well, when you create and initialize a DTM it takes up memory. The memory does not automatically get freed when SCAR closes, so you need to do it youself.

    This is called Freeing the DTM.
    oh ok so that goes in the main loop?

  12. #12
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Yes, at the very end when the script exits.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  13. #13
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    I realized someone didn't put a freedtm((dtmnamehere)); in there script, if it leaks memory, does it go away after restarting your computer, like not take up that memory anymore? if not, how do you tell if it's taking up memory, and if it still is taking up that memory, how do you get it to stop?

  14. #14
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Yes, RAM only retains its data for a few milliseconds of no power. It will be free'ed. If you want to do it during runtime however (w/o restarting) you'd need to go-ask-google.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  15. #15
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    oh, so restarting will work though?

  16. #16
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Isn't the default AreaSize on (D)DTMs 0?
    Anyways, always like pictures . Nice.

    EDIT: Max tolerance isn't 255. It's either 442 or 422 (I think 442) on CTS 1.

  17. #17
    Join Date
    Dec 2006
    Location
    SC
    Posts
    692
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Very good tutorial. And I love the font.

    Good job. 10/10

    PS Don't you need to declare an integer as the variable's name? I didn't see that in the first part.

  18. #18
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Eh yeah. I Might've forgotten it but they should infer it right?
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  19. #19
    Join Date
    Dec 2006
    Location
    SC
    Posts
    692
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, this is a "beginner's tutorial" and most beginner's don't know that you have to declare the DTM name as an integer. They will most likely get an error and quit trying. The more advanced ones (who have dealt with bitmaps and such) will probably figure it out after they get an error.

    It would require some work to update the tutorial seeing how it's made out of tutorials. It's really your choice and depends on whom you want to appeal to.

    You could just mention it in the beginning. Either in a SCAR tag or through a picture, you could show them to declare DTM as a global integer and then go on to show them how to use it. This way you wouldn't really need to edit too much.

    PS I do see that you included that in step two. I guess I missed it last time . I guess that discredits this whole post, but oh well. Once again, very good tutorial.

  20. #20
    Join Date
    Jul 2008
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for all of the screenshots, they helped explain a lot.

  21. #21
    Join Date
    Aug 2008
    Location
    Serdia, Isla Prima
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanx for the excellent tut on DTMS. Been looking for a good explination for a while now

    P.S. not sure if it's just on my PC, but I can't see any pictures.

  22. #22
    Join Date
    Oct 2008
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    omg thank u for this tutorial
    it helped me so much and the other tuts on DTMs didnt reall help me
    thank you again

  23. #23
    Join Date
    Oct 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks helped me quite a bit Im going to start scripting after I read more tuts

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Complete Guide to Logging In
    By Richard in forum Outdated Tutorials
    Replies: 33
    Last Post: 07-18-2008, 06:17 PM
  2. Need help with DDtms
    By Naum in forum OSR Help
    Replies: 9
    Last Post: 02-02-2008, 06:31 AM
  3. DDTMs
    By Jackrawl in forum OSR Help
    Replies: 19
    Last Post: 12-23-2007, 02:56 AM
  4. Ddtms?
    By RudeBoiAlex in forum OSR Help
    Replies: 6
    Last Post: 09-11-2007, 04:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •