Results 1 to 5 of 5

Thread: How to mod the AOR (area of recruitment) of a unit

  1. #1
    Alwyn's Avatar Frothy Goodness
    Content Director Patrician Citizen

    Join Date
    Feb 2014
    Location
    United Kingdom
    Posts
    9,317

    Default How to mod the AOR (area of recruitment) of a unit

    Perhaps you are playing a campaign as a minor faction, using a mod which allows you to recruit a few extra units. You notice a gap in your roster - for example, you may be playing Crimea and you cannot recruit light infantry. You may have found a light infantry unit which you would like to be able to recruit, such as Kurdish Hillmen (I'm using this example because poa asked how to enable Crimea to recruit this unit in Crimea's home region). If you edit units_to_exclusive_faction permissions to allow Crimea to recruit east_ethnic_hillmen_musketeers_kurdish (Kurdish Hillmen) and start a campaign, you might be disappointed to find that you still cannot recruit Kurdish Hillmen in Crimea. Why not? Because, in the vanilla game, this unit can only be recruited in regions which have the resource 'kurds' (this resource is in the startpos.esf file - players cannot see which region has which resource in the game, except by capturing a region and seeing which units we can recruit there.)

    As I see it, AOR (area of recruitment) works like this: every unit has a Region ID Ref. Every region has a list of resources (we cannot see this list in the game. Below, I'll show you how to find and edit it). A faction can only recruit a unit in regions whose list of resources includes the unit's Region ID Ref.

    If you use a pack file manager to open a copy of the game's vanilla patch.pack, open db and select the Units table, you'll see that each unit has a Region ID Ref. (Incidentally, if you're new to modding, it is worth knowing that experienced modders recommend that we only make changes to units, etc, in mod files - in other words, we don't ever edit the game's original files such as patch.pack. There are tutorials on how to create a mod; alternatively, you could start with a resource such as poa's useful extracted mods resource which includes many of the files which modders use.)

    In this example, I'll show how to allow Crimea recruit Kurdish Hillmen in Crimea's home region. This technique can be used with any unit which has a limited AOR, such as Sikh Musketeers (recruitment is limited to regions with the 'sikh' resource) or Irish Brigade (recruitment is limited to units with the 'displaced irish' resource.) As I mentioned above, in addition to modding the game to either change the unit's Region ID Ref or changing the region's resources, you would need to allow your faction to recruit the unit by including an appropriate entry in the units_to_exclusive_faction permissions table (I normally look at a copy of the game's patch.pack file to see what appriopriate entries in database tables look like).

    The Region ID Ref for Kurdish Hillmen (east_ethnic_hillmen_musketeers_kurdish) is 'kurds'. Each region has a list of resources (it is possible to view this resource list using an ESF Editor; I show how to do this below). You can only recruit a unit where the region's list of resources includes the Region ID Ref for the unit. This means that, to recruit Kurdish Hilllmen in Crimea, you could do either of two things:-

    (a) Edit the unit so that it can be recruited in more regions. Use Pack File Manager (or DB Editor) to open your mod which includes the Units table. Change the Region ID Ref for Kurdish Hillmen from 'kurds' to something like 'global' or 'europe.' That's relatively easy to do. It would mean that factions which can recruit Kurdish Hillmen could recruit them in every region in the world or every region in Europe, which could be a downside if that it not what you wanted. As I see it, this is a 'tried and tested' technique. I have played complete campaigns in which I had changed the Region ID Ref for units without problems. You can use this method with an existing campaign (in other words, you would not need to start a new campaign).

    (b) Edit the region so that it has the resource which is needed to recruit the unit. Using an ESF Editor, edit a copy of the startpos.esf so that the Crimea region has the 'kurds' resource. First, find a region which has already has the 'kurds' resource. Copy and paste that resource to the Crimea region. In the startpos, you will need to select the following folders to find the regions: campaign_startpos, then campaign_env, then campaign_model, then world, then region_manager, then regions_array, then select a region, e.g. crimea, then (again) crimea, then resources_array. If you would only like Kurdish Hillmen to be recruitable in their original region and in Crimea, this method will achieve that. For me, this is a relatively new, experimental technique - so far, it seems to work without causing problems. To use this method, you would need to start a new campaign.

    If you edit the startpos, then (to make the effects appear in the game) you would need to do the following: visit your C:/ProgramFiles(x86)/Steam/steamapps/common/empire total war/data/campaigns/main folder. (Those are the folders to open to reach the campaigns/main folder on this Windows 7 PC; if your computer is different, the path may vary). Rename the original, unmodified startpos.esf to something like 'vanilla startpos.esf'. When you start the Grand Campaign, the game uses the startpos.esf file in this folder to define the starting position. Keep a backup copy of the vanilla startpos file somewhere else. Then copy your edited startpos.esf file to the campaigns/main folder and start the game normally. (It’s best to keep a back up copy of any startpos file which you have edited, if you want to edit it further, because sometimes the ESF Editor randomly corrupts them, preventing any further editing of that copy of the startpos). If anyone accidentally deletes your vanilla startpos file, you can get another copy of the vanilla startpos file by verifying the integrity of your game files on Steam. On Steam, right-click on Empire Total War; select Properties, then Local Files, then Verify Integrity of Game Cache. Steam should detect that you don’t have this file and will then put the vanilla startpos in the correct folder for you.

    My other basic guides to modding ETW are listed here.
    Last edited by Alwyn; September 06, 2015 at 02:20 AM.

  2. #2

    Default Re: How to mod the AOR (area of recruitment) of a unit

    I just did the copy from Syria kurds to Crimea thing in ESF, it worked as a charm and was easy,
    i could carry on with my old campaign but that meant i couldnt recruit in current campaign,
    but i just started a new campaign and saw i will be able to recruit the kurds once i upgraded capitol one step.
    My 6 2nd rates routed in horror from 1 brig + 1 5th rate on auto-resolve....

  3. #3
    Alwyn's Avatar Frothy Goodness
    Content Director Patrician Citizen

    Join Date
    Feb 2014
    Location
    United Kingdom
    Posts
    9,317

    Default Re: How to mod the AOR (area of recruitment) of a unit

    Thank you, poa - good luck with your new campaign. Your comment reminds me of something that i should warn people about - which method works with an existing campaign and which method requires players to start a new campaign. I'll amend the instructions above accordingly.

  4. #4

    Default Re: How to mod the AOR (area of recruitment) of a unit

    Super helpful stuff Alwyn.

    I'm dipping my toes in the modding pond. I'm really hoping to set it up so my Quebec campaign can recruit natives.

    I've made some progress on it, especially using the existing (but non-functioning) Warpath to Grand Campaign mod. I can see that those units can exist in the campaign, but I still haven't unlocked the recruitment of them.

    Additionally, while I'd like to add them to the game, I'd also like to see some restrictions on their recruitment. I'd like to use the AoR for this.

    Is it possible to simply add a new AoR, then add them in to the regions in the .ESF?

    I see that the region ID already restricts the regions to "Americas", but I'd like to add in two more Regions: nan_nw and nan_ne and nan_s

    I've made lists of of the regions that were occupied by each of the native factions and of the lands that they would wish to occupy (ie, their homelands).

    I see three patterns.

    Nan_nw would include Northwest Territories, Rupert's land, Black Hills, Huron, Upper Louisiana.
    Nan_ne would include Huron, Rupert's Land, Montagnais, Upper Canada, New France, everything North of Virginia along the coast up to the Inuit lands.
    Nan_s would include New Mexico, Upper and Lower Louisians, Cherokee lands, and everything South of Virginia all the way down through Brazil (just because).

    Then I would set the Plains Nations units to Nan_nw, Huron-Wyandot and Iroquois to Nan_ne, Cherokee and Pueblo to nan_s.

    This would create some incentive to conquer lands in order to recruit the special units.

    I'm kind of uncomfortable with the idea of recruiting Muscogee Warriors or Mohawks down in Mexico... I'll have to see how it goes...

    Any tips on adding AoR?

  5. #5
    Frunk's Avatar Form Follows Function
    Artifex

    Join Date
    Jun 2009
    Location
    Gold Coast
    Posts
    6,490

    Default Re: How to mod the AOR (area of recruitment) of a unit

    Thread moved from Text Editing and Scripting.

    (Let me know if I've made a mistake, Alwyn )
    FrunkSpace | Mod Announcements | Colonies & Empires

    Under the patronage of Iskar of the House of Siblesz. I am the proud patron of:

    atthias | PaulH | Athos187

Posting Permissions

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