Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 1.04 KB

File metadata and controls

18 lines (11 loc) · 1.04 KB

TBAF -- TypeScript to BAF Transpiler

TBAF is a TypeScript subset that transpiles to BAF (Infinity Engine AI scripts). It lets you use TypeScript abstractions -- variables, functions, loops, enums -- that are fully resolved at compile time into flat IF/THEN/END blocks. BAF has no runtime variables or control flow; TBAF provides those at compile time.

.tbaf files are bundled with esbuild, converted to .baf via the transpiler, then compiled by WeiDU.

How It Works

  1. You write .tbaf files using a subset of TypeScript
  2. Transpiler converts .tbaf to .baf, the resulting file is written next to the source
  3. WeiDU compiles the .baf into the game

Engine builtins (triggers, actions, objects) are provided by IETS as typed declarations.

Guides

  • Writing TBAF -- Comprehensive reference for all supported syntax, condition algebra, and gotchas
  • LLM Reference -- Compact reference optimized for LLM context windows (copy into your project for AI-assisted coding)