SRL Archive - Help

access violation


Shuttleu

2010-12-16 17:58:50

anyone know why i get a access violation
the error is at compile time
program ReflectionScript;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
{$i srl/srl/misc/paintsmart.scar}

const


{---SMART Setup Constants---}
WORLD = 32;
MEMBERS = false;
SIGNED = true;
{---------------------------}

var
NPCs: TNPCArray;
Dots: array of TPointArray;
Colors: TIntegerArray;
i: Integer;
sdf:tstringarray;

begin
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;

SetupSRL;
SetupReflectionEx(true);

SetArrayLength(Dots, 3);

Colors:= [255, 16776960, 65280];

repeat
NPCs:= GetNPCs;
for i:=0 to High(NPCs) do
if InStrArr('Attack', NPCs[i].Actions, True) then
if (NPCs[i].Level < GetMe.Level) then
begin
SetArrayLength(Dots[0], Length(Dots[0])+1);
Dots[0][High(Dots[0])]:= TileToMM(NPCs[i].Tile);
end else
if (NPCs[i].Level = GetMe.Level) then
begin
SetArrayLength(Dots[1], Length(Dots[1])+1);
Dots[1][High(Dots[1])]:= TileToMM(NPCs[i].Tile);
end else
if (NPCs[i].Level > GetMe.Level) then
begin
SetArrayLength(Dots[2], Length(Dots[2])+1);
Dots[2][High(Dots[2])]:= TileToMM(NPCs[i].Tile);
end;
SMART_DrawDotsEx(True, Dots[0], Colors[0]);
SMART_DrawDotsEx(False, Dots[1], Colors[1]);
SMART_DrawDotsEx(False, Dots[2], Colors[2]);
until(false);
end.

~shut

Frement

2010-12-16 18:06:42

It's the SMART that bugs afaik.

Shuttleu

2010-12-16 18:10:30

the error is at compile time

~shut

Frement

2010-12-16 18:14:03

From: Shuttleu
the error is at compile time

~shut


I meant, some function that is used from smart.scar.

Shuttleu

2010-12-16 18:14:48

i habe got it down to these lines
if (NPCs[i].Level < GetMe.Level) then
if (NPCs[i].Level = GetMe.Level) then
if (NPCs[i].Level > GetMe.Level) then

~shut

Frement

2010-12-16 18:15:18

From: Shuttleu
i habe got it down to these lines
if (NPCs[i].Level < GetMe.Level) then
if (NPCs[i].Level = GetMe.Level) then
if (NPCs[i].Level > GetMe.Level) then

~shut


Yes, its the GetMe.Level

Shuttleu

2010-12-16 18:17:49

ah fixed it

Level:= GetMe.Level;
if (NPCs[i].Level < Level) then
if (NPCs[i].Level = Level) then
if (NPCs[i].Level > Level) then

~shut

Death12652

2010-12-23 09:14:53

Did you get an error in players.scar becuase I keep getting an access violation in the LoggedIn function of at Result := part