Writing Commands
VNKit’s Commands are ordinary Yarn Commands. Each one is the Command’s name, then what it acts on, then one value:
<<move capsley left>>This moves Capsley to the left slot. Each Command does one thing, so changing several things about a character takes several short Commands. For example, a character’s nameplate colour, name colour, and nameplate position are three separate Commands:
<<nameplate c 4f63c2>>
<<name_colour c ffffff>>
<<nameplate_position c left>>How long a Command takes
Every Command can end with a duration, in seconds:
<<move capsley left 0.5>>This moves Capsley to the left slot over half a second. If you leave the duration out, the change happens instantly.
The story waits for each Command to finish before it carries on. In the example above, the next line appears after Capsley has finished moving.
pop and shake can’t be seen without a duration. If you leave it out, VNKit warns you in the Console.
Running Commands at the same time as the story
Put nowait after the duration, and the story carries on straight away while the Command plays out:
<<show witch neutral 1 nowait>>
w: You're not the only one here, salesman.Here, the Witch fades in over a second while her line is shown.
nowait always comes after a duration. Without a duration, the change is instant, so there’s nothing to wait for. If you write 0 nowait, VNKit warns you in the Console.
nowait in place of the duration, as in <<show witch neutral nowait>>. In most Commands, Yarn Spinner tries to read nowait as the duration, the Command doesn’t run, an error appears in the Console, and the dialogue stops. emphasise and deemphasise are the exception: they only warn you in the Console.Waiting for something to finish
<<wait_for target>> waits until something you started with nowait has finished:
<<move capsley off_left 1 nowait>>
d: He left his yarn behind.
<<wait_for capsley>>
<<hide capsley>>| Target | Waits for |
|---|---|
A character’s name, like capsley | Anything happening to that character. |
A slot, like left | Anything happening to the character in that slot. |
| A stage’s name | The stage being raised, switched to, or faded. |
background | A background change. |
mask | The mask being started, moved or ended. |
emphasis | emphasise or deemphasise. |
textbox | hide_textbox. |
music | A music change, fade or volume change. |
ambience | An ambience change, fade or volume change. |
sound | A sound effect fading in, or stop_sound. |
all | Everything started with nowait. |
If nothing is happening to the target, wait_for carries on straight away.
When animations finish early
If you give a Command to something that’s still moving from an earlier nowait, the earlier animation jumps to its end first, then the new one starts.
Anything started with nowait also jumps to its end when a node finishes, when the dialogue ends, and before the game saves.
Writing names and words
- Words don’t need quotes. Text with spaces in it does, like
<<show sylvie "green smile">>. - American spellings work too:
bg_color,name_color,emphasize,deemphasize, andcenterdo the same thing asbg_colour,name_colour,emphasise,deemphasise, andcentre. - Yarn removes quotes before VNKit sees a Command, so VNKit can’t tell
leftand"left"apart. A character named after a slot, likeleftorfar_right, or a character namedall, is treated as the slot or keyword.
Autocomplete
VNKit comes with VNKit.ysls.json, which tells the Yarn Spinner editor about every VNKit Command. With it, the editor autocompletes Commands as you type, and warns you when one is missing something. See Adding VNKit to Your Project to set it up.