Can somebody please explain to me how I can enable a player to cycle through different possible text options that each set different variables which come into effect on moving to the next passage?
So you might have for instance:
You drink the purple splooge.
...but on clicking 'purple' it then turns to the word 'green', click it again 'pink', again and it goes back to 'purple' and which ever option the player leaves it on when they move to the next passage it will enable the respective variable.
You only need to use two of his three examples:
1. The example titled Insert into passage which goes into your passage.
You will need to edit the name (all occurrences) of the $myVar variable as well as the text options contained with the data-cycling-texts array.
To clarify, I'm using Twine 1 with sugarcane and this script says harlowe.
Here's what I tried:
...and I opened a new script passage, tagged it harlowe and pasted -
Should that work if I'm using sugarcane?
The error messages I get are
which it I think it should be as it includes a
and on the next passage titled 'a' it reads -
What am I doing wrong?
Am I using the wrong one?
Visit this Glorious Train Wrecks link and copy the code from the section titled Script code into your story's script tagged passage, the code will add a cyclinglink macro to your story.
If you don't have a script tagged passage then use the Story -> New -> Script menu items to create one.
The following example shows how to use the new cyclinglink macro with a $colour variable that stores the currently shown option.