Skip to content

BGforgeNet/tbaf-example

Repository files navigation

TBAF example

An example/template IE mod project setup for TBAF usage in BGforge MLS

Quickstart

If you want to just try TBAF:

  1. Install Node.js.
  2. Install pnpm.
  3. Clone and install dependencies:
    git clone https://github.com/BGforgeNet/tbaf-example.git
    cd tbaf-example
    pnpm i
  4. Open script.tbaf in VScode.
  5. Use CTLR-R, or "BGforge MLS: compile" command from command menu.
  6. Check out the resulting script.baf.

Usage in existing mods

No all these steps arent's strictly necessary for using TBAF, but you'll save yourself some headache by following them.

  1. Install Node.js.
  2. Install pnpm.
  3. Copy over package.json. Edit name field.
  4. Run pnpm install in mod directory. This installs npm packages specified in package.json.
  5. Install VScode ESlint extension, copy over eslint.config.mjs. That helps VScode to point out some errors in TS code.
  6. Add node_modules/, **/_tmp.tbaf.ts to .gitignore - they don't need to be checked in.
  7. Add .tbaf to .gitattributes as shown, that will allow for proper highlighting on GitHub.
  8. Add **/_tmp.tbaf.ts to VScode files:exclude list. (CTRL-, - files:exclude. Or, see example). This is just a temp file used in transpilation.
  9. Create your first tbaf!