Results 1 to 8 of 8

Thread: DDTM's

  1. #1
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default DDTM's

    Hello,

    I've followed YoHoJo's DTM+DDTM's tut, and i understand them quite well.
    Ive made this to find the 'dirt' road above Varrock West Bank (the road to GE):

    SCAR Code:
    program DDTMs;
    {.include srl\srl.scar}
    {.include srl\srl\misc\path.scar}

    var YRoadDTM: Integer;
        RoadMP: TDTMPointDef;
        RoadSP: array[0..3] of TDTMPointDef;
        RoadDTMSkel: TDTM;
        x, y, I : Integer;
        RDTMTol, RDTMArea : Integer;


    procedure Load;
    begin
      RDTMTol :=40;
      RDTMArea:=1;

      RoadMP.x            := 932;
      RoadMP.y            := 238;
      RoadMP.areasize     := RDTMArea;
      RoadMP.areashape    := 0;
      RoadMP.color        := 5401472;
      RoadMP.tolerance    := RDTMTol;
     
      RoadSP[0].x         := 935;
      RoadSP[0].y         := 241;
      RoadSP[0].areasize  := RDTMArea;
      RoadSP[0].areashape := 0;
      RoadSP[0].color     := 5401472;
      RoadSP[0].tolerance := RDTMTol;

      RoadSP[1].x         := 929;
      RoadSP[1].y         := 925;
      RoadSP[1].areasize  := RDTMArea;
      RoadSP[1].areashape := 0;
      RoadSP[1].color     := 5401472;
      RoadSP[1].tolerance := RDTMTol;

      RoadSP[2].x         := 935;
      RoadSP[2].y         := 241;
      RoadSP[2].areasize  := RDTMArea;
      RoadSP[2].areashape := 0;
      RoadSP[2].color     := 5401472;
      RoadSP[2].tolerance := RDTMTol;

      RoadSP[3].x         := 930;
      RoadSP[3].y         := 240;
      RoadSP[3].areasize  := RDTMArea;
      RoadSP[3].areashape := 0;
      RoadSP[3].color     := 5401472;
      RoadSP[3].tolerance := RDTMTol;
     
      RoadDTMSkel.MainPoint := RoadMP;
      RoadDTMSkel.SubPoints := RoadSP;
      YRoadDTM              := AddDTM(RoadDTMSkel);
    end;

    procedure FindRoad;
    begin
      for I := 1 to 10 do
      begin
      RDTMTol := RDTMTol+5;
      RDTMArea:= RDTMArea+1;
       if (FindDTM(YRoadDTM, x, y, 1, 1, 1280, 1024)) Then
        begin
          Writeln('Found DTM at a tolerance of '+IntToStr(RDTMTol)+
          'and an area of '+IntToStr(RDTMArea))
          exit;
        end else
      end;
      Writeln('DTM Not Found')
     end;

    begin
    SetUpSRL;
    ActivateClient;
    Load;
    FindRoad;
    end.

    But it just won't work..
    I am sure the colors are set well..
    Ce ne sont que des gueux


  2. #2
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    try using autocolor for the DirtRoad...that is probably the best advantages of DDTMs.

    Also set your mainpoint to a tol of 255 so if someone is standing on the spot it will still recognize it.

    SCAR Code:
    program DDTMs;
    {.include srl\srl.scar}
    {.include srl\srl\misc\path.scar}
     
    var YRoadDTM: Integer;
        RoadMP: TDTMPointDef;
        RoadSP: array[0..3] of TDTMPointDef;
        RoadDTMSkel: TDTM;
        x, y, I : Integer;
        RDTMTol, RDTMArea DColor : Integer;
     
     
    procedure Load;
    begin
      RDTMTol :=40;
      RDTMArea:=1;
     
      RoadMP.x            := 932;
      RoadMP.y            := 238;
      RoadMP.areasize     := RDTMArea;
      RoadMP.areashape    := 0;
      RoadMP.color        := 5401472;
      RoadMP.tolerance    := 255;
     
      RoadSP[0].x         := 935;
      RoadSP[0].y         := 241;
      RoadSP[0].areasize  := RDTMArea;
      RoadSP[0].areashape := 0;
      RoadSP[0].color     := 5401472;
      RoadSP[0].tolerance := 255;
     
      RoadSP[1].x         := 929;
      RoadSP[1].y         := 925;
      RoadSP[1].areasize  := RDTMArea;
      RoadSP[1].areashape := 0;
      RoadSP[1].color     := DColor;
      RoadSP[1].tolerance := RDTMTol;
     
      RoadSP[2].x         := 935;
      RoadSP[2].y         := 241;
      RoadSP[2].areasize  := RDTMArea;
      RoadSP[2].areashape := 0;
      RoadSP[2].color     := DColor;
      RoadSP[2].tolerance := RDTMTol;
     
      RoadSP[3].x         := 930;
      RoadSP[3].y         := 240;
      RoadSP[3].areasize  := RDTMArea;
      RoadSP[3].areashape := 0;
      RoadSP[3].color     := DColor;
      RoadSP[3].tolerance := RDTMTol;
     
      RoadDTMSkel.MainPoint := RoadMP;
      RoadDTMSkel.SubPoints := RoadSP;
      YRoadDTM              := AddDTM(RoadDTMSkel);
    end;
     
    procedure FindRoad;
    begin
      for I := 1 to 10 do
      begin
      RDTMTol := RDTMTol+5;
      RDTMArea:= RDTMArea+1;
       if (FindDTM(YRoadDTM, x, y, 1, 1, 1280, 1024)) Then
        begin
          Writeln('Found DTM at a tolerance of '+IntToStr(RDTMTol)+
          'and an area of '+IntToStr(RDTMArea))
          exit;
        end else
      end;
      Writeln('DTM Not Found')
     end;
     
    begin
    SetUpSRL;
    ActivateClient;
    Load;
    DColor := FindDirtColor;
    FindRoad;
    end.

    And if that doesnt work, then try setting the tolerance higher on the sub points.
    METAL HEAD FOR LIFE!!!

  3. #3
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    not sure if this is right or not but...

    shouldn't you be using FindDTMRotated?

  4. #4
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Cud be :P

    Thx gerauchert :P
    Ce ne sont que des gueux


  5. #5
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    Oh yeah, like IllKillUTill said.

    Use the function DTMRotated or FIndDTMRotated

    FindDTMRotated is more syntax specific
    METAL HEAD FOR LIFE!!!

  6. #6
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Also, use MMX1,MMY1,MMX2,MMY2 if it's a minimap DDTM or MSX1,MSY1,MSX2,MSY2 if it's for the main screen.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  7. #7
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Are those pre-sets?
    Ce ne sont que des gueux


  8. #8
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by floor66 View Post
    Are those pre-sets?
    yes.


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. DDTM's
    By iroki_ in forum OSR Help
    Replies: 3
    Last Post: 04-22-2008, 09:37 AM
  2. DDTM's
    By quiescent_87 in forum OSR Help
    Replies: 6
    Last Post: 04-06-2008, 07:07 PM
  3. Help with DDTM's
    By dark4mdawn in forum OSR Help
    Replies: 7
    Last Post: 09-07-2007, 02:13 PM
  4. DDTM's edge off MM
    By rkroxpunk in forum OSR Help
    Replies: 1
    Last Post: 06-30-2007, 07:05 AM

Posting Permissions

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