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

# npc.getdefaultradiusw

```lua
npc.getdefaultradiusw()
```

|                         |                                                                                 |
| ----------------------- | ------------------------------------------------------------------------------- |
| id                      | `0x02B1`                                                                        |
| arguments               | 0                                                                               |
| result                  | float: goes to the very next call, or to `npc.lua(npc.getdefaultradiusw(), fn)` |
| in NPC Kit              | yes                                                                             |
| measured from a kit NPC | returns                                                                         |
| vanilla scripts         | 199 calls in 38 of 1114 scripts                                                 |

## What it does

Gives the radius of the NPC's body as its model authors it. Inside a town the model's town value is read instead. A result; `0.0` with no model.

## Result

The radius, a float. Hand it to the call right after, as its first argument: `npc.setradius_221(npc.getdefaultradiusw(), 1.0)`.

## Timing

Returns at once.

## In NPC Kit

* `getdefaultradiusw` and [getdefaultradiusd](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/getdefaultradiusd.md) give the same value: the model holds one radius, not a separate width and depth.
* Vanilla's most used form, `setradius_221(getdefaultradiusw() * 0.8, getdefaultradiusd() * 0.8)` (137 of its 190 calls), is arithmetic on results, which a recorded script can't do. Write the radii as numbers, or use the radius as is.
* Through `npc.lua` (`references/api.md`) a float arrives cut to an integer, so a radius under `1` arrives as `0`: feed it to a call, not to Lua.
* Not tested on a kit NPC.

## Used with

* [bindp2\_d4](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/bindp2_d4.md) first: the radius is the bound model's.
* [setradius\_221](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setradius_221.md): vanilla's only consumer, right after `bindp2_d4` in `init`. Besides the `* 0.8` form: `(getdefaultradiusw(), 1)` (24 calls), `(getdefaultradiusw(), getdefaultradiusw())` (9), a few with a literal depth (`1.5`, `1.2`).
* [setradius](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setradius.md): the same radius on both axes.

## Example

```lua
init = function()
    npc.bindp2_d4(0x006E0019, 4, 3);
    npc.setradius_221(npc.getdefaultradiusw(), 1.0);   -- the model's width, a deeper body
end,
```

## Pitfalls

* Call it after [bindp2\_d4](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/bindp2_d4.md): with no model there is no radius to read, and it gives `0.0`.
