Loreline v0.11.02026-11-01
新增:Loreline带来when块,按显著度(saliency)在条件成立的规则里挑出要求最多的一条来播放,写角色插话和反应台词不必再堆if/else,也能把对话拆成storylet模块化叙事。规则可用- 标记只播一次、true常驻,+ Beat引入其他节拍的规则,另有when first、when pick和自定义策略;规则建有索引缓存,prepareCaches()可提前生成,避免首次挑选卡顿。
元数据:脚本开头新增metadata块,声明标题、作者、语言与IFID,脚本内用$metadata.title读取,宿主用getMetadataField(),loreline ifid可生成IFID写入。
复数:复数改按各语言规则最多六种形式,并支持计数阈值,复数管道与plural()同规则;语言取自language字段,译文行跟随译文语言,未翻译行沿用原文规则。
Loreline v0.10.02026-08-26
<img width="1200" height="630" alt="og-banner" src="https://github.com/user-attachments/assets/48f7f0f6-89a8-414d-adff-5bd32e873da3" />
This release rather well packed with changes: beat parameters and dynamic beat calls, PHP support, pure GDScript runtime for Godot, and various interpreter and language fixes.
Beat Parameters & Dynamic Beat Calls
Beats can now take parameters, with optional default values, and be invoked in every form the language supports:
``loreline
beat Greet(name, mood = "happy")
$name looks $mood.
beat Main
Greet("Ana", "curious") // runs the beat, then comes back here
-> Farewell("Ana") // transitions with arguments
`
- Beat call statements: calling a beat like Greet("Ana") runs it and returns to the caller, preserving the call stack, like a subroutine.
- Dynamic beat calls: beat(expr, args...) resolves the target beat at runtime, from a beat value or a computed name. The same works for transitions (-> beat(expr, ...)) and choice insertions (+ beat(expr, ...)).
- Dynamic function calls: call(expr, args...) does the same for functions, including inside function code.
- Everything integrates with save/restore, and the LSP provides completion and hints for beat parameters and dynamic calls.
PHP Support
Thanks to being written in Haxe, Loreline can now run on PHP (8.1+). The library is plain PHP, ships with a Composer-friendly layout, and mirrors the API of the other targets: parse(), play(), resume(), custom functions, character and state access.
Look at the PHP integration guide to learn more about it!
Pure GDScript Runtime for Godot
Alongside the native GDExtension, Loreline now ships a pure GDScript version of the runtime, which can be used as a drop-in replacement.
The native GDExtension remains the recommended option where available, since it is meaningfully faster. The pure GDScript build is there for platforms where native libraries are not an option, or for purists who want to use GDScript everywhere to rule them all...
Interpreter Lifetime & Memory Model
- Fixed a race condition where an interpreter could be released too early while the native runtime still needed it, which crashed exported Godot Android builds that worked fine in the editor.
- C++ API (breaking): the advance and select continuations handed to dialogue and choice handlers are now LorelineAdvance and LorelineSelect values, each bound to the interpreter that produced it. Call sites are unchanged (advance(), select(index)), but storing one and answering later, from a UI event for instance, is now safe, including with several interpreters running side by side. The previous function pointers resolved a global interpreter and could drive the wrong story.
- Added a more automated tests to cover this area and make sure it doesn't stop working because of some future change.
Language & Runtime Improvements
- Arrays and key-value objects now cross the host boundary in the C API and the Godot extension, as deep-copy snapshots with a consistent contract.
- UTF-8 performance: targets that are slow at random access into UTF-8 strings, PHP first among them, can now use a code point vector representation, with further UTF-8 optimizations across the board.
- Parser fixes: trailing if` conditions using chained dot access and calls, several save/restore fixes when choice insertions are involved, choice introspection returning the full flattened list mid-collection, and state field values that look like expressions but are not.
- Haxe 4.3.7 toolchain update, plus Haxe 5 compatibility fixes (thanks @mikaib!).
New Contributors
* @mikaib made their first contribution in https://github.com/jeremyfa/loreline/pull/29
Full Changelog: https://github.com/jeremyfa/loreline/compare/v0.9.1...v0.10.0
Loreline v0.9.12026-07-03
Loreline发布v0.9.1,一次以条件解析为主的修复版本。此前以数字或运算符开头的条件(如if 5 > 3、if score - bonus >= 0)只有以标识符开头才能被正确识别,现在都能正常解析;选项if条件中的+号也不再导致解析出错,且尾部条件严格限定为单行,不会再吞掉后续的插值或选项内容。choices()、choicesall()、choicesdisabled()在选项含插值(insertion)时会返回完整的扁平列表,存档读档后依然正确(#28)。无花括号的嵌套对象在反缩进前不再强制要求尾逗号(#27)。C#方向,从Haxe导出时不再依赖-D erase-generics,同时移除了yaml haxelib,改用内置的YAML子集解析器,顺带解决了C#目标的兼容问题。另外修复了自定义函数在JavaScript、Lua、Python上的包装问题(#20)。
Loreline v0.9.02026-06-11
<img width="1200" height="630" alt="og-banner" src="https://github.com/user-attachments/assets/48f7f0f6-89a8-414d-adff-5bd32e873da3" />
Asynchronous Functions
Custom functions exposed to your scripts can now run asynchronously: a function can pause the interpreter and resume it later, once its work is done. This makes it natural to await animations, timers, network calls, or any host-side event from inside a story, without blocking the host update loop. Async functions integrate with save/restore and work across native and Web, including the Godot Web export.
Localization & Translation Workflow
Localization received a major overhaul.
- Standard file formats: translation files can now be generated and read back as PO (gettext), XLIFF, CSV, and TSV, in addition to the native .lor format.
- translate CLI command: loreline translate story.lor --lang fr --format po creates or updates a translation file next to your script. Regenerating is merge-preserving (existing translations are kept, new entries are added, source changes are flagged) and idempotent.
- Localization keys: --auto-ids inserts stable #id markers into the source, --clear removes them.
- Per-file mapping: each file, including imported ones, maps to its own translation entries instead of a single root translation file.
- Consistent API on every target, with AOT-friendly format dispatch and registrable formats via Loreline.translationFormat(...).
Documentation: https://loreline.app/en/docs/
Language Improvements
- Implicit characters from dialogue: in a top-level script without named beats, every dialogue speaker is automatically treated as a character, so barista.name := Alex works out of the box, with no explicit character barista { ... } declaration needed.
- Interpolation at line start: indentation is now correctly stripped when a line begins with an interpolation.
Improvements
- Catchable errors: Loreline.lastError() exposes parse and loadLocale errors without relying on thrown exceptions, which is friendlier for AOT and host integrations.
- Vendored scripting engine: the embedded expression engine is now bundled in-tree as loreline.lorscript, so a host Haxe project that depends on its own copy of hscript no longer conflicts with Loreline.
- Godot: save/restore and async functions now work on the Web export as well as native, bindings were tidied for both the native and JS paths, and the extension's memory model was improved (especially around custom functions). Godot test coverage in CI was expanded.
- C++ API: shared library export fixes, internal cleanup, and an updated test runner.
- LSP: new documentReady notification, a fix for duplicate "From:" entries, and various server improvements.
- currentNodeFilePath is now exported to JS/TS.
- Bug fixes: native GC crash surfaced by async functions, C++ library export across related targets, and localization edge cases (now covered by a dedicated CLI test suite).
Full Changelog: https://github.com/jeremyfa/loreline/compare/v0.8.1...v0.9.0
Loreline v0.8.12026-03-28
v0.8.1为问题修复版本,主要改善使用体验,未带来新功能。
Loreline v0.8.02026-03-27
<img width="1200" height="630" alt="og-banner" src="https://github.com/user-attachments/assets/48f7f0f6-89a8-414d-adff-5bd32e873da3" />
New Platform: Godot Engine
Loreline now ships with a GDExtension for Godot, making it easy to add dialogue systems to any Godot game using GDScript. Native support for macOS, Windows, Linux, iOS, Android, and Web. Includes a ready-to-use sample project.
- Documentation: https://loreline.app/en/docs/using-godot/
C++ on Mobile
Native C++ libraries are now exported for iOS and Android, in addition to the existing Windows, Linux, and macOS support. An SDL3 sample project covers all five platforms as a starting point for engine-less C++ integration.
Language Improvements
- Ternary operator: ${condition ? "yes" : "no"} directly in text
- Single-use choices: prefix with - to auto-disable after selection (equivalent to * in Ink)
- Unquoted assignment: weather := blue sky with clouds without quotes
- Conditions on insertions: + BeatName if condition to conditionally include choice insertions
- Beat visit counting: beat_visits() and BeatName.visits() for introspection
- Smarter quote handling: embedded quotes in unquoted strings are detected automatically, no escaping needed
- Unquoted text in expressions: numbers, true/false/null work as unquoted text in dialogue
Improvements
- AST JSON roundtrip: fromJson() support for lossless AST serialization
- State field access: currentNode() and position info available across all target APIs
- Once-only choices: disable instead of remove, preserving stable choice indices
- Unity: improved export with Unity package support
- Bug fixes: default beat selection with imports, C++ test runner crash on Windows (MSVC), interpolation in embedded quotes, wait() non-blocking behavior with host update loops
Full Changelog: https://github.com/jeremyfa/loreline/compare/v0.7.1...v0.8.0
Loreline v0.7.12026-03-09
Loreline发布v0.7.1,重心在平台导出。新增Java/JVM实现,整套功能已在JVM环境跑通,配套使用文档同步上线,Java开发者不必再绕道C++。同时补了一个SDL3示例工程,基于C++版本的Loreline编写,一次覆盖Mac、Windows、Linux、iOS、Android五个平台,想验证跨平台集成的可以直接拿它当起点。
Loreline v0.7.02026-03-05
v0.7.0把Loreline带到了新的平台:一是提供Java/JVM版实现,可在JVM项目中直接使用,官方文档已给出接入方式;二是新增SDL3示例工程,基于C++版本搭建,覆盖Mac、Windows、Linux、iOS和Android,想做跨平台图形应用的开发者可以拿它当起点。本次没有功能性修复,主要就是补齐平台支持。
Loreline v0.6.12026-02-28
Loreline v0.6.1是首个功能完整、经过充分测试的公开版本。
语言层面新增sequence、cycle、once、pick、shuffle等备选区块,用于生成动态变化的文本;语句支持尾置if条件,条件里可用and、or替代&&、||,布尔运算也放宽为类JS的真值规则。文本与对话可写成多行不加引号的形式,自动处理缩进;另有import模块化组织、带默认参数的外部函数声明、内置字符串/数组/map辅助函数(含plural()管道语法)与本地化翻译。
项目可从Haxe编译到JavaScript/TypeScript、C#(支持AOT)、C++共享库、Python、Lua 5.4及独立loreline命令行,各目标均配完整测试。配套的VS Code扩展提供语法高亮与LSP支持(补全、悬停、诊断、格式化),交互式CLI带彩色输出和打字动画。160余个测试文件覆盖选项、分支、状态与存读档,往返解析校验AST一致性,存档可在各目标间序列化。
修复包括:从insertion恢复时finish()被重复调用、类节点id目标与C#的序列化错误、若干存读档边界情况;stripStringIndent()现在同时兼容制表符与空格。
Loreline v0.6.0预发布2026-02-27
Loreline迎来首个功能完善的公开版本(v0.6.0)。脚本语言新增sequence、cycle、once、pick、shuffle等动态文本备选块,语句可挂末尾if条件,支持多行无引号文本、import模块化组织、带默认参数的外部函数声明以及本地化翻译;条件中and/or可直接替代&&/||,布尔运算也更接近JS的宽松语义。一套Haxe代码可导出为JS/TS、C#(含AOT)、C++共享库、Python、Lua和原生命令行,各目标均配完整测试,存档恢复跨平台通用。配套工具包括VS Code扩展(语法高亮、LSP补全、悬停与格式化)、彩色输出并带打字动画的交互式CLI,以及五个示例工程。测试超160个文件,覆盖分支、选择、状态、导入、函数与存档等场景,兼容LF和CRLF行尾,并有解析—打印往返校验。另修复了从insertion恢复时finish()重复触发、C#序列化异常等多个边界问题。