Results 1 to 3 of 3

Thread: Runtime Error Help :\

  1. #1
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Runtime Error Help :\

    I think it's a problem with the way I'm using my DDTM, but I can't seem to figure it out, my head's about ready to explode Probably a nooby mistake...But here it is -

    SCAR Code:
    function LoadAllDTMWalks(WalkNumber: Integer): Integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: array[0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      RDTMArea := 1;
      case WalkNumber of
        1:  begin
             dtmMainPoint.x := 857;
             dtmMainPoint.y := 347;
             dtmMainPoint.AreaSize := 1;
             dtmMainPoint.AreaShape := 0;
             dtmMainPoint.Color := FindFallyRoadColor;
             dtmMainPoint.Tolerance := 1;

             dtmSubPoints[0].x := 857;
             dtmSubPoints[0].y := 347;
             dtmSubPoints[0].AreaSize := RDTMArea;
             dtmSubPoints[0].AreaShape := 0;
             dtmSubPoints[0].Color := FindFallyRoadColor;
             dtmSubPoints[0].Tolerance := 1;

             dtmSubPoints[1].x := 853;
             dtmSubPoints[1].y := 337;
             dtmSubPoints[1].AreaSize := RDTMArea;
             dtmSubPoints[1].AreaShape := 0;
             dtmSubPoints[1].Color := FindFallyRoadColor;
             dtmSubPoints[1].Tolerance := 1;

             dtmSubPoints[2].x := 864;
             dtmSubPoints[2].y := 342;
             dtmSubPoints[2].AreaSize := RDTMArea;
             dtmSubPoints[2].AreaShape := 0;
             dtmSubPoints[2].Color := FindFallyRoadColor;
             dtmSubPoints[2].Tolerance := 1;

             dtmSubPoints[3].x := 852;
             dtmSubPoints[3].y := 342;
             dtmSubPoints[3].AreaSize := RDTMArea;
             dtmSubPoints[3].AreaShape := 0;
             dtmSubPoints[3].Color := FindFallyRoadColor;
             dtmSubPoints[3].Tolerance := 1;

             dtmSubPoints[4].x := 852;
             dtmSubPoints[4].y := 336;
             dtmSubPoints[4].AreaSize := RDTMArea;
             dtmSubPoints[4].AreaShape := 0;
             dtmSubPoints[4].Color := FindFallyRoadColor;
             dtmSubPoints[4].Tolerance := 1;

             TempTDTM.MainPoint := dtmMainPoint;
             TempTDTM.SubPoints := dtmSubPoints;
             Result := AddDTM(TempTDTM);
            end;
        end;
    end;

    Yes, I know it isn't finished yet ^^

    SCAR Code:
    procedure WalkToShop;
    var rx,ry, count,x1,y1,x2,y2: integer;
    begin
      if not(loggedin) then LoginPlayer;
      case Players[CurrentPlayer].Loc of
        'havethecash': begin  //Inside the bank ready to go
                         LoadAllDTMWalks(1);
                         count := 0;
                         repeat
                           if DTMRotated(TempTDTM,x,y,x1,y1,x2,y2) then
                           begin
                             mouse(x,y,2,2,true);
                             writeln('used ddtm');
                             FFlag(3);
                             break;
                           end else
                           begin
                             RDTMArea := RDTMArea + 1;
                             count := count + 1;
                           end;
                         until (count >= 10);
                         FreeDTM(TempTDTM);
                         if (count >= 10) then
                         begin
                           if not RadialRoadWalk(FindFallyRoadColor, 200, 260, 70, 2, 2) then
                           begin
                             if not RadialRoadWalk(FindFallyRoadColor, 190, 270, 70, 2, 2) then
                             begin
                               if not RadialRoadWalk(FindFallyRoadColor, 190, 270, 70, 2, 2) then
                               begin
                                 if (UseCoords) then
                                 begin
                                   mouse(0,0,5,5,true);  //NEED TO ADD COORDS
                                   FFlag(3);
                                 end else
                                 begin
                                   writeln('Failed walking to the shop, next player');
                                   NextPlayer(false);
                                   if (ActivePlayers = 0) then
                                   begin
                                     if (PlayMusic) then
                                       PlaySound(Location);
                                   end;
                                   exit;
                                 end;
                               end;
                             end;
                           end;
                         FFlag(3);
                         end;
                         Players[CurrentPlayer].Loc := '2pos';

                       end;

    And there's where I use it, and I think I use it incorrectly (^^ That isn't the whole procedure btw). Also please point out any errors in my coding or anything I can improve on/shorten.

    The error I'm getting -

    SCAR Code:
    [Runtime Error] : Exception: Access violation at address 006D691C in module 'scar.exe'. Read of address 00000000 in line 73 in script C:\Program Files\SCAR 3.15(2)\includes\SRL/SRL/Core/Color.scar

    I searched this, and only found 1 result in which the error occurred because the DTM was improperly used.

  2. #2
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    change this:

    SCAR Code:
    if DTMRotated(TempTDTM,x,y,x1,y1,x2,y2) then

    to

    SCAR Code:
    if DTMRotated(LoadAllDTMWalks(1),x,y,x1,y1,x2,y2) then

  3. #3
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ty, Rep++

    Error is gone but my DDTM doesn't work *sigh*

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [Runtime Error] : Exception: buffer error
    By GasMan in forum OSR Help
    Replies: 11
    Last Post: 05-13-2007, 02:07 PM
  2. Runtime Error
    By CamHart in forum OSR Help
    Replies: 2
    Last Post: 11-23-2006, 05:21 AM
  3. Runtime error
    By sk8ter in forum OSR Help
    Replies: 3
    Last Post: 10-30-2006, 01:55 PM

Posting Permissions

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