Page 1 of 1

Randomness function?

Posted: April 26th, 2014, 2:05 pm
by mbrowne
Any chance there is a random # function available for scripts?

Re: Randomness function?

Posted: April 26th, 2014, 4:32 pm
by SpottedShroom
I requested a cond_random script directive over in the private Editing Tools forum, but didn't get a response either way from BW. I'm hoping 1.03 will have more mod support, possibly including this.

If you're interested in this stuff, ask BW to add you to the Editing Tools forum.

Re: Randomness function?

Posted: April 27th, 2014, 7:47 pm
by BasiliskWrangler
The problem with random numbers is: what do you do with it once you've generated a number? As far as I can determine, you'd need to somehow assign that random number to a variable in order to use it in any meaningful way...but the Eschalon scripting engine is so rudimentary it doesn't support variables.

Re: Randomness function?

Posted: April 28th, 2014, 10:05 am
by SpottedShroom
BasiliskWrangler wrote:The problem with random numbers is: what do you do with it once you've generated a number? As far as I can determine, you'd need to somehow assign that random number to a variable in order to use it in any meaningful way...but the Eschalon scripting engine is so rudimentary it doesn't support variables.
I was thinking it would just be a random percent chance that the script would continue executing, similar to the other cond_ keywords. Something like:

Code: Select all

cond_random 50; msg(You'll see this message half of the time)

Re: Randomness function?

Posted: April 28th, 2014, 10:45 am
by IJBall
SpottedShroom wrote:
BasiliskWrangler wrote:The problem with random numbers is: what do you do with it once you've generated a number? As far as I can determine, you'd need to somehow assign that random number to a variable in order to use it in any meaningful way...but the Eschalon scripting engine is so rudimentary it doesn't support variables.
I was thinking it would just be a random percent chance that the script would continue executing, similar to the other cond_ keywords. Something like:

Code: Select all

cond_random 50; msg(You'll see this message half of the time)
Yes - you could also use something like this to "respawn" mobs in certain cases (e.g. stepping on a grid square, or opening a chest, etc.). So something like this could be very useful.

Besides - isn't there already a "random number generator" function in Book III?! If not, how else does Lucky's "game" work?... (Or is this another "special script" condition thing-ie?...)

Re: Randomness function?

Posted: April 28th, 2014, 11:48 am
by mbrowne
IJBall wrote:
SpottedShroom wrote:
BasiliskWrangler wrote: Besides - isn't there already a "random number generator" function in Book III?! If not, how else does Lucky's "game" work?... (Or is this another "special script" condition thing-ie?...)
Then there's random loot. Conditional statements would be great.