LiminaliaLiminalia
Migration guide: Moving from TyranoScript

Migration guide

Moving from TyranoScript

TyranoScript and TyranoBuilder projects can be imported all at once with lim import. Each .ks file in data/scenario becomes a .lim file, character definitions go into cast.json, and macros are gathered as @define in a single file.

How to import

  1. On the Studio start screen, choose New Project → A TyranoScript or TyranoBuilder project.
  2. Select the source project folder (the one containing data/scenario) and click Create.
  3. Studio converts the scripts, copies the assets, and sets where New Game starts. When it finishes, open the import report to check the results.

You can also start an import by selecting the source folder with Open Project.

With the command line:

lim new my-game --from-tyrano ../my_tyrano_project
  • The title and screen size are read from data/system/Config.tjs in the TyranoScript project.
  • first.ks and title_screen.ks aren't imported. Liminalia's own startup and title screen are used, and New Game starts where *start on the title screen jumps to (or where first.ks jumps to). A [jump] to title_screen.ks becomes @title-screen.
  • Assets are copied from bgimage, fgimage, image, bgm, sound, video and others in data to the folders with the same names in the project's assets (TyranoScript plugins in others/plugin aren't copied).
  • It's a one-time import. After importing, you keep editing the .lim files.

If you keep writing in TyranoScript

If you keep editing in TyranoScript, you can import again with the steps below. Reimporting overwrites changes made to the .lim files.

  1. Create the Liminalia project to import into (lim new my-game --blank, or New Project in Studio).
  2. In the project's liminalia.json, write the folder of the TyranoScript project to import from. In Studio, this is the Import source (TyranoScript project) field under Advanced settings on the Project screen, which opens when you click the project name at the top left.
    "import": { "tyrano": { "source": "../my_tyrano_project" } }
  3. In Studio, press Import again above the scenario to reimport without copying assets. Or run lim import in the project folder. Add --assets to copy assets into matching folders under assets without overwriting existing files.

The results are written to import-report.md in the project (in Japanese). The “本文の一致” (text match) line at the top is the number of files whose text came out the same as the original .ks.

# 取り込みの報告(3 ファイル)
| mapped  | 63 | 94.03% |
| dropped |  3 |  4.48% |
| generic |  0 |  0.00% |
| manual  |  1 |  1.49% |
- 本文の一致: 3 / 3 ファイル(11 ページ)

Side-by-side table

These are real results of converting with lim import. In .lim, parameters that match Liminalia's defaults aren't written.

