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

# npc.bonecalcforce

```lua
npc.bonecalcforce(steps)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x0223`                          |
| arguments               | 1: Int                            |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 2810 calls in 213 of 1114 scripts |

## What it does

Settles the NPC's swaying parts (hair, cloth, hanging gear) at once, so they don't swing into place when the NPC appears.

## Arguments

### `steps` (Int)

`-1` resets the sway (973 vanilla calls, every NPC's setup); a positive number runs that many extra steps (`30` in 1,597 calls, then `10`, `50`).

## Timing

Returns at once; the settling happens on the next pose.

## In NPC Kit

`bonecalcforce(-1)` in `init`, after `fetchambient()`, as vanilla.

## Used with

* [setpos2](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setpos2.md), [fetchambient](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fetchambient.md) before it in `init`.

## Example

`-1` in `init` after the lighting, and `30` extra steps when an NPC appears mid-talk so its hair and cloth are already at rest.

```lua
init = function()
    -- ...
    npc.setpos2(29.36, -9.0, 68.65);
    npc.dir(1.676);
    npc.fetchambient();
    npc.bonecalcforce(-1);
    npc.clearhidecomplete();
    npc.show();
    npc.showshadow();
end,

arrive = function()
    local guest = npc.on("npckit_0022")
    guest.setpos2(319.94, 2.02, 42.10);
    guest.bonecalcforce(30);
    guest.show();
    guest.showshadow();
end,
```

## Pitfalls

* Left out, a long-haired or caped NPC swings into place on its first frames.
