Linking Passages in Twine

## What is a Passage?

In Twine, passages are important texts or paragraphs. Navigating through a Twine game is done by moving from passage to passage. Passages have two elements: a name and body. The name is the title of the passage, that allows the programmer to reference the passage they choose. The body is the text that will be displayed to the user of the Twine game.

### The importance of linking

When creating a Twine game, linking passages is a must. You are creating a story and to go through it, multiple passages will be created. Passages are different pages made with text and/or images that shows the player what is happening. Using multiple pages creates an interactive experience, instead of one static screen that scrolls. Having many passages can also result to creating branching arcs, letting the player experience different scenes, short or long. Using multiple pages shows that there are different texts can be shown based on their choice. All of these are possible because of linking passages together.

### More

It is also important to name your passages appropriately. Creating a Twine game, it is inevitable that you will make numerous passages, from the beginning passages, to important scenes all players must go through and the end scene. Using specific names, relating to the body, will help you debug your game and let others understand it as well.

## Creating Links

There are different ways link passages: passage links, piping links, routing links.

To start, create a few passages and name them appropriately. ("start" and "end" are the names of two passages)

### Passage Links

```
[[<name>]]
```
This is the simplest form to link one passage to another passage:

* [ [ ] ] :
	+ using two pairs of square brackets, indicates to Twine that we are creating a link to a passage
* <name> :
	+ this is a placeholder for the name of the passage you want to link to

```
[[end]]
```
"end" is the name of the passage in this example.

Using this link, the user/player will see the name of the passage highlighted, showing that it is clickable

note: make sure to use two sets of square brackets, using one creates a hook, and that is something else

### Piping Links

```
[[<text>|<name>]]
```
This allows text/s to be used as links to passages:

* <text> :
	+ this is a placeholder for the the text/s you want to used as links
	+ this can be one word or a sentence
* | :
	+ this is called a pipe, which indicates to Twine that what's on its left will be used to reference the passage on the right
* <name> :
	+ this is a placeholder for the name of the passage you want to link to

```
[[this is the end|end]]
```
"end" is the name of the passage and "this is the end" will be the text the the user will see and click to move to the next passage

Using this kind of linking allows you to rename the link name to your desired word or sentence.

note: the name of passages are case and space sensitive

### Routing Links

```
[[<text>-><name>]]

        or

[[<name><-<text>]]
```

This allows texts to point to a passage, to route the text to the desired passage:

* <text> :
	+ this is a placeholder for the the text/s you want to used as links
	+ this can be one word or a sentence
* <- or ->:
	+ these are arrows used to "point" to the passage
	+ both arrows can be used to link passage names
* <name> :
	+ this is a placeholder for the name of the passage you want to link to

```
[["this is the start"->start]]
```
"start" is the passage name and "this is the start" will be the text that the user/player will see and click.

This is similar to piping links, allowing the programmer to replace the name of the link when linking a passage that the user will see. This type of linking was also introduced starting Twine 2.

With this kind of linking, you are able to create branching arcs for your game. Having a passage that gives users choices and each option being linked to different passages. Each route can consist of one or more passages and all then converge to one passage.

note: make sure that where the arrow is pointing to is the passage name not the text

## Conclusion

Linking passages is an important element needed to be used when creating Twine games. This allows users/players to be able to go through your story and complete the game. I hope with this tutorial you are now able to utilize this command and create your own.

1. https://twinery.org/cookbook/starting/twine2/creatinglinks.html#story-format-additions
2. https://twinery.org/cookbook/questions/links.html
3. http://www.adamhammond.com/twineguide/
4. https://www.youtube.com/watch?v=RwN6JcWcP0s