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

# npc.setwh

```lua
npc.setwh(w, h, flag1, flag2)
```

|                         |                                 |
| ----------------------- | ------------------------------- |
| id                      | `0x0124`                        |
| arguments               | 4: Float, Float, Float, Float   |
| in NPC Kit              | yes                             |
| measured from a kit NPC | returns                         |
| vanilla scripts         | 466 calls in 68 of 1114 scripts |

## What it does

Sizes the NPC's touch area and talk area at once, each as a width and a depth around the NPC: how close the player must come to bump into it and to get the talk prompt. It is `settouchwh` then `settalkwh` in one call.

## Arguments

### `w` (Float)

The touch area's width. A negative value counts as positive.

### `h` (Float)

The touch area's depth.

### `flag1` (Float)

Despite the name, the talk area's width.

### `flag2` (Float)

The talk area's depth.

Vanilla: `(1, 1, 0.8, 0.8)` most (215 of 466), then `(2, 2, 1, 1)`, `(1.5, 1.5, 1.2, 1.2)`, `(2, 2, 0.25, 0.25)`. The sizes are taken times the NPC's [setscale](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setscale.md).

## Timing

Returns at once.

## In NPC Kit

In the editor's Collision group, as touch width, touch depth, talk width, talk depth; vanilla's `1, 1, 0.8, 0.8` is the default.

## Used with

* [setscale](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setscale.md) before it: the sizes are scaled when set.
* [setradius](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setradius.md), [setradius\_221](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setradius_221.md): set the body first. After `setwh` a body change no longer resizes these two areas.
* [talkradius](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/talkradius.md), [touchradius](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/touchradius.md): the round forms.

## Example

A guard behind a counter: the player can talk from further away than it can bump into him.

```lua
init = function()
    npc.setwh(1.0, 1.0, 2.0, 2.0);   -- touch 1 x 1, talk 2 x 2
end,
```

## Pitfalls

* Order matters: a `setradius` after `setwh` keeps these sizes, one before it is overwritten.
