Page 1 of 19 1234567891011 ... LastLast
Results 1 to 20 of 380

Thread: [Tutorial] How to change region ownerships + enable emergent factions to be played

  1. #1

    Default [Tutorial] How to change region ownerships + enable emergent factions to be played

    Hello,

    In this tutorial I will show you how you can give a region to another faction as well as making an emergent playable in the same process.

    First make a backup of your startpos.esf in the data/campaigns/main/ folder

    Next you will need to download this program http://www.twcenter.net/forums/showthread.php?t=242353 and open up your startpos.esf with it.

    I will start with making a emergent faction playable because it will in the end have the same process that is gone through as you would with adding a region to any faction whether it was already in the game.

    The first section we will be editing is known as the CAMPAIGN_PREOPEN_MAP_INFO as the name suggests this is what the game reads in when you are at the grand campaign start area so it can populate the menu with who can be played and what regions they own.

    We first want to edit CAMPAIGN_PLAYERS_SETUP. Find the emergent faction you wish to play.

    Under its CAMPAIGN_PLAYER_SETUP section you will see the faction's name and then three booleans. By setting the second boolean to True you will allow that faction to be chosen at the menu.

    Next find your faction in FACTION_INFOS and set the last integer to 1 or if you plan to give your faction multiple regions, then just put the number of regions you plan to give. This step may not be completely necessary because I notice for the faction I stole the regions from they automatically updated to reflect correctly in the start game screen.

    Next we have REGION_OWNERSHIPS_BY_THEATRE. Each subsection is for a specific theatre, India, America, Europe. So find the theater for your region and then find the specific region entry and change the faction name to the name of the Emergent faction you want to play.

    Now we are moving on to the CAMPAIGN_ENV section. This defines the bulk of the campaign state at the start of the first turn.

    Under CAMPAIGN_PLAYERS_SETUP you will do the same process as in the prior section where the second boolean needs to be set to True.

    Next we will move to CAMPAIGN_MODEL/WORLD.

    Under this section you will see a FACTION_ARRAY and a REGION_MANAGER. These are the two final areas we will be editing.

    Firstly go into the FACTION_ARRAY and find the Faction you want to be emergent or the faction you want to give a region to.

    When you have found him you will see a lot of data variables for the faction at its FACTION section level. Here is what some of them do:

    1. faction_id - int
    2. faction_db_name - uft16
    3. faction_display_name - utf16
    4. unknown - Boolean
    5. unknown - Boolean
    6. Is Major Faction? - Boolean
    7. unknown - Binary Data
    8. Official Religion - utf16
    9. unknown - Boolean
    10. capitol_region_id - Int
    11. capitol_region_id - Int
    12. unknown - Boolean
    13. Is Emergent? - Boolean
    14. unknown -Uint
    15. unknown - Binary Data
    16. unknown - int
    17. unknown - int
    18. Main AI mode - utf16 (FULL or MAINTAINANCE)
    19. AI Personality - utf16
    20. protector faction_id - int


    For Emergent factions to be playable you need to set Is Emergent? to False. (sorry forgot this step )

    So I suggest to write down the Faction ID# for your faction.

    Next we will go into the REGION_MANAGER and you will need to find the entry for your Region which may take some time as there are 205 regions to find it through.

    At the REGION section level you will see a large set of data for each region here is explained some of what they are:

    1. region_db_name - utf16
    2. region_id - int
    3. (skip past 13 unknowns)
    4. owner faction_id - uint
    5. owner theater_id - uint
    6. theater_name - utf16
    7. main_rebels - uft16 (Can be any Faction or just a rebels type)
    8. base rebels type - utf16 (This can only be a rebels type of faction)
    9. coastal climate? - utf16


    So first we want to take the faction_id of our faction and set the owner faction_id to this value.

    If you are using an emergent faction we will also need to go back to our faction section and change the capitol_region_ids to point to this region.

    Next we must proceed further into the region and edit parts of the REGION_SLOT_MANAGER and the SETTLEMENT sections.

    Proceed as far in as you can for each element in REGION_SLOT_MANAGER to if you can reach a BUILDING section which inside will have who owns the building and also the gov_type. You must edit each building to have your faction's name and government type.

    Furthermore for each REGION_SLOT you need to edit SEIGABLE_GARRISON_RESIDENCE/GARRISON_RESIDENCE. In there is a single Uint that holds the ID to the owner faction of this region. (These same things also get done for the region_slots inside of the Road and Fort Slots.

    Also do the same thing under SETTLEMENT for the SEIGABLE_GARRISON_RESIDENCE/GARRISON_RESIDENCE.

    If you followed all the steps correctly this region should now be properly owned by the faction you chose.

    If you were unlocking a emergent faction please note that you can only play as that emergent faction because the AI definitions for the emergent probably are not there so other factions crash on load.

    Update: How to decouple an enemy army from the settlement of a region they no longer own

    Next we will be looking at how you can get those pesky armies that start in a settlement out of the settlement. I found after so much turns the army eventually vanished. What typically happens to this army is it will exhibit behavior similar to trade fleets on trade nodes when the game first came out where they were trapped there. When you load up the game with this fix to your region you will see the army sits in the center of your settlement but is no longer in the settlement. I think soon the AI will realize that unit is borked and will destroy it on its own.

    So to do this step we will now be looking at the ARMY under the FACTION of the FACTION_ARRAY of the original owner of the region.

    So you see here that the first step will be to find what the army we want to edit is. To do this we need to go back to our Region we gave to the other faction.

    At the SETTLEMENT/SIEGEABLE_GARRISON_RESIDENCE level of our region we will see this data:

    1. settlement_id - int
    2. 8 unknowns
    3. some ai ID - int
    4. some ai ID - int
    5. garrisoned_army_id - int


    So here you see that we will want to make note of our settlement_id and to also change the garrisoned_army_id to 0 so that the settlement no longer has a garrison to it.

    We then take our settlement_id and we find the ARMY in the ARMY_ARRAY for the old owner of the region

    At the ARMY section level is some set of data which is explained thus:

    1. unknown Binary Data
    2. unknown Binary Data
    3. army_id - int
    4. settlement_id -int (for the settlement they are garrisoning, 0 if no settlement)
    5. unknown - boolean
    6. unknown - int


    So we change that settlement_id to be 0 so that the army no longer will think it is to be garrisoning that settlement. If all goes well you will find the army standing outside the settlement right at its center and after you save the game it should check validity of each armies position on the campaign and these bad armies will be sent to the nearest region. When I did Greece from the Ottomans this resulted in the army getting stuck on one of the little islands of Anatolia.

    Also for emergent faction if you want to get all your government people to generate you will need to capture a region and then instantly the game will generate a Faction Leader and ministers for your faction. (It is hard with some factions who cannot build stuff like Scotland, but with USA I tested this).

    Here are two esfs as an example. (You can only play the specific emergent faction for each esf since AI setups have not been developed into them for the emergents so playing anybody else caused crashes)
    startpos_us.esf gives the USA Virginia to start off. Once you capture another region everything should be working as normal, till then you cannot manage taxes you will have no faction leader or ministers. When I tested I just made 4 Minutemen and quickly attacked the region above me and then it was business as usual. Also in this file I made Portugal a Major faction with FULL AI just as a test.

    scotty_startpos.esf is a Scotland version. This one is near useless because as Scotland it would not let me build any building or any units so I was stuck with a city with just the garrison I think something in the db files could fix this maybe.

    http://rapidshare.com/files/213902506/main.zip.html
    Last edited by GeorgiaPeanuts; March 29, 2009 at 03:16 PM.

  2. #2
    aronnov's Avatar Tiro
    Join Date
    Oct 2004
    Location
    Nashville, TN
    Posts
    267

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    have my babies? +rep

    can you upload your .esf with usa playable and save some of us the trouble? do we want to set emergent to false?
    Last edited by aronnov; March 26, 2009 at 02:43 PM.
    Honor ... means that a man is not exceptional; fame, that he is. Fame is something which must be won; honor, only something which must not be lost. ~ Schopenhauer

  3. #3

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    Thanks alot! I'm going to try Ireland, I'll be back with some feedback in a bit.

    Crashed when I loaded the faction on the grand campaign, I'll try again. Probably did something wrong.

    The emergent factions doesn't have a portrait for the kings, might that be the problem? Do I have to copy a picture from another faction to the slot?

    I really did it exactly as it said this time but I still can't get Ireland to work, the "data\campaigns\main" is the Long Campaign, right? I'm positive I didn't do anything wrong this time. I'd love it if anyone who gets Ireland to work could upload the ESF.
    Last edited by Sorkenlol; March 26, 2009 at 03:06 PM.

  4. #4

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    I wonder why there are 2 capitol id's...

    Nice work dude.

  5. #5
    aronnov's Avatar Tiro
    Join Date
    Oct 2004
    Location
    Nashville, TN
    Posts
    267

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    Quote Originally Posted by Cursisanafou View Post
    I wonder why there are 2 capitol id's...

    Nice work dude.
    Yeah i wondered that too. I just populated them both with the same value. *shrugs*

    Thanks alot! I'm going to try Ireland, I'll be back with some feedback in a bit.

    Crashed when I loaded the faction on the grand campaign, I'll try again. Probably did something wrong.

    The emergent factions doesn't have a portrait for the kings, might that be the problem? Do I have to copy a picture from another faction to the slot?
    I dont think the faction picture matters. did you go down to every building in the town and change the building to the new owner? that's the step i forgot the first time.
    Honor ... means that a man is not exceptional; fame, that he is. Fame is something which must be won; honor, only something which must not be lost. ~ Schopenhauer

  6. #6

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    There will be no faction leader or ministers till you capture another region. So you cannot use the tax/etc panel till then.

  7. #7

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    Quote Originally Posted by aronnov View Post
    Yeah i wondered that too. I just populated them both with the same value. *shrugs*



    I dont think the faction picture matters. did you go down to every building in the town and change the building to the new owner? that's the step i forgot the first time.
    Yeah, I've re-done it 3 times now to make sure I didn't miss anything and I didn't. Maybe it's just Ireland, I don't know. When you change the ID of the Garrison Residence, do you change the ID in both Garrison Residence and Siegable Garrison Residence? I've only changed it in Garrison Residence, not sure if I should change both.


    I'm going to try USA now and see if that works.

    Didn't work either.. Has someone else gotten an emergent faction to work?
    Last edited by Sorkenlol; March 26, 2009 at 03:31 PM.

  8. #8

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    You just need to change the GARRISON_RESIDENCE which holds the id of the faction who the residence is owned by.

    Also make sure you have changed the emergent factions capital to be the region_id of their region you add to them and that you have set the Is Emergent? to False.

  9. #9

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    Quote Originally Posted by GeorgiaPeanuts View Post
    You just need to change the GARRISON_RESIDENCE which holds the id of the faction who the residence is owned by.

    Also make sure you have changed the emergent factions capital to be the region_id of their region you add to them and that you have set the Is Emergent? to False.
    Ah ok, I never set "Is Emergent" to false, I'll try this hold on.

    It worked Thanks!
    Last edited by Sorkenlol; March 26, 2009 at 03:54 PM.

  10. #10

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    Ok I added a zip file with two examples. One for Scotland and one for USA

  11. #11
    aronnov's Avatar Tiro
    Join Date
    Oct 2004
    Location
    Nashville, TN
    Posts
    267

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    Is usa government gov_republic?

    n/m. i see the upload.
    Honor ... means that a man is not exceptional; fame, that he is. Fame is something which must be won; honor, only something which must not be lost. ~ Schopenhauer

  12. #12

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    Also the best way to use this would be to load up each seperate campaign for an emergent faction and save the game. Then you can return to the default campaign esf file and still be able to start a campaign with emergent faction by loading one of the saves that were made from its start

  13. #13

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    You beat me to posting how to edit regions. Darn, I wanted to be Lord of the Tutorial Makers.

  14. #14

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    Maybe find the values in the RTI campaign for emerged factions.. see what is different..

  15. #15

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    I know how to do everything to completely fix it, the ESF editor doesn't currently support the features I need to do it though. I just make a few saves with as many emergents emerged to get AI defines and armies + ministers, but till you can copy from one instance of the program to another and also copy any section type it is not possible.

  16. #16
    aronnov's Avatar Tiro
    Join Date
    Oct 2004
    Location
    Nashville, TN
    Posts
    267

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    my loads are ctd when attempting to load an emergent faction
    Honor ... means that a man is not exceptional; fame, that he is. Fame is something which must be won; honor, only something which must not be lost. ~ Schopenhauer

  17. #17

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    I tried your USA/Virginia file. It works great, but interestingly enough it seems that my taxes are still somehow connected to the 13 colonies'. When I conquer a region and access the tax policy screen, my colony with the lowest public order was "New York." My only regions were Virginia and the Carolinas. Also, every time I exempt Virginia from taxes, it reverts back the next turn.

    Otherwise things run smoothly so far. I will see what happens when I eliminate the 13 colonies.

  18. #18

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    I create hungary as playable in gc. added the province hungary,croatia,transylvania to it. hungary province is also the capital. Croatia, transylvania works ok, because by default there is no austrian garrison. In pressburg there is an austrian garrison, so i can built anything in pressburg, but the flag of the city is austrian. Also if i give austria a military acces, He withdraw some of his armies, but not all. How can i edit the ingame armies???

  19. #19

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    Quote Originally Posted by derringer View Post
    I create hungary as playable in gc. added the province hungary,croatia,transylvania to it. hungary province is also the capital. Croatia, transylvania works ok, because by default there is no austrian garrison. In pressburg there is an austrian garrison, so i can built anything in pressburg, but the flag of the city is austrian. Also if i give austria a military acces, He withdraw some of his armies, but not all. How can i edit the ingame armies???
    If you see the name of his army's general then you can go to Austria's ARMY_INFO array and delete the whole Army in there with that general in it.. I haven't been able to find a location information yet so can't move it.

  20. #20

    Default Re: [Tutorial] How to change region ownerships + enable emergent factions to be played

    Hey GeorgiaPeanuts could you help me. I tried to give the us a single region, Pennsylvania, I made it the US capital and switched the thirteen colonies capital to Boston, but when I started up the game, I saw that the colonies still controlled Pennsylvania over me, is there anyway I fix this, or make it to where the US will appear via revolution?
    Last edited by Wise Strategist; March 26, 2009 at 11:02 PM.

Page 1 of 19 1234567891011 ... LastLast

Posting Permissions

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