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

# npc.stdmotionplay\_2c2

```lua
npc.stdmotionplay_2c2(motion, blend)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x02C2`                          |
| arguments               | 2: Int, Float                     |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 4894 calls in 479 of 1114 scripts |

## What it does

Plays one of the standard motions of the NPC's loaded package: the idle, the talking pose, a gesture. It starts the motion and returns.

## Arguments

### `motion` (Int)

`0x01000000 + n`, standard motion `n` (0 to 29) of the package. The ones an NPC uses (names of the town package's actions; full list in `references/staging.md`, Standard motions: the ids `stdmotionplay_2c2` takes):

| `motion`                   | action                |
| -------------------------- | --------------------- |
| `0x01000000`               | idle (`ready`)        |
| `0x01000002`               | talking (`ev_talk_1`) |
| `0x01000003`, `0x01000004` | turn right, turn left |
| `0x01000010`               | talk, happy           |
| `0x01000011`               | talk, angry           |
| `0x01000012`               | talk, sad             |
| `0x01000013`               | laugh                 |
| `0x01000014`, `0x01000015` | yes, no               |
| `0x01000016`               | end of talk           |

Vanilla in talks: `0x01000010` around joy and thanks, `0x01000012` hesitation and reproach, `0x01000016` a question or an offer. A slot the package doesn't fill plays nothing.

### `blend` (Float)

The blend into the new motion. Vanilla: `20` for changes the player watches (1,522 to the idle and 1,374 to the talking pose), `0` when placing the NPC in `init` (523), `6` for `0x0100001B`, a few `15` and `5`. An integer works: the game reads it as a float.

## Timing

Returns at once. Nothing waits for the motion to end: add a [wait](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/wait.md) to let a gesture play before the next call. The motion plays only with the package loaded.

## In NPC Kit

Works on a kit NPC and, in a talk, on another one: `npc.on("id").stdmotionplay_2c2(0x01000010, 20)`.

## Used with

* [stdmotionread](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionread.md) + [stdmotionreadsync](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionreadsync.md): the package it plays from.
* [setkutipakustatus](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setkutipakustatus.md) / [setunazukistatus](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setunazukistatus.md): the mouth and nods on top of the talking pose.
* [motionloop](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/motionloop.md)`(1)` in `init`: loop it.
* `talkOpen` plays `0x01000002`, `talkClose` the idle back (`references/talks.md`).

## Example

```lua
bow = function()
    npc.stdmotionplay_2c2(0x01000014, 20);   -- yes
    npc.wait(40);
    npc.stdmotionplay_2c2(0x01000002, 20);   -- back to the talking pose
end,
```

## Pitfalls

* After a talk, play the idle back, or the NPC stays in its talking pose.
