Wolfenstein: Enemy Territory

Custom Model Depot Yard

Quick tutorial for adding the new animations


This tutorial spots how we can add the new animations to the existing player model system. I will explain that how we add the new animations to the deafault bone system, but you should be able to do this in another bone system.

1. Create animations with biped in max

Well, the first step to climb up is creating animations. To do this, you must create the default biped. For more detail about the default biped, here. This work is pretty fun for me :). If you are doing with the Character studio plugin, it will help you to create smart animations easily. When it is done, write down somewhere about "Name of animation", "First frame number", "Length", "FPS to play this animation" for each animation you got.

You may want to know the default biped figure. Yes I wanted to know that. So I have adjusted the biped to fit the normal player character. You can get it here( figure file ).

2. Skin up the biped roughly.

As for the mds exporting plugin can not reguard the biped mesh itself as the model object, we need to make a skin around the biped. No need to make a detail skin, just dummy. Physique the model with biped roughly, but remember each bone must have a link to 1 vertex at least.

Guess what is the most simple skin that fullfill that state...? Yes, it can be an object with one triangle. Attaching this object to the biped node and assign the vertices to all bones. Whoa, you have made it. Easy?

3. Export mds and cut into mdx

Now we are going to export mds so that we can get the animation data into ET. You can cut mds into mdx by my tool with running mode 2.

4. Configure the .aninc file

What is the .aninc file...? The aninc file is the definition of the mdx to tell ET what animations this mdx holds and those properties, so that ET can handle the series of frames as an animation to play.

The aninc file format is the followings. Each animation requires this description.
<Animation Name> <First Frame Number> <Length of Animation> <Looping> <FPS to play> <Move speed> <Transition> <Revered>

For example, suppose that a mdx holds the 3 types of animation, punch, kick, guard. The punch animation ranges from 0 to 14 frames and it should be played at 30 fps. The kick animation is 15-44 frames at 30 fps and the guard animation is 45-59 frames at 45 fps. The animc for this mdx is the followings:

// animation config for the custom mdx
	punch	0	15	0	30	0	0	0
	kick	15	30	0	30	0	0	0
	guard	45	15	0	45	0	0	0

Save your aninc text as animationname.animc. animationname prefers to be the same as the mdx name animationname.mdx.

5. Put the mdx and aninc into the folder tree

Maybe you already have, if you do not then just make, the folder animations/base/human somewhere on your disk. Put the your mdx and animc file into animations/base/human/.

6. Configure the anim file to include your mdx

Now let's copy the human_base.anim at animations/ to your tree and open it with text editor. Then, add the lines to the line before the last '}' like this:

animgroup
{
	animfile "animations/human/base/body.mdx"
	{
		#include "animations/human/base/body.aninc"
	}
	animfile "animations/human/base/mortar.mdx"
	{
		#include "animations/human/base/mortar.aninc"
	}
	animfile "animations/human/base/akimbo.mdx"
	{
		#include "animations/human/base/akimbo.aninc"
	}
	animfile "animations/human/base/prone_pistol.mdx"
	{
		#include "animations/human/base/prone_pistol.aninc"
	}	
	animfile "animations/human/base/prone_rifle.mdx"
	{
		#include "animations/human/base/prone_rifle.aninc"
	}	
	animfile "animations/human/base/prone_dual_pistols.mdx"
	{
		#include "animations/human/base/prone_dual_pistols.aninc"
	}		
	animfile "animations/human/base/prone_mortar.mdx"
	{
		#include "animations/human/base/prone_mortar.aninc"
	}
	animfile "animations/human/base/binocs.mdx"
	{
		#include "animations/human/base/binocs.aninc"
	}
	animfile "animations/human/base/no_juice.mdx"
	{
		#include "animations/human/base/no_juice.aninc"
	}
	animfile "animations/human/base/swim.mdx"
	{
		#include "animations/human/base/swim.aninc"
	}
	animfile "animations/human/base/youranimation.mdx"
	{
		#include "animations/human/base/youranimation.aninc"
	}
}

Save this text. Therefore we have configured the anim file to let the default human animation have your animations included and enable to use them in ET.

7. Assign the animations to the actions

Okay, almost done... the left thing is assigning those animations to the specific actions. Copy into your tree the script at animations/script/ of pak0.pk3 then open in text editor. Oi, indeed oi, huge text file. This is the script for assigning the animations to actions. Find out and replace the existing animation to yours where you want the model to play, or if you are modding totally and adding new actions then add the script by refering the existing. As you can see, the player animation is separated to 2 parts, torso and legs. Due to this feature we can save the time to build animations of whole body parts. Nice SD :)

8. Done!

Congraturations, you have added(replaced) the new animations. If you have added the new another action, you need to code to activate it. I think this work also fun for coders...isn't it? To see your new animations in ET, just compress the folder animations and rename its extension to pk3(recommand to rename it as its name starts with a letter 'q' or alphabetically later), place it to etmain.