The goal of this tutorial is to explain how you can easily take a part of a unit from one faction, and use it for a unit from another faction.
The tools used for that are PFM and Gimp + the DDS plugin.
I'm speaking here only of the method to get the proper parts. You can also refer to l'Aigle tutorial about saving dds files with no quality loss.
I suppose you know how to create packs, and I won't explain this part here.
Part 1: Identifying what we need : a look at the variants and the textures
Let's suppose we want to create a new Austrian unit, with the standard uniform (let say Austrian line infantry), but using the Tartleton helmet (same as the British horse artillery).
First, we use PFM to open the data.pack, and have a look at the uniform table.
From here, we see that aur Austrian unit is using the Austria_Inf_Austrian_German_Fusiliers variants. And of course, if we look at British horse artillery, we'd get Britain_Art_Horse_British_6_lber
Now, we open variantmodels.pack, and we look at the unit folder. We have two things to do here.
First, we can find the variant of Austria_Inf_Austrian_German_Fusiliers, with for instance austria_inf_line_austrian_german_fusiliers.soldier.unit_variant.
Since we want to create a new uniform based mostly on that, we extract the soldier, officer, musician and flagbearer. To start with, we suppose we will try to use the same Austria texture.
So we can just rename the export unit_variant to austria_MyNewUnit.soldier.unit_variant. And then we import it into our mod. It is important to keep the start as austria_, since that is what indicates to the engine in what atlas it should look.
This is based on the austria texture, so now I look at the units/atlas folder, and have a look at the autria_diffuse.dds
This file contains all the texture for Austria. But we can see it doesn't contain a texture for the British helmet we want.
But if we look at Britain_diffuse.dds, it contains our helmet. Let's have a look at the British variant.
britain_art_horse_british_6_lber.soldier.unit_variant. More particularily at the hat.
Each part requires two elements: the mesh, and the texture.
The mexh (i.e. the shape of the part) is not a problem. It is shared between every faction. Se we can copy the line from the british variant VariantModels/UnitParts/Euro/Hats/Tartleton/mesh and past it in the mesh of the hat of our new variant (to replace VariantModels/UnitParts/Euro/Hats/Shako/Base_Shako/mesh
If we try to start now it will not work. Because in the new unit variant, the texture is still VariantModels/UnitParts/Euro/Hats/Shako/Austrian_Basic_Shako/texture, and this texture is not adapted to this mesh: the unit would look very weird.
So we also need to use the texture from the british unit. But we cannot jsut copy the texture entry from the variant, because it references an image which is NOT in the austria_diffuse.dds (and the other files: normal, gloss, colour mask...).
So before we go further, we need to take the part of the britian_diffuse.dds corresponding to the tartleton, and copy it in our austria_diffuse so it is available.
First problem here is: how can know exactly what part to use?
Well, looking at the british artillery variant, the texture for the hat shows VariantModels/UnitParts/Euro/Hats/Tartleton/tex/texture
This is actually a reference to exact coordinate, and we can find it in the britain_diffuse.atlas file. So let's have a look at this in PFM. First, at the top of PFM, check "Toggle coordinate as Pixel Units"
Find the line for our unit part, and look to the right for the size and the coordinate. Width and height are 384x384. And the X1 Y1 show 1152 2944. Note these values.
Part 2: Copying and pasting with gimp
We can now extract britain_diffuse.dds, and open it with gimp.
We need to copy exactly the part we need. We can try to it graphically, but it's far from easy as we need to very precise. So we'll use a better way.
Use the rectangular selection tool, and select any part of the image (it doesn't matter where). Then, in the toolbox, enter the exact size and coordinate (taking from the atlas). And now, you can see the selection rectangle: the selection is exactly our helmet texture (note: you cannot enter the exact size and coordinate if you don't select a part of the image graphically first, but what you select graphically doesn't matter, you will modify it with exact value just after).
Now we can copy the texture. We need to paste it in the Austrian texture. We have several solutions for that. The first one is to replace a part that we don't want to use anymore. For example, let say we don't want to use the casquet (the Austrian small hat from the Italy campaign) for any unit.
So we look in the Austrian_diffuse.atlas, and we find that for the casquet, the coordinates are 1920 and 1024. The size is still 384x384.
So now, we open the austrian_atlas.dds with gimp, and we use the method desribed above with the rectangular selection to select this part exactly
The last step is simple:
copy the image from the britain_diffuse.dds with CTRL+C (the selection should be exactly the tartleton texture) and paste in the austria_diffuse.dds with CTRL+V. Since the current selection in austria_diffuse is exactly the casquet, the image will be pasted exactly over it!
You can now save (check l'Aigle tutorial to avoid compression loss), and import austria_diffuse.dds in your mod.
Part 3: Using the new texture
This part is simple. We now have a modified austria_diffuse, were the casquet texture as been replaced by the tartleton texture. However, we have just replaced the image. In the austria_diffuse.atlas, the name is still VariantModels/UnitParts/Euro/Hats/Casquet/Infantry/texture
So now, go to austria_MyNewUnit.soldier.unit_variant , edit the hat part, and in the texture, use VariantModels/UnitParts/Euro/Hats/Casquet/Infantry/texture.
We now have a new variant, using the mesh of the tartleton, but also the texture (except it replaces the casquet texture, so it's name casquet in the variant.
Part 4: Finalizing the new unit
To finish the unit:
- Use the same method with the gloss, normal and colour mask. We need to copy the image from the tartleton over the image of the casquet in every austria_XXXX.dds.
- In the uniform table, add austria_MyNewUnit uniform to the new unit.