Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Dice rolling

12 years ago

Have you played Terra Proxima? I think that every single person ever has. Anyways, there is a number table and it says to poke it with a pencil with you eyes closed. I think that after doing that about 3 times your computer screen would break and so would your pencil. There should be a feature that is like rolling a dice and you say how many sides it has. If you didn't understand any of that, I'm going to post more about it soon.

Dice rolling

12 years ago

You can roll dice by using scripting. For example, if you had the variable YEAH and wanted to make a link have a one in six chance of leading to another page, you could use the following link script:

%YEAH := 1D6 #setting the variable YEAH to the value of 1 roll of a 6-sided die

IF %YEAH = 6 THEN #if the result of the die roll is 6
BEGIN

$DEST := @P15 #set the destination to page 15.
END

So essentially to have die roll, you just have to use the #D#, where the first # is the number of dice you are rolling and the second # is how many sides each of those dice have. If you want to let the reader know what they rolled, you can display the variable that is being changed for a dice roll on the page. Like, if you wanted to say you rolled a five, you could write:

You rolled a %%YEAH%%.

And that would show up as "You rolled a 5."

You can also do this without scripting by using variables. Solo wrote an article on it, which you can read here. Hope that helped! (Also, I've moved this from the Feature Wishing Well as we already have the feature you desire.)