owned this note
owned this note
Published
Linked with GitHub
# Twine: The Basics
## What is it?
- Twine is a tool for telling interactive, non-linear stories
## What resources are there to learn more about it?
- Twine's own "[Cookbook](https://twinery.org/cookbook/using_cookbook.html)" offers examples that you can download and explore; it includes a compilation of many of the most requested code solutions
## Key terms / building blocks
Twine produces *stories.*
- Stories are individual projects in Twine; published to HTML and readable by web browsers
- Each story gets in IFID, aka an Interactive Fiction Identifier, which helps to track projects/stories across platforms
*Stories* are made up of *passages*
- Passages are divisions of space, time, or both, which form the core of the story
- Passages can include blocks of dialogue & sections of code
- Using passages is a way to break up a complicate project
*Stories* and *passages* can also include *variables*
- Variables are containers for a value that can change; they give you a way of storing and acting on data of some kind
- anything can be stored in a variable in twine!
- Twine variables most commonly start with $ or -
- They are globally accessible, and are translated into their values when used in a passage
## Key tools, or: okay, but how do I actually make a Twine story?
### Markup/Markdown
- Twine stories are written in markdown, which is easily converted to HTML, which web browsers will then use to make your story readable
- Makdown is a kind of markup language (as is HTML, which stands for hyper text markup language)
- A markup language involves extra symbols to designate / create visual effects (adding headings, adding images, adding color, adding emphasis, etc.)
### Macros
- Twine macros allow code to intermix with text onscreen; they add functionality to a story
- Different story formats offer different macros
### Story formats
- different formats provide different visual layouts, macros, and java script functions
- Harlowe is the default story format, and is notable for its ease of use; this is the format most often used by newcomers to Twine
- Sugar cube: adds more functionalty, but requires more programming knowledge for advanced usage
- Snowman: designed for those with more advanced knowledge of Javascript and CSS
- Chapbook: a second generation story format for Twine two, which separates its functions into "inserts" (which cause text to appear) and "modifiers" (which affect text in some way)
### HTML
- Each story format handles HTML structure
### CSS
- Every story contains a story style sheet screen that allows additional formatting rules to be added with CSS (cascading style sheets, a fundamental way of styling HTML, used beyond Twine)
### JavaScript
- Knowledge of javascript is *not* required to use Twine.
- *But*, understanding how it works and structures things can be helpful, especially for sugar cube and snowman story formats
- Every story also contains a javascript screen, which allows you to write specialized code or include external libraries and files
### Twee
- Twee is the source code for Twine stories
- Twine 2 has sections where the user can add CSS and javascript
## Where can I learn more about HTML and CSS?
[Free code camp](https://www.freecodecamp.org/)
[W3 schools HTML](https://www.w3schools.com/html/)
[W3 schools CSS](https://www.w3schools.com/css/default.asp)
## Are there other tutorials for using Twine?
[Twine Guide Video Tutorial](https://www.adamhammond.com/twineguide)
[Twine in the Classroom Cheat Sheet](https://blogs.stockton.edu/textscape/files/2015/04/A-Twine-Cheat-Sheet.pdf)