0 votes
by (190 points)

Hi guys, i'm new on Twine.

I'm using Harlowe 3.0.2.

I put a random choice like this:

(if: (random: 1, 10) <= 7)[walk](else:)[run]
in a page.
i want to print the result in the next page.
How can i do it?

1 Answer

0 votes
by (159k points)

You can save the random determined result it a story variable...

(set: $result to "run")
(if: (random: 1, 10) <= 7)[(set: $result to "walk")]

... which you can then print to the screen later on using either of the following methods.

(print: $result) (using a macro)
or $result (using a naked variable)


by (190 points)
And what if i want to use multiple choise? for example i want pick up a random character for the beggining of the sotry by 4-5 random.
by (159k points)

Use more story variables to store the randomly determined values.

(set: $travelMethod to "run")
(if: (random: 1, 10) <= 7)[(set: $travelMethod to "walk")]

(set: $shopOwner to "Jane")
(if: (random: 1, 10) >= 5)[(set: $shopOwner to "John")]