Page 7 of 12 FirstFirst 123456789101112 LastLast
Results 121 to 140 of 227

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

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

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

    great work Styrr!
    you may have saved Rome 2

  2. #2

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

    I wish I was a programmer, because I got lost trying to do this. I have Jruby and nokogiri going I think, but when I try to run those powershell scripts I get lots of unknown file errors and something about lzma.

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

  3. #3

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

    @Caki: Download Jruby 1.7.5 http://jruby.org/. After installing use the command
    Code:
    gem install nokogiri
    if you are not using windows you might find more info at http://nokogiri.org/tutorials/installing_nokogiri.html

    @Dresden: if you pn me your modified version ($directories) and the error messages I might be able to help you out

  4. #4

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

    Actually it was an error ob my side. Please try this one:

    UnpackESF.ps1:
    Code:
    $esfdir = "d:\modding\ESFviaXML"
    $esfname = "\startpos_remove_etrus_army2.esf"
    $esfxmldir = "d:\modding\ESFviaXML\etwng-master\esfxml"
    $tempdir = "d:\modding\ESFviaXML\temp"
    
    $currpwd = pwd
    cd $esfxmldir
    
    jruby --server $esfxmldir\esf2xml $esfdir$esfname $tempdir\xml
    .\lzma d $tempdir\xml\compressed_data.esf.xz $tempdir\xml\compressed_data.esf
    rm $tempdir\xml\compressed_data.esf.xz
    jruby --server .\esf2xml $tempdir\xml\compressed_data.esf $tempdir\xml\compressed_data
    rm $tempdir\xml\compressed_data.esf
    
    cd $currpwd

  5. #5
    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?

    Quote Originally Posted by Styrry View Post
    @Caki: Download Jruby 1.7.5 http://jruby.org/. After installing use the command
    Code:
    gem install nokogiri
    if you are not using windows you might find more info at http://nokogiri.org/tutorials/installing_nokogiri.html

    @Dresden: if you pn me your modified version ($directories) and the error messages I might be able to help you out
    Thank you, I did all that (hope it installed) but can't get it to unpack the file(using yours power shell scripts)
    Proud To Be Under The Patronage Of TheFirstONeill
    Proud team member of Thera, A New Beginning

  6. #6

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

    Honestly I am way over my head either way. I may keep trying to work at it, but I don't even understand the basics so I may be a lost cause.

    For example, how do you download esf2xml from GitHub or is it just a script you run? What about the other files, converter etc. Are you using powershell to run these, jruby, or simply cmd? Like I said, I don't really even have a grasp of the basics so I might have to just wait for ESF editor.

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

  7. #7

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

    You have to download the whole etwng from github: https://github.com/taw/etwng (download as zip on the right side). Unpack it wherever you want. I for example have it in d:\modding\ESFviaXML\etwng-master\ as you can see in the code: $esfxmldir = "d:\modding\ESFviaXML\etwng-master\esfxml"

  8. #8

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

    Quote Originally Posted by Styrry View Post
    You have to download the whole etwng from github: https://github.com/taw/etwng (download as zip on the right side). Unpack it wherever you want. I for example have it in d:\modding\ESFviaXML\etwng-master\ as you can see in the code: $esfxmldir = "d:\modding\ESFviaXML\etwng-master\esfxml"
    Ahh ok, sweet! Thanks I think I might have gotten it working. Massive credit and appreciation to you for your help!

    Edit: After about 4 hours of headaches I think I got it working, nokogiri doesn't like playing nice with older jruby versions.
    Last edited by Dresden; October 10, 2013 at 09:43 PM.

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

  9. #9

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

    I got the process working, but I can't figure out what to edit in the startpos.esf to get this working properly.

    When I remove the extra faction province manager array, the game won't start. If I add each number to both entries, I get phantom building and no edicts again (which makes no sense, because I have it set so one faction has all 4 provinces twice). Both Faction Manager entries have System Byte [4] with the proper faction number, still won't work.

    There are a ton of other directories in there that don't appear in the editsf, so it could be something in there.

    I am still missing something, but going to call it a night.

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

  10. #10

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

    Hey Dresden, great you got it working now! Now we've got double the manpower to solve this issue.

    Actually I'm struggling with exactly the same issue since yesterday
    1) If we leave both faction_province_managers be and add all 4 regions to each's byte arrays, now effecively both factions have full control of the province and it's regions. So no wonder we get ghost buildings in all regions. This is defenitely not the right way to do it. The issue regarding edicts might be, that the game might check if you are the only faction_province_manager in a province instead of counting the regions you control (it's just easier to implement so I guess that's why they do it like this)
    2) If we remove one faction_province_manager and have a byte array with all regions as an entry in the other, the game crashes on starting the campaign. However, if you look at factions who own a whole province at the beginning (check e.g. syria in province_array - 17 of the vanilla startpos.esf) or acquire the region ingame and check your savegame this is exactly how it is looking. One faction_province_manager with all the regions of the province referenced in the array(System.Byte).

    Now the question is, why the hell will the game refuse to start, when we remove a faction_province_manager? In a second shot, I thought maybe the faction_province_manager's and recruitment manager's IDs could be the issue. If you look at your remaining faction manager and the subsequent (after you deleted one) you see, that now of course there is a gap in the IDs. So we got e.g. 20 and 22, but 21 is missing since we deleted it. So I had some fun decrementing the faction_province_manager and its recruitment manager IDs of all the subsequent provinces and sea regions. However this did not resolve the issue. The game still crashes.

    I'm a 100% sure we're doing the faction_province_manager right when we do as mentioned in 2). It's just like the game does it when conquering the whole province. Yet, there most be a reference to the faction_province_managers or maybe a container naming the number of active faction_province_managers (or recruitement_manager since we delete one as well when removing the faction_province_manager) or something like that in the startpos.esf (and I hope there and not in any of the .packs or even hardcoded - the latter one being super stupid, so I really don't think so).

    There are a ton of other directories in there that don't appear in the editsf, so it could be something in there.
    This is not additional info as far as I understood. It's just structured in an other way. AFAIK you can see everything which is available in the startpos.esf in the EditSF (all but the System.Byte[] entries, for now).

    But well - it seems like we have to do a lot of searching now what we have to change additionally to allow us to remove a faction_province_manager...

  11. #11

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

    If you move just one region from Province manager A to ProvinceManager B, does the ghost construction remain? (Also keep a look out for zero construction in an AI factions new province) My guess is it will remain.

    There are a lot of references to regions and provinces tying them to factions in the CAI-section (they use a different reference system, check the governor objects), which is likely one of the reasons removing province manager objects entirely crash the game. Changin them is a huge chore though, and when I tried to on top of province manager changes the ghost cunstruction *still* remained. :/

  12. #12

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

    Thanks for your input Spmon... could you explain a little more what you've found out, since this CAI stuff really messes my head. I can't find any correlation there we got 129 governships and 129 factions. Now cai_bdi_component_property_set seems has same entries for every governship. cai_bdi_component differs only in the first value which is a high number i never saw anywhere before. Owned direct is another high number I've never seen. cai_governship is 36 for all again. Finally, I'm totally lost...

  13. #13

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

    There are definitely references to the faction province ownership value. Each faction ownership is assigned a unique value, which is the number that seems to have nothing to do with the rest of the table. That number is referred to in various cai directories. So, when I remove, say, faction ownership entry 65 (and leave it going from 64 to 66), the game is still looking for 65 from other references. That must be what causes the crash.

    I just now read Spmon and realized he is saying the same thing

    I am just as lost as you guys in the cai files. There are numbers there that have no real context. I found, for example, that in the cai regions area one referred to playable_carthaginian. But, I couldn't find the number 3 (carthage's value) in the table. I was hoping maybe the cai regions were still referring to a faction and that caused the ghost building.

    There are so many cai directories that arent even in ESF editor, its crazy. I have no idea what to do now, but it seems they made it a little too complicated to change region ownership.

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

  14. #14

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

    @Caki what error are you getting?


    I thought I made some progress but it ended up not changing anything. In the cai_faction directory are tables for each faction. I found that in that table are another set of numbers that correspond to the cai_regions directory entries (they aren't the same numbers as the region number or region array number). So, for my example I am working on Carthage and Libya. I gave Libya's region numbers to Carthage in cai_faction table and I changed Libya to be the same as a civil war faction, where they have no regions listed. The game loaded, but I still got phantom building and no edicts.

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

  15. #15

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

    Regarding the CAI references, some stuff I found:

    Owned_Direct entries (for example in the CAI regions or CAI faction provinces directories) seem to refer to governorships, which map to factions as you found:
    Rome: 1754
    Carthage: 1813
    C. Nova: 7713
    and so on

    Regions seem to refer to both provinces and to an owned_direct number. They are ordered alphabetically in the CAI directory, but they contain a field that refers to its "true" number in the World\Regions directory.

    There is a directory that also ties governorships to factions (through owned_direct). Provinces have their own numbering here and in the regions directory, but they can be determined as well:
    Italia: 17229
    Carthaginensis: 17389
    Africa: 17294
    and so on

    There is even a building slot directory that refers to regions through an owned_indirect field (which maps to the corresponding entry in the regions directory), but I assumed there is no need to change this.

    I guess to cut a long story short, the CAI section feels pretty opaque and no matter what I changed in the regions and faction provinces directories the ghost construction remained, i didn't even manage to break anything so I'm not sure if it even makes a difference! Managing to change the System.byte field is a great start though, good work!

  16. #16

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

    Quote Originally Posted by Spmon View Post
    Regarding the CAI references, some stuff I found:

    Owned_Direct entries (for example in the CAI regions or CAI faction provinces directories) seem to refer to governorships, which map to factions as you found:
    Rome: 1754
    Carthage: 1813
    C. Nova: 7713
    and so on

    Regions seem to refer to both provinces and to an owned_direct number. They are ordered alphabetically in the CAI directory, but they contain a field that refers to its "true" number in the World\Regions directory.

    There is a directory that also ties governorships to factions (through owned_direct). Provinces have their own numbering here and in the regions directory, but they can be determined as well:
    Italia: 17229
    Carthaginensis: 17389
    Africa: 17294
    and so on

    There is even a building slot directory that refers to regions through an owned_indirect field (which maps to the corresponding entry in the regions directory), but I assumed there is no need to change this.

    I guess to cut a long story short, the CAI section feels pretty opaque and no matter what I changed in the regions and faction provinces directories the ghost construction remained, i didn't even manage to break anything so I'm not sure if it even makes a difference! Managing to change the System.byte field is a great start though, good work!
    Sorry there were some errors above.

    CAI_World_Regions in the CAI directory simply refer to the owning CAI_World_Settlement through the OWNED_INDIRECT field. Settlements in turn refer to both the owning province and the owning faction/governorship (trough OWNED_DIRECT).

    Still, there are way too many unexplained fields here to make sense of it all.

  17. #17

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

    @Caki: did you use the corrected version of UnpackESF.ps1 from post #122? The initial post had some errors in it. If you already used the corrected ones, please pn me the error messages.

    @Spmon: So rome not only has the ID 2 but also the ID 1754? This gets more and more confusing... Also that the provinces have different numbering here... Maybe we really have to wait if CA gives out some modding tools to solve this. It seems way to stirred up for me to make sense of it with the little info we have...

  18. #18
    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?

    Thank you for helping me Styrry :-). Yes I used the one you updated. There is no error message or maybe there is but I don't know because the window closes very fast.
    Proud To Be Under The Patronage Of TheFirstONeill
    Proud team member of Thera, A New Beginning

  19. #19

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

    So you are starting the script by doubleclicking? If you start the powershell (search shell after hitting windows start button) navigate within it to the folder where the script is located and execute it you will see the error messages.

  20. #20
    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?

    Couldn't find the error log so I printscreend it before it closed :-D
    This is what it said:
    File UnpackESF.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
    + Categoryinfo : NotSpecified: <:> [], ParentContainsErrorRecordException
    + FullyQualifiedErrorld : RuntimeException
    I'm executing it by right click and "Run whit PowerShell" because double click opens the content in notepad
    Proud To Be Under The Patronage Of TheFirstONeill
    Proud team member of Thera, A New Beginning

Posting Permissions

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