> 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/vm-reference/calls/ames.md).

# npc.ames

```lua
npc.ames(slot, text, x, y, align)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x000F`                          |
| arguments               | 5: Int, Int, Int, Int, Int        |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 2024 calls in 109 of 1114 scripts |

## What it does

The game's own blue message window at a screen position: shows line `text` of the script's text section, sized to it.

## Arguments

### `slot` (Int)

The window slot, 0 to 7.

### `text` (Int)

`0x01000000 + n`, a line of the running script's text section.

### `x` (Int)

### `y` (Int)

Where the window goes on screen.

### `align` (Int)

The anchor / style. Vanilla passes `4` most.

## Timing

Returns at once; [messync](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/messync.md) waits for the player.

## In NPC Kit

**Use `dialog.ames` instead**: the kit's script has no text section (`references/dialog.md`).

## Used with

* [messync](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/messync.md), [amese](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/amese.md).

## Example

The kit form of a vanilla `ames` + `messync`: a narration line with no speaker, in the blue window.

```lua
local crate = [[
The crate is nailed shut, and the nails are new.
Someone wanted very badly to keep it closed up.
]]

talk = function()
    talkOpen();
    npc.lua(function(handle)
        if not dialog.ames.open {
                body = crate,
                queue = true,
                onClose = function() handle.finish() end,
                onError = function() handle.finish() end
            } then
            handle.finish()
        end
    end);
    talkClose();
end,
```

## Pitfalls

* `dialog.ames` sizes itself: passing `w` / `h` to it is refused.
