INCLUDE libraries

Last edit 11 Sept 2026, 10:29 by WikiModHistory

A library is an Ink file that is not a conversation. Put functions, VAR / CONST / LIST, and helper knots there. Conversations pull them in with INCLUDE.

Unity / SmGF mods often ship this as global.inkin plus INCLUDE ../global.inkin. Sexter does the same job in the Ink editor.

Where they live

Ink editor → Files → Libraries (top of the list). + adds a file. Default name is global.inkin. Rename by clicking the filename.

Libraries have no Test button. They are not chats. Save still checks that the file compiles as an include, then recompiles conversations that INCLUDE it.

How to include

From a conversation:

ink
INCLUDE global.inkin

Paths are matched by filename only. These all load the same library named global.inkin:

ink
INCLUDE global.inkin
INCLUDE ../global.inkin
INCLUDE ../../foo/global.inkin

You can also write INCLUDE global (Sexter treats that as global.inkin).

Autocomplete offers library names after you type INCLUDE .

What to put in a library

Functions, variables, and knots other files divert to. Example: pack a 0–15 score into four story flags.

ink
=== function set_points(points, to) ===
{ points:
- 0:
    ~ RemoveStoryFlag("{to}_0")
    ~ RemoveStoryFlag("{to}_1")
    ~ RemoveStoryFlag("{to}_2")
    ~ RemoveStoryFlag("{to}_3")
- 1:
    ~ SetStoryFlag("{to}_0")
    ~ RemoveStoryFlag("{to}_1")
    ~ RemoveStoryFlag("{to}_2")
    ~ RemoveStoryFlag("{to}_3")
- else:
    ~ SetStoryFlag("{to}_0")
    ~ SetStoryFlag("{to}_1")
    ~ SetStoryFlag("{to}_2")
    ~ SetStoryFlag("{to}_3")
}
    ~ return true

Then in a conversation:

ink
INCLUDE global.inkin

~ temp score = get_points("gf_lewd")
~ score = score + 1
~ set_points(score, "gf_lewd")

Do not put a root flow (chat lines that run on their own with no knot). Sexter compiles the library by including it into an empty stub. A file that starts talking on its own will fail that check.

Player-facing lines belong in conversations. Libraries stay English when you translate a story.

EXTERNALs

You do not need EXTERNAL SetStoryFlag(...) (or the rest) at the top of a library. Sexter injects platform externals on the conversation file. If a library still has those Unity headers, they are stripped on compile so you do not get Duplicate EXTERNAL.

See External functions.

Import and Git

ZIP / Git packages:

  • Sexter export writes Includes/global.inkin
  • Unity export also writes Conversations/global.inkin so INCLUDE ../global.inkin from a chapter folder still works
  • Import picks up any *.inkin plus Includes/*.ink / Includes/*.inkin

Cap is 50 libraries per story.

Related

Official Sexter creator documentation. Older Unity / SmGF folder-mod docs remain at docs.unzipped.games. Creator Corner is for community models and production workflows.