SRL Archive - SRL Old School RuneScape

FindNormalRandomEx()


slushpuppy

2013-03-29 04:51:56

I thought I get feedback from the community before spending time to revamp antirandoms.simba


My proposal:

FindNormalRandomEx(custom : array of TRandom);

var
FishingRandomSet : array of TRandom;
..

FishingRandomSet := [WHIRLPOOL,BIGFISH,FLYINGROD];

Description: FindNormalRandoms ideally solve for all random events, FindNormalRandomEx allows the script user to enable "skills-specific" random events such as whirlpool, exploding rock, pickaxe. It will also allow the user to load his own custom event solver, incase default solvers are not suitable for his script.

Ashaman88

2013-03-29 16:29:08

From: slushpuppy
I thought I get feedback from the community before spending time to revamp antirandoms.simba


My proposal:

FindNormalRandomEx(custom : array of TRandom);

var
FishingRandomSet : array of TRandom;
..

FishingRandomSet := [WHIRLPOOL,BIGFISH,FLYINGROD];

Description: FindNormalRandoms ideally solve for all random events, FindNormalRandomEx allows the script user to enable "skills-specific" random events such as whirlpool, exploding rock, pickaxe. It will also allow the user to load his own custom event solver, incase default solvers are not suitable for his script.


So the user would call both random solvers in scripts? I was thinking what if there was just a boolean that the user set to true to enable skill specific randoms? Like if you are fishing set SRL_FISHINGRANDOMS to true, then FNR will only check for it if it's true? I'm impartial though

slushpuppy

2013-03-29 21:16:48

Maybe a boolean would be a better idea i guess. By default, should we assume all skill related randoms are turned off automatically?

Ashaman88

2013-03-29 22:16:35

From: slushpuppy
Maybe a boolean would be a better idea i guess. By default, should we assume all skill related randoms are turned off automatically?


Exactly!

slushpuppy

2013-03-29 22:24:17

But that begs the question, What will be the default state of FindNormalRandoms?

Because it certainly implies that it finds all the randoms

Ashaman88

2013-03-29 22:40:32

From: slushpuppy
But that begs the question, What will be the default state of FindNormalRandoms?

Because it certainly implies that it finds all the randoms


True but tis just a name - as the skill specific randoms would still be handled in fnr. It just would need to be turned on… Less user input required instead of having to specify which randoms to solve and such, what else are ya thinking?

Olly

2013-03-29 22:47:09


findRegularRandoms;
findSkillRandom(RANDOM_EVENT_EVIL_TREE);


something like that?

slushpuppy

2013-03-29 22:49:04

From: Ashaman88
True but tis just a name - as the skill specific randoms would still be handled in fnr. It just would need to be turned on… Less user input required instead of having to specify which randoms to solve and such, what else are ya thinking?


Well, IMHO fnr must handle all random events for backwards compatibility. if you still need to turn on the skill-related random and disable the rest, you still need to have the end user disable/enable each one in turn and that can end up quite alot

slushpuppy

2013-03-29 22:53:56

From: Ollybest

findRegularRandoms;
findSkillRandom(RANDOM_EVENT_EVIL_TREE);


something like that?



{
Desc: finds all the randoms including skillsets
}
FindNormalRandoms;
{
Desc: finds all the randoms excluding skill randoms-except for those specified in arg
}
FindNormalRandomsCustom() / FindNormalRandomEx(custom : array of TRandom);

In antirandom.simba, we would init and instant

var
FishingRandomSet : array of TRandom;
..

FishingRandomSet := [WHIRLPOOL,BIGFISH,FLYINGROD];

Or taking a leaf from you and asham,


FindRegularRandom();
SRL_FISHINGRANDOMS := True;

Ashaman88

2013-03-29 22:58:02

I would be ok with it, but would still be annoying to have to call 2 functions instead of one l, as opposed to just setting a Boolean to true once at the beginning of the script - you know what I mean?

slushpuppy

2013-03-29 23:25:17

From: Ashaman88
I would be ok with it, but would still be annoying to have to call 2 functions instead of one l, as opposed to just setting a Boolean to true once at the beginning of the script - you know what I mean?


Oh no, it's not calling two functions. We can have either


FindRegularRandom();
SRL_FISHINGRANDOMS := True;

or

FindNormalRandomCustom(SRL_FISHINGRANDOMS);

Ashaman88

2013-03-30 05:50:35

From: slushpuppy
Oh no, it's not calling two functions. We can have either


FindRegularRandom();
SRL_FISHINGRANDOMS := True;

or

FindNormalRandomCustom(SRL_FISHINGRANDOMS);


Oo so that would do all normal randoms plus the fish skill ones?

slushpuppy

2013-03-30 06:14:03

yes, although i suddenly have a brainwave atm.


i think it is essential to give the script writer some control over the random event..

for example if the script detects an ent, it should execute a callback provided by the script writer; because if the ent is not on the users tree, then the random event solver should not execute at all

Ashaman88

2013-03-30 06:59:17

From: slushpuppy
yes, although i suddenly have a brainwave atm.


i think it is essential to give the script writer some control over the random event..

for example if the script detects an ent, it should execute a callback provided by the script writer; because if the ent is not on the users tree, then the random event solver should not execute at all


That's true, but it just depends on the event - ents for sure would be hard to have a generic function to work for every tree type. Most of the skill ones you would need to know which direction the character was facing and such to start detection (at least I imagine, haven't done a ton of skill scripting on OSR)