Page 1 of 2 12 LastLast
Results 1 to 25 of 33

Thread: Yohojo's DTM Tut 2 DDTMs

  1. #1
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default Yohojo's DTM Tut 2 DDTMs

    Note: I HIGHLY recommend reading my normal DTM Tutorial before attempting to create a DDTM.
    Link:http://www.villavu.com/forum/showthread.php?t=564

    Thanks to Fakawi on Making the first DDTM Tutorial.
    I'v learned a lot from it.


    Part 1: Creating a DDTM!
    Hello, and welcome to Yohojo's DDTM tutorial.
    Well, you should already know about DTMs and how they work well for constant things like items and other things off of the runescape mainscreen.

    The one problem with DTMs is that they were static, meaning that they couldn't be easily edited or changed. They had a set tolerance,area,color ect. Making it hard for them to be very tolerable for some things.

    This is why DDTMs were created.
    Instead of un-understandable code like in normal DTMS:
    SCAR Code:
    KnifeDTM:= DTMFromString('78DA63DCCBC0C0E0C580023212E219FE03694' +
           '620FE0F048CBB31D54064612490DE0E240208A8D90224C209A8D9' +
           '0A24A209A8D90724FC09A83908243CF1AB010061060D7C');

    DDTMs display their information and values in a more human friendly dialect .

    Creating a DDTM is very similar to creating a normal one.
    We still have the same instances to look for such as :
    Code:
    X coordinate
    Y coordinate
    Area Size
    Area Shape
    Color
    Tolerance
    Each of these values are shown on the DTM Editor:


    When creating a DDTM, the DTM editor is not needed.
    All coding can be done by hand to create it.

    I will show you how i made my DTM for my auto road colorer.

    First we must define some variables:

    SCAR Code:
    var RoadMP: TDTMPointDef;
    var RoadSP: array[0..3] of TDTMPointDef;
    var RoadDTMSkel: TDTM;

    I will call the Main Point of my DDTM: RoadMP
    I will call the Sub Points of my DDTM: RoadSP
    And the 'Skeleton' of the DDTM: RoadDTMSkel

    Notice that the Subpoints are an array as we will be using many of them.

    Now we must fill out the 'skeleton' of the DTM.
    We must fist declare a main point:

    SCAR Code:
    RoadMP.x:=;
      RoadMP.y:=;
      RoadMP.areasize:=;
      RoadMP.areashape:=;
      RoadMP.color:=;
      RoadMP.tolerance:=;

    This is what must be inputed and filled out on scar in order to declare your main DTM point.
    To do this, first get the color picker, and click were you would like your main point to be.
    In the debug you will get something similar to:
    Code:
    Color Picked: 7041653at (660, 40)
    You must now choose an areasize, shape, and tolerance.
    REMEMBER: A main point can not have an area size larger than 1

    After you finish you should have something like this:

    SCAR Code:
    Procedure Load;
    Begin
      RoadMP.x:=660;
      RoadMP.y:=40;
      RoadMP.areasize:=1;
      RoadMP.areashape:=0;
      RoadMP.color:=7041653;
      RoadMP.tolerance:=RDTMTol;

    This is now your parent point of your DDTM.

    Next, you must choose a few sub-points.

    For my sub points of the road, i choose 4 points in a box around the main one like so:


    These four points were also filled in, using RoadSP Variable, and the same outline as my main point
    SCAR Code:
    RoadSP[0].x:=663;
      RoadSP[0].y:=43;
      RoadSP[0].areasize:=1;
      RoadSP[0].areashape:=0;
      RoadSP[0].color:=7041653;
      RoadSP[0].tolerance:=30;

      RoadSP[1].x:=657;
      RoadSP[1].y:=37;
      RoadSP[1].areasize:=1;
      RoadSP[1].areashape:=0;
      RoadSP[1].color:=7041653;
      RoadSP[1].tolerance:=30;

      RoadSP[2].x:=657;
      RoadSP[2].y:=43;
      RoadSP[2].areasize:=1;
      RoadSP[2].areashape:=0;
      RoadSP[2].color:=7041653;
      RoadSP[2].tolerance:=30;

      RoadSP[3].x:=663;
      RoadSP[3].y:=37;
      RoadSP[3].areasize:=1;
      RoadSP[3].areashape:=0;
      RoadSP[3].color:=7041653;
      RoadSP[3].tolerance:=30;

    TIDBIT: Knowing that the road was all the same color, i entered the same color automatically, also. Instead of picking 4 more points, i subtracted/added 3 coordinates from each x and y to create a box around my main point.
    This saves time and color picking =).


    SCAR Code:
    RoadSP[0].x:=663;
      RoadSP[0].y:=43;

      RoadSP[1].x:=657;
      RoadSP[1].y:=37;

      RoadSP[2].x:=657;
      RoadSP[2].y:=43;

      RoadSP[3].x:=663;
      RoadSP[3].y:=37;

    After you have your main and sub-points. You must now tell scar to 'make' your DTM.

    This is done using the variable i called: RDTMSkele
    After the sub-points add these lines using your own variable names.

    SCAR Code:
    RoadDTMSkel.MainPoint:=RoadMP;
      RoadDTMSkel.SubPoints:=RoadSP;
      YRoadDTM:=AddDTM(RoadDTMSkel);

    RoadDTMSkel.MainPoint:=RoadMP
    Tells scar the the MainPoint of 'RDTMSkele' is RoadMP
    RoadDTMSkel.SubPoints:=RoadSP;
    Tells scar the the Sub-Pointsof 'RDTMSkele' are RoadSP
    And YRoadDTM:=AddDTM(RoadDTMSkel)
    Tells scar the 'YRoadDTM' (The name of the actual DTM) is to be made from RoadDTMSkele.

    The variable 'YRoadDTM' is the one you will be using when calling upon the
    FindDTM function.

    Now you can use this like a normal DTM!
    SCAR Code:
    Program DDDTMTutorial;

    var YRoadDTM:Integer;
    var RoadMP: TDTMPointDef;
    var RoadSP: array[0..3] of TDTMPointDef;
    var RoadDTMSkel: TDTM;
    {.include SRLSRL.scar}

    Procedure Load;
    Begin
      RoadMP.x:=660;
      RoadMP.y:=40;
      RoadMP.areasize:=1;
      RoadMP.areashape:=0;
      RoadMP.color:=7041653;
      RoadMP.tolerance:=30;

      RoadSP[0].x:=663;
      RoadSP[0].y:=43;
      RoadSP[0].areasize:=1;
      RoadSP[0].areashape:=0;
      RoadSP[0].color:=7041653;
      RoadSP[0].tolerance:=30;

      RoadSP[1].x:=657;
      RoadSP[1].y:=37;
      RoadSP[1].areasize:=1;
      RoadSP[1].areashape:=0;
      RoadSP[1].color:=7041653;
      RoadSP[1].tolerance:=30;

      RoadSP[2].x:=657;
      RoadSP[2].y:=43;
      RoadSP[2].areasize:=1;
      RoadSP[2].areashape:=0;
      RoadSP[2].color:=7041653;
      RoadSP[2].tolerance:=30;

      RoadSP[3].x:=663;
      RoadSP[3].y:=37;
      RoadSP[3].areasize:=1;
      RoadSP[3].areashape:=0;
      RoadSP[3].color:=7041653;
      RoadSP[3].tolerance:=30;

      RoadDTMSkel.MainPoint:=RoadMP;
      RoadDTMSkel.SubPoints:=RoadSP;
      YRoadDTM:=AddDTM(RoadDTMSkel);
    End;

    Procedure FindIt;
    Begin
      if (FindDTM(YRoadDTM,x, y, MMX1, MMY1,MMX2, MMY2)) Then
      Writeln('w0ot');
    End;

    Begin
      SetupSRL;
      Load;
      FindIt;
    End.

    Congratulations! You have just created your first DDTM!

    Part 2: Using the 'Dynamic' part of your DDTM!

    Well, its nice that you have created a DDTM, but from the example script it acts no differently than a normal DTM?

    So, whats the point you ask?!
    Editable variables i say!

    In this 2nd part of the tutorial, i will show you the true beauty of DDTMs, the Dynamic Part!

    Now, in my road color finder, i add tolerance and area to my DTM to make the search very extensive.
    To do this, we must first setup a common variable for Tolerance and Area for your Main and Sub Points.

    Iv called mine:
    SCAR Code:
    RDTMTol:=40;
      RDTMArea:=1;

    Now you must change all the tolerance and area values to these variables like so:

    SCAR Code:
    RoadMP.x:=660;
      RoadMP.y:=40;
      RoadMP.areasize:=1;
      RoadMP.areashape:=0;
      RoadMP.color:=7041653;
      RoadMP.tolerance:=RDTMTol;

      RoadSP[0].x:=663;
      RoadSP[0].y:=43;
      RoadSP[0].areasize:=RDTMArea;
      RoadSP[0].areashape:=0;
      RoadSP[0].color:=7041653;
      RoadSP[0].tolerance:=RDTMTol;

    NOTICE:Keep the main points area size at 1, it can not have an area size larger than 1.


    Now i made it so tolerance and area is added every loop.
    This code searches for the DTM 5 times, adding an area of 1 and tolerance of 5 each time:

    SCAR Code:
    Procedure FindIt;
    Begin
      For Z:=1 To 5 Do
      Begin
        RDTMTol:=RDTMTol+5; // Adds 5 Tolerance
        RDTMArea:=RDTMArea+1 // Adds 1 Area
        if (FindDTM(YRoadDTM,x, y,MMX1,MMY1,MMX2,MMY2)) Then
        begin
          Writeln('Found DTM at a tolerance of '+IntToStr(RDTMTol)+
          'and an area of '+IntToStr(RDTMArea))
          Exit;
        End
      End
      Writeln('DTM Not Found')
    End;

    Now this is the entire script.
    Notice how i declare
    RDTMTol and RDTMArea in the loading procedure in order to preserve their values. Each time the DTM is loaded again, the Area and Tol will be reset to their original values. If this was not here, the loop would keep adding area and tolerance creating a mess!

    Also notice how i load before each loop, so the RDTMTol and RDTMArea are once again reset to their original values.
    SCAR Code:
    Program DDDTMTutorial;

    var YRoadDTM,Z,RDTMTol,RDTMArea:Integer;
    var RoadMP: TDTMPointDef;
    var RoadSP: array[0..3] of TDTMPointDef;
    var RoadDTMSkel: TDTM;
    {.include SRLSRL.scar}

    Procedure Load;
    Begin
      RDTMTol:=30
      RDTMArea:=1

      RoadMP.x:=660;
      RoadMP.y:=40;
      RoadMP.areasize:=1;
      RoadMP.areashape:=0;
      RoadMP.color:=7041653;
      RoadMP.tolerance:=RDTMTol;

      RoadSP[0].x:=663;
      RoadSP[0].y:=43;
      RoadSP[0].areasize:=RDTMArea;
      RoadSP[0].areashape:=0;
      RoadSP[0].color:=7041653;
      RoadSP[0].tolerance:=RDTMTol;

      RoadSP[1].x:=657;
      RoadSP[1].y:=37;
      RoadSP[1].areasize:=RDTMArea;
      RoadSP[1].areashape:=0;
      RoadSP[1].color:=7041653;
      RoadSP[1].tolerance:=RDTMTol;

      RoadSP[2].x:=657;
      RoadSP[2].y:=43;
      RoadSP[2].areasize:=RDTMArea;
      RoadSP[2].areashape:=0;
      RoadSP[2].color:=7041653;
      RoadSP[2].tolerance:=RDTMTol;

      RoadSP[3].x:=663;
      RoadSP[3].y:=37;
      RoadSP[3].areasize:=RDTMArea;
      RoadSP[3].areashape:=0;
      RoadSP[3].color:=7041653;
      RoadSP[3].tolerance:=RDTMTol;

      RoadDTMSkel.MainPoint:=RoadMP;
      RoadDTMSkel.SubPoints:=RoadSP;
      YRoadDTM:=AddDTM(RoadDTMSkel);
    End;

    Procedure FindIt;
    Begin
      For Z:=1 To 5 Do
      Begin
        RDTMTol:=RDTMTol+5;
        RDTMArea:=RDTMArea+1
        if (FindDTM(YRoadDTM,x, y,MMX1,MMY1,MMX2,MMY2)) Then
        begin
          Writeln('Found DTM at a tolerance of '+IntToStr(RDTMTol)+
          'and an area of '+IntToStr(RDTMArea))
          Exit;
        End
      End
      Writeln('DTM Not Found')
    End;

    Begin
      SetupSRL;
      Load;
      FindIt;
    End.

    Thank you for reading this tutorial, i hope you have learned a lot.
    If you have any questions/comments/criticism/changes you would like to see/ask/hear feel free to post.
    Iv made this tutorial pretty fast, so please tell me if anything is unclear to you.
    Also, if you are an SRL member, check out my RoadcolorFinder using many techniques displayed in this tutorial.
    http://www.villavu.com/forum/showthread.php?t=11076

    Except Updates and Tidy-Ups

  2. #2
    Join Date
    May 2007
    Location
    Canada
    Posts
    261
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh sweet, this is nice and detailed. Good job Even though I understood DDTMs before, you made them a lot clearer...thanks.
    On vacation from July 2nd till middle of August


    Account Creator and Tutorial Island Runner (member | public) Errors fixed


    Check out my Complete forms tutorial. It will teach you everything you need to know about forms.

  3. #3
    Join Date
    Apr 2007
    Location
    California
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great tut, should help many people. Never thought of that adding tol and area thing. Maybe make a small explanation on the uses of making the color non-static too, and how you can use FindRoadColor and stuff like that in those places. Or set a variable to FindRoadColor, and so on..

    Offtopic: What ever happened to making a tutorial on minimap DTMs? Though i suppose it may not be needed since you made a tutorial on DDTMs.

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Ill make that tutorial someday.
    I think ill just make a DDTM tutorial on how to make MM DTMs later.
    Im busy with stuffs and things right now but ill make that eventauly.
    Glad i could help you all.

    And yea, the tol/area is a pretty neat idea i love it it works so nicely.

  5. #5
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default

    great tutorial, has helped me a lot.

  6. #6
    Join Date
    Nov 2006
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    mh... what about instead of a color use RoadColor(FindRoadColor)
    Infractions, reputation, reflection, the dark side of scripting, they are.

  7. #7
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by iloveit8 View Post
    mh... what about instead of a color use RoadColor(FindRoadColor)
    not everything is autocolored....

    anywayz even though i already knew DDTM's this would have saved me a lot of experimenting >.< nice Tutorial you explained very well.
    Sleeping...

  8. #8
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Quote Originally Posted by iloveit8 View Post
    mh... what about instead of a color use RoadColor(FindRoadColor)
    I was going to add a part about custom color adding later thanks though.
    Im glad i could help yall =).
    And claw, ill try to help you with that west mine DTM sometime sounds like a fun challenge .

  9. #9
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great tut! lets try to make my owne ddtms

    ow btw:
    ''This code searches for the DTM 5 times, adding an area of 1 and tolerance of 10 each time:''
    but in the scar part under that:
    ''//add 5 tol each time''
    wich one is the right? i tough 5 but.. (in procedure FindIt)

  10. #10
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Thanks, like i said i made the tutorial very fast.
    There should but lots of little mistakes, thanks for finding that =).

  11. #11
    Join Date
    May 2007
    Location
    Seattle
    Posts
    1,069
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Nice detail.

    10/10
    FORMERLY BORN2CODE | Play Internet Games
    http://img147.imageshack.us/img147/2084/sigg.png

  12. #12
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow! First tutorial that I understood from the beginning.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  13. #13
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Wanna sum rep++?

  14. #14
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i have a small qeustion about dtm and ddtm. where is areashape for?

  15. #15
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    dunno, and its not gonna make any difference if its 0

  16. #16
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Area shape is a different area than a square to search in.
    We got like
    Crosses and Xs and + signs.
    They are kinda stupid, but useful in some cases i guess.

  17. #17
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oke thanks!
    iam going to have a little play with that.

  18. #18
    Join Date
    Feb 2006
    Location
    gmail messnger--evilkukka@gmail.com
    Posts
    272
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    pretty cool! Though i don't remember any mention of them last year, SCAR Divi feature?
    <SmarterC> mixster: The only reason so many people are homosexuals

  19. #19
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  20. #20
    Join Date
    Dec 2006
    Posts
    173
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice tutorial! This really helped me understand what a DDTM was and how to make them. 11/10 lol !

    Off topic: Whats better to walk with, Radial Walking or DDTM's? (ex. for a death walk back...)
    Starting to merchant, if you know of any good clans, PM me please.

  21. #21
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I use mainly RRW and a few DDTMs for things like crossroads or landmarks.
    Its all up to you though. I like a mix of both.

  22. #22
    Join Date
    Jun 2007
    Location
    New Jersey, USA
    Posts
    123
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well... Up til now I've been using DDTM's by loading them everytime I went to walk. I tried to change my script so I only have to load the DDTM's once, but something is wrong.

    I change MMRoadCol inside my walking loop constantly, and I know it works because RadialWalk uses that color. I set the colors of the subpoints/mainpoint of my DDTM to MMRoadCol as well, but ever since I've been loading the DDTM at the begining of the script, it fails to recognize the DDTM. I'm 100% sure that even though I am changing MMRoadCol, the colors of the subpoints/mainpoint are not changing.
    My Scripts:
    Rimmington Soft Clay Farmer 2.0 - Makes approx. 40k gold per hour. Mines clay, softens it, and banks it.

  23. #23
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Tried 5 mins ago making a DDTM for the first time, i made one for the Fountain (small one near E Bank) and i tested it multiple times and it works!!

    Thanks YoHoYo!!!
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  24. #24
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    10/10 thanks man i really needed it but if this uses colors(yes it does!) you can set mutiple color so you can use it as and autocolor procedure?
    because i cant autocolor...
    ~Hermen

  25. #25
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Glad everyones liking this.
    @Pie, as for auto color DDTMs will work fine. But try using Neilse's ACA (auto color aid) that thing is beautiful.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Yohojo's DTM Tut 1(Item finding with DTMs)
    By YoHoJo in forum OSR Intermediate Scripting Tutorials
    Replies: 206
    Last Post: 07-31-2013, 12:45 AM
  2. Ddtms?
    By RudeBoiAlex in forum OSR Help
    Replies: 6
    Last Post: 09-11-2007, 04:07 PM
  3. Yohojo's Precision Minimap Clicking Services
    By YoHoJo in forum OSR Help
    Replies: 159
    Last Post: 08-13-2007, 09:21 AM
  4. Some of Yohojo's random songs
    By YoHoJo in forum Music, Movies and TV
    Replies: 7
    Last Post: 05-31-2007, 10:54 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
  •