Results 1 to 17 of 17

Thread: How to add building slots in cities and how to change the type of slots in towns and facilities

  1. #1

    Default How to add building slots in cities and how to change the type of slots in towns and facilities

    How to add building slot in cities and change the type of slots in towns and facilities

    A new method has been released for Empire that makes possible to really upgrade cities without downgrading others. It is pretty much the same procedure for Napoleon. There 2 major differences:

    1. Regions.esf grids in Napoleon have an additional height dimension.


    2. The names of slots and the building types are different. Check in data.pack\db\building_chain_to_slots and building_levels about them. Also in Napoleon there is a bigger variety of city sizes from 1 to 5 slots.


    To calculate the startpos and regions slot grids you'll need the DataConv.ods which is contained in the attached in files. Open it with OpenOffice or Excel and go in startpos and regions sheets.


    A. startpos.esf changes:

    Follow the procedure that as it is in Empire's tutorial. Leave for the moment step
    A 4. Also have in mind difference 2 above. It would be very helpful to check another city if the same size of the city you are going to make, to see how you will name building slots. Have in mind that the same name you have to use later in regions.esf.

    B. Regions.esf changes

    1. Because of the new height future that is added in Napoleon's regions.esf no "traditional" editor can edit the file. Hopefully Taw's esf2xml can do the job for us and using
    Esf Total Editor thinks are even easier. So open Esf Total Editor, browse to your regions esf, type the output folder name and convert esf2xml. In Menu Xml open the folder you named as an xml output and locate your region.



    2. Open the xml and go in slot_descriptions. Clone one of them carefully so all slot entries are included during copy/paste. After that correct all
    settlement_X1_slot:X2 assigning the correct building slots. X1 is the number of the new size of the city (1-4) and X2 the number of slot (0-6). They have to be the same as you made them in startpos.esf. We shall come back later to change the grids.

    Spoiler Alert, click show to read: 


    After you've done convert xml back to esf using Esf Total Editor. Browse for the REGIONS folder (editor points the Xml folder), type the name for output esf file regions.esf (never forget the .esf extension) and convert xml2esf. In menu Esf go in Esf folder and copy your new regions.esf to your game's map folder (e.g. nap_europe).




    C. Assigning a new CAI_BUILDING_SLOT in startpos.

    Follow exactly the steps form Empire's tutorial.


    When you finish you can test your files though we have not change the buildings grids. Wrong building grids do not cause a CTD. You just see hardly new slot(s) since the new one is on top of the old one we've cloned. But if you get a CTD at this point that means that you've done a mistake and you have to correct that before proceeding. When campaign starts without CTD then you can go in.


    D. Assigning new grids


    1.
    Startpos.esf: Open DataConv spreadsheet and in second sheet with startpos tables find the one you need. Open startpos and go in ...\REGION\REGION_SLOT_MANAGER\REGION_SLOT_ARRAY\ of yopur region. Go further in SETTLEMENT\SIEGEABLE_GARISSON_RESIDENCE. Copy the basic grids from 10th (X) and 11th (Y) lines in ConvSheet table.

    Spoiler Alert, click show to read: 


    Then copy the appropriate grids to every one of the building slots, new and old one(s).


    Spoiler Alert, click show to read: 


    2.
    Regions.esf: Here we are gonna need Regions sheet of DataConv spreadsheet. Open your xml output folder (menu Xml\Xml Folder\ in Esf Total Editor), and open again your region's xml. Here basic coordinates are in regions/settlement_ and_slots (X);(Y).

    Spoiler Alert, click show to read: 


    Type them in DataConv and then copy the calculated new grids in all building slots. You have to replace the x, y, z, in first line and x, y in second:


    Spoiler Alert, click show to read: 




    Y value of the second line must be the same with Z of the first one.


    Convert again xml2esf (exactly as you did before) and copy your new regions.esf from Esf Folder to your game's map folder. Attached in Spain_files there is Madrid where I've added a new slot using the new method.


    There is a graphical issue with fortifications. To correct it you have to make a small pack or add the right db table and make your changes in your existing mod pack. In attached Files there is mine which you can use. Open the TSV, replace the cities with yours and change the number of slots accordingly. Then open the pack and import the TSV. Do not forget to activate your mod pack.


    In next spoiler there is the old tutorial.


    Spoiler Alert, click show to read: 
    Adding building slots to cities in Napoleon is a similar process as in Empire. However modders that have in mind the files of Empire startpos.esf and regions.esf, will notice some important and obvious differences. Unfortunately we cannot still add new stuff in the game so the slots must be taken from other city or cities. In Napoleon we have more types of cities with 1 - 5 building slots. Also, the names of building slots have changed, while the type of buildings can vary and are not specific as in Empire. The last major deference is the addition of a height grid in regions.esf since city models in Napoleon are 3d. This last new entry was the main reason for the delay of this tutorial since the existing Esf editors could not edit Napoleon's regions.esf. Erasmus's made an update for me so rep the man because without it's tool nothing of the following would be possible. This version is in beta stage and Erasmus is still improving that. But it is more than enough for the purposes of this tutorial. I use it only for rgions.esf changes. For startpos I use the old reliable and fast 1.4.3. As you will see when 1.5 will be ready, it is going to be the best Esf editor ever.

    One of the major difficulties in Empire's similar process is the fact that modder cannot test the changes until he finishes entire modification. Finding an error, after that, is extremely difficult as this could have been happened in any step of the process. If you add the often possibility of an accidental error, the tutorial becomes a real headache even for experienced modders. In Napoleon I've organized the process in a way that testing points are appeared in several levels of the process, making easier the discovery of a possible mistake.

    A. Working files

    Startpos.esf

    Regions.esf

    Data.pack\db\campaign_map_settlements_tables

    B. Tools

    Pack File Manager

    EsfEditor 1.5 beta (attached)

    EsfEditor 1.4.3. For this tutorial I use a beta of 1.5 which is the only solution for editing regions.esf. For startpos I use 1.4.3 version after a make a small preparation with 1.5...

    DataConv (attached). It is a spreadsheet that contains 3 useful sheets: data sheet helps in copying stuff during modification, startpos and regions sheets are used for calculating building slot grids which change after conversions in startpos.esf and regions.esf files.

    I. How to add building slots

    In this tutorial we shall take a building slot from Estonia & Livonia and will add it in Courland.
    Spoiler Alert, click show to read: 

    Spoiler Alert, click show to read: 
    Before start changes we have to make some preparations. First we'll find CAI_SETTLEMENT Id's for both cities which we shall need later. Using 1.5 editor, open startpos and go in \CAMPAIGN_ENV\CAMPAIGN_MODEL\CAI_INTERFACE\CAI_WORLD\CAI_WORLD_REGIONS find the regions Estonia & Livonia and Courland. Now go further in CAI_WORLD_REGIONS\ CAI_ REGIONS and note the CAI_SETTLEMENT Id in 3rd line of both in DataDataConv.
    Spoiler Alert, click show to read: 

    Spoiler Alert, click show to read: 

    1. Using 1.5 editor, open starrpos.esf \CAMPAIGN_ENV\CAMPAIGN_MODEL\WORLD\REGION_MANAGER\REGIONS_ARRAY\REGION and find both Estonia & Livonia and Courland regions. Right click on every one copy and paste on REGIONS_ARRAY. After that delete the old records. Save the file. In this way you can find easily both regions later, using 1.4.3 editor.
    Spoiler Alert, click show to read: 

    Spoiler Alert, click show to read: 

    2a. Using 1.4.3 editor, open again startpos and go in Estonia & Livonia, in ...\REGION\REGION_SLOT_MANAGER\REGION_SLOT_ARRAY\. As you can see here there are all the slots of the region. The first 2 are the slots of Riga city. The second settlement:eur_estonia_livonia:riga:settlement_2_slot:3 is the one we shall "borrow". For now, note the slot Id 861606940 and delete this REGION_SLOT. Also though we are not going to make any changes in first settlement_2_slot:1 note Id and the type of building from REGION_SLOT\BUILDING_MANAGER\BUILDING second line.
    Spoiler Alert, click show to read: 

    2b. Leave REGION_MANAGER and proceed in ...CAI_INTERFACE\CAI_WORLD\CAI_WORLD_BUILDING_SLOTS. Here we mast spot eur_estonia_livonia:riga:settlement_2_slot:3. For that we shall use CAI_SETTLEMENT Id we already know, 1502.

    Generally CAI_WORLD_BUILDING_SLOTS follow this order: if XXXX is CAI_SETTLEMENT Id of the city, then the next records are CAI_BUILDING_SLOTS that are outside city, as ports, towns, farms, etc. The 2 records before that (XXXX-1 and XXXX-2) are fortifications and road. From XXXX-3 and further are the building slot in city. There might be from 1 to 5 Id's depending on the size of the city.

    In our case Estonia & Livonia is a 2 slot city so it has 2 CAI_ BUILDING_SLOTs. These must be XXXX-3 and XXXX-4 and since CAI_SETTLEMENT Id is 1502 these are 1499 and 1498. The settlement_2_slot:3 is 1499 as we check in CAI_WORLD_BUILDING_SLOTS\CAI_BUILDING_SLOT. Here we can see the slot Id in first line we've already noted in DataConvSheet and the CAI_SETTLEMENT Id of Estonia & Livonia in third line. We'll change the Id in first line. We shall enter here the same Id of the other slot 861606940. In this way the slot we deleted will have no CAI Id and the remaining slot will have 2 CAI id's 1499 and 1498 (!!!).Why we've done that? To create our first check point. Save the file.
    Spoiler Alert, click show to read: 

    Check Point: In this point we just need to start the game successfully and nothing more. Start the game and enter in campaign map (do not hit turn button). In next image you can see Riga left only with one slot. The remaining building is in wrong position because we have not changed its grids yet.
    Spoiler Alert, click show to read: 

    If you can start the game, congratulations, everything has been made right. If a CTD happened return and try to find the problem. Keep a copy of your startpos if everything is O.K. so far.

    3. Open DataConv spreadsheet and in second sheet with startpos tables find the 1 slot. Open startpos and go in ...\REGION\REGION_SLOT_MANAGER\REGION_SLOT_ARRAY\ Estonia & Livonia. Go further in SETTLEMENT\SIEGEABLE_GARISSON_RESIDENCE.
    Spoiler Alert, click show to read: 

    Copy the basic grids from 10th (X) and 11th (Y) lines in ConvSheet 1 slot table.
    Spoiler Alert, click show to read: 

    Now we have the needed grids for the remaining slot, road and fortification. Let's change them.
    Spoiler Alert, click show to read: 

    Save the file and test.
    Spoiler Alert, click show to read: 

    As you can see now the building is in the right place.

    Check Point: When a checkpoint is available we try just to start the campaign. If succeed then we keep a new copy of the working file. If a CTD happens try to find the mistake. If you cannot find it then use the last good copy and repeat the last steps after previous successful check point.

    4. Open startpos and go in ...\REGION\REGION_SLOT_MANAGER\REGION_SLOT_ARRAY\ Estonia & Livonia. Proceed in ...\CAI_WORLD\CAI_WORLD_BUILDING_SLOTS and change settlement_2_slot:1 to settlement_1_slot:1 of the first slot since from now on Riga will be one slot city. Save the file. In next step will start modifying regions.esf file as well.
    Spoiler Alert, click show to read: 

    5. Go in data\campaign_maps\nap_europe \ open regions.esf using EsfEditor 1.5 and find Estonia & Livonia in Region_Data\Regions. Proceed in Settlement_And_Slots\Slot_DIscriptions, delete settlement:eur_estonia_livonia:riga:settlement_2_slot:3 and in settlement:eur_estonia_livonia:riga:settlement_2_slot:1 change 2 to 1. Do the same in second line. Save the file.
    Spoiler Alert, click show to read: 

    6. Open it again and go in the same place to change the grids as we did in startpos for the settlement_1_slot:1, settlement_road and settlement_fortification. To do that copy the basic grids from Regions\Settlement_And_Slots 88,65597 ; 108,6812 to DataConv in third sheet for regions.esf.
    Spoiler Alert, click show to read: 

    Now enter the calculated grids from sheet to regions.esf file. You have to be extremely cautious with semicolons, the spaces before and after them if any, and the numbers of type 0,0xxxxxx since during copying it is easy to make a mistake which will cause CTD.
    Spoiler Alert, click show to read: 

    Save the file. We've finished working on Estonia & Livonia which has been downgraded in 1 slot city. Now we shall proceed with Courland's upgrading

    IMPORTANT: From now on modded startpos.esf demands the modded regions.esf to be present and vice versa or you'll get a CTD.

    Check Point: Test and keep a copy of both files. That was the last one so you need to be even more careful in next steps because there are many changes there. Follow tutorial to the letter and do not improvise.

    7. Open startpos.esf with 1.4.3 editor and go ...\CAMPAIGN_ENV\CAMPAIGN_MODEL\WORLD\REGION_MANAGER\REGIONS_ARRAY\REGION and find Courland. Go further in ...\REGION\REGION_SLOT_MANAGER\ and clone the 1st REGION_SLOT_ARRAY. In first REGION_SLOT_ARRAY change settlement:eur_courland:mitau:settlement_1_slot:1 to settlement:eur_courland:mitau:settlement_2_slot:1, since from now on Mitau is going to be a 2 lot city.
    Spoiler Alert, click show to read: 

    8. Go in the cloned REGION_SLOT_ARRAY:
    a) in REGION_SLOT change settlement:eur_courland:mitau:settlement_1_slot:1 to settlement:eur_courland:mitau:settlement_2_slot:3.
    b)In first line change the Id and enter the one we have already copy in data sheet and have borrowed from Estonia & Livonia (861608300).

    c) The same Id you'll enter in REGION_SLOT\SIEGEABLE_GARISSON 1st line replacing the existing one.

    d) Proceed to REGION_SLOT\BUILDING_MANAGER\BUILDING and in second line enter a deferent type of building. I enter here sCannon1_cannon_foundry. You can find building types and levels in db\building_levels tables.

    e) Now we have to change the grids since Mitau now has 2 slots. Open startpos sheet and in 2 slot table enter the x and y grids of Courland which can be found in SETTLEMENT\SIEGEABLE_GARISSON_RESIDENCE as we did in step 3. Then copy from sheet the grids in both building slots, road and fortifications.
    Spoiler Alert, click show to read: 

    9. Last thing in startpos is to assign the necessary CAI_BUILDING_SLOT for our new slot in Mitau of Courland. It is there waiting from step 2b. Go in ...CAI_INTERFACE\CAI_WORLD\CAI_WORLD_BUILDING_SLOTS and find the cai slot 1499. This belonged to Riga's slot which we've already removed. Now let's assign it to Courland. Go in CAI_WORLD_BUILDING_SLOTS\CAI_ BUILDING_SLOT, change the Id in first line entering 861608300 and in third line change cai settlement of Riga 1502 with the one of Mitau 1482. All these Id's are in your data sheet. Save the file. We've done with startpos but we cannot test it until we finish as well with regions.esf changes for Courland.

    10. Open regions.esf with 1.5 editor, go in Region_Data\Regions and spot Courland. Proceed in Settlement_And_Slots\Slot_DIscriptions and clone the second slot settlement:eur_courland:mitau:settlement_1_slot:1.

    a) In settlement:eur_courland:mitau:settlement_1_slot:1 change in first and second line settlement_1_slot:1 to settlement_2_slot:1

    b) Go in cloned Slot_Discriptions and change settlement_1_slot:1 to settlement_2_slot:3, in 1st and 2nd lines.

    c) From Regions\Settlement_And_Slots copy basic grids in regions sheet in 2 slot table. Copy the calculated grids in settlement_2_slot:3 (cloned), settlement_2_slot:1, settlement_road and settlement_fortification.

    Save the file, exit and have the last test. The job has been done.

    The same procedure must be followed if you want to add more building slots, repeating the proper steps for the extra slots. Data sheet will be more useful in these cases.

    11. There is a graphical issue with fortifications. To correct it you have to make a small pack or add the right db table and make your changes in your existing mod pack. In attached Files there is mine which you can use. Open the TSV, replace the cities with yours and change the number of slots accordingly. Then open the pack and import the TSV. Do not forget to activate your mod pack.
    Spoiler Alert, click show to read: 
    II. Changing the type of slots in towns and facilities

    Let's change Helsiniki in Finland and turn it from a commercial town to an industrial:
    Spoiler Alert, click show to read: 

    1. Using 1.4.5 EsfEditor open startpos and go in \CAMPAIGN_ENV\CAMPAIGN_MODEL\WORLD\REGION_MANAGER\REGIONS_ARRAY\REGION and find Finland. Get in further in ...\REGION\REGION_SLOT_MANAGER\REGION_SLOT_ARRAY\ and find Helsinki. In REGION_SLOT\BUILDING_MANAGER\BUILDING change the type in second line from tCommerce1_market to tFactory1_manufactory.

    2. Using 1.5 editor open regions.esf, go in Region_Data\Regions and find Finland. In Slot_Discription of Helsinki change 2nd line entering town-industrial and in 7th line nap_eur_town_ind.
    Spoiler Alert, click show to read: 

    Credits

    LtChambers for PFM

    Just and koras321 for Esf Editor

    Special thanks to Erasmus777 for his constant development of EsfEditor.
    Last edited by husserlTW; January 26, 2011 at 11:45 AM.




  2. #2
    Atlaas's Avatar Tiro
    Join Date
    Apr 2010
    Location
    Paris, France
    Posts
    246

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    Thanks so much for this tutorial. I thought adding slots in cities was impossible. Now I see that it is not. Unfortunatly, you have to steal them from other cities

  3. #3
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    Quote Originally Posted by Chorius View Post
    Thanks so much for this tutorial. I thought adding slots in cities was impossible. Now I see that it is not. Unfortunatly, you have to steal them from other cities
    Probably because I told you so, and it is. Shifting slots is not adding them

    It's not very useful in my opinion because it means focusing on an area at the expense of another. We might do it in a few cases if we really need something somewhere but I don't think it's a good idea to do it too often.

    No thing is everything. Every thing is nothing.

  4. #4

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    Update: Method has been updated for Empire and soon I'll add for Napoleon too. Look in first page.




  5. #5

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    UPDATE: New method has been updated for Napoleon as well




  6. #6

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    Thank you in my name, thank you in the name of EiC team, and I also thank you in advance in the name of the EiC users of future versions (and aslo past versions).

  7. #7

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    Hi!

    As you know I had CTD when playing my files despite I followed the empire guide. I have found out what it was and also I think that the solution is interesting so I am posting here.

    The CTD was caused because I did this to add a prestige building in Madrid:

    Startpos....REGIONS_SLOTS_ARRAY

    settlement:eur_spain:madrid:settlement_4_slot:0

    settlement:eur_spain:madrid:settlement_4_slot:1

    settlement:eur_spain:madrid:settlement_4_slot:2

    settlement:eur_spain:madrid:settlement_4_slot:3

    settlement:eur_spain:madrid:settlement_prestige:5

    ...

    settlement:eur_spain:madrid:settlement_road:4

    settlement:eur_spain:madrid:settlement_fortification:6

    And then in CAISET xml I was doing this:

    100794 794 795 796 797 798 799

    So I thought that maybe the other of Startpos....REGIONS_SLOTS_ARRAY should be respected too when going into CAISET so I changed the other to this:

    794 795 796 797 100794 798 799


    So it has worked, but not only that, the buildings appear in the same order than in vanilla playable factions.
    Last edited by Bethencourt; January 28, 2011 at 12:54 AM.

  8. #8

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    Hi!

    I am having a problem. The game works fine but when I want to quit the computer freezes. Have you got the same problem?

  9. #9

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    The order that slots are appeared in campaign map is determined by the grids you add. change them and you'll see that slots will change positions. You can even send them in another region. Exit bug means wrong cai changes.




  10. #10

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    Hi!

    With this buildings appear in the same order than in vanilla playable factions. I meant the order of the buildings in the selection bellow the map not the map itself.




    About the bug you are right, I have checked that I included in startpos the CAIBUL original values instead of the modified ones.
    Last edited by Bethencourt; January 28, 2011 at 12:53 AM.

  11. #11

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    Can you release a mod with all cities are 5 level cities in europe?
    Napoleon total war my mods

    Sweden is underrestimated! Sweden is underrestimated!

  12. #12
    Steph's Avatar Maréchal de France
    Patrician Artifex

    Join Date
    Apr 2010
    Location
    Pont de l'Arn, France
    Posts
    9,174

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    Sometimes I wonder how CA manage to make something that should be very simple so complicated.

    There are so many steps involved I don't really dare trying that

    Can we check we are doing things right at some intermediate steps? Like the slot appears at the bottom of the screen, even if the graphics on the map is not yet correct?

    Or do we need to make every steps before we can try to avoid a crash?

  13. #13

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    I´m trying to add a prestige building like "arc de triophe" to Madrid and "level 5" structures at the four buildable slots of Madrid ( defence walls not counting ). I got it with the "top level structures", but didn´t manage to get a prestige building slot ( I mean the 6th slot that allows the five MAIN CAPITALS to build their characteristic building) for my capital... can someone give me a hand ?

  14. #14

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    I can give you... 2 hands if you can be more specific. Also you can find Madrid with a prestige building attached in first post. Btw have you tried EasyEsf?




  15. #15
    Segador's Avatar Libertus
    Join Date
    Mar 2010
    Location
    Barcelona (Catalonia) -`s-Hertogenbosch (Netherland)
    Posts
    78

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    I'm trying to add slots to Barcelona with Easy Esf and the mod Factions but i just fail and fail... my changes dont cause efect to the game. Any help¿¿¿???


  16. #16
    Lord Davn's Avatar Senator
    Join Date
    Jul 2011
    Location
    Milwaukee, WI
    Posts
    1,070

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    Quote Originally Posted by Segador View Post
    I'm trying to add slots to Barcelona with Easy Esf and the mod Factions but i just fail and fail... my changes dont cause efect to the game. Any help¿¿¿???
    Check the October 6th post here:http://www.twcenter.net/forums/showt...=498159&page=4
    It works if you install and run on a Windows 7 64-bit OS with current Java updates (it did NOT work on my Win 7 32-bit OS).
    You have to read and follow the installation instructions VERY carefully, and make sure to install jRuby and Nokgiri.
    Takes a lot of patience but husserlTW's Easy Esf is worth its weight in gold vs the older modding methods
    Last edited by Lord Davn; February 06, 2013 at 09:41 AM.

  17. #17

    Default Re: How to add building slots in cities and how to change the type of slots in towns and facilities

    Really nice tutorial,

    It seems that settlement IDs are a fixed range, and because of that we cannot actually add new slots for startpos. If that range could be augmented (somehow) I think we could actually add slots, not just move them. Any comments on this one?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •