Log in

View Full Version : Adding Random Events to a script



boffysworld
01-05-2012, 09:53 PM
Would it be possible to add some helpful information on setting these up.
Due to the randomness on these events i cant find a way to test if its set correct.

I have tried adding FindNormalRandoms;
inside every procedure and every loop.

Using
If (FindNormalRandoms) then
Begin
UseRewardBox;
FindLamp(LampSkill);
End;

Sometimes it detects the random, but other times it continues with the script (searching for trees or whatever.) Not detecting random.

Can u put too many in or do u need to be careful where u place them.
Thx for time reading my question.

[XoL]
01-05-2012, 10:47 PM
I do this:


procedure AntiRandom;
begin
FindNormalRandoms;
LampSkill := 'SKILLYOUWANT';
LevelUp;
end;


Then I just call AntiRandom;
Where ever I can see a random happening in sequence to my script (Put it in each area where something new happens)

Sabzi
01-05-2012, 11:10 PM
It's enough to set LampSkill only once after SetupSRL as it's a global variable in srl.
Wrapping an if around FindNormalRandoms is also a good idea, so you will know if it failed to solve a random or not. Then you can act accordingly.(log out, next player, terminate, whatever)
But making your own little function/procedure for it is a wise idea, saves some lines, makes script cleaner.