Getting Started

## Overview

Tip: In practice, most settings will be handled either by story configuration or via the command line, so the only configuration step that's absolutely necessary to begin using Tweego is to enable it to find your story formats.

Tweego may be configured in a variety of ways—by environment variable, story configuration, and command line options. The various methods for specifying configuration settings cascade in the following order: 1. Program defaults. 2. Environment variables. 3. Story configuration. See the [`StoryData` passage](#special-passages-storydata) for more information. 4. Command line. See [Usage](#usage) for more information. ## Program Defaults
Input charset

The default character set is utf-8, failing over to windows-1252 if the input files are not in UTF-8.

Tip: It is strongly recommended that you use UTF-8 for all of your text files.

Story format
The default story format (by ID) is sugarcube-2.
Output file
The default output file is -, which is shorthand for standard output.
Starting passage
The default starting passage name is Start.
## Environment Variables
TWEEGO_PATH

Path(s) to search for story formats. The value should be a list of directories to search for story formats. You may specify one directory or several. The format is exactly the same as any other path type environment variable for your operating system.

Tip: Setting TWEEGO_PATH is only necessary if you intend to place your story formats outside of the directories normally searched by Tweego. See Search Directories for more information.

Note: To separate multiple directories within path variables, Unix-like operating systems use the colon, while Windows uses the semi-colon. Only relevant if you intend to specify multiple directories.

Unix-y examples

If you wanted Tweego to search /usr/local/storyformats, then you'd set TWEEGO_PATH to:

/usr/local/storyformats

If you wanted Tweego to search /storyformats and /usr/local/storyformats, then you'd set TWEEGO_PATH to:

/storyformats:/usr/local/storyformats

Windows examples

If you wanted Tweego to search C:\\storyformats, then you'd set TWEEGO_PATH to:

C:\storyformats

If you wanted Tweego to search C:\storyformats and D:\storyformats, then you'd set TWEEGO_PATH to:

C:\storyformats;D:\storyformats
## Story Formats

Note: Throughout this document the terms story format and format are virtually always used to encompass both story and proofing formats.

Tweego should be compatible with *all* story formats—i.e., those written for Twine 2, Twine 1 ≥v1.4.0, and Twine 1 ≤v1.3.5. Installing a story format can be as simple as moving its directory into one of the directories Tweego searches for story formats—see [Search Directories](#getting-started-story-formats-search-directories) for more information. Each installed story format, which includes separate versions of the same story format, should have its own unique directory within your story formats directory—i.e., if you have both SugarCube v2 and v1 installed, then they should each have their own separate directory; e.g., `sugarcube-2` and `sugarcube-1`. Do not create additional sub-directories, combine directories, or rename a story format's files.

Tip: To ensure a story format has been installed correctly, use the list-formats command line option (--list-formats) to see if Tweego lists it as an available format.

Warning: Twine 2 story formats are, ostensibly, encoded as JSON-P. Unfortunately, some story formats deviate from proper JSON encoding and are thus broken. Tweego uses a strict JSON decoder and cannot decode such broken story formats for use. Should you receive a story format decoding error, all reports should go to the format's developer.

### Search Directories When Tweego is run, it finds story formats to use by searching the following directories: *(in order)* 1. The directories storyformats and .storyformats within its program directory—i.e., the directory where Tweego's binary file is located. 2. The directories storyformats and .storyformats within the user's home directory—i.e., either the value of the HOME environment variable or the operating system specified home directory. 3. The directories storyformats and .storyformats within the current working directory—i.e., the directory that you are executing Tweego from. 4. The directories specified via the TWEEGO_PATH environment variable. See Environment Variables for more information.

Note: For legacy compatibility, the following directories are also checked during steps #1–3: story-formats, storyFormats, and targets. You are encouraged to use one of the directory names listed above instead.

Warning: A story format's directory name is used as its unique ID within the story format list. As a consequence, if multiple story formats, from different search paths, have the same directory name, then only the last one found will be registered.