Page 9 of 12 FirstFirst 123456789101112 LastLast
Results 161 to 180 of 227

Thread: [question] How to change a faction's starting provinces?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Caki's Avatar First Consul of Thera
    Join Date
    May 2007
    Location
    Negotin, Serbia
    Posts
    655

    Default Re: [question] How to change a faction's starting provinces?

    OK let's get started . This won't be a tutorial because it's not something special (your gonna laugh when you read what I have done). Basically I have made a confederation of Carthage, NC and Libya then saved the game (Dresdens mod gave me the idea http://www.twcenter.net/forums/showt...-4-13%29/page4). Now you have to unpack the original startpos and your saved game (this is the esf to xml unpacking and here is the tutorial http://www.twcenter.net/forums/showt...tions-Tutorial ). There are two great powershell script written by Styrry (UnpackESF.ps1 which is on the 7th page of this thread post 122 and PackESF.ps1 which is on 6th page of this thread post 117) THANK YOU Styrry for the scripts and for helping me whit nokogiri +rep When you unpack the startpos you give that folder a name startpos and your save game lets say carthage. In the startpos folder you will finde 3 folders (compressed_data, preopen_map_info and save_game_header) and one file esf.xml. In carthage folder you will have 2 folders (compressed_data and save_game_header) and one file also esf.xml. Next go to the carthage/compressed_data folder and you will finde 32 folders and 1 file also called esf.xml. carthage\compressed_data\save_game_header folder and open it. The first 13 lines should look like this: rom_carthage UI\Portraits\portrait_PH.png 1 481 Spring data\ui\flags\Carthage 1 0 0 481 rom_politics_carthage_barcid main_rome_map Now you should edit them to this: rom_rome UI\Portraits\portrait_PH.png 1 481 Spring data\ui\flags\Rome 1 0 0 481 main_rome_map This step is maybe not needed but I still haven't tested it. Next go back to carthage/compressed_data folder and copy all folders except the esf.xml file. After this you should open the startpos/compressed_data folder and paste your copied folders. When this is done you should rename back the startpos folder to xml folder and then use the powershell script PackESF.ps1 to pack the folder back to esf format. I know this is not what you expected because there is no real editing but for now this is all we got. And yes this can be done for Seleucids also but you have to make them playable so you can manage the confederations.
    Proud To Be Under The Patronage Of TheFirstONeill
    Proud team member of Thera, A New Beginning

  2. #2

    Default Re: [question] How to change a faction's starting provinces?

    Very smart solution. Unfortunately I take it it will only work for merging whole factions.

  3. #3

    Default Re: [question] How to change a faction's starting provinces?

    I managed to get this working a few days ago. The solution leaves garrisons unresolved (not that it matters much), and perhaps other issues. But the game works fine as far as I can see and the AI behaves properly and without CTD issues.

    It's pretty complicated to make even simple changes though, but I'll list all the fields I found necessary to change for reference:

    Directories in CAMPAIGN_MODEL\WORLD (as usual):
    REGION_MANAGER - change fields and sub-entries as necessary
    PROVINCE_MANAGER - change region content or ownership or remove managers as necessary.
    SEA_REGION_MANAGER - change region content or ownership or remove managers as necessary.

    Directories in CAMPAIGN_MODEL\CAI_INTERFACE\CAI_WORLD (references between directories are usually to the BDI_COMPONENT row 1 value):
    CAI_WORLD_FACTIONS\#\
    • CAI_FACTION Row 1 - list of faction owned entries in CAI_WORLD_REGIONS (excluding sea regions). Add or remove regions.
    • CAI_FACTION Row 15 - list of faction owned entries in CAI_FACTION_PROVINCES. Add or remove managers.
    • CAI_FACTION Row 16 - list of faction owned entries in CAI_FACTION_SEA_REGIONS. Add or remove managers.

    CAI_WORLD_SETTLEMENTS\#\
    • OWNED_DIRECT - same as CAI_FACTION\OWNED_DIRECT. Change to new faction value.

    CAI_WORLD_REGIONS\#\ (no need to change ownership here, OWNED_INDIRECT just refers to the owning settlement, or nothing in the case of sea regions)
    • CAI_REGION Row 18 - in sea region entries (the last 20 or so #) this array refers to all sea region managers in CAI_FACTION_SEA_REGIONS that refer to this sea. Must be edited if a WORLD\SEA_REGION_MANAGER and its corresponding CAI_FACTION_SEA_REGIONS entry referring to this sea region is removed or added.

    CAI_PROVINCES\#\
    • CAI_REGION Row 4 - this array refers to all province manager entries in CAI_FACTION_PROVINCES that refer to this province. Must be edited if a WORLD\PROVINCE_MANAGER and its corresponding CAI_FACTION_PROVINCES entry referring to this province is removed or added.

    CAI_FACTION_PROVINCES\#\ - these refer to province managers (WORLD)
    • OWNED_DIRECT same as CAI_FACTION\OWNED_DIRECT. Change to new faction if necessary.
    • CAI_FACTION_PROVINCE Row 1 - refers to the corresponding entry in WORLD\PROVINCE_MANAGER\PROVINCE\FACTION_PROVINCE_MANAGER, for reference.
    • CAI_FACTION_PROVINCE Row 3 - refers to each CAI_REGION controlled by this manager object (as noted above the regions refer back as well). Change as necessary.

    CAI_FACTION_SEA_REGIONS\#\ - these refer to sea region managers (WORLD)
    • OWNED_DIRECT - same as CAI_FACTION\OWNED_DIRECT. Change to new faction if necessary.
    • CAI_FACTION_SEA_REGION Row 1 - refers to the corresponding entry in WORLD\SEA_REGION_MANAGER\SEA_REGION\FACTION_SEA_REGION_MANAGER..., for reference.
    • CAI_FACTION_SEA_REGION Row 3 - refers to each CAI_REGION controlled by this manager object (as noted above the regions refer back as well). Change as necessary.

    Using EditSF, I found that changes in all of the fields above will take up towards 30-60 minutes to save to disk.

    I've tried to get everything down correctly above, but there may be errors. Consider it a draft.

  4. #4

    Default Re: [question] How to change a faction's starting provinces?

    Very clever, doesn't solve the root issue but at least its a start. Thanks for explaining!

    Edit: I am going to use this process to make some Carthage options but will give you full credit. If that is okay?
    Last edited by Dresden; October 17, 2013 at 01:35 PM.

    ----> Website -- Patreon -- Steam -- Forums -- Youtube -- Facebook <----

  5. #5
    Antiokhos Euergetes's Avatar Protector Domesticus
    Join Date
    Sep 2011
    Location
    Antiokheia
    Posts
    4,026

    Default Re: [question] How to change a faction's starting provinces?

    @ Caki
    Yes thank you for explaining, it is not as complicated as I thought it might be. I think though I will wait till they release Seleukid DLC (whenever that might be)
    @ Dresden what Carthage options? You have my attention

  6. #6

    Default Re: [question] How to change a faction's starting provinces?

    Quote Originally Posted by Basileos Antiokhos Euergetes View Post
    @ Caki
    Yes thank you for explaining, it is not as complicated as I thought it might be. I think though I will wait till they release Seleukid DLC (whenever that might be)
    @ Dresden what Carthage options? You have my attention
    I plan on updating my Qart-Hadast Mod with 3 optional startpos files. One will have Carthage+Libya as one nation, one will have Carthage+NC as one nation and one will have all 3 as one nation. Each will have 2 and 4 tpy options also. I am going to wait until patch 5, though, because I imagine they will tweak the startpos again.

    ----> Website -- Patreon -- Steam -- Forums -- Youtube -- Facebook <----

  7. #7

    Default Re: [question] How to change a faction's starting provinces?

    Hi Caki! Great idea! Thanks a bunch! Are you planning to go down a little further? Like checking which of the files in the compressed folders can be left unchanged? If you isolated the files which are required for the changes we could use tools like kdiff or WinMerge to track down the lines which are to be edited!

  8. #8
    Caki's Avatar First Consul of Thera
    Join Date
    May 2007
    Location
    Negotin, Serbia
    Posts
    655

    Default Re: [question] How to change a faction's starting provinces?

    Yes you can use it and no credit is needed because I used all of yours (you and other people) ideas and put them together
    Proud To Be Under The Patronage Of TheFirstONeill
    Proud team member of Thera, A New Beginning

  9. #9
    Caki's Avatar First Consul of Thera
    Join Date
    May 2007
    Location
    Negotin, Serbia
    Posts
    655

    Default Re: [question] How to change a faction's starting provinces?

    Styrry..I think I did have a look and only one folder was cai there were 2 or 3 more folders but I can´t remember whic. I do remember that one was only numbers and no words or even letters just:16516813216848978715187798465189115864984681651819818157342612958628662849846118918132181981161894789461849489819819819818982978652797582212712798579207980872719797071977529092759759219702970492937129729179915...
    Proud To Be Under The Patronage Of TheFirstONeill
    Proud team member of Thera, A New Beginning

  10. #10

    Default Re: [question] How to change a faction's starting provinces?

    I followed your instructions Spmon but I still can't issue edicts. Maybe I missed a table somewhere. Also, I had a first turn crash on Knossos' turn.

    Edit: Just realized I may have confused the OWNED DIRECT value with the BDI COMPONENT value for one of the factions.

    Edit 2: I changed the OWNED DIRECT to the right value and the various BDI values around and it still won't let me do edicts. I also now get a crash at ending the first turn. I will keep working on this at a later time.


    Is it necessary to edit CAI_PROVINCES and CAI_WORLD_REGIONS if you aren't removing or adding entries but, rather, just reassigning faction ownership?
    Last edited by Dresden; October 20, 2013 at 04:33 PM.

    ----> Website -- Patreon -- Steam -- Forums -- Youtube -- Facebook <----

  11. #11

    Default Re: [question] How to change a faction's starting provinces?

    Quote Originally Posted by Dresden View Post
    Is it necessary to edit CAI_PROVINCES and CAI_WORLD_REGIONS if you aren't removing or adding entries but, rather, just reassigning faction ownership?
    No, I don't think so. The issues only start cropping up when you end up with two managers owned by one faction in one province (or sea region!), but unless you make very clean ownership changes you will have to remove at least a sea region or province manager at some point. Leaving "dud" managers seem to cause issues when factions lose provinces ingame (CTD!).

    Still, I don't think edicts are affected by CAI changes. The important thing is to get the WORLD\PROVINCES correct - as in having all the settlements in the correct places and only having one manager object per faction and province. The CAI stuff is just to get the AI on board.

    But assuming you're giving Carthago Nova's settlements to Carthage, you will for example need to remove C:N's management object in Carthaginensis entirely. That means moving Ibossim to Carthage's manager objects then erasing them in WORLD\PROVINCES + CAI_FACTION_PROVINCES and then removing the references to it in CAI_FACTION and CAI_PROVINCES. However changing the sea region in the Carthaginensis case is fairly simple as you just have to change ownership.

    I only got as far as giving Thapsus and Ibossim to Carthage, Cosentia to Syracuse and Brundisium to Epirus (all wanted was an entertaining start for my Rome campaign!)... but I'm going give this a rest for now. But the campaign has played out for 100 turns without a hitch so it seems to work.

  12. #12

    Default Re: [question] How to change a faction's starting provinces?

    Ah so I can't just change the values to the other faction's BDI or faction value? I have to fully remove the entries and all references to them? For example, I am changing Nova Carthago's various Faction and Province entries from value 109 and BDI 8067 (NC) to value 3 and BDI 1813 (Carthage). Instead of doing that, I should remove NC's entries entirely?

    Thanks again for your help.

    ----> Website -- Patreon -- Steam -- Forums -- Youtube -- Facebook <----

  13. #13

    Default Re: [question] How to change a faction's starting provinces?

    Quote Originally Posted by Dresden View Post
    Ah so I can't just change the values to the other faction's BDI or faction value? I have to fully remove the entries and all references to them? For example, I am changing Nova Carthago's various Faction and Province entries from value 109 and BDI 8067 (NC) to value 3 and BDI 1813 (Carthage). Instead of doing that, I should remove NC's entries entirely? Thanks again for your help.
    Yeah, changing everything from C:N to Carthage means that Carthage will have more than one province manager and sea region manager in a lot of places. When removing them (after emptying them of regions), start by removing the WORLD entry and then work backwards through CAI_INTERFACE. Start with a single province to and see if it works out, that's plenty complicated on its own sadly. I'll try writing a short step-by-step for changing Thapsus ownership later this week. About the edicts: before I even started changing the CAI stuff i got edicts working in a way: I gave Cosentia and Brundisium to Epirus by only changing stuff in the WORLD directory. Playing as epirus and conquering Sicily I could then issue edicts in Magna Graecia as usual - for that reason I suspect edicts is all about getting WORLD\REGIONS and WORLD\PROVINCES right. I haven't tried giving an entire province to one faction though, so that might explain it. I also have a habit of changing the OWNERSHIP_BY_THEATRE directory values when I change region ownership, but I doubt that matters really.

  14. #14

    Default Re: [question] How to change a faction's starting provinces?

    Ouch, that post was supposed to have more line breaks than that! Sorry.

  15. #15

    Default Re: [question] How to change a faction's starting provinces?

    Hi Spmon, great posts! Thanks a lot for the details. Sadly if we want to go for many changes this is a hell lot of work. When you posted your step-by-step tutorial I will check if it's possible to support the work by a script going through the unpacked xmls.

  16. #16

    Default Re: [question] How to change a faction's starting provinces?

    This is so unbelievably complicated when you start dealing with changing entire factions around. I am trying to get NC and Libya to Carthage, but wow my eyes are starting to bleed

    It depresses me even further when I think the changes have to be redone everytime they update the startpos.

    ----> Website -- Patreon -- Steam -- Forums -- Youtube -- Facebook <----

  17. #17

    Default Re: [question] How to change a faction's starting provinces?

    I wish there was a way to simply reset or recalculate the entire CAI section. It seems to just be a blank slate anyway - one mirroring what's in the WORLD part of startpos.

  18. #18

    Default Re: [question] How to change a faction's starting provinces?

    The problem I am running into is that you can't have a blank entry in EditSF in certain byte arrays. So, I can't remove every region from Libya or Nova Carthago. I guess I could try to give them 1 region each.

    ----> Website -- Patreon -- Steam -- Forums -- Youtube -- Facebook <----

  19. #19

    Default Re: [question] How to change a faction's starting provinces?

    The only point where I encountered that issue was for province managers. And here indeed the solution is to delete the provine manager (instead of removing all entries of the array). However you have to follow Spmon's guide and alter CAI as well. Otherwise, you'll end up at CTD.

  20. #20

    Default Re: [question] How to change a faction's starting provinces?

    Right, but in Libya's CAI WORLD FACTIONS entry you have to remove the regions they own. But, you can't leave it blank using EditSF.

    When I open up a save where I have confederated Libya, almost all those CAI WORLD FACTION entries are blank.

    ----> Website -- Patreon -- Steam -- Forums -- Youtube -- Facebook <----

Posting Permissions

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