This tutorial will show you how to add building slots to a city, so that the city will get larger and enable the building of an additional type of building (e.g. admiralty). This will require quite a lot of steps, so be patient and follow step by step.
NOTE: The following Tutorial is based on changing a City into having 5 buildings in it. To change the city into having any other building number, will require almost the same steps, except the change of coordinates, as the process differs from number to number.
First you will need the latest Esf Editor
In this tutorial I will add an admiralty to Athens (I tried this for my mod purposes with Greece ETW Playable & Retexture mod)
So let's begin:
1) First backup the following files that we are going to edit:
· startpos.esf (C:\Program Files\Steam\steamapps\common\empire total war\data\campaigns\main)
· regions.esf (C:\Program Files\Steam\steamapps\common\empire total war\data\campaign_maps\global_map)
2) Now open startpos.esf with esf editor. First, we need to clone an existing REGION_SLOT_ARRAY of any settlement building (i.e. located inside the city).
This will be found under this path:
CAMPAIGN_STARTPOS\CAMPAIGN_ENV\CAMPAIGN_MODEL\WORLD\REGION_MANAGER\REGIONS_ARRAY\REGIONS_ARRAY\REGION(Greece)\REGION_SLOT_MANAGER\REGION_SLOT_ARRAY right click on an existing settlement building slot and click CLONE.
3) After cloning, a new higlighted green REGION_SLOT_ARRAY should appear. Now we need to click on the green REGION_SLOT, and change the 1st entry on the right (the Building ID, type Uint), and rewrite a random one, but be sure to keep it a 9-digit number! (the chance of rewriting an existing ID, is extremely small)
4) Next, we need to change the 2nd entry, to a new one reflecting the building type we want to add.
In this example it’s "settlement:greece:athens:settlement_navy-admin". Change the bold text respectively.
ID references of other building types can be found here main.pack/db/building_chains_to_slots_tables\building_chains_to_slots under the data folder that needs the PackFileManager to be opened
The 5th and 6th entries are the campaign map coordinates, and we will change them accordingly later on, in the process explained further down. Also for the 8th entry it decideds what type of small buildings will surround the city. I would leave it as it is, the same with all the REGION_SLOTs of the specific region. (This number should actually match with the 1st entry when you have SETTLEMENT field highlighted i.e. in my example it should be no. 3).
We aren’t going to bother with the rest entries of this field.
5) Now, highlight SIEGABLE_GARISSON_RESIDENCE and change the 1st entry here to be exactly the same with the Building ID of REGION_SLOT you have just randomly edited.
Then, under the SIEGABLE_GARISSON_RESIDENCE, click on GARISSON_RESIDENCE and change the entry on the right, to the ID of the faction that owns the City. (in this example Greece) You can simply copy the entry from the other existing GARISSON_RESIDENCEs of the other existing REGION_SLOT_ARRAYs in that region.
6) This will decide if the building slot will have a building already built in it or if it will be an empty slot
a) For empty slot:
Simply right click on the BUILDING field (if there is one) under BUILDING_MANAGER and click DELETE (it should turn red).
After doing this, click on the BUILDING_MANAGER and change the 1st Boolean to “False”.
b) For built-in slot:
Click on the BUILDING_MANAGER and be sure the 1st Boolean is set to “True”.
There should also be a BUILDING field present under BUILDING_MANAGER. (If there isn’t one, then simply right-click copy one from another slot). With BUILDING being highlighted, change the 3rd entry to the owner faction (i.e. in this case from “portugal” to “greece”) and the 4th entry to the owner faction government type (i.e. in this case from “gov_constitutional_monarchy” to “gov_absolute_monarchy”)
The 2nd entry will determine the building level,so enter the appropriate text (in this example “admiralty”)
Building IDs of other building levels can be found here main.pack/db/building_levels_tables/building_levels under the data folder that needs the PackFileManager to be opened
7) Now, we have to add the building slot in the AI entries as well, so that the game won't crash when the building upgrades. We will follow the method of HusserlTW to do this.
a) Go to startpos.esf\CAMPAIGN_STARTPOS\CAMPAIGN_ENV\CAMPAIGN_MODEL\CAI_INTERFACE\CAI_WORLD\CAI_WORLD_BUILDING_SLOTS and right-click on anyoneof the CAI_WORLD_BUILDING_SLOTS and click CLONE. A new highlighted-green CAI_WORLD_BUILDING_SLOTS field should appear. Click on it.
b) Change the 1st entry on the right, which is the slot's ID, to a 4-digit random number, but this number shouldnt conflict with any other ID, so to be on the safe-side, change this to lets say "9999". (this was one of my mistakes:whistling)
c) Then click on the CAI_BUILDING_SLOT field under CAI_WORLD_BUILDING_SLOTS we cloned. From here change the 1st entry on the right, to match exactly with our randomly created REGION_SLOT ID we created in Step 3 above. The 2nd entry should be 0, that probably indicates that the building is inside the city.
d) The last step, is to change the 3rd entry on the right, to our Settlement's AI ID (i.e. in our example Athens' AI ID is 1681). To find this for other settlements, check out the list I prepared for all Settlements AI IDs, to save you from having to find it yourself...
Spoiler Alert, click show to read:
After this, we are finished editing the startpos.esf, so now SAVE the file and open regions.esf with esf editor
8) Go to global_map\regions.esf\root\region_data\regions\ and find the region that you will add a building/slot to. (in my example greece). Under regions, go to settlement_and_slots/slot_descriptions and right-click on an existing field and click CLONE.
9) Click on the cloned green slot_descriptions, and change the 1st and 2nd entries on the right, to reflect your new building accordingly, like previously done in the startpos.esf. (i.e. in my example I will change the 1st entry to "settlement:greece:athens:settlement_navy-admin" and the 2nd entry to "settlement_navy-admin")
The 3rd and 4th entries are probably the battle map coordinates, and we will change them accordingly later on, in the process explained further down.
After this, SAVE changes
To Place Building Slots correctly so that the buildings fit properly in the newly enlarged city (both campaign and battle map), use this excellent spreadsheet made by erasmus777 and follow the steps described in the spreadsheet and the additional steps below.
a) When editing startpos.esf, go to your REGION_SLOT_ARRAY and click on your first slot. The 5th and 6th entries are X and Y coordinates respectively. Check the building type and enter the appropriate value. Do this for all the settlement slots.
Save. Your buildings will now appear in the correct position on the campaign map!
b) When editing regions.esf, go to slot_descriptions, under settlement_and_slots, and click on your first slot. The 3rd and 4th entries are both the coordinates X and Y separated by a “ ; ”. Check the building type and enter the appropriate value. Do this for all the settlement slots.
Save. Your buildings will now also appear in the correct position on the battle map!
For a full-detailed explanation of this method, check out the spoiler below
Spoiler Alert, click show to read:
NOW YOU HAVE SUCCESSFULY COMPLETED THIS TUTORIAL. see the result belowSpoiler Alert, click show to read:
I hope this was useful and easy to follow, even though it was a quite long process. I would like to thank erasmus777 and husserlTW for their help to complete this tutorial and their teamwork, that I really like in TWC community!