Std Motion Play

Signature

void stdmotionplay(int motionId); //id:0x011d

Description

Plays a standard motion of a character (current script).

The motion differs based on the motion group that was assigned to the character via the Std Motion Read function.

Arguments

Motion Identifier

The identifier of the motion that will be played. Usually, it's OR'ed by 0x01000000 before passing it as an argument as that leads to a list of animation identifiers that are generally used.

However, you can also just pass an animation identifier. In that case, the identifier will be OR'ed by 0x1000 and then again by x << 20 where as x is an unknown state of the current script. The latter is almost always 0, so it should be mostly safe to ignore it.

Depending on the character's motion group, the played animation may be different. For example, one motion group may contain animations for battle (e.g. attack) while another contains animations used in towns (e.g. talking). Some are even completely unique to a character model.

Here is a list of which motion identifiers translate to which animation identifiers and which of those result in which animation.

Motion IdAnimation IdTown Anim NameBattle Anim Name

0x01000000

0x1001

Idle

Idle

0x01000001

0x1001

Idle

Idle

0x01000002

0x101A

Interaction

?

0x01000003

0x1018

Left Leading Legs & Feet Wiggle

Left Foot Leading Walk

0x01000004

0x1019

Right Leading Legs & Feet Wiggle

Right Foot Leading Walk

0x01000005

0x1009

?

Magick Cast Ready

0x01000006

0x100A

?

Magick Cast Start

0x01000007

0x403D

?

Attack

0x01000008

0x101C

?

?

0x01000009

0x301B

Object Touch

Object Touch

0x0100000A

0x1008

?

Death

0x0100000B

0x1049

?

?

0x0100000C

0x3001

?

?

0x0100000D

0x4001

?

?

0x0100000E

0x4036

?

Battle End

0x0100000F

0x4035

?

Battle Start

0x01000010

0x401E

Happy

?

0x01000011

0x401F

Angry

?

0x01000012

0x4020

Sad

?

0x01000013

0x4021

Laugh

?

0x01000014

0x4022

Accept

?

0x01000015

0x4023

Decline

?

0x01000016

0x4024

Conversation

?

0x01000017

0x1011

?

Magick Cast Ready

0x01000018

0x1012

?

Magick Cast Start

0x01000019

0x1013

Lift Left Hand

Magick Cast End

0x0100001A

0x1014

?

Damaged

0x0100001B

0x1015

?

Item

0x0100001C

0x104A

?

Attack

0x0100001D

0x302F

?

?

So if you want a character to play their item use animation, you can either use stdmotionplay(0x0100001B), stdmotionplay(0x15) or stdmotionplay(0x1015).

There are several more animations available, but not all of them are known, so you will have to find them yourself via trial and error.

Notes

Do NOT use a motion identifier outside of the usual range (0x01000000 -> 0x0100001D), as that will result in an animation identifier being retrieved that isn't even in the predefined list (whatever value is next in static memory).

Some motions are looped (e.g. idling) while others aren't (e.g. laughing). So to avoid the character from freezing at the last frame of the animation, it's important to either play a non-looped animation in a loop via your code or play a looped animation like idling after a non-looped one. You can do the latter either manually or automatically via the Set Auto Relax function.

If a character is already playing a motion, it will be cancelled before playing the new one.

Last updated