> For the complete documentation index, see [llms.txt](https://fehdead.gitbook.io/npc-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fehdead.gitbook.io/npc-kit/readme.md).

# NPC Kit

![](https://3881308715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBE6a3fWKKXWQg8lv0u6v%2Fuploads%2F8JJHdRAZ2cEdzLWDaCDX%2Fhero.avif?alt=media\&token=e9a8ab03-7ca3-4fcd-b075-b37bee0056b2)

**NPC Kit lets a Lua mod add new NPCs to any map: where they stand, how they move, what they say.**

### What does it do?

In the vanilla game, every NPC comes from the map's event script (`.ebp`). Adding one means editing and shipping that file, and two mods that edit the same `.ebp` can't both be installed: the last one wins.

NPC Kit adds NPCs without touching any `.ebp`. You write the NPC's script call by call in Lua, as in an EBP, and the game runs it in its own interpreter. Mods that only edited an `.ebp` to add NPCs no longer conflict: each one adds its own, on the same map. With it you can:

* **Place a new NPC on any map**, with any model the game has.
* **Make it move**: idle motions, turns, walks.
* **Make it talk**: the game's own talk button, name tag and target ring, with the dialogs of the Lua Loader's dialog capability.
* **Run your own Lua in the middle of a talk**, to branch, keep state, or open a window.
* **Play fixed camera shots** or move the field camera during a talk.
* **Give it another model's motions**, for a model that ships none of its own.

No `.ebp` edit, no borrowed actor, no shipped file.

{% hint style="info" %}
**Requirements** NPC Kit needs the [FF12 Lua Loader](https://fehdead.gitbook.io/ffxii-modding-guide/modding/resources/ff12-lua-loader-documentation) 2.0.1 or newer.
{% endhint %}

{% hint style="success" %}
**You write the NPC, NPC Kit makes it possible.** The whole routine of your NPC is Lua you write: NPC Kit doesn't write code for you. It makes the implementation easy, and [NPC Kit Editor](https://fehdead.gitbook.io/npc-kit/editor.md) helps you find the right calls and values while you work.
{% endhint %}

{% hint style="info" %}
**NPC Kit is used together with the Lua Loader's dialog capability.** The kit makes the NPC and its talk; the windows the NPC speaks in come from `dialog.*` ([Lua Loader documentation](https://gitlab.com/ff12-module-loader/modules/ff12-lua-loader-docs)).
{% endhint %}

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><strong>About NPC Kit</strong></td><td>What the kit is for, how it works, and what the game gives it for free.</td><td><a href="https://fehdead.gitbook.io/npc-kit/about.md">About NPC Kit</a></td><td><a href="https://3881308715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBE6a3fWKKXWQg8lv0u6v%2Fuploads%2Fgit-blob-f233239809163e18088e4b8d8a07e243d0b5574c%2Fframework.svg?alt=media">framework.svg</a></td></tr><tr><td><strong>NPC Kit API</strong></td><td>Everything a mod writes to declare an NPC, with examples.</td><td><a href="https://fehdead.gitbook.io/npc-kit/api.md">NPC Kit API</a></td><td><a href="https://3881308715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBE6a3fWKKXWQg8lv0u6v%2Fuploads%2Fgit-blob-52f5c0f6c6f664190ec1978becc79fafa3721b9f%2Fcode.svg?alt=media">code.svg</a></td></tr><tr><td><strong>Starting Template</strong></td><td>A whole NPC in one file: a Seeq in the Muthru Bazaar who says hello.</td><td><a href="https://fehdead.gitbook.io/npc-kit/api/starting-template.md">Starting Template</a></td><td><a href="https://3881308715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBE6a3fWKKXWQg8lv0u6v%2Fuploads%2Fgit-blob-52f5c0f6c6f664190ec1978becc79fafa3721b9f%2Fcode.svg?alt=media">code.svg</a></td></tr><tr><td><strong>Limits</strong></td><td>What the kit can't do, and the numbers to stay under.</td><td><a href="https://fehdead.gitbook.io/npc-kit/api/limits.md">Limits</a></td><td><a href="https://3881308715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBE6a3fWKKXWQg8lv0u6v%2Fuploads%2Fgit-blob-464d3d9e7ecfabbf4053b22b4492a5c07a30de07%2Fguide.svg?alt=media">guide.svg</a></td></tr><tr><td><strong>NPC Kit Editor</strong></td><td>A helper for the creator: see models, place and turn NPCs, copy the calls. Never shipped.</td><td><a href="https://fehdead.gitbook.io/npc-kit/editor.md">NPC Kit Editor</a></td><td><a href="https://3881308715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBE6a3fWKKXWQg8lv0u6v%2Fuploads%2Fgit-blob-f233239809163e18088e4b8d8a07e243d0b5574c%2Fframework.svg?alt=media">framework.svg</a></td></tr><tr><td><strong>References</strong></td><td>VM calls, models, text tags and items, to look up while you write.</td><td><a href="https://fehdead.gitbook.io/npc-kit/references.md">References</a></td><td><a href="https://3881308715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBE6a3fWKKXWQg8lv0u6v%2Fuploads%2Fgit-blob-464d3d9e7ecfabbf4053b22b4492a5c07a30de07%2Fguide.svg?alt=media">guide.svg</a></td></tr></tbody></table>
