Setting Up Your Development Environment
Since t-Plot is based on the Yarn Spinner dialogue scripting language, we recommend using the Yarn Spinner extension for Visual Studio Code. Here's how you can set up your environment:
Steps to Set Upβ
First, download Visual Studio Code (VSCode) for your system:β
Install Yarn Spinner Extensionβ
- Open VSCode.
- Go to the Extensions tab (on the sidebar or press
Ctrl+Shift+X
). - Search for Yarn Spinner and install the extension.
Open Your Project Folderβ
- In VSCode, click on File > Open Folder... and select your project folder.
Working with Yarn in Visual Studio Codeβ
Once you open a .yarn
file in VSCode, you can check if the Yarn Spinner extension is active by looking in the bottom right corner of the screen for the words "Yarn Spinner":
The bottom right corner of the Visual Studio Code window will only show "Yarn Spinner" if the extension is installed and the currently active file is recognized as a .yarn
file.
You can use any text editor to work with .yarn
files and write your stories, but the Yarn Spinner extension for Visual Studio Code provides many features that make the process easier.
For example, if you hold the Ctrl
key (on Windows or Linux) or the Command
key (on macOS) and hover over the names of nodes in <<jump>>
expressions, you can click on them to jump directly to that node's code.
You'll also be offered autocomplete suggestions based on the node names in your project. For example, when creating a new <<jump>>
statement, you can choose a node from the list.
If your project uses variables, the Yarn Spinner extension for VSCode will assist you. For example, when you declare a variable using <<declare>>
, you can add a comment with three slashes ///
to describe the variable. Then, when you use that variable in VSCode, hovering over it will show you its description and initial value.
Variable names will also autocomplete, and if you attempt to use a variable with an incorrect type, an error will appear.
The "Problems" Tabβ
Visual Studio Code allows you to track script errors through the Problems tab. It is located at the bottom of the window, next to the Terminal and Tasks tabs. Any errors found in your project will be listed here.
If you don't see the "Problems" tab, you can open it by pressing Ctrl+Shift+M
(on Windows or Linux) or Command+Shift+M
(on macOS).
Keep the "Problems" tab empty, as unresolved errors may prevent your script from compiling. If your project shows any errors, they must be resolved before proceeding.