> 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/nowmap.md).

# npc.nowmap

```lua
npc.nowmap()
```

|                         |                                                                    |
| ----------------------- | ------------------------------------------------------------------ |
| id                      | `0x0090`                                                           |
| arguments               | 0                                                                  |
| result                  | Int: goes to the very next call, or to `npc.lua(npc.nowmap(), fn)` |
| in NPC Kit              | yes                                                                |
| measured from a kit NPC | returns                                                            |
| vanilla scripts         | 63695 calls in 582 of 1114 scripts                                 |

## What it does

Gives the id of the map the party is on. A result.

## Result

The location id, as `map` in `npc.add` takes it (`data/locations.csv`).

## Timing

Returns at once.

## In NPC Kit

A kit NPC already lives on one map, so it rarely needs it. To read it in Lua:

```lua
npc.lua(npc.nowmap(), function(handle, map)
    print("on map " .. map)
    handle.finish()
end);
```

Vanilla calls it almost only inside `if` tests, which a recorded script can't hold: branch in Lua.

## Used with

* `npc.lua` (`references/api.md`, `npc.lua` and its handle): where its result can go.

## Example

A helper shared by NPCs on several maps, picking its line by the map it runs on.

```lua
local lines = { [290] = "The bazaar never sleeps.", [132] = "Mind the sand." }

talk = function()
    talkOpen();
    npc.lua(npc.nowmap(), function(handle, map)
        say(handle, lines[map] or "Hello there.")
    end);
    talkClose();
end,
```
