0 votes
by (140 points)
reshown by
Hello there!

First of all, I am currently using SugarCube and I was wondering what code would let the user click on a text and it being able to change into different options.

E.g. You are a: *X*

And you would be able to click on 'X' to turn into 'Y', 'Z'.

Also, how would the user be able to save whatever option they choose?

Thank you for your time!

3 Answers

0 votes
by (980 points)

Passage Name: Maze

<< link [Go right | Maze]>> <<set $TurnRightA = true>> <</link>>

<< link [Go left | Maze]>> <<set $TurnLeftA = true>> <</link>>

<< if $TurnRightA == true>> << link [Go right again | Maze]>> <<set $TurnRightB = true>> <</link>>

<< link [Go left | Maze]>> <<set $TurnRALeftA = true>> <</link>>


<< else if $TurnLeftA == true>> << link [Go left again | Maze]>> <<set $TurnRightB = true>> <</link>>



There are other ways but that is one that I have used.
0 votes
by (8.8k points)

Check out the <<linkreplace>> macro.

0 votes
by (41.8k points)

Take a look in the Twine Cookbook.  There are examples there for all kinds of things, including the "cycling text" you're looking for.

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.