TD is a TypeScript DSL that transpiles to WeiDU D dialog files for Infinity Engine games (Baldur's Gate, Icewind Dale, Planescape: Torment). Functions are dialog states, method chains define transitions, and the transpiler handles state collection, text references, and patch operations.
.td files are bundled with esbuild, converted to .d via the transpiler, then compiled by WeiDU.
- You write
.tdfiles using a TypeScript DSL (functions as states, method chains as transitions) - Transpiler converts
.tdto.d, the resulting file is written next to the source - WeiDU compiles the
.dinto the game
Engine builtins (triggers, actions, objects) and text helpers (tra, tlk, obj) are provided by IETS as typed declarations.
- Writing TD -- Comprehensive reference for the dialog API, state/transition model, and gotchas
- LLM Reference -- Compact reference optimized for LLM context windows (copy into your project for AI-assisted coding)