Results 1 to 17 of 17

Thread: FindDTM Help

  1. #1
    Join Date
    Feb 2010
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FindDTM Help

    Alright so I have gotten further with my current script and everything seems to be good except for DTM's.

    I cant seem to get them to work... I have read what I can find on the forums regarding them but it just wont work....


    I am using the following code:

    Loading the DTM:
    Code:
    FlyRod := DTMFromString('78DA636C616360E0666240063EE6DC0C2250F' +
           '67F2060AC01AA914455C3C000E13342798C13816AFE32E257D306' +
           '542348C09C7AA01A4E026AFA816AD809A8A900AA11C1AF060007A' +
           'D09E2');
    Finding the DTM:
    Code:
      if FindDTM(FlyRod, MMx, MMy,MIX1, MIY1, MIX2, MIY2) then
      begin
        Writeln('Rod Found!!');
      end else
      begin
         Writeln('Rod Not Found!!');
      end;
    This is what my DTM looks like in the editor.



    I have the tolerance set to 20 for the parent. ( I would assume that's the only one I would have to change... As black is well... black.. )

    I dont know what the Area Size and Area Shape stuff is for... and no one seems to mention it in there DTM tutorials. Is it required? what does it do..


    Does anyone know why I cant seem to find my fly rod!?

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    I usually set the tolerance of every point to 5.

    E: Also try using only the outline.
    Last edited by Frement; 02-19-2010 at 02:48 PM.
    There used to be something meaningful here.

  3. #3
    Join Date
    Feb 2010
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol Strangely enough that seems to have worked.....

    Thanks man. Rep++

  4. #4
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    No problem, keep learning
    There used to be something meaningful here.

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

    Default

    Nooo!
    NO TOLERANCE ON POINTS!
    The outline color of items is CONSTANT!
    And so is the area/position of the points!

    Leave the DTM just like you have it in the picture, and on the first point, change the Tolerance to 255, and it will be fine!

  6. #6
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Nooo!
    NO TOLERANCE ON POINTS!
    The outline color of items is CONSTANT!
    And so is the area/position of the points!

    Leave the DTM just like you have it in the picture, and on the first point, change the Tolerance to 255, and it will be fine!
    +1

    You want your "Parent" point to have 255 tolerance as RS uses Static Colors and by setting the tolerance to 255 you will find it no matter what variation of that color it is really.

  7. #7
    Join Date
    Feb 2010
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks guys!

  8. #8
    Join Date
    Dec 2006
    Posts
    249
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    +1

    You want your "Parent" point to have 255 tolerance as RS uses Static Colors and by setting the tolerance to 255 you will find it no matter what variation of that color it is really.
    If I have a dtm of FishX (uncooked), and the main point tol is set to 255.

    FindDTM would find an uncooked, cooked & burnt FishX if I had them all in my inventory?

    ScarPreRelease 3.23 rev 80, Includes - Dev Rev 457

  9. #9
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Yes.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  10. #10
    Join Date
    Dec 2006
    Posts
    249
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So what would be better
    1. use a tol of 255 for all DTMs and use UpText to work out how cooked an item maybe
    2. use a lower tol of about 20?
    3. something else?

    ScarPreRelease 3.23 rev 80, Includes - Dev Rev 457

  11. #11
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    You could use a bitmap. Or a DDTM. Or a lower tol for the parent. (Like 0..)

  12. #12
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    When I am doing DTMs that have to be specific like that (item with same shape but different texture/color) I use a tolerance of 15 in the main point and 0 in all the edge points.

    Edit: Or do a color check where the DTM is found.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  13. #13
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Use a ddtm for fish of the same shape but different colour.

    A dtm with a tol that isn't 255 is usually your best bet. It's silly to have it that high it would lead to sone silly silly false positives that are not necessary. A proper tol > all tol.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  14. #14
    Join Date
    Dec 2006
    Posts
    249
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok thanks everyone. I have had lots of probs so far with Bitmaps/DTMs for my bone burying procedure, but the concept is the same for many other procedures.

    Bitmap Finder - Never works after I switch worlds? Only works on the world I create the bitmap on. here is an example.
    PHP Code:
    program New;
    {.include 
    srl/srl.scar}
    var
    NormalBones:integer;
    procedure LoadBitMap;
    begin
      NormalBones 
    := BitmapFromString(1415'beNp9ke0LwVAUxvf/f' +
           
    '1UIGZuJNIQxy1jCFGM+YN6Sl+GLIv+Ap06tdTduv9Z5bs8997lnHB' +
           
    'dcRUGgQlcUwP1YrUq5kM1Q/Xk8VpYF0rEoYzO7XZDneZLH1ZLY2Db' +
           
    'wO1+uCwxVJWkNBvPR8NftznyG44iKGGq1yv1d543TazX5eJzZp8xa' +
           
    'rQb8nWVJCjZh0i6nE9DX2oBx2qbp70aS7goOh4rdYgGbd3Cod4Dfi' +
           
    'fz4vu83gJ7AS8VMUpFlr74f9mOj50nUIBGJkCzlxNBxIQbyYLD0tO' +
           
    't2K6aSoc7n5XxarwFJiofNTqP+7398AVKEur8=');
    end;
    procedure FBitmap;
    var
    xyinteger;
    begin
      FindBitmapToleranceIn
    (NormalBonesxy56021473445735);
    end;
    begin
      SetupSRL
    ;
      
    FBitmap
    end

    with DTMs previously to finding this thread I had always left the tol at 0. Since setting it to 255, it has managed to find and bury all bones in the inventory. A real achievement and I am very happy. lol (first brick in the wall of learning how to script )


    So my questions are.
    1. What was wrong on the Bitmap finder above?
    2. For items in Inventory that have same shape diff colour, food/armor/weapons etc
    - Why are DDTMs better than DTMs and what about Bitmaps?
    - Which are faster, less memory hungrey?
    3. For items in Inventory that have a unique shape/colour, what mthod is best here?

    Sorry for all the questions, I have tried to limit them.

    Slowly getting the hang of things.

    Thanks Again.

    ScarPreRelease 3.23 rev 80, Includes - Dev Rev 457

  15. #15
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by twobac View Post
    ok thanks everyone. I have had lots of probs so far with Bitmaps/DTMs for my bone burying procedure, but the concept is the same for many other procedures.

    Bitmap Finder - Never works after I switch worlds? Only works on the world I create the bitmap on. here is an example.
    PHP Code:
    program New;
    {.include 
    srl/srl.scar}
    var
    NormalBones:integer;
    procedure LoadBitMap;
    begin
      NormalBones 
    := BitmapFromString(1415'beNp9ke0LwVAUxvf/f' +
           
    '1UIGZuJNIQxy1jCFGM+YN6Sl+GLIv+Ap06tdTduv9Z5bs8997lnHB' +
           
    'dcRUGgQlcUwP1YrUq5kM1Q/Xk8VpYF0rEoYzO7XZDneZLH1ZLY2Db' +
           
    'wO1+uCwxVJWkNBvPR8NftznyG44iKGGq1yv1d543TazX5eJzZp8xa' +
           
    'rQb8nWVJCjZh0i6nE9DX2oBx2qbp70aS7goOh4rdYgGbd3Cod4Dfi' +
           
    'fz4vu83gJ7AS8VMUpFlr74f9mOj50nUIBGJkCzlxNBxIQbyYLD0tO' +
           
    't2K6aSoc7n5XxarwFJiofNTqP+7398AVKEur8=');
    end;
    procedure FBitmap;
    var
    xyinteger;
    begin
      FindBitmapToleranceIn
    (NormalBonesxy56021473445735);
    end;
    begin
      SetupSRL
    ;
      
    FBitmap
    end

    with DTMs previously to finding this thread I had always left the tol at 0. Since setting it to 255, it has managed to find and bury all bones in the inventory. A real achievement and I am very happy. lol (first brick in the wall of learning how to script )


    So my questions are.
    1. What was wrong on the Bitmap finder above?
    2. For items in Inventory that have same shape diff colour, food/armor/weapons etc
    - Why are DDTMs better than DTMs and what about Bitmaps?
    - Which are faster, less memory hungrey?
    3. For items in Inventory that have a unique shape/colour, what mthod is best here?

    Sorry for all the questions, I have tried to limit them.

    Slowly getting the hang of things.

    Thanks Again.
    1. I would have made bitmap mask of the outline.
    2. DTM is best for that imo.
    3. I still say DTM is the best option.
    There used to be something meaningful here.

  16. #16
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Bitmaps are faster apparently. According to Freddy..

    And I'd say bitmaps.

    http://villavu.com/forum/showthread.php?t=47374

    Notice how he doesn't get the whole part. You really don't need much of the picture at all and it can find the difference between them. A small 2x7 would suffice for most things.

  17. #17
    Join Date
    Dec 2006
    Posts
    249
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks I will read the tut 2morrow

    ScarPreRelease 3.23 rev 80, Includes - Dev Rev 457

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
  •