bin | ||
doc | ||
lib | ||
var | ||
.gitignore | ||
.travis.yml | ||
.yardopts | ||
CONTRIBUTING.md | ||
Gemfile | ||
Gemfile.lock | ||
LICENSE | ||
Rakefile | ||
README.md | ||
sapling-dialogue.gemspec |
Sapling: A Dialogue Tree CLI Utility
Sapling allows for easy creation and use of dialogue trees.
A dialogue tree is a series of dialogues which follow sequentially, though with branching options. Examples include "Choose Your Own Adventure" games, or the dialogues seen in many video games.
Structure
A dialogue tree can be broken down into three distinct parts: the trunk, branches, and leafs. The trunk represents the main structure of the tree. Unlike a branch, which displays content and options, the trunk provides metadata. Generally speaking, it is a branch, with the exception that it has no options. A branch represents a choice taken in the dialogue. Branches flow to each other through leafs, which are the actual choices.
You can experience this yourself, by loading "Example Quest! - A Meta Dialogue
Tree!". You can find the tree itself at var/trees/example_quest.yaml.
To run it, just type sapling read path/to/example_quest.yaml
.
Building a New Tree
To build a new tree, you have two options. You can manually edit a configuration file, or go through the construction wizard. Either way, the end result is a plain-text configuration file, which can be easily shared, edited, and viewed. For more details on the configuration file itself, check out the Configuration File documentation, or the self-documented configuration file example. Alternatively, you can checkout Example Quest for a complete tree.
Manual Edit
- Open your preferred text editor.
- Refer to the Configuration File documentation
- Make your changes.
- Save your changes.
Automatic Edit -- Coming Soon(tm)!
- Run the configuration editor:
sapling edit [TREE]
- If you don't include a TREE,
sapling
will create a new tree in the current directory. - If you choose to modify an existing file,
sapling
will open the tree at the trunk, and show you the first branch. - Make your changes.
- Save your changes.
More details on the editor can be found in the Editor documentation.
Contributing
You can contribute to Sapling by following these instructions:
- Fork this repository.
- In your fork, make your changes.
- Make sure your changes respect the contribution guidelines.
- Submit a pull request.
License
Sapling is licensed under the MIT license. The full text can be found in LICENSE.