How to create a custom unit - a complete guide
This step-by-step guide was written by various members (see credits in the end) in various threads, I just tried to gather all the important information in one tutorial and added my thoughts as well. There are still some unknown issue regarding unit creation (like changing an unit's 3D model), but you should be able to make your own custom unit if you follow this guide. If you have problems or suggestions, ideas, post them.
STEP 1. Downloads
- Download the Pack File Manager (PFM) from here.
- Download the Sample Mod Pack from here. (I attached the zip file to this thread, because there were some problems with the attachment in the other thread.) Unpack the zip and put user.empire_script.txt in your C:\Documents and Settings\username\Application Data\The Creative Assembly\Empire\scripts (XP) and place the my_pack.pack in your C:\Program Files\Steam\SteamApps\common\empire total war\data folder (XP). Those who have other mods already installed and understand the use of user.empire_script.txt will know they can edit their own script and rename the mod pack to what is suitable for them. To remove the mod simple delete the script and pack file.
STEP 2. Creating a new unit (Based on The Phenom's excellent guides)
STEP 3. Create the texture of an unit (also "how to change the texture of an unit")
- Open my_pack.pack with the Pack File Manager (It is in the /data folder of within installation directory).
- Choose the unit you want to clone (use as a template), f.e. euro_line_infantry_austria.
- The files you need to edit are:
building_units_allowed
unit_stats_land
unit_to_unit_abilities_junctions
units
units_to_exclusive_faction_permissions
units_to_groupings_military_permissions
- The first file we are going to edit is "building_units_allowed". In order to do this, select and expand the "building_levels_tables" under the "db" directory. After this select "building_units_allowed". You will see a tab. Find your chosen unit to clone. Copy or clone all the lines of the original unit and rename it accordingly. [Select that row and click "Clone Current Row" button (on the top of the file manager). This will copy the selected row to the end of the tab. Now you need to rename the unit from "euro_line_infantry_austria" (in our example) to something else for example "mycustom_unit". To edit the first column you have to disable "Use first column as row header" in the options.] Now, you will need to make them recruitable in advanced military buildings so that you can recruit them as you upgrade your Army Barracks in the Grand Campaign. In order to do this, clone the line of you new custom unit 3 times, so that you have 4 rows with your new unit, starting with:
military_academy
army_board
army_staff_college
army_barracks- Repeat this process (cloning the row of your chosen unit and renaming it.)with the other files as well:
unit_stats_land
unit_to_unit_abilities_junctions
units
units_to_exclusive_faction_permissions
units_to_groupings_military_permissions
The units_to_exclusive_faction_permissions is especially important as it sets which faction has access to your custom unit.- Save the process.
- For "units_to_gov_type_permissions", open the main.pack using Pack File Manager. Expand the "db" directory under the "main.pack". Then select "units_to_gov_type_permissions_table". After that, right click on it and select "Extract Selected..." Import it in the my_pack.pack.
- Giving your unit a screen name. Go to the localisation.loc tab in my_pack.pack and make an entry for your new unit
"units_on_screen_name_my_customunit My Customunit" (for example)
This will give a screen name for your unit, hurray! It should appear in your game now (the fastest way to test this is to look for it in the custom battle setup page).
To make sure the screen name will appear in the game, open up the patch_en.pack and implement these screen name changes there too and save the file.
STEP 4. Add texture to a newly created custom unit (based on MrThibs detailed tutorial here
- Note: for advanced photoshop tips try looking in this thread, in this thread, and in this thread.
- Decide which unit would you like to retexture. Make some research, use google images or other sources to find out the details.
- Check first if the unit you'd like to reskin has been modded and posted here.
- If you don't have the nvidia photoshop plugin installed, download it first from here:
http://developer.nvidia.com/object/p...s_plugins.html- Open up the models.pack file. Go to unitmodels/textures and find the texture(s) you'd like to modify. Select it, right click and choose "Extract selected".
- Open the extracted texture file with photoshop. There are usually 3 files for each unit, a normal, a gloss and a diffuse.
euro_militia_infantry_france_normal.dds
euro_militia_infantry_france_gloss.dds
euro_militia_infantry_france_diffuse.dds
Open the last one (diffuse), don't bother yourself with the other 2 for now. As you can see, each file contains 4 faces and 2 sets of bodies, which the computer randomly generates the units from.
Spoiler Alert, click show to read:
The gloss map tells the game where to splash the factions colour on the texture. Here is the one for light infantry:
Spoiler Alert, click show to read:
If you would like to make changes on the texture covered by the gloss areas, here's what you have to do: rename and use another gloss map which doesnt paint those areas in the faction colour, but has the same tunic layout (for example the euro_artillery_gloss_map.dds). Or paint the whole image black (by switching on the alpha channel first). Or just use a blank picture and save it as the gloss map of that unit.- Repaint/redraw the image as you wish.
- Regarding editing the gloss map
Spoiler Alert, click show to read:- Save the new dds file on the same name as the original file with the following settings:
DDS SETTINGS
DXT5 ARGB 8 bpp | interpolated alpha
Generate MIP maps checked- Repack the modified file by opening my_pack.pack, selecting "my_pack.pack" --> right click --> add file(s) --> select the modified textures (warning again: they should have the same names as the original files) --> save my_pack.pack.
- Open my_pack.pack and go to unit_stats_land_tables, locate the row of your custom unit and change its model name (8th column) to a custom model name.
- Import warscape_animated_lod_tables from patch.pack to your custom pack.This file looks like this
Spoiler Alert, click show to read:- The first column is the line ID, a random number. If you make a new row for your custom unit, just add another random number here.
- The second Column is the path to the 3D mesh (it use the same folder structure path than all the other packed files). Each 3D model comes with four meshes (perhaps not all of them, should be confirmed) that, in my understanding, are relatives to details and graphical options (the weight differences). This is where we’ll be able to add custom 3D meshes when we’ll be able to work with them.
- The third Column must be affecting graphical settings, it's not entirely known yet. It’s associated with the different meshes. (for now just copying the actual settings of similar models is the safest way to go).
- The last Column is the model name found in the other db files (the name of your custom unit).
- So, knowing this, adding my entries is not hard at all (use the filters function to looks through default files to copy what you need):
Spoiler Alert, click show to read:- Copy the path to the meshes from the default file.
- Now, you need to link the texture you want to use with your model, this information is located in the warscape_animated_tables. Import it from patch.pack. This tab is quite clear, the first column is the unit name, the second column is the path, the third column (category) should be left as it is. So clone a similar row and fill in the proper data.
- Now you just have to add your textures to the pack. Be warned that the unit names you gave in the files and the texture file names have to match. For example if your unit name is "bloody_pirates", your texture should be named "bloody_pirates_diffuse.dds". etc.
- Save your work and enjoy.
STEP 5. Modify unit specs
- This is quite easy. Open up my_pack.pack with the PFM.
- Go to unit_stats_land, find your unit (it should be in the end if you followed my guide). Modify the data. Save the pack.
- Make sure the box you're editing isn't active anymore when saving (click somewhere else).
- Look for the rest of the tabs as well, f.e. you can modify the tech abilities of the unit in the unit_to_unit_abilities_junctions tab.
- For modding weapon range, enter: projectiles_table (import it from patch.pak).
STEP 6. Creating a custom unit card
- Modifying an existing card. Go to ui.pack --> units/icons. Find the unit card you want to modify --> select it --> right click --> extract selected --> locate it in the ui/units/icons folder. Modify and save it (its extension should rename .tga). Add the modified file(s) in your custom pack --> save.
- Creating a new unit card. Create an image of your unit, crop it, resize to 66x88 pixels (extension should be .tga). Put it in the data/ui/units/icons folder. Open up your custom pack file, add the new image(s). Now go to db/units_tables/units tab, go to the line of your custom unit, go to the 12th column and enter the name of the card image file (f.e. if your custom unit card was named bloody_pirates.tga, write bloody_pirates here).
STEP 7. How to edit the AOR (Area of Recruitment) of an unit
See the tutorial here.
Credits:
[user]LtChambers[/user] - Pack File Manager
[user]juniroxors[/user] - Sample Mod Pack
[user]HellFell[/user] - for the unit creating breakthrough
[user]The Phenom[/user] - for various unit creating tutorials
[user]MrThib[/user] - adding textures to custom units
[user]warmachine[/user] - unit texturing info
[user]waronmars[/user] - unit texturing info
[user]Tharros[/user] - AOR unit tutorial
Before you rep me, go around and rep these people please, as they are the main contributors of this guide compilation. If you don't rep them, I will e-slap your face, that's a promise.