GETTING THE BASIC TOOLS
- Milkshape 3d 1.5.8 BETA 1 (Or newer).
- A converter of files like GOAT (I also recomend downloading Modeler's Toolbox as an alternative converter and for some extra functions).
- IWTE
CHOOSE ONE OF THE FOLLOWING OPTIONS
I STILL DONT HAVE A MOD AND WANT TO EDIT VANILLA ANIMATIONS - Download BareGeomod wich is nothing but a clean/base mod that will be installed in med2 folder, containing the med2 main files so you can create your own mod and then work with animations inside this new "mod" and test them there without messing up the other mods you have installed or the original game folder. PS: Download and install Baregeomod only, you don't need the Geomod Tool.
- Finally, you need to follow this in order to get everything ready to start modding the animations. Warning: When extracting these files, point to the /data folder inside the bare_geomod folder you just installed. It will create a /data/animation folder, go in this animation folder and find "_descr_skeleton.txt", rename it to "descr_skeleton.txt", cut it and paste into the /data folder.
Warning: In case you don't have your med2 files available from unpacking yet, do it, it will unpack all the original game files so you'll have acess to the 3d models associated with the animations you just downloaded. You need to have the files unpacked otherwise you will not find the .mesh models to work on, unless you get them from another source.
THE BASIC LOGIC ON MODDING ANIMATIONS FOR MED2:
One can start a new model and animation from scratch if he has the necessary skills, but this tutorial will guide you by teaching how to actually edit existing animations, either vanilla or custom modded ones.
Editing med2 existing animations is a good way to have your own custom animations in the game because the animation system in med2 has its own rules. Animations in med2 are linked to each other via a text file (descr_skeletons.txt), for example, the start of a "run" animation must fit the end of a "idle" animation, otherwise your soldier animation will be glitched in between these two phases. So you must follow this structure.
But this is actually not really a limitation, as you will see along the tutorial, this editing process gives you so many possibilities in changing the animation freely that it ends up being the same of creating a new one, only that your stuff will already be fit for the engine rules.
Run Med2 vanilla game or mod that contains the unit you want to work in. In custom battle menu, take a look in the units and choose one, memorize its name, close the game. Now go in /text folder and open export_units.txt and look for the name you memorized. You will find something like this:
Copy the text inside the {}, open export_descr_unit.txt in data/ folder and search for the text you just copied, there is the unit you choose in game. As you can see there is a lot of line in this unit entry, look for "soldier" line and you will se something like this example:Code:{memorized_name}Memorized Name
Copy the first value, now open battle_models.modeldb in /data/unit_models and search for it, there is the model of the unit you choose.Code:soldier giant, 7, 0, 1
PS: battle_models.modeldb is not easy to understand, if you want to know more about it, check here.
In battle_models.modeldb, you found something like this example:
The line in blue is the animation set used for the model.Code:14 giant 1 4 61 unit_models/_Units/EN_Peasant_Padded/viking_raiders_lod0.mesh 121 61 unit_models/_Units/EN_Peasant_Padded/viking_raiders_lod1.mesh 900 61 unit_models/_Units/EN_Peasant_Padded/viking_raiders_lod2.mesh 2500 61 unit_models/_Units/EN_Peasant_Padded/viking_raiders_lod3.mesh 6400 2 7 denmark 79 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_denmark.texture 78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_normal.texture 46 unit_sprites/denmark_Viking_Raiders_sprite.spr 5 slave 78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_rebels.texture 78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_normal.texture 44 unit_sprites/slave_Viking_Raiders_sprite.spr 2 7 denmark 60 unit_models/AttachmentSets/Final Danish_denmark_diff.texture 60 unit_models/AttachmentSets/Final Danish_denmark_norm.texture 0 5 slave 58 unit_models/AttachmentSets/Final Danish_slave_diff.texture 58 unit_models/AttachmentSets/Final Danish_slave_norm.texture 0 1 4 None 9 MTW2_Mace 0 2 17 MTW2_Mace_Primary 14 fs_test_shield 0 16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
Go in /data/animations folder and search for the text in blue, you will find a folder with this name. Inside this folder, there is all the animations that compose the animation set for the model.
4 - UNDERSTANDING THE ANIMATIONS SYSTEM OF A MODEL Now that you have already choosen a model and know where its animations are, you need to understand the function of all these animation files and how they relate to each other. The easiest and most intuitive way to do this is to check descr_skeleton.txt, wich is now inside bare_geomod/data folder, open this file and search for the animation set (in our example, MTW2_Mace. You will find an entry for this set, like:
Code:type MTW2_Mace parent MTW2_Knifeman locomotion_table soldier anim default data/animations/MTW2_Mace/MTW2_Mace_basepose.cas ;;;Defend anim eager_defend_hi_slashlr_med data/animations/MTW2_Mace/MTW2_Mace_defend_hi_slashlr.cas -fr -if:3 -evade -prob 10 -evt:data/animations/MTW2_Mace/MTW2_Mace_defend_hi_slashlr.evt anim eager_defend_hi_slashrl_med data/animations/MTW2_Mace/MTW2_Mace_defend_hi_slashrl.cas -fr -if:5 -evade -evt:data/animations/MTW2_Mace/MTW2_Mace_defend_hi_slashrl.evt anim eager_defend_hi_stab_med data/animations/MTW2_Mace/MTW2_Mace_defend_hi_stab.cas -fr -if:3 -evt:data/animations/MTW2_Mace/MTW2_Mace_defend_hi_stab.evt anim eager_defend_lo_slashlr data/animations/MTW2_Mace/MTW2_Mace_defend_lo_slashlr.cas -fr -if:4 -evade -prob 10 -evt:data/animations/MTW2_Mace/MTW2_Mace_defend_lo_slashlr.evt anim eager_defend_lo_slashrl data/animations/MTW2_Mace/MTW2_Mace_defend_lo_slashrl.cas -fr -if:7 -evade -prob 10 -evt:data/animations/MTW2_Mace/MTW2_Mace_defend_lo_slashrl.evt anim eager_defend_lo_stab data/animations/MTW2_Mace/MTW2_Mace_defend_lo_stab.cas -fr -if:4 -evt:data/animations/MTW2_Mace/MTW2_Mace_defend_lo_stab.evt anim eager_defend_mid_slashlr_med data/animations/MTW2_Mace/MTW2_Mace_defend_mid_slashlr.cas -fr -if:4 -evade -prob 10 -evt:data/animations/MTW2_Mace/MTW2_Mace_defend_mid_slashlr.evt anim eager_defend_mid_slashrl_med data/animations/MTW2_Mace/MTW2_Mace_defend_mid_slashrl.cas -fr -if:7 -evade -evt:data/animations/MTW2_Mace/MTW2_Mace_defend_mid_slashrl.evt anim eager_defend_mid_stab_med data/animations/MTW2_Mace/MTW2_Mace_defend_mid_stab.cas -fr -if:4 -evt:data/animations/MTW2_Mace/MTW2_Mace_defend_mid_stab.evt anim eager_defend_overhead_slashlr data/animations/MTW2_Mace/MTW2_Mace_defend_hi_slashlr.cas -fr -if:3 -evade -prob 10 -evt:data/animations/MTW2_Mace/MTW2_Mace_defend_hi_slashlr.evt anim eager_defend_overhead_slashrl data/animations/MTW2_Mace/MTW2_Mace_defend_hi_slashrl.cas -fr -if:5 -evade -evt:data/animations/MTW2_Mace/MTW2_Mace_defend_hi_slashrl.evt anim eager_defend_overhead_stab data/animations/MTW2_Mace/MTW2_Mace_defend_hi_stab.cas -fr -if:4 -evt:data/animations/MTW2_Mace/MTW2_Mace_defend_hi_stab.evt ;;;Reaction anim knockback_from_front data/animations/MTW2_Mace/MTW2_Mace_knockback_from_front.cas -fr -evt:data/animations/MTW2_Mace/MTW2_Mace_knockback_from_front.evt . . .
By reading the information in this entry, you will manage to understand the animation system and how the engine links one animation to another. For example:
In this case, we can see how some animations are intermediary states between two others.Code:anim stand_a_idle data/animations/MTW2_Mace/MTW2_Mace_stand_A_idle.cas . . . anim stand_a_to_ready data/animations/MTW2_Mace/MTW2_Mace_stand_A_to_ready.cas . . . anim ready_to_stand_a data/animations/MTW2_Mace/MTW2_Mace_ready_to_stand_A.cas
Now check this line:. This line points to another animation set entry (in this example, it points to MTW2_Knifeman) and what it does it taking from it any specifc animation that is not present in the "child" set.Code:parent MTW2_Knifeman
For example, lets say the child set called MTW2_Mace has no attack animation, so the engine will look for the attack animation in the parent set called MTW2_Knifeman. And this "family" can be even bigger since MTW2_Knifeman can be the child of yet another parent animation set...
After understanding the system, you will be able to choose the exact animations you want to edit.
Side Note: If you're not creating a complete new animation set but actually only editing an existing one, then you don't need to edit every animation listed in the set. For example, I'm working in a new animation set for Orc creatures for TATW mod, but I'm only editing the run, walk etc. animations, because the standard attack and defense ones seem to fit well for Orcs.
5 - PREPARING THE ANIMATION FILE TO BE EDITED Now, choose one animation you want to edit from the list you found in descr_skeleton.txt (I recomend to start with any "idle" one for they're simple to understand). Copy the name of its .cas file (example: MTW2_Mace_ready_to_stand_A.cas) and search for it inside the data/animations folder, it will find the .cas file you're looking for. Copy this file and paste in any empty folder you want to use as a storeage for your modding activity. Check the entry you previously found in battle_models.modeldb and copy the name of the .mesh model file of the unit you're going to work in. Search for this name in Medieval II Total War/data/unit_models (Not in bare_geomod/data/unit_models because there will be not such a folder there!) and find the .mesh file, copy it and paste in the same folder where you placed the .cas file. Open the GOAT tool you downloaded back there and click the Mesh to Ms3d Convert button to convert the .mesh file to ms3d. (In case you get any problem with the .mseh file, use Mesh Header Fix.rar on it and then proceeed). Now click the animmerge button, it will ask for the .ms3d file and then for the .cas file, choose the .ms3d file you just converted and then the .cas file. The toll will create a new .ms3d model inside the same folder where the other files are, this one is the file where you will finally edit the animation itself.
2 - I WANT TO EDIT EXISTING ANIMATIONS FROM A MOD -In this case you can just jump to the next steps.
6 - EDITING THE ANIMATION Now that you have a file ready to be edited, you can start playing with the animation itself. Editing the animation is not complicated and the complete process is described in the first 5 minutes of this video:
Yes, I'm serious. Almost all you need to know in order to start editing animations for med 2 via milkshape 3d is explained in the most friendly way in the first 5 minutes of this video.
TO BE CONTINUED... This is all I know for now, and I promise that once I lear the rest, I will update this tutorial with more information.