Page 1 of 50 123456789101126 ... LastLast
Results 1 to 20 of 986

Thread: STARTPOS.ESF analysis and modifications. HYBRID startpos.esf

  1. #1

    Default STARTPOS.ESF analysis and modifications. HYBRID startpos.esf

    Decoding” crucial files like startpos.esf that are needed for minor or major modifications is a long proses due to lack of CA's modding tools. I've decided to make this tutorial with all the informations I've found so far. Also there are many pieces of informations in several posts around. I've included just some of these but there more that need to be gathered. And that is the ambitious objective of this tutorial: to become a place where will be gathered several already known futures of these files and to be provoked further improvement in modding them. Any contributions in theoretical or practical ideas, successful tests experiments and modifications are needed. In the other hand questions are added in several threads about changes in startpos. In this case a guide is needed and this tutorial/research will try to help in this direction, revealing some of the roots in startpos.esf labyrinth.

    Contents:

    1. THEORY

    2. TOOLS

    3. TUTORIALS BASED ON STARTPOS.ESF CHANGES

    4. ANALYSIS

    5. MODIFICATIONS (How to)

    • LEVEL 1

    (Use EasyEsf to make all Level 1 changes easily)

    1. Minor faction playable
    2. Starting treasury
    3. Minor faction to major
    4. Starting date-Turns per year
    5. Change faction's capitol
    6. Adding victory conditions
    7. Starting technology
    8. Change government type


    • LEVEL 2


    1. Emergent to playable
    2. Playable to emergent
    3. Activate emerged facilities
    4. Remove fog of war
    5. Diplomacy manager
    6. Protectorate playable
    7. Editing Starting Armies
    8. How to establish Patron _ Protectorate relations
    9. Determine the number and the sequence of character's portraits appearance


    • LEVEL 3


    1. Change region's ownership
    2. Change ownership of characters
    3. Change ownership of armies and fleets
    4. Convert minor to major city
    5. Enable Unique Regiment Names
    6. How to relocate a whole army or a unit


    • LEVEL 4


    1. HYBRID STARTPOS.ESF


    • LEVEL 5


    1. HYBRID STARTPOS.ESF

    Startpos.esf:
    As it's name says startpos is the starting position of the game. It's database includes all the elements of the game and the way they are connected. Maps, theatres, factions, regions, armies, trading roots and posts, governments, families, even the roots of the horse wagons that carry commodities are included.
    Regions.esf:
    This file includes the positions and the roots on the campaign. Demis14 connects it also with the positions of buildings in battle map.
    EsfEditor (l.v. 1.4.3.0)
    Thanks to Just there is EsfEditor that has been improved by koras31 and alpaca. It can handle multiply .esf files like startpos, regions and saved_games. This is the basic interface:


    Here you can see the database tree and the informations that can be displayed. Except Values and Types has also 2 very helpful columns. In Description can be noted by the user general descriptions of the values which are known. (Here you can find Lazy Knights NodesDescriptions file with many useful descriptions. Just replace the one in EsfEditor's installed directory). When you change a value -and until save it- the original remains in Original Value until you save it.
    Links for more info:
    Grid_spreadsheet
    Erasmus777, based on the relations among the basic coordinates of a settlement and the coordinates of her building slots, has made a very useful spreadsheet that calculates new coordinates when building slots are added or disabled.
    Link: spreadsheet
    HusserlTW: How to convert a minor city to a major one

    More "How to" in the Modifications section at the end of the tutorial.

    EDIT: Most of the images are from v. 1.2 startpos. Some of the deference from the startpos.esf v. 1.4.0 build, is that Ids numbers have changed in the field of WORLD. In CAI, the records have their Id's been increased by 2. Note that main_2 startpos (RTI_4 or Late Campaign) uses different CAI id's. To find them easily go in CAI_WORLD_REGIONS find the region's record that settlement belongs to, and there you'll see settlement CAI Id.

    Trying to present known elements of
    startpos.esf and regions.esf, I am going to follow the root of the known connections inside these files. To do that I will follow Portugal in the labyrinth of the vanilla startpos.esf. Although this presentation follows linear the database tree, as it is shown in the left window of the editor, working in startpos.esf usually it is not like this. Searching or heading to a record following the shortest root through the connections among them is often the quicker way. Since starting points often is a name (faction, region, etc.) and the long lists of the records are not in alphabetical order, it is helpful to be advised by lists that are made in the forum, with useful connections. Some of them are included in the tutorial. Especially entering CAI_INTERFACE most common way is through CAI_BUILDING_SLOTS ID's using the BUILDING_SLOT ID.1

    Spoiler Alert, click show to read: 

    Faction:Portugal
    Status: minor, not playable
    Regions: portugal, curacao.
    Capitol: Lisbon
    Government: Absolute monarchy
    startpos.esf/
    CAMPAIGN_STARTPOS/
    CAMPAIGN_PREOPEN_MAP_INFO:
    The first data about Portugal are met in CAMPAIGN_PLAYERS_SETUP/PLAYERS_ARRAY/PLAYERS_ARRAY/:
    Spoiler Alert, click show to read: 
    Here are the factions with the relations to the player. In the table above there is a list with all the players_array and their position in the list:

    The 27th record that belongs to portugal:
    CAMPAIGN_PREOPEN_MAP_INFO/CAMPAIGN_PLAYERS_SETUP:
    Spoiler Alert, click show to read: 
    The second false value tells if portugal is playble (True) or non (False). There are other fields need to be changed for activating a non playable factions in next records.
    CAMPAIGN_PLAYERS_SETUP/CAMPAIGN_VICTORY_CONDITIONS:
    Spoiler Alert, click show to read: 


    These values are the same for all factions in PLAYERS_ARRΑY (factions) as those in CAMPAIGN_PLAYERS_SETUP_MODIFIABLES.

    CAMPAIGN_PREOPEN_MAP_INFO/VICTORY_CONDITION_OPTIONS:
    There is a list of the faction is in a different order. Portugal's VICTORY_CONDITION_OPTIONS:
    Spoiler Alert, click show to read: 

    VICTORY_CONDITION_OPTIONS of Portugal is divided by 4 VICTORY_CONDITION_BLOCK which include the preconditions for victory in every campaign scenario.
    Spoiler Alert, click show to read: 

    The CAMPAIGN_VICTORY_CONDITION of the first VICTORY_CONDITION_BLOCK is for campaign mod 0 (short), which ends in 1750 and the player must own 10 provinces:
    Spoiler Alert, click show to read: 

    Among them must be the regions that included in the the REGION_KEYS under VICTORY_CONDITION_BLOCK:
    Spoiler Alert, click show to read: 

    The rest three blocks has the preconditions for the campaign mod 1-long, 2-prestige, 3 - world domination.

    CAMPAIGN_PREOPEN_MAP_INFO/FACTION_INFOS:
    Here are the factions in the same order as in PLAYERS_ARRAY with basic informations.
    Spoiler Alert, click show to read: 


    Portugal is the 27th record with infos about portrait, description and the region that the faction owns. The entries in 3rd and 4th line are True/True for playable faction, False/False for unplayable and True/False in Mughal and US.

    CAMPAIGN_PREOPEN_MAP_INFO/REGION_OWNERS_BY_THEATRE:
    All the regions with the owner faction are grouped in the 3 theatres, europe, america, india.
    Spoiler Alert, click show to read: 

    Above the REGION_OWNERSHIPS malaba-portugal in indian theatre.

    startpos.esf/
    CAMPAIGN_STARTPOS/CAMPAIGN_ENV:
    Spoiler Alert, click show to read: 

    CAMPAIGN_ENV/CAMPAIGN_SETUP includes the same records as startpos.esf/CAMPAIGN_STARTPOS/CAMPAIGN_PREOPEN_MAP_INFO/CAMPAIGN_PLAYERS_SETUP:
    Spoiler Alert, click show to read: 

    CAMPAIGN_SETUP/CAMPAIGN_SETUP_OPTIONS:
    Spoiler Alert, click show to read: 


    Unknown entries with 6th and 7th lines matching with 7th and 8th entry of next table.

    CAMPAIGN_ENV/CAMPAIGN_MODEL:
    Spoiler Alert, click show to read: 


    CAMPAIGN_MODEL/
    CAMPAIGN_MAP_DATA:
    Spoiler Alert, click show to read: 



    CAMPAIGN_MODEL/WORLD/
    Here is one of the most interesting fields of startpos.esf -and area of many modifications-. where detailed settings and unique ID's are given to game elements.
    WORLD/FACTION_ARRAY:
    Spoiler Alert, click show to read: 

    In FACTION_ARRAY/FACTION we can see informations about Portugal. Some interesting are in line:
    1st faction's ID.
    6th False for minor, True for major.
    8th, 10th True playable, False non. If True is placed here for a minor faction, even it is playable by modding, the game crashes.
    11th , 12th Capitol region ID. Regions ID's are in a later record of WORLD.
    13th Demis14 connects True/False with emergent/non emergent.
    17th , 18th Usually is 0. Some of the major factions have numbers like France 4960/2150, Ottomans 3690/730, Austria 4570/0, etc.
    19th The following strategy during the game. All the minor nations have MAINTANANCE and majors FULL.
    20th Is something like special ability. Portugal's is maritime_repressive. The minors have usually default. Some of them like Morocco have no_europe but most of non europe factions have default. The values of the major factions are variable. Brtain maritime_progressive, France mixed_progressive, Austria continental_progressive, Netherlands trader, Spain maritime_repressive, etc. There are also major with default like Sweden and no_europe like Ottomans or Maratha.
    23th - 26th All values are 0 for minor factions. Major have numbers (like 8, 10, 15, etc.).

    FACTION/ANCILLARY_UNIQUENESS_MONITOR:
    Spoiler Alert, click show to read: 

    As in all minor factions, ENTRIES in Portugal are empty. In the above image is Britain with two ENTRIES: Ancillary_Government_Comptroller and Ancillary_Army_Merc_Artilleryman.

    FACTION/CAMPAIGN_PLAYERS_SETUP:
    Spoiler Alert, click show to read: 

    Same records as in CAMPAIGN_PREOPEN_MAP_INFO.

    FACTION/FACTION_ECONOMICS:
    Spoiler Alert, click show to read: 

    Staring money of Portugal.

    FACTION/DIPLOMACY_MANAGER:
    Spoiler Alert, click show to read: 

    Here are the relations between Portugal and the other factions. Above in DIPLOMACY_RELATIONSHIP Portugal is neutral to faction with ID 351568752 which is new_spain.
    Spoiler Alert, click show to read: 

    For the relation between Portugal and New Spain there are 22 DIPLOMACY_RELATIONSHIPS_ATTITUDES_ARRAY. Most of them have 0 values in 1, 2, 3, and 5th line. If a number appears in one of 1, 2, 3, then False in 4th line turns to True. Same thing happens in 5th and 6th line.

    MORE INFO: Lazy Knight

    FACTION/GOVERNMENT:
    Spoiler Alert, click show to read: 

    ID an type of Portugal's government.

    GOVERNMENT/POSTS_ARRAY/CHARACTER_POST:
    Spoiler Alert, click show to read: 

    In Portugal's GOVERNMENT there are 9 CHARACTER_POST's. 7 are for the ministers and 2 governors for Europe and India. In every record are noted the government post ID, the type, the character ID and the government ID of Portugal.

    GOVERNMENT/GOV_IMP
    Spoiler Alert, click show to read: 

    Probably when the first revolution is occurred. Above, after 10 turns or years (?) a CONSTITUTIONAL_MONARCHY will be attempted (?).

    FACTION/FAMILY:
    Spoiler Alert, click show to read: 

    In FAMILY are included the Monarch and his successors. The 5t line maybe is the turns or years that he will be replaced by his successor. CAMPAIN_LOCALISATION and PORTRAIT_DETAILS link to descriptions and details (loc files). The records of successors have 0/False values.
    Spoiler Alert, click show to read: 

    Every MONARCH_INFO_CHARACTER seems to have a NAME_ALLOCATION_DETAILS record. One of them has in 1stline 0 (the others have numbers) and in second the number 4245029912. These type of 10 digit numbers are met also in the other records.
    Comment:
    We have also meet CAMPAIGN_MODEL with 10 digit number and CAMPAIGN_MODEL/RandSeed with 11th digit number.

    FACTION/CHARACTER_ARRAY/CHARACTER:
    Spoiler Alert, click show to read: 

    In this CHARACTER table of a Portugal minister there are in line:
    1st Character ID
    2nd Type of character. Except ministers here are the generals, admirals, captains, gentlemen and rakes.
    7th The government post ID for this minister. It is GOVERNMENT/POSTS_ARRAY/CHARACTER_POST ID for finance we've met already. So this character is the minister of treasury.
    14th Number 10 is met on land CHARACTERS and 15 on sea CHR's (admirals, etc.)

    CHARACTER_ARRAY/CHARACTER/LOCOMOTABLE:
    Spoiler Alert, click show to read: 

    1st and 2nd line are the location of finance minister. These are the basic coordination's of Lisbon settlement (we'll meet the entries later), where the government is settled. The coordinates varies from character to character depending on his location on campaign map.
    Comment:
    I've noticed many remaining entries like settlements coordination's, which are connected with several records, in attempts of changing region ownership.

    FACTION/ARMY_ARRAY:
    Spoiler Alert, click show to read: 


    Here are registered the armies and navies of Portugal. Every army has it's ID, settlement ID (if it is inside settlement as in Lisbon). In MILITARY_FORCE the character leader's ID (general or captain) and in UNITS_ARRAY the units that this army has in the beginning of the game.

    WORLD/REGION_MANAGER

    Thanks to
    Gerlandric here is an update list after 1.4 patch.

    Spoiler Alert, click show to read: 

    This is the REGION portugal and in line:
    1 Region name.
    2 Region ID
    6-11 Demis14 connects these numbers with economic figures like starting wealth of productive facilities.
    17 Controlling faction ID
    18 Governorship ID
    19 Theatre
    20 Emerging nation
    21 Region rebels
    22 Region group. Bournoutfigshas moded this line so New Orleans get europe civilian buildings around city and not native american's(sc_european_americans).

    REGION/LINE_OF_SIGHT:
    Spoiler Alert, click show to read: 

    Most of the regions have that record just after SETTLEMENT. All the QAD_TREE_BIT_ARRAY_NODE sub-records have no values.

    REGION/POPULATION:
    Spoiler Alert, click show to read: 

    These three numbers of population have nothing to do with the 3 classes. 1st and 3rd is very close to staring population.
    Spoiler Alert, click show to read: 

    In REGION_FACTORS 2nd line is the population number that you can see in the Lists of in game interface, regions tab, in Lisbon city. Maybe the fourth line is the population of all region.
    REGION_FACTORS contains 3 population records for the 3 classes with the same values (0 most cases). RELIGION_BREAKTROUGH determines the religion of Portugal.
    Spoiler Alert, click show to read: 

    Above in rel_catholic table 2nd line is 1 and in all others religions 0.

    REGION/REGION_SLOT_MANAGER
    Here are placed all the building slots of buildings, towns, ports, farms and mines for region portugal. Minor cities have only 1 building (minor_government), major 4 or 5.
    Spoiler Alert, click show to read: 

    Above is the table of Lisbon's army building:
    1 REGION_ SLOT ID for army building.
    2 Type of slot, settlement lisbon:settlement_army-admin.

    5, 6 The coordinates of its location in Lisbon settlement major city.
    8 Type of civilian small buildings. Can be between 1-5 depending on the city growing. Here there are images of the 5 levels.
    10, 11 Are connected with the type of slot as well as 7, 8.
    12 The 10 digit number 4294967295 is shown in many occasions. Amazing coincidence (?) that is the same with highest value of turns per year in Just's tool.
    REGION_ SLOT/SIEGABLE_GARRISON_RESIDENCE must have the REGION_ SLOT ID, and GARISSON_RESIDENCE the FACTION ID
    REGION_ SLOT/BUILDING_MANAGER is True/False if the slot exists in the beginning and False/False if it is going to be spawned later in the campaign:
    Spoiler Alert, click show to read: 

    If the slot is occupied by a building (True/False) then the sub-record BUILDING appears with the specific type and level of slot.
    Spoiler Alert, click show to read: 

    Above the army building of Lisbon in army_encampment level.

    REGION_SLOT_MANAGER/SETTLEMENT
    This record has to do with the city of Lisbon:
    Spoiler Alert, click show to read: 

    First line's value must be the same with 8th line of city's building slots. In 2nd and 4th the status of settlement lisbon
    and in 3rd the owner faction.

    SETTLEMENT/ SIEGABLE_GARRISON_RESIDENCE table is almost the same as REGION_SLOTS,
    Spoiler Alert, click show to read: 


    plus the basic coordinates of the settlement in lines 10, 11 and the ARMY ID that is stationed there in the beginning of the game. The same coordinates were met in the CHARACTERS that are in city. Also this ARMY ID is connected with the ARMY and the it's leader records in FACTION/ARMY_ARRAY and FACTION/CHARACTER_ARRAY.


    REGION_SLOT_MANAGER/REGION_RECRUITMENT_MANAGER:
    Spoiler Alert, click show to read: 



    Portugal owns a second region, Goa in India, which has it's own REGION records.

    CAMPAIGN_MODEL/CAI_INTERFACE
    CAI_INTERFACE/CAI_WORLD
    All the CAI records are connected among them and with the rest startpos file. Here are gathered all the elements by type and not by region or by faction. CAI uses it's own ID's. Portugal has a FACTION ID (352193016) and a CAI_FACTION_ID (1341).
    CAI_WORLD/CAI_WORLD_FACTIONS. The order is the usual by FACTION ID and Portugal is the 27th .
    CAI_FACTION ID for Portugal can be found here in the 1st line of it's record. The record numbers are from 1263-1431. Not all the numbers between 1263-1431 are used. The unused numbers are not free but are used in other field of CAI. That's a rule in CAI records numbering.
    CAI_WORLD_FACTIONS/CAI_FACTION:
    Spoiler Alert, click show to read: 

    6th and the last line is CAI_REGION ID where the capitol is, that means region portugal. These are 0 in emerged factions.
    7th is FACTION ID of Portugal as is registered in WORLD/FACTION _ARRAY.
    10th is CAI_TECHNOLOGY_TREE ID of Portugal.

    CAI_WORLD/CAI_WORLD_REGIONS
    CAI_WORLD_REGIONS records are numbered in the area between 52-1261. It's easy to find portugal CAI_REGION since it's ID (629) is registered in CAI_FACTIONS.
    Spoiler Alert, click show to read: 

    CAI_REGION ID of portugal in 1st line, CAI_WORLD_TRADING_POST in 11th.

    CAI_WORLD_REGIONS/OWNED_INDIRECT
    Here is registered the CAI_SETTLEMENT (Lisbon) ID.
    CAI_WORLD_REGIONS/CAI_REGION
    CAI_REGION records are numbered in the area between 1439-3588.
    Spoiler Alert, click show to read: 

    3rd line is CAI_SETTLEMENT (Lisbon) ID.
    5th, 6th basic coordinates of Lisbon settlement and are the same with regions.esf/regions(portugal)/settlements_and_slots, 1st line.
    11th the region name.
    12th REGION ID.
    13th CAI_COVERNRSHIP ID.

    CAI_WORLD/CAI_WORLD_SETTLEMENTS
    Theserecords are numbered in the area between 1439-3588.
    As registered in CAI_REGION, CAI_WORLD_SETTLEMENT of portugal (Lisbon) is 1752.
    Spoiler Alert, click show to read: 

    In the following list of settlement you can find the CAI_SETTLEMENT ID's. Using this list is very useful especially for the settlements that are not capitol's.Due to changes in startpos.esf (1.3.0 build), the right ID is this the list plus 1.



    In CAI_WORLD_SETTLEMENTS/OWNER_DIRECT there is CAI_FACTION ID of Portugal.
    CAI_WORLD_SETTLEMENTS/CAI_SITUATED:
    Spoiler Alert, click show to read: 

    CAI neededs informations for the location of settlement Lisbon. The coordinates in 1sth and 2nd line are the basic coordinates of settlement Lisbon and are registered in portugal's region REGIONS_ARRAY/SETTLEMENT/SIEGABLE_GARRISON_RESIDENCE of WORLD/REGION_MANAGER/
    In CAI_WORLD_SETTLEMENTS/CAI_GARRISONABLE first line there is CAI army ID which is our key to enter CAI armies later.

    CAI_WORLD_SETTLEMENTS/CAI_SETTLEMENT:
    Spoiler Alert, click show to read: 

    CAI_FACTION ID and SETTLEMENT ID. Only settlements who are the same time capitols have in the second line the CAI_FACTION ID. For the rest, the value is 0.

    CAI_WORLD/CAI_WORLD_BUILDING_SLOTS
    CAI_WORLD_BUILDING_SLOTS records are numbered in the area between 1433-3591. The quicker way to find a CAI_BUILDING_SLOT record is using the CAI_SETTLEMENT ID that belongs to. The records with numbers close to it are the CAI_BULDING_SLOTS records. To find settlement Lisbon's I am looking the records around 1752 checking the CAI_WORLD_BUILDING_SLOTS/CAI_BUILDING_SLOTS of every record.
    Spoiler Alert, click show to read: 

    In the third line is the CAI_SETTLEMENT ID settlement Lisbon's: 1752. In the first the BUILDING_SLOT ID that has been registered in REGION_SLOT_MANAGER of WORLD/REGION_MANAGER/REGIONS_ARRAY (portugal). Above is the CAI record 1745 of the army-admin building slot of Lisbon city. The second line is 0 for city building slots and 1 for road and fortifications. In this way can be found the records 1745, 1746, 1747, 1748, 1749, 1750, 1751 that belongs to the 5 buildings of the city (in minor 1), and to city's road and fortifications.
    The rest CAI building slots (towns, ports, farms, mines, etc.) are the first records after 1742nd : 1754, 1756, 1758, 1760, 1762, 1764, 1766. They belong to 1 port, 4 towns, 1 wineries and 1 sheep farm, that exist in portugal region. As in city's building slot, in the first line of CAI_BUILDING_SLOT record is the BUILDING_SLOT ID. In second changes depending on the type: towns 2, ports 3, sheep farms, wineries, 5. In the third line there is a link that leads not to the CAI_SETTLEMENT ID as in city's building slot, but to a specific record in CAI_RIGION_SLOTS.

    CAI_WORLD/CAI_WORLD_REGION_SLOTS
    CAI_WORLD_REGIONS_SLOTS records are numbered in the area between 1441-3591. These are the “alter ego” of the CAI_BUILDING_SLOTS that are non city building slots and provide CAI with additional need informations. Next image belongs to Porto's CAI_REGION_SLOT ID.
    Spoiler Alert, click show to read: 

    In OWNED_INDIRECT is CAI REGION ID
    In CAI_SITUATED are the coordinates registered in building slot of REGIONS_ARRAY:
    Spoiler Alert, click show to read: 

    The second CAI_SITUATED record under CAI_REGION_SLOT appears only in ports. The coordinates are very close to those of it's place and maybe has to do with the position of ships recruitment. The number in 3rd line (170) is the CAI ID of the sea that is attached. Seas have their own CAI_REGION ID.
    WORLD/CAI_WORLD_RESAURCE_MOBILES
    This is the list of the armies in the beginning of the game. The easiest way to get here is with CAI army ID in CAI_WORLD_SETTLEMENTS/CAI_GARRISONABLE.
    Spoiler Alert, click show to read: 

    In the first 2 sub-records, informations can be found about the owner CAI_FACTION, the CAI_REGION ID the army is stationed and the coordinates of its place.
    In CAI_BDI_COMPONENT_BLOCKS_OWNS are probably connected with the green area in campaign map of army response.
    In CAI_RESOURSE_MOBILE there is the CAI_CHARACTER ID that this army is being assigned to. In the second line is CAI_SETTLEMENT ID and in 10th line the army ID that was registered in WORLD/FACTIONS_ARRAY/FACTION/ARMY_ARRAY.
    Spoiler Alert, click show to read: 

    The next records in the list are for the rest armies and fleets of Portugal. Armies and fleets are organised by the game in groups registered to a character (general, admiral, etc.). If there is not general then one of the units becomes colonel and a new character record is created in FACTION/CHARACTERS.
    CAI_WORLD/CAI_WORLD_UNITS
    Here are the units of the armies. Having in mind the numbering system that CAI uses, these ID's should be in the records closest to the number of CAI_ARMY ID.
    Spoiler Alert, click show to read: 

    In CAI_UNIT there is the CHARACTER ID in first line. This happens only to the units that belong to CHARACTERS, like body_guards to generals. The rest units of the army have in 1st line 0. The unit ID is registered in FACTION/ARMY_ARRAY. In 3rd line is the CAI_ARMY ID we saw previously.
    CAI_WORLD/CAI_WORLD_CHARACTERS:
    Spoiler Alert, click show to read: 

    Here are the CAI records of all characters that are registered in FACTION/CHARACTERS with the ID of the 4th line. In first and third lines are the CAI_ARMY ID or 0 if is a civilian (minister, priest, etc.). Gentlemen and Rakes have also CAI_ARMY ID but they luck CAI_UNIT ID so in second line is 0. For military CHARACTERS here is the basic CAI_UNIT he belongs (e.g. body_guards).
    CAI_WORLD/CAI_WORLD_FORTS:
    Spoiler Alert, click show to read: 

    Typical CAI record about forts with basic informations. CAI_FORT ID, coordination's of its place, CAI_REGION ID of the region it is settled and CAI_ARMY ID if one is stationed.



    Here are some modifications that can be made through startpos changes. You can check the ANALYSIS section to find ID's or other proper entries that are not described in this section.

    It will be very helpful to replace the NodesDescriptions file in the EsfEditor installed directory with this one for v. 1.3.4 or this for erasmus v. 1.4.5.

    LEVEL 1

    main/startpos.esf/CAMPAIGN_STARTPOS/ [..]

    1. Minor faction playable
    Spoiler Alert, click show to read: 
    [..] CAMPAIGN_PREOPEN_MAP_INFO/PLAYERS_ARRAY/PLAYERS_ARRAY (non playable faction)/ middle False change to True
    [..] CAMPAIGN_PREOPEN_MAP_INFO/FACTION_INFOS/ FACTION_INFOS/ 3rd and 4th False change to True
    [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/WORLD/FACTION_ARRAY/FACTION_ARRAY/FACTION/CAMPAIGN_PLAYERS_SETUP/ middle False change to True
    [..] CAMPAIGN_ENV/CAMPAIGN_SETUP/PLAYERS_ARRAY/PLAYERS_ARRAY/ middle False change to True

    2. Starting treasury
    Spoiler Alert, click show to read: 
    [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/WORLD/FACTION_ARRAY/FACTION_ARRAY/FACTION/FACTION_ECONOMICS in 1st line change the amount.

    3.Minor faction to major
    Spoiler Alert, click show to read: 
    [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/WORLD/FACTION_ARRAY/FACTION_ARRAY/FACTION/ 6th False change to True.

    X-minor faction will be shown among the major factions in game menus (diplomacy, prestige, etc.) and news/events will be shown during the campaign (if the player is playing as another faction).

    4. Starting date-Turns per year
    Spoiler Alert, click show to read: 
    [..] CAMPAIGN_PREOPEN_MAP_INFO/DATE, here you can change the date in menu factions info.
    [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/ CAMPAIGN_CALENDAR/DATE, for the date in game's hud.

    In CAMPAIGN_CALENDAR is determined the turns per year (1st line) and the turns that have past (2nd and 3rd lines in saved_games). The date has to do mainly for the victory conditions and the turns meter for the game AI calculations for all characters, units, ships, etc. who have a date of birth or recruitment. So, if you change the date, say 1900, you'll get a message that you've lost in the opening screen, but the game can be continued even your units are born in 17th cent.

    5. Change faction's capitol
    Spoiler Alert, click show to read: 
    [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/WORLD/FACTION_ARRAY/FACTION_ARRAY/FACTION place the new capitol-region ID in 11th and 12th entry.

    6. Adding victory conditions
    Spoiler Alert, click show to read: 
    [..] CAMPAIGN_PREOPEN_MAP_INFO/VICTORY_CONDITIONS_OPTIONS/
    clone a VICTORY_CONDITIONS_OPTIONS record and change the faction name . In every VICTORYVICTORY_CONDITIONS_BLOCK (one for every scenario) edit the regions. One of them must be always the capitol region.

    7. Starting technology
    Spoiler Alert, click show to read: 
    [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/WORLD/FACTION_ARRAY/FACTION_ARRAY/FACTION/FACTION_TECHNOLOGY_MANAGER/techs/techs, 2nd entry 0, 3rd the value of the technology cost in research points, which you can find in the patch.pack's "technologies_tables" (thanks to Lazy Knight's correction).

    8. Change government type

    See here.

    LEVEL 2

    1. Emergent to playable
    Spoiler Alert, click show to read: 
    Make the emergent (e.g. Scotland) playable as it was a minor (see LEVEL 1). Also in [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/WORLD/FACTION_ARRAY/FACTION_ARRAY/FACTION IN 11th and 12th entries enter capitol region ID (scotland) and change the 14th True to False.

    Then add enough money in the emergent faction's treasury. Now you can start the game as the emergent (Scotland). Open diplomacy menu and buy the capitol region of the emergent faction (scotland) from the faction that owns it (Britain).

    After buying is completed the emergent faction is fully unlocked and playable. Save the game and exit. Open saved_game and restore the treasuries of the two factions (see LEVEL 1). Using your original startpos.esf and the saved_game make a hybrid startpos by replacing the CAMPAIGN_MODEL of startpos with the one from the saved_game (see more in LEVEL 4). Now the saved_game has become a real startpos.esf where your emergent is playable.
    2. Playable to emergent
    Spoiler Alert, click show to read: 
    Give all regions to another faction. Then in [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/WORLD/FACTION_ARRAY/FACTION_ARRAY/FACTION 11th and 12th entries, enter 0 and change the 14thFalse to True .

    Then reverse the
    Minor faction playable procedure (LEVEL 1).

    3. Activate emerged facilities

    See tutorial here.

    4. Remove fog of war

    See tutorial here.

    5. Diplomacy manager

    See tutorial here. Also, here, here and here

    6. Protectorate playable
    Spoiler Alert, click show to read: 
    Follow minor faction playable (LEVEL 1) instructions and then:

    1st way:

    For erasing protectorate status you can follow two ways. The esiest is to go in
    FACTION_ARRAY/FACTION_ARRAY/FACTION/ of protectorate and enter 0 in 21st line replacing the patron faction Id. In this way you can have full diplomatic abilities in game. If you want to be independent just declare war to your patron faction. If you want from the beginning to be independent, follow the second way.

    2nd way:

    Get in FACTION_ARRAY/FACTION_ARRAY/FACTION/DIPLOMACY_MANAGER and find

    the RELATIONSHIP record with the patron faction using the FACTION ID (1st entry). Change the the relation from patron to neutral (4th entry) by copying/pasting the entries of another near by neutral status record. For further changes check previous topic (diplomacy manager).

    Do the same in Diplomacy Manager of the patron FACTION where you'll make the changes in the protectorate RELATIONSHIP record, changing protectorate to neutral. In this way x-protectorate can make normal in game diplomacy relations.
    Last thing go in protectorate FACTION and in 21st line enter 0 instead the patron faction Id.

    To play with Louisiana, Thirteen Colonies or New Spain you will also need to remove the script that enables the handover missions (you have to r
    emove the block at the very top of the scripting.lua). (thanks to Lazy Knight's correction).

    Scripting.lua is in the same folder with startpos.esf.


    7. Editing Starting Armies

    See here.

    8. How to establish Patron _ Protectorate relations

    See here.

    LEVEL 3

    Change region's ownership
    Spoiler Alert, click show to read: 
    In [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/WORLD/REGIONS_ARRAY/REGIONS_ARRAY/ find a region that belongs to new owner faction. In 16th and 17th entries are the controlling faction's and governorships IDs. Enter them in region's entries that is going to be changed ownership.

    Get further in REGION/REGION_SLOT_MANAGER/REGIONS_SLOT_ARRAY/REGIONS_SLOT_ARRAY/REGION_SLOT_SIEGEABLE_GARRISON_RESIDENCE/ GARRISON_RESIDENCE and enter the new owner faction's ID. Do the same for every building slot, plus road slot, fortification slot and SETTLEMENT. If the region is the only one for the former owner faction then you have to downgrade it as an emergent (see
    LEVEL 2).

    Don't bother changing in BUILDING subrecord the faction's name and government type. This is needed only if this is the last and only region of the former owner faction.

    2. Change ownership of characters
    Spoiler Alert, click show to read: 
    In campaign map check for the character's name and note it.

    Find the character record in [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/WORLD/FACTION_ARRAY/FACTION_ARRAY/FACTION/CHARACTER_ARRAY checking for his name in CAMPAIGN_LOCALISATON.
    Copy/paste CHARACTER_ARRAY record from old to new faction in and then delete it from old faction.

    Get further in
    CHARACTER_ARRAY/CHARACTER/CHARACTER_DETAILS and change faction's name in 3rd line. In LOCOMOTABLE you can change it's position on the campaign map, in CAMPAIGN_LOCALISATON the name and in PORTARAIT_DETAILS his image (available names in localisaton_loc file, images in ui_portrait). Then get in [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/CAI_INTERFACE/CAI_WORLD/CAI_CHARACTERS/CAI_CHARACTERS/OWNED_INDIRECT and change CAI_FACTION ID.

    3. Change ownership of armies and fleets
    Spoiler Alert, click show to read: 
    Fleets is similar but simpler than army's change so here I describe only the army change case.

    Every army/fleet have a leader character (general, admiral, colonel, captain, etc.) and units. In campaign map check for the leader character name and note it. Find the character record in CHARACTER_ARRAY checking for his name in CAMPAIGN_LOCALISATON. In the 3rd line of CHARACTER_ARRAY/CHARACTER is the ARMY ID entry. Using this get in ARMY_ARRAY and spot the army. In ARMY_ARRAY/ARMY 4th line is 0 or a settlement ID if the army is stationed inside a settlement. Since you probably want to change the position also, enter 0 or new settlement ID. Get further in UNITs records and in COMMANDER_DETAILS change the owner faction name. Repeat for every UNIT of the army.

    Now get in [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/CAI_INTERFACE/CAI_WORLD/CAI_WORLD_SETTLEMENTS and find the settlement cai record that the army is stationed in. In CAI_GARRISONABLE 1st entry is the CAI_ARMY ID. Write it down and enter 0. If the army is not inside a settlement you still need to do this in any settlement of the same faction that has an army stationed in. Write down the CAI_ARMY ID and leave it as it is.

    Get in [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/CAI_INTERFACE/CAI_WORLD/CAI_RESAURCE_MOBILES (these are the cai army/fleet records), and spot the record of the army using the CAI_ARMY ID you have already. If the army was not inside a settlement use the CAI_ARMY ID of the other army you found in previous step, search the nearby records checking CAI_RESAURCE_MOBILES/CAI_RESAURCE_MOBILE 10th entry which is the army ID (found in [..] CAMPAIGN_ENV/CAMPAIGN_MODEL/WORLD/FACTION_ARRAY/FACTION_ARRAY/FACTION/ARMY_ARRAY/ARMY_ARRAY/ARMY 3rd line).

    When you find the right CAI_RESAURCE_MOBILES get in OWNED_DIRECT and enter CAI_FACTION ID of new faction. In CAI_SITUATED change both coordinates (1
    st and 2nd entries) and CAI_REGION ID for the new place of the army.

    In CAI_RESAURCE_MOBILES/CAI_RESAURCE_MOBILE 2
    nd entry enter 0 or the new settlement CAI ID if you want to place it in a settlement. In that case you have to return in CAI_SETTLEMENT record and place the CAI_ARMY ID in CAI_GARRISONABLE 1st entry.

    4. Convert minor to major city.

    See tutorial here.

    5. Enable Unique Regiment Names

    See tutorial here.

    6. How to relocate a whole army or a unit

    See tutorial here.

    LEVEL 4

    HYBRID STARTPOS.ESF

    (Use EasyEsf to make a Hybrid startpos easily)

    Hybrid startpos is a modding technique I am testing for some time now with success. It is a starting position file, made from pieces of a startpos and a saved game. In this way modifications are made quickly and easy with the least changes in startpos.esf because most of the changes are made "live" in the game. Merging the save file after the in game changes with the original startpos.esf, is the way to create a hybrid startpos and a new modded starting position.

    The basic action in hybrid startpos is the merging, in other words how to create a startpos form a saved a game:

    Open startpos.esf and saved_game.esf in the same instance if EsfEditor.

    1. Go in startpos.esf/CAMPAIGN_STARTPOS/CAMPAIGN_ENV/ right click on CAMPAIGN_MODEL and delete it.
    2. Save it and open again in CAMPAIGN_ENV
    3. In saved_game.esf/ CAMPAIGN_STARTPOS/CAMPAIGN_ENV/ right click on CAMPAIGN_MODEL and then click copy. Give sometime to the Editor to complete this and the following step since the amount of data is huge. In my machine with Intel Core 2 Quad Q 9550, 4 GB RAM and Windows 7 64-bit, it takes several seconds for every step, so be patient. Your Editor will stop responding but this is normal.
    4. Right click on CAMPAIGN_ ENV of startpos.esf and paste.
    5. Save the new hybrid startpos.esf.

    That is the new modded startpos.esf. Starting a new game the campaign map will be as it was in the saved game file.
    (The same way you can make all the startposes of RTI playable as a grand campaign).

    LEVEL 5



    .
    Last edited by husserlTW; November 04, 2012 at 04:57 AM.

  2. #2

    Default Re: About STARTPOS.ESF file

    CAI_INTERFACE 1st part has been uploaded.
    Last edited by husserlTW; June 25, 2009 at 05:43 AM.

  3. #3
    Gomer_Pyle's Avatar Ducenarius
    Join Date
    May 2007
    Location
    Norway
    Posts
    909

    Default Re: STARTPOS.ESF

    is this editor up to date on 1.3 patch? or people having no issues at all with this???

    We make war that we may live in peace.

    -Aristotle-

  4. #4

    Default Re: STARTPOS.ESF

    Husserl, you are the Mother F#$%#n Man!

  5. #5

    Default Re: STARTPOS.ESF

    nice to see somebody writing tutorials about this forgotten part of modding. Sad the tool is not being updated any longer and we still need to overwrite the file


  6. #6

    Default Re: STARTPOS.ESF

    Quote Originally Posted by Gomer_Pyle View Post
    is this editor up to date on 1.3 patch? or people having no issues at all with this???
    The only deference from 1.3 patch are the Id's (numbers) you see in the images. CAI Ids remained the same with an exception of one added record that changed some fields numbering Id (plus 1 on previous version's records numbering). All comments under images are following 1.3.0 build of startpos.

    Quote Originally Posted by erasmus777 View Post
    Husserl, you are the Mother F#$%#n Man!
    Modding ergo sum....

    Quote Originally Posted by Lazy Knight View Post
    nice to see somebody writing tutorials about this forgotten part of modding. Sad the tool is not being updated any longer and we still need to overwrite the file
    I saw a lot of comments about CA, her policy, the promised tools, etc.. Modding is free spirit and I am glad as long commercial companies stay far away from it.
    Last edited by husserlTW; June 27, 2009 at 03:54 AM.

  7. #7

    Default Re: STARTPOS.ESF

    i have a question, i downloaded the esf editor, and have edited the factions starting money and saved it however everytime i seem to go into the game and run it it seems like it hasnt saved/registered. same goes for adding units to starting armies, ill add an extra few line infantry to the same army, save, and yet no change in game. any ideas?

  8. #8

    Default Re: STARTPOS.ESF

    Quote Originally Posted by 20ninjas View Post
    i have a question, i downloaded the esf editor, and have edited the factions starting money and saved it however everytime i seem to go into the game and run it it seems like it hasnt saved/registered. same goes for adding units to starting armies, ill add an extra few line infantry to the same army, save, and yet no change in game. any ideas?
    Just try it and works with the starting money. Check your changes. Adding armies is another long and sad story. For the moment you can create armies by disputing the same time armies of another faction and taking their Id's to use for the new army.

  9. #9

    Default Re: STARTPOS.ESF

    EDIT: Small part of CAI has been added.

  10. #10

    Default Re: STARTPOS.ESF

    Using the Startpos.esf, is it possible to make a faction playable in custom battles? or is that done in a different way? If it is different, can you direct me to a thread where I may find this info?


    TheSilverKnight - Developer for IBFD


  11. #11

    Default Re: STARTPOS.ESF

    Quote Originally Posted by TheSilverKnight View Post
    Using the Startpos.esf, is it possible to make a faction playable in custom battles? or is that done in a different way? If it is different, can you direct me to a thread where I may find this info?
    You need to edit patch.pack>factions and change the faction to "playable". You'll see the correct column, it's the 4th column. Backup patch.pack first. You'll need the Pack File Manager.

  12. #12

    Default Re: STARTPOS.ESF

    Quote Originally Posted by erasmus777 View Post
    You need to edit patch.pack>factions and change the faction to "playable". You'll see the correct column, it's the 4th column. Backup patch.pack first. You'll need the Pack File Manager.
    Where exactly does it say custom battle availability? I've already modded them to be playable but I can't choose them to be available in custom battles for whatever reason.

    Is it under Early Playability/Late Playability?

    I'm using patch 1.3 if it makes a difference, btw.
    Last edited by TheSilverKnight; June 28, 2009 at 06:27 PM.


    TheSilverKnight - Developer for IBFD


  13. #13

    Default Re: STARTPOS.ESF

    Quote Originally Posted by TheSilverKnight View Post
    Where exactly does it say custom battle availability? I've already modded them to be playable but I can't choose them to be available in custom battles for whatever reason.

    Is it under Early Playability/Late Playability?

    I'm using patch 1.3 if it makes a difference, btw.
    Yes, change Early/Late availability. I forgot that bit, sorry

  14. #14

    Default Re: STARTPOS.ESF

    Thanks very much man. It works fabulously


    TheSilverKnight - Developer for IBFD


  15. #15

  16. #16

    Default Re: STARTPOS.ESF

    Quote Originally Posted by Swiss Halberdier View Post
    @husserITW

    Thank you so much for your awesome and very detailed guide! This is excactly what I'm looking for! +rep
    Thanks, keep an eye because it will be updated from time to time. After the descriptions finish, conclusions and modding tips will follow.

  17. #17
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: STARTPOS.ESF

    husserlTW, excellent work to put all the info in together in one place, it's what I wanted to do but never had the energy/time to do, so congrats for having the appetite to do such a long guide and continue researching on it pal as we are going to need any bit of info for our mod!! +rep

  18. #18

    Default Re: STARTPOS.ESF

    Salut,
    How to increase "resistance to foreign occupation" ?
    My goal is to make the major factions unconquerable.
    Thanks.

  19. #19
    Burnoutfigs's Avatar Semisalis
    Join Date
    Apr 2009
    Location
    Fort Lewis, Wa
    Posts
    408

    Default Re: STARTPOS.ESF

    you would think with all this good info we could make it where the emergent faction had a government...im just not that smart

  20. #20

    Default Re: STARTPOS.ESF

    Quote Originally Posted by Burnoutfigs View Post
    you would think with all this good info we could make it where the emergent faction had a government...im just not that smart
    Even that emergent do have government in world factions, they luck of CAI_GOVERNORSHIP record, that's why practically they can't have government in startpos. And as you already know we can not add cai records. That's why the recapturing of the emergent capitol -as in demis14 greece mod- is at the moment needed. You see the game can add cai records in the saved_games.

    I've found the solution for the wrong fortifications in campaign map in. See the conversion thread.

Page 1 of 50 123456789101126 ... 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
  •