Randomness function?
Randomness function?
Any chance there is a random # function available for scripts?
- SpottedShroom
- Captain Magnate
- Posts: 1372
- Joined: June 4th, 2010, 6:18 pm
Re: Randomness function?
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.
If you're interested in this stuff, ask BW to add you to the Editing Tools forum.
- BasiliskWrangler
- Site Admin
- Posts: 3825
- Joined: July 6th, 2006, 10:31 am
- Location: The Grid
- Contact:
Re: Randomness function?
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.
- SpottedShroom
- Captain Magnate
- Posts: 1372
- Joined: June 4th, 2010, 6:18 pm
Re: Randomness function?
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: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.
Code: Select all
cond_random 50; msg(You'll see this message half of the time)
Re: Randomness function?
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.SpottedShroom wrote: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: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.
Code: Select all
cond_random 50; msg(You'll see this message half of the time)
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?
Then there's random loot. Conditional statements would be great.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?...)