Advanced Twine Features
Here is a video showing how to use some advanced features of Twine.
You can assign values to variables in Twine using the (set: $variable to value) macro. Variables are prefixed with a
dollar sign ($). For example, (set: $health to 100) sets the variable $health to 100.
You can then use the (print: $variable) macro to display the value of the variable in your story. For example,
(print: $health) will display the current value of $health.
You can also just put a variable name in a passage without any macro. For example, if you have a variable $health set to
100, you can just put $health in a passage and it will display the value of $health. For example:
You were struck by an arrow. You have $health health remaining.
Twine macros have the form of (macro-name: arguments)[hook], where the argument
is a value or variable that is passed to the macro, and the hook is an optional value that can include text and other
macros.
Here are some of the basic macros that you should know:
(set: $variable to value) - sets a variable to a specific value. Variables are used to keep track of information about the player's choices and progress in the story.(print: variable) - displays the value of a variable in the story.(if: condition)[actions] - executes the actions if the condition is true. This is used for branching paths in the story based on the player's choices.(else-if: condition)[actions] - executes the actions if the previous (if:) or (else-if:) conditions were false and this condition is true.(else:)[actions] - executes the actions if all previous (if:) and (else-if:) conditions were false.(goto: "passage name") - takes the player to the passage with the specified name.(live: number) - repeats the action in brackets with the specified time delay. For example, (live: 0.5s)[actions] will repeat the actions every half second.There are many more macros available in Twine, and you can find documentation for them in the Harlowe Manual.
There will be a quiz on Thursday, February 19, 2026 covering the material from the last two weeks. The quiz will include questions about how to use Twine and its macros.
Continue working on your story making use of some of the advanced features you learned in the video. You will have the rest of this period to work on your story. It is due at the end of the day on Thursday, February 12, 2026.
Click on the Build tab and click "Publish to File". This will make an HTML file that you can save on your Desktop
and upload to your OneDrive shared folder. The file name should be: lastname_twine.html
Here is the list of documentation resources I gave you last week.