Would you like to create a new unit? Do you follow tutorials only to get stuck and wonder what has gone wrong? Here are the results of my limited experience in this area.
Step One: Create a mod pack file
I used: Pack File Manager 1.5.9 (it is for Napoleon: Total War but it works for Empire Total War as well) and Erasmus777's instructions on how to make a mod.
To make a mod which would create a new unit (a clone of a Line Infantry unit with some edited statistics) I made a mod file which included the following database tables:-
building_units_allowed_tables
unit_required_technology_junctions_tables
unit_stats_land (if you want to make new ships, you will need unit_stats_naval)
unit_to_unit_abilities_junctions_tables
units_tables
units_to_exclusive_factions_permissions_tables
I extracted these tables from a copy of the game's patch2.pack file, which you can find in C:/ProgramFiles(x86)/Steam/steamapps/common/Empire Total War/data; I extract files from copies of the game's files, not from the original files, in case I accidentally mess up the original game files.) Pack File Manager (PFM) crashed when I extracted unit_stats_land. I clicked 'continue' and was able to save the file. I found that I was still able to edit the mod file using PFM 1.5.3, as I explain in Step Two below.
When I extracted the database tables, I saved a copy of that mod file (so that I can use this to create other mod packs in future). I then deleted every row except for the rows relating to the unit which I was cloning to create a new unit - in this case, euro_line_infantry.
I then renamed the database tables, e.g. units became minor_units (I chose 'minor' simply because I am experimenting with creating a mod that will add units to the rosters of minor factions). The renamed database tables looked like this:-
Step Two: edit the database tables
So far, I have cloned a unit, euro_line_infantry. Now it is time to create a new unit.
I did this using Pack File Manager 1.5.3, because PFM 1.5.9 (which I used for the previous step) crashed when I tried to edit the unit_stats_land table. If you would like to try PFM 1.5.3, it is available as a component of husserlTW's EasyDB resource. To use PFM 1.5.3, simply install EasyDB, open EasyDB and select 'PFM' from the options along the top - PFM 1.5.3 will open in a separate window.
This is the step where you need to edit the database entries such as unit_stats_land (e.g. to adjust your unit's accuracy, reloading, morale and melee fighting scores) and units table (e.g. to adjust the cost of the unit, the region where it can be recruited and the unit card which the game will use. I look at the units tables in copies of the vanilla game's patch.pack files to see what entries are possible for the region of recruitment, unit cards etc. (I have not learned how to create unit cards or unit skins - you would need a different set of tutorials and software for that.)
The other essential things to do are:-
- Rename your cloned unit. To create my unit, I renamed euro_line_infantry to euro_line_infantry_old (I'm creating a unit which will be called the Old Guard Regiment). You need to do this in every entry relating to your unit in all of the database tables in your mod file (for an example, see the image above - in the right hand column, you can see that euro_line_infantry_old can be recruited in all types of military barracks in large cities as well as the military buildings in smaller cities.)
- Decide how your mod file will be activated. Will you use a user script file (if so, you will need to right-click on the mod in the left panel, select 'Change Pack Type' and set it to Mod)? Or will you make this a 'movie' type mod so that it activates automatically without the need for a user script file (of so, you will need to right-click on the mod in the left panel, select 'Change Pack Type' and set it to Movie).
Step Three: name your unit and (optional) add a description
For this step, I used Pack File Manager 1.5.9 to create a new mod pack (using the same instructions as in step one, above). Into this mod pack, I extracted the 'localisation' database table from patch_en.pack ('en' stands for English, because I play the English-language version of the game; if you play a different version then you will have a file with a slightly different name).
I did not change the name of the database table.
I tried using four different versions of Pack File Manager to edit this mod file without success - it crashed every time. Then I used Pack File Manager 1.9 and it worked. Another option would be to follow the advice of Quintus Hortensius Hortalus here (use option "Export TSV" choose a location for your loc and then edit the file with the windows text editor. If you made the changes import your updated file and save).
To create a name for my new unit in Pack File Manager 1.9, I first clicked 'Tag' (above the database table entries) to sort them in alphabetical order, which made it easier to find the existing entries which indicate what units are called and which text appears in the unit card.
To create a name for my unit, I added a line with an entry on in the left-hand column, units_on_screen_name_name_euro_line_infantry_old (obviously, you would replace the part in the bold type with your unit) and, in the right-hand column, Old Guard Regiment (the name of my unit).
It should also be possible to add 'long' and 'short' descriptions for a unit, by adding similar entries with the following text on the left:
unit_description_texts_description_text_euro_line_infantry_old
unit_description_texts_long_description_text_euro_line_infantry_old
Obviously, you would need to replace euro_line_infantry_old with your unit in the left hand column and type the description of your unit in the right hand column.
Would you like to see an example of a working mod?
You can download, below, four zipped files which provide a demonstration:-
- Minor 1a.pack is the mod pack at an early stage of development. The dabatase files listed above have been extracted into the mod pack but the rows which I do not intend to use have not been deleted. This is a resource for new modders who would like help with making a mod which creates new units. It is not a mod pack.
- The other files are the components of a simple mini-mod which activates a new unit for minor factions, the Old Guard Regiment.
This unit is a clone of Line Infantry with a few simple changes (reloading score of 30 rather than 25, morale increased from 7 to 9, slightly more expensive recruitment and upkeep and minor factions can recruit only one of this unit). These changes were made by editing the unit_stats_land and units_tables. This is just a simple demonstration of a basic mod which adds a new unit. To make a proper, well-developed mod, it would be helpful to add a unit description (this unit still uses the standard Line Infantry description) and to use a different unit card (this unit still uses the standard Line Infantry unit card).
How to use the demonstration mod
To use this mod, you would need to:-
- Download and unzip it (it was zipped using the free software 7zip, so you could download the same software to unzip it, if you do not already have suitable software). Ignore Minors 1a.pack, as it is a resources for modders, not a component of the demonstration mod.
- Copy Minors 1i.pack into your C:/ProgramFiles(x86)/Steam/steamapps/common/empire total war/data folder (that is the path on this Windows 7 PC; if your computer is different, then the path may vary). This is a 'mod' pack, so it needs to be activated using the user script file, which I explain below.
- Copy the user.empire_script.text file into your C:/Users/[your user name]/AppData/Roaming/The Creative Assembly/Empire (if you already use a user script file to activate mods, simply add a semicolon after the previous entry and, on a new line, add the text in this user script file: mod "Minors 1i.pack")
- Copy the Minors3_en.pack file into your C:/ProgramFiles(x86)/Steam/steamapps/common/empire total war/data folder. (This is a 'movie' type mod, so it does not need to be activated by a user script file)
To uninstall, simply cut and paste the mod files somewhere else. Don't forget to remove the user.empire_script file, or to edit it to remove the line which refers to the Minors 1i.pack. (If you have a user script file which refers to a mod file which is not in your
C:/ProgramFiles(x86)/Steam/steamapps/common/empire total war/data folder then the game will crash when launching.)
What the demonstration mod does
The demonstration mod allows minor factions to recruit one Old Guard Regiment. To do this, they must:-
- Research the 'Carbines' technology
- Have a military barracks in Europe
This demonstration mod does not unlock minor factions for the player - you would need to use a separate mod to do that, such as All Factions Unlocked No FoW or Empire Total Factions.
Permission
Modders are welcome to use these mod files to create your own mods (or components for your own mods).
Known issues
As you can see from the image above, I managed to create a new unit using the steps above. Unfortunately, when I followed the same steps in my next attempt to make a mod which creates a new unit, the game crashed when launching every time. I found (and corrected) a typing error in one of the database tables, but the game continued to crash when launching until I deleted the mod files. I do not know how to fix this problem. So these steps are not guaranteed to work. If anyone can add suggestions or advice on what to do, and what not to do, when creating new units, please post your comments on this thread.
If modding causes problems with your game
In my experience modding sometimes causes unexpected side effects and crashes. For example, you might experience saved game corruption or what I call the '1703 bug' (where every new campaign crashes at the end of 1703). When such problems happen, sometimes you can fix them simply by taking out your mod file and going back to an earlier version. But sometimes that doesn't work. Some people have reported that even reinstalling the game did not fix problems. If you have gone back to an earlier version of a mod and a problem remains, here is a solution which works for me:
- Find your scripts folder. On my Windows 7 PC, this is in: C:/Users/[my user name]/AppData/Roaming/The Creative Assembly/Empire/scripts
- Make a copy of the preferences_empire_script.txt file and put that copy somewhere else in case you ever want to put it back (I never have, but it seems wise in principle to copy a file you are about to delete)
- Delete the preferences_empire_script.txt file
- Start the game normally; you don't need to replace the preferences_empire_script.txt file beforehand, because the game should automatically detect that you don't have a preferences file and should create a new one for you.
- Select your preferred options (e.g. no advice in battles)
- If you had previously edited your the preferences_empire_script.txt file to implement mods such as the developers battle camera
and Bran Mac Born's Preferences Script Setting for better battle AI and You can't play in high? Here is solution, then you will need to (a) edit the preferences script to add those settings and then (b) right-click on the preferences_empire_script.txt file and select 'read only'.
(Reinstalling the game appears to cause the game to replace all of the files in the folder C:/ProgramFiles(x86)/Steam/steamapps/common/empire total war - however, if the problem is located in the other folder which the game uses, C:/Users/[my user name]/AppData/Roaming/The Creative Assembly/Empire, then re-installing the game won't fix it. I have a Windows 7 PC - if your computer is different, the paths to the folders may vary.)
*** The mod resource pack Minors 1a.pack, below, has been edited so that the unit_stats_land table does not include units from the DLC packs (since, obviously, we are not supposed to provide mod files which enable people to use the DLC units without buying them) ***
My other basic guides to modding ETW are listed here.