SRL Archive - SRL Bugs

Box Rewards Error


jimthesoundman

2010-01-22 21:39:41

I'm getting this error message in AntiRandoms.scar:

[Runtime Error] : Out Of Range in line 883 in script C:\Program Files\SCAR 3.22\includes\SRL\SRL\Core\AntiRandoms\AntiRandoms.scar


The line it is referencing is this:
8: if High(Players[CurrentPlayer].BoxRewards) > -1 then
Result := UseRewardBox;

I'll try to comment it out and see what happens.

JIM

YoHoJo

2010-01-22 21:42:48

Looks like boxrewards somehow was either defined properly by a scripter/script user, or a script picked up a wrong value.
Odd though >-1? Most script I see have strings as rewards like this
"Players.BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];"

Wanted

2010-01-22 21:48:14

You didn't have your players setup

Timer

2010-01-22 21:50:08

From: IceFire908
You didn't have your players setup


Aka Declare players. Or atleast have NumberOfPlayers({how many players});

jimthesoundman

2010-01-22 22:52:36

I only run scripts on one account so I never use DeclarePlayers.
Where should I define the NumberOfPlayers? Just in the setup procedure for any script I write? Or somewhere else?

YoHoJo

2010-01-23 00:20:28

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(1);
CurrentPlayer := 1;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
end;
end;

And call that after SetupSRL.

jimthesoundman

2010-01-23 00:24:21

Thank you.

Nava2

2010-01-23 01:21:07

set your players. silly boi