SRL Archive - OSR Help

ChangeWorld(RandomWorld); NEED HELP if you understand this


Sable

2013-04-18 12:41:33

How do i make the script select a random world out of a selection of world lets say world 340-360
Thats 20 worlds that the script needs to select one of each time it hops. How do i do this?

Le Jingle

2013-04-18 13:12:17

Something like this I'd imagine:


program new;
{$include_once srl/srl.simba}
var
rWorlds: TIntegerArray;
begin
SetupSRL;
rWorlds := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; // place any number of worlds in here
ChangeWorld(rWorlds[Random(Length(rWorlds))]);
end.

Make sure that you actually declare players and all that other good stuff for setting up a script properly too
-Lj

Sable

2013-04-18 15:15:49

[Error] C:\Simba\Includes\SRL/SRL/core/simba.simba(3:10): Duplicate identifier 'VARIANTISINTEGER' at line 2
Compiling failed
still doesn't work. can you pm me your skype by any chance?

Le Jingle

2013-04-18 15:20:11

From: Sable
[Error] C:\Simba\Includes\SRL/SRL/core/simba.simba(3:10): Duplicate identifier 'VARIANTISINTEGER' at line 2
Compiling failed
still doesn't work. can you pm me your skype by any chance?


If nobody replies to the thread with help, and the #SRL irc channel doesn't help, you can PM me what you have and I'll try to take a look at it and offer advice.

IRC = http://villavu.com/forum/chat_irc.php

Enslaved

2013-04-18 17:36:34


Program new;
var
rWorlds: TIntegerArray;//global variable

Procedure DefWorlds;
var
i,j,wstart,wend:integer;
begin
wstart:=??;
wend:=??;
j:=0;
for i := wstart to wend do
begin
rWorlds[j]:=i;
j:=j+1;
end;
end;
Procedure HopRanWorld;
begin
ChangeWorld(rWorlds[Random(High(rWorlds))]);
end;
end.
solved :p