How to add new flags
Note: Latest Gimp versions have the save system changed. Now you can use Save for saving the file in Gimp format. For any other format like png, jpg, dds, tga, etc. you have to use Export. So wherever in this tutorial is mentioned Save As.., you should use Export instead.
Having made many flags for new factions I have improved and changed a lot my previous method so here is an update. I've also added a set of files that will assist you in making the flags.
What we gonna need:
1. Paint.Net
2. Gimp
3. A set of blank flags (Download and unzip: http://www.mediafire.com/download/bs...c/FlagsTut.zip)
In the case of a completely new set of flags we have to make:
1. ui\flags\<faction>
flag_132.tga
flag_animation X 12 (flag_animation 0000.tga - flag_animation0011.tga)
hud_left.tga
hud_right.tga
large.tga
mini_flag.tga
portrait_flags.tga
small.tga
2. rigidmodels\campaignbuildings\campaignagenticons\textures
agent_id_<faction>_diffuse.dds
3. rigidmodels\flags\textures
flags4.dds
naval_id4.dds
4. rigidmodels\naval\textures
ensign_\<faction>_diffuse.dds
Let's start working. First find a good image of your new flag. In my example I'll use Serbia's one.
I. Rectangular shapes
1. Open your new flag with Gimp. In Image\Scale change the size to 512 X 256 pix. Then select Edit\Copy.
2. Open large.tga and Edit\Paste as New layer. Using Scale tool make upper layer slightly smaller so the peripheral golden edge of the bottom layer is visible.
3. In Toolbox click the layer mode and select Multiply (you can try also Grain merge). In this way upper layer will take the texture details of lower layer. Do not worry that it is so dark.
4. Mark lower level and select Colors\levels. Adjust color levels until you are satisfied by the result.
5. Mark upper level and select Layer\Merge down. Save the image as large.tga.
6. Now it is easy to make some of the other flags by changing dimensions of large.tga. Select Image\Scale Size, resize:
a. in 200 X 100 pix. and save it as animation.tga (we shall make later the real animation flags)
b. in 132 X 66 pix. and save it as flag_132.tga.
c. in 44 X 22 pix. and save it as mini_flag.tga.
7. Open large.tga again and Save as... flags4.dds. In Save as dds window choose BC3/DTX5 compression and mark Generate mipmaps.
8. Next flag is actually a small set of flags: ensign_<faction>_diffuse.dds (http://www.twcenter.net/forums/showt...6#post11179086). If you are not familiar with Gimp it is better to proceed to second part of tutorial and then come back to make it. We are gonna need an existing image so pick one from models.pack\rigidmodels\naval\textures, and extract it in your working folder (or use my ensign_diffuse.dds). Best choice should be one that the vertical stripes in the left of the image suit with the colors of our new flag. We also gonna need ensign.dds from my files. Open simultaneously large.tga and ensign.dds. Copy the first in a new layer over the second one. Use Scale tool to match completely, turn upper layer mode to Multiply and adjust the bottom layer's level of color so your image is as you like. Then Merge layers, copy new image and paste it as a new layer over the existing you have ensign_<faction>_diffuse.dds chosen. Move layer to cover the big one and Merge layers. Now edit the vertical stripes if you like. Select every one of them and use the Colors tools to adjust them. In my files there is a golden V to be used, so do not worry if you change the colours of the existing. Save your file as ensign_\<faction>_diffuse.dds using the same settings as in step 7 for Save as dds window.
II. Hud flags
I've prepared one more file to make our life easier with hud flags making and get the better result. Actually I've removed the golden stripe which we shall add later. Let's make Croatia's hud flags:
1. Open left_flag.tga and copy mini_flag.tga (we've made already) on it as a new layer.
2. Mark the upper layer, select Layer\Scale Layer and resize it to 50 X 25 pix.
3. Using Rotate, Perspective and Scale tools to cover completely the lower layer.
4. Adjust Opacity of the upper layer so you can see clearly the lower level but have an idea also where upper one is.
5. With Free Select tool (laso) mark the upper triangle that comes out the lower layer (see image below) and paste it as a new image because we are gonna need it later. Then proceed to cut all the other parts of the upper layer that extend out of lower so the 2 layers fit precisely. Restore Opacity so you can see only upper layer.
6. Copy the triangle and paste it as new layer. Then using Rotate, Perspective and Scale tools (perhaps adjust Opacity also) place it to fit exactly in the upper part of the flag. We want its longer vertical side to fit exactly with the side of the flag where the pole should be. The sorter vertical will fit exactly with the edge of the flag. In this way the longest third side will give us the effect of the long folding that there is there. When you are satisfied Layer\Merge down the triangle layer so you have again only 2 layers.
7. Before proceed we have to save as.. this image because we'll need it latter for hud_right.tga. So save as e.g. base_hud.tga
8. Let's proceed: Mark upper layer and repeat steps 3-5 of part I but save it as base_left.tga.
9. Open left_hud.tga and copy over it base_left.tga we just madeas a new layer. Move it to fit perfectly and the golden stripe is clearly visible. If it is need it stretch it a little.
10. Now you have a perfect hud_left.tga! Save the file.
11. The rest hud flags can be done now much easier using the base_hud.tga we have saved in step II 7. To make the hud_right.tga you can follow 2 ways:
a. The... instant way is to open left_hud.tga and using Flip tool make it with one click. Then save it as right_hud.tga!
b. The... professional way is to make it as we did for left since the original has deferent folds. To do open base_hud.tga do the former trick with Flip tool. Then open right_hud.tga (the unmodded grey one) and repeat steps 8-10.
12. Having the hud_right.tga made so far, you should have made also a base_right.tga as we did in step 8. Using base_left.tga and base_right.tga you can make the portrait_flags.tga following the already known procedure.
13. Last image for this section is the small.tga. It is a very... small flag and I am sure now you know enough how to make it. Have in mind that it is so small that only some details are visible at the end so do not spend much time on that.
III. Animation flags
There are 12 animations flags that are used as 12 frames from the game to give the illusion of a waving flag. We shall work it with Paint. NET using Displace effect. To do that you have to add in Paint.NET the right plug in. To make our life easier I made a couple of displacement mask sets. Since it is a routine work with 12 repeated steps I suggest to prepare your work like this:
Make a new folder and copy in there animation.tga we've made in step I 6a. Copy also in this folder one of the mask sets (total 12 .png files). Last thing, copy in there all the grey animation flags (total 12 .tga files).
Before we proceed we have to prepare animation.tga, so open it with Gimp. Select Resize and resize it to 190 X 95 pix. Select Image again but this time Canvas Size and change size to its original 200 X 100. In this way there will be some space around image. Save the image and close Gimp.
Now open Paint.NET and your working folder side by side (or up and down) on your desktop and start the routine:
1. Drag animation.tga on Paint.NET. Select Effects\Alpha-Displacement and in fill the settings as the image below. In Mask file Browse and link to 0.png file of the mask set you use. Then fill the places with red circles as I have them and press o.k.
Your image should already have waves as you can see in its edges.
2. Drag 0.png over your image as a new layer and then double click on upper layer (in layers window).
Adjust Opacity until wave shadows are just visible. Save file as flag_animation0000.tga overwriting the existing file.
The reason I prefer to have these tga's is first to have the name of the file ready and second to know all the time which file I am working in (trust me is not difficult to be confused).
3. Drag animation.tga again and select Open. Repeat the procedure only now you should work with 1.png mask file to make flag_animation0001.tga. In this way you'll make all 12 animation flags.
IV. Round flags
Game uses 2 round flags, one over agents and the second over ships, both in .dds format. To make them open your new large.tga with Gimp. Using the round tool select a round piece of the flag which you like, copy and paste it as a new image. Resize it to 128 X 128 pix. and save it as agent_id_<faction>_diffuse.dds. Then resize it again in 64 X 64 pix. and save it as naval_id4.dds. Here we've done with all images.
Now you have all images ready you have to place them in pack file. The easiest way is to extract in a folder all the flags of an existing faction from ui. In this way you'll have all folders ready. Then replace flags with your new set and add them it in your mod.pack. I think all these are know. I'll just mention we edit the 2 .tai files.
As you've noticed in rigidmodels\flags\textures there are 2 .tai files which determine which flags the game will use on campaign map. The land flags are in flags1.dds, flags2.dds, and flags3.dds. Instead of messing with vanilla dds you can make a new flag (I 8 step) and name it as flags4.dds. Then open flags.tai (use notepad) and if:
a. change an existing flag find the line with faction and change it in:
flag_<faction>.tga flags4.dds, 4, 2D, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000
The same way you add a fifth flag, sixth and so on.
b. If you want to add a new name add the same line with the new faction name. In this case you have to go in satrtpos.esf and change the name of the flag in FACTIONS record.
The same procedure is for naval flags. Here if the new flag is naval_id4.dds the added line in naval_id.tai is:
naval_ID__<faction>.tga naval_id4.dds, 0, 2D, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000
COMMENTS:
1. About grey flags: the set I've provide is grey but actually the best color it should have depends on the colors of our new flag. If it has light colors then it should be light grey (I do not like white). If it has heavy dark color it should be darker. Most of the flags have several strips with deferent colors, so the ideal should be to have deferent grey color for every stripe.
2. About displacement mask files: The method I've followed is based on this tutorial: http://forums.getpaint.net/index.php?/topic/15442-creating-an-animated-waving-flag/. But making them was not easy at all because there more than 20 frames are used and here only 12. If you want to make your own the tricky part is to make the 12 frames in this way so a potential 13th should look exactly like first one or else you'll get a nasty glitch. The same time the time between frames should be specific so it will not wave too fast or too slow. The easiest way to combine those things is to have symmetric shapes. However it will still cost you hours of tests to adjust them. I hope somebody finds a quicker and easier way so we have a bigger variety.