Computer 2

Thursday, February 12, 2026

Advanced Twine Features

Advanced Twine Features

Here is a video showing how to use some advanced features of Twine.

Variables

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

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:

There are many more macros available in Twine, and you can find documentation for them in the Harlowe Manual.

Quiz next Thursday

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.

Today's Class Assignment

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.

Turning In Your Work

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

Documentation Resources

Here is the list of documentation resources I gave you last week.