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?
Thanks.

1 Answer

0 votes
by (156k 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 (156k 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")]

 

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...