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:
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.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;
Below is the section of script that causes the error to occur.
Specifically it occurs at the if statement highlighted.
Hope someone can helpCode: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;
Thanks



Reply With Quote

. 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.











