Results 1 to 5 of 5

Thread: Object DTM Out of Range Error

  1. #1
    Join Date
    Nov 2008
    Location
    UK
    Posts
    153
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default Object DTM Out of Range Error

    Hi guys

    I've written a firemaking script which uses objdtm as a walking system between the bank and road outside.

    While running the script i am getting an error which takes me to the ObjDTMInclude script. The error is: 'Error: Out Of Range at line 647'

    This error relates to the section of ObjDTMIncludes shown below for groundlevelcheck:

    Code:
    function GroundLevelCheck: Boolean;
    By: euphemism
    Last Edit: 03 Apr 2012 -- euphemism
    Description: Creates a circular slice out of the minimap, and checks to see
                 if the dominant color is black.
    *******************************************************************************)
    var
      H, Half, I, Passed, TempColor, TPALength, Valid: Integer;
      Lum, Hue, Sat: Extended;
    begin
    
      for H := 0 to 4 do
      begin
    
        TPALength := Length(MinimapSlices[h]);
        Half := Floor(TPALength / 2);
    
        for I := 0 to (TPALength - 1) do
        begin
                                                  {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i ObjectDTM\ObjDTMInclude.simba}
          TempColor := GetColor(MinimapSlices[h][i].x, MinimapSlices[h][i].y)
          ColorToHSL(TempColor, Hue, Sat, Lum);
    
          if Lum < 5 then
          Inc(Valid);
        end;
        if (Valid < Half) then
          Inc(Passed);
      end;
      Result := (Passed > 2);
    end;
    I've tried all i can think of to make it work but i know its bound to be something stupid and simple. I have used the same code (different ObjDTM) in another script and it works fine so cant understand whats going wrong here.

    Below is the section of script that causes the error to occur.
    Specifically it occurs at the if statement highlighted.

    Code:
    Procedure WalkOutside;
    var x,y: integer;
        OutsideDTM: TStringArray;
    begin
       OutsideDTM := ['79:61:1:0:7:76:49:4:65:38:66:73:107:74:92:32']; //'86:52:3:0:7:76:37:1:7:115:36:2:7:111:65:5:43:19:24:70:124:109:150:48:114:9'];
    
        if ObjDTM_InArea(OutsideDTM[0], True) then
        begin
            ObjDTM_Walk(OutsideDTM[0], 0, 100, 80, True);
        Writeln('We are Outside!');
        end
        else
          begin
            writeln('Outside not found');
            //do something else
          end;
    end;
    Hope someone can help

    Thanks

  2. #2
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Hey mounty . I just had the exact same problem, and a google search brought me here . Did you find a way to fix it? I think that the problem may be from choosing sub-points that are too close to the edge of the minimap. I'll try with different sub-points and report back.

  3. #3
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Sure your doing ObjDTM_Setup?

  4. #4
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by Ollybest View Post
    Sure your doing ObjDTM_Setup?
    Whoops, yeah I forgot to add it.

    Thanks

  5. #5
    Join Date
    Jun 2008
    Location
    United States
    Posts
    818
    Mentioned
    60 Post(s)
    Quoted
    90 Post(s)

    Default

    Quote Originally Posted by Ollybest View Post
    Sure your doing ObjDTM_Setup?
    Yup, that would be your problem.
    [10/14/13:19:03] <BenLand100> this is special relatively, just cleverly disguised with yachts

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
  •