Motion Read

Signature

void motionread(int motionGroupId); //id:0x00a2

Description

Loads a motion group from the motion file (.mot) of the current location.

A motion group is a collection of 1 or more motions. This can be a motion for sitting, laughing, and many more. Generally, every model has 1 or more motion groups.

The motions played via this function are mostly exclusive to specific characters in the current location.

After a motion group has been loaded once, its motions can be played multiple times with functions like Motion Play.

Once a motion group is no longer needed, it should be disposed of with the Motion Dispose function.

Augments

Motion Group Identifier

The motion group of the current location.

Notes

How to find a motion and which group it belongs to

Generally, it's impossible to tell which motion groups in a location have which motions and for which character models they are. So at worst, you have to try them all out one by one. However, there is a way to check how many motions groups there are in a location and what they roughly do.

For that, you have to do the following:

  1. Search for your current location in this spreadsheet (e.g. Dalmasca Estersand - Passage Entrance).

  2. Note the name of the ebp file it uses (e.g. dst_a05).

  3. Extract the ps2data\plan_master\us\plan_map\dst_a\dst_a05\global\dst_a05.mot via the VBF Browser (us directory differs depending on your game language).

  4. Open it via any HEX Editor (e.g. HxD, 010 Editor, ...)

To find the amount of motion group a location has, search for the text @FRP or the array of bytes 40 46 52 50. In this case you will find 2 occurrences, which equals 2 motion groups.

To find the amount of motions a motion group has, search for the text @FMN or array of bytes 40 46 4D 4E. In this case, you will find that the first motion group has 6 motions while the second one only has 1.

To know which motion group a motion belongs to, simply check between which addresses it is. For example, the motion at offset 0x11C0 (mn_0, talk_sad) is after the first motion group at offset 0x0800, but before the second motion group at offset 0x01E800. Therefore it's part of the first motion group.

As you read just now, each motion comes with a unique name and description such as mn_0 and talk_sad, or mn_5 and laugh. The name usually contains the motion identifier (e.g. mn_5 -> 5) while the descriptions gives you a rough idea of what it does (e.g. laugh).

There is no easy way to know for which model a motion is created. So if it looks weird when you use it with one model, you will know that it wasn't made for it.

Example

Make the Seeq in Dalmasca Estersand - Passage Entrance laugh

motionread(0) //0 since the motion "mn_5" ("laugh") is part of the first motion group.
motionreadsync() //wait until the motion group is loaded.
motionplay(0x10000005); //motion id (5) is OR'ed by 0x10000000

Last updated