DSA: random number?

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
ADDF_Toxic
On Master
Posts: 623
Joined: Wed Apr 27, 2005 2:43 pm
Location: Canada
Contact:

DSA: random number?

Post by ADDF_Toxic »

Is there any way to randomly choose a number within a range using DSA in CSBWin? Thanks.
I'm a boy, unlike my avatar.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

&RAND

This generates a number between 0 and the number one less than on the stack

L50 &RAND generates a number between 0 and 49, etc
User avatar
ADDF_Toxic
On Master
Posts: 623
Joined: Wed Apr 27, 2005 2:43 pm
Location: Canada
Contact:

Post by ADDF_Toxic »

That sounds simple enough! It sounds like you can't set a lower boundary (too bad), but I think I have a way around that. I'll just need to subtract the upper boundary by the lower boundary, then add it again after the random number has been found :) Thanks for the help.
I'm a boy, unlike my avatar.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Pretty much

L5 &RAND gives you 0 - 4
L5 &+ gives you 5 - 9 for example
User avatar
ADDF_Toxic
On Master
Posts: 623
Joined: Wed Apr 27, 2005 2:43 pm
Location: Canada
Contact:

Post by ADDF_Toxic »

Do you mean

Code: Select all

L5 &+ &RAND
? Wow, that's easier than I was about to make it!
I'm a boy, unlike my avatar.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

No, you need to put things on the stacks first

L5 &RAND L5 &+
User avatar
ADDF_Toxic
On Master
Posts: 623
Joined: Wed Apr 27, 2005 2:43 pm
Location: Canada
Contact:

Post by ADDF_Toxic »

Ah, so like I was saying :)
I'm a boy, unlike my avatar.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Probably!
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

Stay true to CSB - employ gigglers for random generators.
Parting is all we know from Heaven, and all we need of hell.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Lol, some numbers can't reply on gigglers - like which direction a trolin will strike in combat with deth knights :D
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

Maybe you just need enough giggler-controlled invisible soundless spinners ;-)
Parting is all we know from Heaven, and all we need of hell.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Maybe that's how DSA's really work - they generate 32 hidden levels of giggler mechanics :D
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

poor giggler sods!
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Serves them right for STEALING MY VORPAL BLADE *fireball fireball poison dart*
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

You should not have (waved ) the vorpal blade in front of the gigglers' faces in the first place!
Next time , put it into your backpack.
THey are cleptomaniacs that have a fixation on stuff in hands..
BUT, if you think about it : fireballing them is fun! even more so, if they charge you.
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

Maybe if the gigglers had a guild you could pay them gold coins in order to keep your vorpal blade.
Parting is all we know from Heaven, and all we need of hell.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Maybe, if I had any left! They stole them! *fireball fireball oh um ew*
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”