There are many idle animations that can be used with Oblivion – both from the vanilla game and from various mods, so while I don’t know how to make a brand new animation, I can explain how to create new animation effects using existing material. Obviously, if you are using animations made by others, you need to obtain permission to re-release them with your mod.
An animation as you see it in game, consists of several parts: animation of the skeleton, idle objects and conditions. Animation of the skeleton is the actual animation file that has an extension KF. It determines how the skeleton moves, and is creature-specific (people are creatures in this context). Poses are also animations, but their duration is zero, they are static.
Some animations use objects – for example, sweeping the floor looks better if the character holds a broom. The broom idle object is not the same as the broom item that the character can have in the inventory. Idle objects have their own model files, that is files with extension NIF. I do not know how to convert a regular object into an idle object, although there must be a way. An animation can use any number of objects – it is embedded in the animation data. Usually it is either no objects, or one, or two (one in each hand). For example, taking notes animation uses two objects: a notebook in the left hand and a quill in the right hand. The mystery of creation of idle objects also shrouds how the animation “knows” which object goes in which hand. You can experiment and see what happens.
Many animation movements are actually quite versatile – give the NPC different objects to use with them, and you’ll have a completely different effect. All this can be done using existing animations and idle objects – you are just combining them in a different way.
Animations
The first step is to define your animations with their conditions through the menu Gameplay -> Idle animations. The animations manager window has a tree of various animation groups and subgroups – the order is important. Any time an NPC needs to pick an animation, the system evaluates each animation defined in the manager, starting at the top and expanding each branch depth-first before moving on to the next branch. The first animation that satisfies the currently active conditions, is then selected and played.
The animation manager is not very flexible – you can move animation definitions within a branch but you cannot move them between branches, you have to delete the old one and create a new one in a different place, so plan before you type. Look at the standard animations or the mod where you are taking the animations from, and do something similar. In general, your animations should go under “Unique animations” and be defined as “Special Idle”, unless you are really making an idle that will be played for everyone all the time. Think on that.
Not every entry in the animation manager actually defines an animation. Some are group headings – they have no animation file attached to them. These empty entries will never be picked and serve as headings to group other animations under them. However, it is also possible to use a fully defined animation as a heading – it is then evaluated before the animations gathered under it.
An animation entry has its name, the animation file (KF file) and conditions. These conditions determine whether the animation is selected. If the conditions are not met, the selector moves on to the next animation.
Idle Objects
Idle objects are defined in the Object window under Miscellaneous. Each record links an animation from the animations manager to an idle object model (NIF file). Note that it does not link a KF file to a NIF file, but rather an animation definition from the manager, that is an animation with the conditions attached to it. This way you can reuse the same KF file with different idle objects if the conditions to select that animation are different.
Let me reiterate that the idle object model is not the same as the corresponding item model, this is a completely different NIF file even if it results in something looking exactly the same (for example, a broom).
If an animation uses more than one idle object, you need to make a separate record for each object used, and there is no way to define in which hand or position those objects are used. This is encoded in the models – the KF and the NIF files. So if you link two right-hand objects to the same animation, you will likely get a very strange effect.
Playing an animation
The system plays animations automatically all the time, you don’t need to do anything special to get them to play, other than to satisfy the conditions. However, once an animation has been selected for playing, it won’t stop until the actor re-evaluates its AI package or gets a specific command to pick another animation, even if the conditions for playing the current animation no longer hold.
If you think that no animation is being played while your character is standing still… think again. She moves a little, shuffles her feet, checks her scabbard from time to time… these are all idle animations. Some of them simply have long stretches of nothingness, which is exactly what you want, otherwise everyone would be fidgeting constantly. These idle animations are placed quite low in the animation manager tree however, meaning that any special idles would be selected first, if the right conditions are met.
You can also add player animations into the tree – animations meant for the player character. It is usually best to make them explicit – to include condition GetIsID==player into their definition. They will be then picked up by the system when the other conditions hold and the player is not doing anything else.
For NPCs it is also possible to trigger a change of animation through a script using command PickIdle. It triggers an immediate animation change, although in some cases it allows the current animation to finish its cycle (I am not clear what those cases are). There are also other commands that trigger animations, for example PlayGroup, but I was not successful using them.
For example, if you have an animation that checks for quest variable MyQuest.anim, you could write the following script fragment to trigger an animation change:
scn MyQuestScript
short anim
begin gamemode
;if condition to change idle animation
set anim to 1
PickIdle
;else
set anim to 0 ;don't forget to reset
;endif
end
In this example, all you do in the script is set the variable that is being checked, then call PickIdle, and the system starts evaluating animations from the top of the tree in the animation manager, and hopefully picks what you expect it to pick. Bear in mind that if another animation meets the conditions first, it will be picked instead of what you had in mind, so keep your conditions specific enough to prevent this.
This is also the way to make the player character change animation, although the player does not do it immediately. For example, if you put PickIdle into OnActivate block of an activator, it will not be played straight away, but it will be played eventually. This is because first of all the default animation associated with “activate” command will be played, and the player character will ignore your PickIdle for that reason. I am not entirely sure how to solve this, other than wait ten seconds for your chosen animation to play. Yet there must be a way. Watch this space.
And this is it! Pray to your chosen deity to let it all work as expected, and off you go!