Moving from Ink and Yarn Spinner
Ink (.ink) and Yarn Spinner 2 and 3 (.yarn) scenarios can be imported, with knots and nodes becoming labels, choices becoming @choice, and variables becoming Liminalia variables. Ink becomes one .lim file including the files it INCLUDEs, and Yarn Spinner becomes one .lim file per .yarn file.
How to import
Run these in the folder of the project you're importing into.
lim import-ink story.ink
lim import-yarn dialogue/ # every .yarn in the folder
lim import-yarn intro.yarn --name opening # choose the name of the .lim to writeThe results are written to ink-import-report.md and yarn-import-report.md (in Japanese). For a single file, you can also use Import text in Studio (Import in Studio). In Studio, the initial values of variables are written as @set lines at the top.
The end of the story (Ink's END and DONE, and the end of a Yarn Spinner node and <<stop>>) becomes @title-screen, which returns to the title screen, by default. Use --end stop for @stop, or --end return for @return (when the story is called with @call).
Ink side-by-side table
These are real results of converting with lim import-ink.
| Ink | .lim |
|---|---|
=== start ===, = part | # start, # start-part |
Akari: Welcome back. | Akari "Welcome back." |
VAR trust = 0 | game.trust in variables in liminalia.json |
~ trust = trust + 1 | @set game.trust = game.trust + 1 |
~ temp n = 0 | @let n = 0 |
-> go, -> go ->, ->-> | @jump #go, @call #go, @return |
{trust > 1: That was fun.|That was awkward.} | {= game.trust > 1 ? "That was fun." : "That was awkward."} |
# bg: room.png | @bg room.png |
=== function double(x) === | A macro that returns a value, @define ink-double(…) |
Choices, and what follows them, look like this.
* [Go out] -> go
* {trust > 0} [Stay home]
We spent the day at home.
-> ending@choice
- Go out -> #go
- Stay home -> #start-c2 if=(game.trust > 0)
@end
# start-c2
We spent the day at home.
@jump #endingInk rounds down when dividing one integer by another, but Liminalia's / always divides with decimals. Divisions where both sides are known to be integers are converted to floor(a / b).
Yarn Spinner side-by-side table
These are real results of converting with lim import-yarn.
| Yarn Spinner | .lim |
|---|---|
A node, from title: Start to === | # Start |
Akari: Welcome back. | Akari "Welcome back." |
<<declare $trust = 0>> | game.trust in variables in liminalia.json |
<<set $trust to $trust + 1>> | @set game.trust = game.trust + 1 |
Visit number {$trust}. | Visit number {= game.trust}. |
<<jump Go>>, <<detour Go>>, <<return>> | @jump #Go, @call #Go, @return |
<<if>>, <<elseif>>, <<else>>, <<endif>> | @if, @elif, @else, @end |
-> Stay home <<if $trust > 0>> | - Stay home -> #Start-c2 if=(game.trust > 0) |
<<bg room.png>> | @bg room.png |
[b], [wave], [pause=500 /] | {b …}, {fx wave …}, {@wait 500ms} |
<<once>> … <<endonce>> | A variable that remembers whether it was shown, and @if |
How tags and commands map
Ink tags (# bg: room.png) and Yarn Spinner commands (<<bg room.png>>) are replaced with Liminalia commands by name. bg, bgm, se, voice, wait, chara, hide, quake and others are supported out of the box. For other names your project uses, you can write the mapping in liminalia.json.
"import": {
"ink": { "commands": { "flash": "@quake time=200ms" } },
"yarn": { "commands": { "fade_out": "@mask time={1:s}" } }
}{1} is the first value, and {1:s} turns a number of seconds into a time. Tags and commands with no mapping become comment lines such as // #tag, and the report shows how many there are. The details are in How tags and commands map.
What can't be imported
The following aren't converted; they become comment lines and are listed in the report. Replace them with the Liminalia way of writing them, for example by branching with @if for each destination.
- Ink: parameters on knots and stitches, threads with parameters,
EXTERNAL, diverts to variables, functions such asTURNS, and comparing lists by size and functions such asLIST_MIN - Yarn Spinner: jumps to an expression such as
<<jump {$x}>>, replacement markup such as[select], and functions that aren't built in
What to check after importing
- Set which file New Game starts from with
entryinliminalia.json. - In Liminalia, one line of text is one click. Test play to check where the game waits for a click.
- Put the assets for the
@bgand other commands made from tags and commands intoassets. - Check for errors on the Check screen in Studio or with
lim check, and use the all-routes test to check for labels that can't be reached.