I'm being lazy and I'm getting a runtime error I'm not sure why. So heres a condensed version of the code:
SCAR Code:
program New;
const
PWR_Mining = 0;
PWR_Woodcutting = 1;
PWR_Fishing = 2;
Inv_Count = 1;
Inv_Load = 2;
type
TPointerInfo = Record
Check: Function(Index: Integer): Integer;
FollowObj: Function(Col: Integer; TP: TPoint): Boolean;
Equiptment: Function(Index: Integer): Boolean;
Rec: Procedure(Index: Integer);
Move: Function: Boolean;
end;
var Location: Array of TPointerInfo;
GlobalIndex: integer; ConstIndex: Integer;
DropArr: TStringArray;
Procedure LoadLibrary(Index: Integer);
begin
case Index of
PWR_Mining:
begin
with Arr[CurrentPlayer][0] do // iron
begin
timer := 6000;
sat := 0.17;
hue := 0.07;
lum := 15;
Col := 2371405;
name := 'Iron';
end;
with Arr[CurrentPlayer][1] do // copper
begin
timer := 12000;
sat := 0.84;
hue := 0.02;
lum := 10;
Col := 4225488;
name := 'Copper';
end;
with Arr[CurrentPlayer][2] do // tin
begin
timer := 12000;
sat := 0.12;
hue := 0.07;
lum := 15;
Col := 8027016;
name := 'Tin';
end;
end;
PWR_Woodcutting:
begin
with Arr[CurrentPlayer][0] do // Normal
begin
hue := 0.10;
sat := 1.58;
col := 1988169;
Lum := 8;
Width := 8;
Height := 8;
name := 'Tree';
timer := RandomRange(50000, 120000);
end;
with Arr[CurrentPlayer][1] do // Oak
begin
hue := 0.06;
sat := 0.79;
col := 3176040;
Lum := 10;
Width := 15;
Height := 15;
name := 'Oak';
timer := RandomRange(50000, 120000);
end;
with Arr[CurrentPlayer][2] do // Willow
begin
hue := 0.50;
sat := 0.45;
col := 7314065;
Lum := 8;
Width := 5;
Height := 5;
name := 'Willow';
timer := RandomRange(50000, 120000);
end;
end;
PWR_Fishing:
begin
with Arr[CurrentPlayer][0] do // Fishing Spot
begin
hue := 0.07;
sat := 0.13;
col := 10919318;
Lum := 15;
Width := 3;
Height := 3;
name := 'Fishing Spot';
timer := RandomRange(12000, 240000);
end;
end;
end;
end;
Procedure SetPointers(Which: String);
begin
case Lowercase(Which) of
'mining':
begin
with Location[CurrentPlayer] do
begin
Rec := @LoadLibrary;
FollowObj := @IsMining;
Check := @TextCheck;
Equiptment := @FindEquipt;
Move := nil;
end;
ConstIndex := PWR_Mining;
DropArr := [Arr[CurrentPlayer][GlobalIndex].Name, 'em'];
end;
'woodcutting':
begin
with Location[CurrentPlayer] do
begin
Rec := @LoadLibrary;
FollowObj := @FollowPixelBox;
Check := @TextCheck;
Equiptment := @FindEquipt;
Move := nil;
end;
ConstIndex := PWR_Woodcutting;
DropArr := ['og', 'est'];
end;
'fishing':
begin
with Location[CurrentPlayer] do
begin
Rec := @LoadLibrary; // Runtime Error (probably for all)
FollowObj := @FollowPixelBox;
Check := @TextCheck;
Equiptment := @FindEquipt;
Move := @MoveFishingSpots;
end;
ConstIndex := PWR_Fishing;
DropArr := ['almon', 'rout', 'hrimp', 'chovie', 'ardine', 'erring'];
end;
end;
end;
This error occures when I try to set up a player fishing. Help would be appreciated (I think I set my pointers wrong?).