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

# npc.stdmotionvariation

```lua
npc.stdmotionvariation(variation)
```

|                         |                                |
| ----------------------- | ------------------------------ |
| id                      | `0x01AA`                       |
| arguments               | 1: Int                         |
| in NPC Kit              | yes                            |
| measured from a kit NPC | returns                        |
| vanilla scripts         | 61 calls in 29 of 1114 scripts |

## What it does

Picks which variation of its motions the NPC plays. A motion package can hold more than one posture under the same motions; vanilla uses it to sit NPCs down with package 18.

## Arguments

### `variation` (Int)

The variation, from 0. How many a package has is in the package itself. Vanilla: `1` (44 calls), `2` (10), `0` (7).

## Timing

Returns at once; the next motion played uses the variation.

## In NPC Kit

Works on a kit NPC. The sitting sequence vanilla uses:

```lua
npc.stdmotionread(18);
npc.stdmotionreadsync();
npc.stdmotionvariation(1);               -- or 2
npc.stdmotionplay_2c2(0x01000000, 0);
```

On a chair or a ledge add `usemapid(0)` and the seat's `y`, and `fetchambient_4e1` at a point in front of the NPC (`references/staging.md`, Sitting and other postures).

## Used with

* [stdmotionread](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionread.md)`(18)` and [stdmotionreadsync](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionreadsync.md) before it.
* [stdmotionplay\_2c2](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionplay_2c2.md) after it.
* [usemapid](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/usemapid.md)`(0)`, [fetchambient\_4e1](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fetchambient_4e1.md): seats above the floor.

## Pitfalls

* A variation the package lacks: what it plays is not confirmed here; try it in the game.
