Results 1 to 10 of 10

Thread: DTMs For Noobies - By R1ch

  1. #1
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default DTMs For Noobies - By R1ch



    In this tutorial, I am going to teach you how to create, and use your own DTMs.

    Now before we start, I would like to say: No matter how hard they look, and how other tutorials may make them look, DTMs are easy. I wouldn't lie to you. Also, if you do not know how to use a DTM, you are not a noobie

    For my example, I am going to find bones in my inventory. I may do another example for the mini-map if I feel like it.


    Step 1: Print-screen RS with bones visible in your inventory.

    Step 2: Open up MS Paint, and then press Control-V.

    Step 3: Trim the picture down, so all that is visible is the bones, with the black outline, like this:

    I suggest zooming in 10x to do this. To zoom 10x, click a few pixels below where it says 8x. Trust me, it's there. DO NOT CLOSE MS PAINT!

    Step 4: Open up SCAR 3.20d.

    Step 5: Target the bones in MS Paint with the crosshair

    Step 6: Click on Tools, then DTM Editor (see picture below).



    If you have done everything correctly so far, you should now see a window like this:



    For the three bullet points at the top, make sure the top one is ticked.

    Step 7: Move your mouse over the white centre bit of the bones. You should see something like this:



    Make sure when making a DTM of an item in the inventory that the main point is near to the middle of the item.

    Step 8: Click. You will now see a little yellow dot flashing where you clicked, like this:



    This is your mainpoint.

    Step 9: Remember I told you to keep the black outline? Well it plays a vital part in using DTMs. The black outline around objects never changes colour, and we use it for our subpoints.

    Click some of the points on the black outline, so now we have something that look likes this:



    Now we can see on the little picture that there are little red lines on it. These represent the subpoints that you chose by clicking on the black outline.

    Also, notice on the right hand side the list of points and colours. If any of the colours (highlighted red) apart from the mainpoint (highlighted blue) do not have their colour as 65536, then delete that point by clicking on it, and pressing Delete (highlighted green). Then simply just choose another subpoint where the other one used to be.

    Step 10: Set the tolerance! Around 15 is normally good.

    Step 11: Press File, then Save (see picture below). Then save it where you want, and name it what you want.



    Step 12: Close the DTM Editor.

    Step 13: Open the DTM Editor

    Step 14: Press File, then Open, and open the DTM you just saved. Open up RS, and focus it with the crosshair.

    Step 15: Press Test, then Find DTM... (see picture below).



    Step 16: Now open your saved DTM again.

    Step 17: If you completed everything correctly, you should get something like:



    Press either No or Cancel. Then press File, then DTM to text. This will put a whole load of letters and number in your debug box.

    Sometimes you will get this:



    Don't panic. Raising the tolerance may sort this out, so try that first. If it doesn't, just go through the tutorial again, and eventually, you will get a working DTM.

    Step 18: Now assuming that you have a working DTM, go back to SCAR. Now we are going to start scripting. Of course, we include SRL. So now we have:
    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    begin
      SetupSRL;
    end.

    Step 19: Let's add all of our variables in. This time, they are all integers. You will see why we have BoneDTM later on. If you don't know what X and Y are for, then I suggest you read some more beginners tutorials. Now we have:
    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var
      X, Y, BoneDTM : Integer;

    begin
      SetupSRL;
    end.

    Step 20: Let's actually do something with this DTM. Let's load it, and then make a FindBone function, and then a ClickBone procedure. Now we have
    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var
      X, Y, BoneDTM : Integer;

    procedure LoadDTM;
    begin
    end;

    function FindBone : Boolean;
    begin
    end;

    procedure BuryBone;
    begin
    end;
     
    begin
      SetupSRL;
    end.
    So put the whole load of letters and numbers in the debug box into the LoadDTM procedure to make it like this:
    SCAR Code:
    procedure LoadDTM;
    begin
      DTM := DTMFromString('78DA63E4636060E061400115F9F9609A11CA6' +
           '7140512AC0C688011558D1490E025A0861F48F01350C34D8439EC' +
           '40828B0835EC04D480FCCD8C5F0D00F819022D');
    end;
    But remember when we named our variables, we had BoneDTM? That was the new name of our DTM, and all the letters and numbers are our DTM. So we need to change
    SCAR Code:
    DTM:= DTMFromString('
    to
    SCAR Code:
    BoneDTM:= DTMFromString('

    Now let's do something with that FindBone function. First off, why is it a function? It's a function so it can return true of false, depending on whether it finds our DTM or not.
    SCAR Code:
    function FindBone : Boolean;
    begin
      Result:= FindDTM(BoneDTM, X, Y, MIX1, MIY1, MIX2, MIY2);
    end;
    What this means is that it will return true if it finds BoneDTM, at X, Y in the inventory. MIX1, MIY1 etc. are the inventory coordinates.

    The penultimate part, and that's clicking the bone.
    SCAR Code:
    procedure BuryBone;
    begin
      if FindBone then
        Mouse(X, Y, 7, 7, True);
    end;
    If FindBone returns true, then it will move the mouse to where it found the DTM with X and 7 Y randomness.

    Now to sort our main loop. Currently, it's like this:
    SCAR Code:
    begin
      SetupSRL;
    end.
    But after a bit of typing, we turn it into this:
    SCAR Code:
    begin
      SetupSRL;
      LoadDTM;
      BuryBone;
      FreeDTM(BoneDTM);
    end.
    We don't need to call FindBone, because it's called in BuryBone. And that the...Hang on! What's FreeDTM?! FreeDTM is a function which releases our DTM into the atmosphere to reduce lag on our PCs. It should always be used with DTMs.

    Well, that's it for this tutorial. I hope you have learned something from it. If you need any help or advice, keep it to yourself. Nah, just kidding...Post it if you need to, and I'll get back to ASAP.

    Richard.

    Last edited by Rich; 03-05-2011 at 08:27 PM.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  2. #2
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Looks good, and detailed.
    I guess you have looked at this then:
    http://villavu.com/forum/showthread....highlight=Dtms


    T~M

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

    Default

    Nice, One question though:
    If you create the dtm from a picture and you test the dtm on that dtm it will always find it... so tell them to focus rs... right?
    ~Hermen

  4. #4
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Quote Originally Posted by The Man View Post
    Looks good, and detailed.
    I guess you have looked at this then:
    http://villavu.com/forum/showthread....highlight=Dtms


    T~M
    I knew that Dusk had a TPA tut, that's where I got the idea for the banner, but I didn't know he had a DTM tut.

    Quote Originally Posted by Hermen View Post
    Nice, One question though:
    If you create the dtm from a picture and you test the dtm on that dtm it will always find it... so tell them to focus rs... right?
    Will edit in a second.

    Thanks for the feedback guys. My fingers have gradually being getting shorter from all the tut writing I've been doing recently

    Richard

    EDIT: Hermen's point added.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  5. #5
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Very Nice guide.
    I do visit every 2-6 months

  6. #6
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Thanks ZaSz. Are there any ways, in your opinion, that I could improve it?

    Thanks,
    Richard
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  7. #7
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    You might want to change your title..
    Good tut btw, I'm doing a tut on all three.

  8. #8
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Ok then. I'll change it to DTMs for Noobies.

    All three what?

    EDIT: Thanks to whoever changed the title.
    Last edited by Rich; 07-06-2009 at 02:32 PM.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  9. #9
    Join Date
    Jul 2009
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice tutorial
    lol'd at the dummies book thing
    Quote Originally Posted by Cstrike View Post
    Why do I even try these things? I just shit my pants over this god damn tutorial. Fuck, that's uncleanable. I can't even wash that out because there's so much of my shit it will just stain everything else. If I put it in the washing machine, I'm sure to stain the sides.

  10. #10
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    :/
    My mouse is not clicking it:/

Thread Information

Users Browsing this Thread

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

Posting Permissions

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