Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Random variable.

11 years ago

Can you make the editor do this? 1D(%VARIABLE)

The 1 is the number of dice, and the %VARIABLE IS the number of sides the dices have. 

Then reason I need this is because I'm trying to do this.

IF %MINATT >= %MAXATT THEN

BEGIN

%MINATT := %MAXATT

END

IF %MAXATT > %MINATT THEN 

BEGIN

%ATTACK := (%MAXATT + %MINATT)/2 + 1D(%MAXATT - %MINATT)

END

Where %MINATT is the minimum attack you can dish out, and %MAXATT is the maximum attack you can dish out, and where %ATTACK is (%MINATT + MAXATT)/2 + 1D(%MAXATT - %MINATT)

Random variable.

11 years ago

Unfortunately, from what I can tell, no, that's not possible.

Random variable.

11 years ago

That's okay. I somehow found a loophole.

 

%ATT :=  %MINATT + ((%MAXATT - %MINATT) * 1D50 / 1D50) 

It won't work as good as the other one, but it'll do for now.