Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Random variable question

10 years ago
Hi,
How do I make it so that a random number is picked between 7 and 20 in my storygame?

Random variable question

10 years ago

In the Scripting of the Link or Page or Item - just add the Variable that you want Randomized (such as) -

%NUMBER := 1D14 + 6

That will assign %NUMBER a value of 7-20

If you want to Add the Random Number to the Variable, rather than Replace its Value you would use:

%NUMBER := %NUMBER + 1D14 + 6

 

Random variable question

10 years ago
Note -

EDITED original above, to answer the 7-20 question (that I missed before) :)