Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Multiplying a random variable by another variable

10 years ago

Is there a way to make a variable multiply randomly for example: 1D%POINTS?

Multiplying a random variable by another variable

10 years ago

?

So you want the range to be 1 to the current size of the variable?

Multiplying a random variable by another variable

10 years ago

Yes.

Multiplying a random variable by another variable

10 years ago
There is the hard way...

IF %TEST = 1 THEN %TEST := 1D1
IF %TEST = 2 THEN %TEST := 1D2
IF %TEST = 3 THEN %TEST := 1D3
IF %TEST = 4 THEN %TEST := 1D4

Depending on how large your variable might be...

Multiplying a random variable by another variable

10 years ago

There is a way, but you can't directly do 1D%POINTS.

You have to use percentage. Like so:

POINTS * 1D100/100

Multiplying a random variable by another variable

10 years ago
That...is genius. Kinda like what you have to do to get random whole numbers in JS.