TyranoScript.lim
#アカリ followed by 「おかえり」[p] on the next lineアカリ「おかえり」
窓の外は雨だった。[p]窓の外は雨だった。 (one line is one click)
一行目[l]続き[r]二行目[p]一行目{click}続き{br}二行目
[cm], [er], [ct]@clear
[ruby text="かさ"]傘{r 傘|かさ}
[font color="0xff0000"]赤[resetfont]{c #ff0000 赤}
[emb exp="f.trust"]{= game.trust}
[bg storage="room.jpg" time="1000"]@bg room.jpg time=1s
[playbgm storage="main.ogg"]@bgm main.ogg
[fadeoutbgm time="1000"]@stop-bgm time=1s
[playse storage="door.ogg"], [stopse]@se door.ogg, @stop-se
[chara_new], [chara_face]Characters and variants in cast.json
[chara_show name="akari" time="500"]@chara akari default at=auto time=500ms wait=true if-hidden=true
[chara_mod name="akari" face="smile"]@chara akari smile time=600ms wait=true
[chara_hide name="akari"]@chara-hide akari time=1s wait=true
[mask time="500"], [mask_off time="500"]@mask time=500ms, @mask-off time=500ms
[wait time="500"]@wait 500ms
[eval exp="f.trust = 1"]@set game.trust = 1
f., sf. and tf. variablesgame., system., temp.
[if exp="…"], [elsif], [else], [endif]@if …, @elif, @else, @end
*go# go
[jump target="*end"]@jump #end
[call storage="sub.ks" target="*memo"], [return]@call sub#memo, @return
[macro name="greet"] … [endmacro]@define greet(…) … @end in macros.lim

A run of [glink] tags followed by [s] becomes an @choice block. cond= becomes if= on that choice's line.

TyranoScript
[glink text="出かける" target="*go" cond="f.trust >= 1"]
[glink text="家にいる" target="*stay"]
[s]
.lim
@choice
  - 出かける -> #go if=(game.trust >= 1)
  - 家にいる -> #stay
@end

How each tag is handled is listed in TyranoScript import in the technical docs.

Tags that can't be imported, and what to use instead

The following tags aren't converted. The report lists how many there are and why, under the sections for places that need manual work and for tags this engine doesn't handle.

TyranoScriptWhat to use in Liminalia
[iscript] … [endscript]Kept as @script … @end. The contents of @script don't run (it can only be written in projects that set "allowScript": true in liminalia.json), so rewrite it as a plugin command
[loadjs], [loadcss], plugin JavaScriptMake the commands and rendering with a plugin (Make your first command)
[html] containing JavaScriptIf it only displays something, remove the JavaScript and write it with @html
[button fix=true], [button role=…]Make always-visible buttons and system buttons with the system screens
[position], [message_config], [deffont]Set the message window and the look of the text in Game settings in Studio or in ui in liminalia.json. [position vertical=true] becomes @vertical on
[glyph], [glink_config], [cursor]Set the look of the click-wait icon, choice buttons and cursor in Game settings or with CSS
[erasemacro]Macros can't be erased. Simply stop calling the macros you don't use
[graph]Images can't be placed inside the text. Show them on screen with @image or similar
[wb], [wait_cancel]There's no mechanism for waiting on events. To wait for an effect to finish, use wait=true on that command
[speak_on], [speak_off]Read aloud is chosen by the player on the Display tab in Settings
[tb_replay_image_button], [tb_cg_image_button]Use the standard Extras screen for the gallery and scene replay (Make extras: gallery, scene replay and music room)

Display timing differs too. @wait and effects jump to their end state as soon as the player clicks (TyranoScript's [wait] keeps waiting even after a click). To match TyranoScript, set ui.input.skipEffects in liminalia.json to false, or write skip=false on the command.

What to check after importing

  • Fix the places the report says need manual work, using the table above.
  • A line becomes dialogue only when the line after the speaker line (#アカリ) starts with a bracket such as 「」 or a quotation mark (" or “). Lines that don't start with a bracket become narration and appear in the diagnostics breakdown in the report as speaker-without-bracket.
  • On the Check screen in Studio, or with lim check, look for missing assets and characters.
  • Use the all-routes test to check for scenes that can't be reached, and test play to check effect timings.

Which one is the source of truth

While liminalia.json has import.tyrano, the .ks files are the source of truth. In Studio, the .lim files made by the import are read-only, and they're rebuilt from the .ks files each time you import again or export. This is for when you keep writing in TyranoScript and use Liminalia to check how it runs.

When you continue writing in Liminalia, make the .lim files the source of truth. First make a base for writing back, then delete import from liminalia.json.

Writing back to .ks

If you want to go back to TyranoScript after making the .lim files the source of truth, lim backport writes the changes you made in .lim back to .ks.

# 1. When you make .lim the source of truth, make a base once
lim backport --make-base backport-base --tyrano ../my_tyrano_project

# 2. Write the .ks files back into .liminalia/backport/scenario and check the report
lim backport --base backport-base

# 3. If it looks right, write them into data/scenario of the import source
lim backport --base backport-base --write

Check the written-back .ks files by importing them again and comparing with your current .lim files. Things TyranoScript doesn't have, such as @while or added macros, can't be written back and appear in the report. For details, see Writing back to TyranoScript.