SRL Archive - Help and Support

More DTMRotated Errors...


Jackrawl

2008-01-06 13:02:48

Well, every time I try to test parts of my air crafter, it messes up in this procedure…
procedure WalkToRuinsFromGate;
var
x, y: integer; Point5, Point6, Point7 : Boolean;
begin
if not(loggedin) then exit;
if Players[CurrentPlayer].Strings[1] = 'Inequipped' then exit;
Point5 := True;
Point6 := True;
Point7 := True;
if not DTMRotated(DTMPoint5, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
MakeCompass('N');
if not FindSymbolIn(x, y, 'Rare Trees', MMX1, MMY1, 641, 6) then
if FindRoadColor > 0 then
if FindFallyRoadColor > 0 then
RadialRoadWalk(FindRoadColor, 180, 220, 20, 0, 0);
FFlag(0);
if FindSymbolIn(x, y, 'Rare Trees', MMX1, MMY1, 641, 6) then
begin
Mouse(x, y, 1, 1, True);
FFlag(0);
Point5 := False;
if DTMRotated(dtmPoint5, x, y, MMX1, MMY1, MMX2, MMY2) then
Point5 := True;
end;
end;
if Point5 = True then
begin
Mouse(x, y, 1, 1, True);
FFlag(10);
end;
if not DTMRotated(dtmPoint6, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
MakeCompass('N');
if FindSymbol(x, y, 'Water source') and Point6 = True then
begin
Mouse(x, y+120, 3, 3, True);
FFlag(0);
Point6:=False;
end;
if FindSymbol(x, y, 'Spinning wheel') and Point6 = True then
begin
Mouse(x, y+120, 3, 3, True);
FFlag(0);
Point6:=False;
end;
end;
if Point6 = True then
begin
Mouse(x, y, 1, 1, True);
FFlag(5);
end;
if not DTMRotated(dtmPoint7, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
writeln('Backup for this comes in v.95');
NextPlayer(False);
Point7 := False;
Exit;
end;
if Point7 = True then
begin
Mouse(x, y, 1, 1, True);
FFlag(5);
Exit;
end;
end;
Is there a better method of doing this? I posted this in the public forum too, but it seems to have gotten lost…o_O

R0b0t1

2008-01-06 14:56:26

Uhm… You're trying to match 'Inequipped'… Do you mean Unequipped?


And symbols tend to move around alot, might want to use bitmaps ;).

Rofl, but I though you were talking about an Access Violation.

Jackrawl

2008-01-06 15:03:48

Yeah, it should be unequipped, but yes, I am talking about access violation in script line 20 -_-

R0b0t1

2008-01-06 15:37:54

Sigh… Well, after helping fr0zn_s0ul with some AV's, guess I'll help you and make a thread.


You're using to much memory ^.^

Better free some bitmaps and DTM's and Canvases and… I think I got them all.

Jackrawl

2008-01-06 16:26:54

…Are you kidding me? OK, I'm merging that procedure in with the rest of the script…

R0b0t1

2008-01-06 17:06:44

Hmm? No, thats not the problem…


You must be forgetting to free something, and using FindColor uses a Canvas, which take up more memory.



EDIT: I've noticed people forget to free Canvases a whole lot.


Canvas.Free;

Jackrawl

2008-01-06 18:14:10

I have it set up so there are 13 dtms loaded, and I don't have much memory. Other people don't seem to have this problem…Anyway, I think I solved it by making three procedures, and freeing them after each procedure.

R0b0t1

2008-01-06 20:55:26

Yay! Someone is thinking!