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

# npc.usemapid

```lua
npc.usemapid(state)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x007B`                          |
| arguments               | 1: Int                            |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 8210 calls in 564 of 1114 scripts |

## What it does

Puts the NPC on the map's floor (`1`) or lets it stand and move freely in three dimensions (`0`). Either way the NPC is placed again at its current position right away.

## Arguments

### `state` (Int)

`1` on the floor: placed on the walkmesh and walking along it. `0` free: it stays at exactly the `y` it is given. Vanilla: `0` 6,016 times (scene actors, props), `1` 2,194.

## Timing

Returns at once.

## In NPC Kit

* `usemapid(1)` before `setpos2` and `fetchambient()`: the NPC takes the ground's height.
* A point off the walkmesh under `usemapid(1)` leaves the NPC at the map's origin.
* `usemapid(0)` for chairs, ledges, anything above the floor; give the exact `y` in `setpos2` (`references/staging.md`, Height).

## Used with

* [setpos2](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setpos2.md) after it.
* [fetchambient](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fetchambient.md) / [fetchambient\_4e1](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fetchambient_4e1.md): the light for where it stands; on a seat, `fetchambient_4e1` at a floor point in front.
* [stdmotionvariation](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionvariation.md): seated postures.

## Example

```lua
-- seated on a ledge
npc.usemapid(0);
npc.setpos2(31.2, -8.4, 66.0);
npc.fetchambient_4e1(31.2, -9.0, 66.8);
```
