PDA

View Full Version : FindNormalRandomEx()



slushpuppy
03-29-2013, 08:51 AM
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
03-29-2013, 08:29 PM
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
03-30-2013, 01:16 AM
Maybe a boolean would be a better idea i guess. By default, should we assume all skill related randoms are turned off automatically?

Ashaman88
03-30-2013, 02:16 AM
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
03-30-2013, 02:24 AM
But that begs the question, What will be the default state of FindNormalRandoms?

Because it certainly implies that it finds all the randoms

Ashaman88
03-30-2013, 02:40 AM
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
03-30-2013, 02:47 AM
findRegularRandoms;
findSkillRandom(RANDOM_EVENT_EVIL_TREE);



something like that?

slushpuppy
03-30-2013, 02:49 AM
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
03-30-2013, 02:53 AM
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
03-30-2013, 02:58 AM
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
03-30-2013, 03:25 AM
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
03-30-2013, 09:50 AM
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
03-30-2013, 10:14 AM
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
03-30-2013, 10:59 AM
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)