COG Verbs - Keyframe


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
0Default. Used for fists, detonators, and other modes are usually based on it.
1 Aimed Weapon. This mode is used for guns.
2Saber. This mode is used when the creature is armed with a saber.
3Swimming. This mode is used when the creature has fists or detonators and is in water.
4Gun Swimming. This mode is used when the creature is swimming with a gun.
5Saber 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
stand0
walk1
run2
walk backwards3
strafe left4
strafe right5
small death6
big death7
small fire8
hit9
jumping10
dropping11
falling12
activating13
crouched14
throw15
place on floor16
use force power (bolt)17
big fire18
choke19
leaping20
shufflin' left21
shufflin' right22
crouch backwards23
fidget1 (modes 1 & 2)24
fidget2 (modes 1 & 2)25
none26
none27
none28
none29
none30
none31
none32
fidget133
fidget234
use force power (dest.)35
use force power (choke)36
walk37
throw38
holster weapon39
draw fists40
draw gun41
draw saber42
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.

  • Create:
This page was last modified 22:55, 24 March 2006.   This page has been accessed 174 times.