
|
Notes:
In this text, the term keyframe or key will be used to refer to the .key file or the variable that is assigned to it. An animation refers to the keyframe when it is being played on a thing.
How Animations Work
A keyframe is a collection of frames that mark the position of each part of a 3do. When a keyframe is played, the parts of a 3do are moved to their respective positions in first frame, then the second, and so on.
Animations can be combined. The engine looks at the animation's priority and combines the animations giving the higher-priority animations more control over the parts of the model that they use. Puppet files use a low to high priority that ranges from 0 to 5, but using a priority as high as three will block out other animations and any higher will not normally be noticed.
JK will not let you play more than four animations simultaneously, and it reserves at least one of them for animations such as walking, running, standing, etc.
Puppet Major Modes
Puppet files (.pup) contain a listing of keyframes that are played when certain events happen to a thing. A puppet has six (0-5) modes - also called major modes. This table explains their use:
| Mode | Purpose |
|---|---|
| 0 | Default. Used for fists, detonators, and other modes are usually based on it. |
| 1 | Aimed Weapon. This mode is used for guns. |
| 2 | Saber. This mode is used when the creature is armed with a saber. |
| 3 | Swimming. This mode is used when the creature has fists or detonators and is in water. |
| 4 | Gun Swimming. This mode is used when the creature is swimming with a gun. |
| 5 | Saber Swimming. This mode is used when the creature is swimming with a saber. |
A Major Mode redefines the keyframes of the thing for certain actions that need to be changed. Puppets also define the flags and priority of the animation. PlayMode() and FireProjectile() both play a keyframe that is already listed in the puppet.
Each keyframe in the .pup has a number. This is called the submode number. Keyframes are not listed in order of their submode number, but in ky.pup, a comment beside each key lists its number.
Submode Listing
| Action | Submode Number |
|---|---|
| stand | 0 |
| walk | 1 |
| run | 2 |
| walk backwards | 3 |
| strafe left | 4 |
| strafe right | 5 |
| small death | 6 |
| big death | 7 |
| small fire | 8 |
| hit | 9 |
| jumping | 10 |
| dropping | 11 |
| falling | 12 |
| activating | 13 |
| crouched | 14 |
| throw | 15 |
| place on floor | 16 |
| use force power (bolt) | 17 |
| big fire | 18 |
| choke | 19 |
| leaping | 20 |
| shufflin' left | 21 |
| shufflin' right | 22 |
| crouch backwards | 23 |
| fidget1 (modes 1 & 2) | 24 |
| fidget2 (modes 1 & 2) | 25 |
| none | 26 |
| none | 27 |
| none | 28 |
| none | 29 |
| none | 30 |
| none | 31 |
| none | 32 |
| fidget1 | 33 |
| fidget2 | 34 |
| use force power (dest.) | 35 |
| use force power (choke) | 36 |
| walk | 37 |
| throw | 38 |
| holster weapon | 39 |
| draw fists | 40 |
| draw gun | 41 |
| draw saber | 42 |
| All actions are for Major Mode 0 unless otherwise listed. | |
Keyframe Symbols
You cannot directly reference a keyframe file when you need to play it. Keyframes, like ai and model files, must be loaded and assigned to a variable first. Then use the variable where you need a reference to the file. So have something like this in the symbols section:
keyframe yourName=yourKey.key local
And then in the code section, use your variable:
PlayKey(player, yourName, 1, 0x38);
You can also use LoadKeyframe() to return a keyframe reference.