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.9k points)

Check out the <<linkreplace>> macro.

0 votes
by (44.7k 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.