Results 1 to 16 of 16

Thread: Submodders' Resource - Unlimited AOR's for TATW 3.2

Hybrid View

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

    Default Submodders' Resource - Unlimited AOR's for TATW 3.2

    I've been working on a few submods (here, here, here, and here) that use hidden_resources to to create special areas of recruitment (AOR's). I worked this up because of the hardcoded limit on hidden_resources (64). I think it may also prove useful for other modders working on some of the larger compilation submods that may be running up against this issue

    The attached files assign a unique hidden_resource set to each region in the descr_regions file based on a set of 16 alphanumeric hidden_resources added to the EDB file. This means that every region in TATW can now be a unique AOR, regardless of the hardcoded limit.

    To make a new AOR recruitment pool in EDB you will need to include the "and hidden_resource X" requirement for each of the first four hidden resources listed for the region in descr_regions. For example to make a new unit recruitable only in Nurn, set up the pool as normal, then add requirements for the first four hidden_resources for Nurn.
    Spoiler Alert, click show to read: 
    descr_region entry:

    Nurn_Province
    Nurn
    venice
    No_Rebels
    255 120 200
    2, B, 6, E, desert, no_brigands, roads, big_city, towers
    5
    1 ;BF
    religions { catholic 90 orthodox 0 islam 0 northmen 5 heretic 5 numenorian 0 }


    EDB entry:

    recruit_pool "Nurn Ash Slaves" 1 0.12 2 0 requires factions { england, } and region_religion catholic 25 and hidden_resource 2 and hidden_resource B and hidden_resource 6 and hidden_resource E

    You will need a copy of the EDB line with the appropriate hidden_resource requirements for each of the regions you want to include in the AOR.

    This can also be used in a similar fashion to replace existing AOR's (this will be necessary if your mod already has more than 48 hidden_resources or is already running up against the hardcoded limit). I would suggest starting with the AOR's that cover only a single region, such as the minas_tirith AOR for the Fountain Guard:
    Spoiler Alert, click show to read: 
    descr_regions entry:

    Anorien_Province
    Anorien
    sicily
    Human_Rebels
    173 172 171
    1, A, 5, E, grasland, minas_tirith, crusade, coast, roads, big_city, towers,
    5
    1 ;BF
    religions { catholic 7 orthodox 5 islam 3 northmen 5 heretic 0 numenorian 80 }


    EDB entry:

    recruit_pool "Fountain Guard" 0 0.07 1 0 requires factions { sicily, } and hidden_resource 1 and hidden_resource A and hidden_resource 5 and hidden_resource E

    Now delete the minas_tirith entry from the list at the top of EDB, and repeat for other AOR's/hidden_resources to keep below the hardcoded limit. Important; you will also need to change the building entries for any buildings that require minas_tirith.

    This work is based on an idea suggested by Kilic Ali. The only things altered in the attached files are the hidden_resource entries in descr_regions and the hidden_resource list in EDB. Please feel free to use or alter this work however you want, no need for any permission.
    Last edited by Spice Master; October 08, 2012 at 09:45 PM.

  2. #2
    paradamed's Avatar Praepositus
    Join Date
    Jun 2006
    Location
    Brasília, Brasil
    Posts
    5,806

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    Thanks, this is very useful.

  3. #3
    Heathen Storm's Avatar Where's my axe?
    Join Date
    Jun 2010
    Location
    Vinland
    Posts
    2,895

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    This IS useful!

    Proud mod leader, modeller and public relations officer of Heiğinn Veğr: Total War


  4. #4
    Den Stark's Avatar Tiro
    Join Date
    May 2012
    Location
    Vladivostok
    Posts
    248

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    Good idea, thank you!

  5. #5

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    This looks to be a big game changer here very good work Spice Master, now to add more buildings .......

  6. #6
    paradamed's Avatar Praepositus
    Join Date
    Jun 2006
    Location
    Brasília, Brasil
    Posts
    5,806

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    Quote Originally Posted by MIKE GOLF View Post
    This looks to be a big game changer here very good work Spice Master, now to add more buildings .......
    Looking forward to a MOS expanded map version, hehe.

  7. #7

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    Indeed, this also allows unique buildings for every settlement (subject to any hardcoded limits on number of building lines and buildings per line) as well as buildings that are only available in a limited number of settlements. E.g. "Elven Tree Dwellings" buildable only in Lorien and Mirkwood regions or "Slag Heaps" buildable only in volcanic regions. Lot's of possibilities here, all without the need to add any new hidden_resources beyond those 16 need for the alphanumeric region codes.

    Here's a full list of the possible region codes in case you want to use this for a mod that has more regions on the map than in vanilla TATW 3.2 (attached).
    Last edited by Spice Master; October 09, 2012 at 02:13 PM.

  8. #8
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,689

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    yes that's useful.
    months ago i did a map where regions names were written down.
    I think this is not upgraded to 3.2 anyway, tharbad was splitted and maybe some other regions were added too, do not remeber.
    oranges are vanilla and red ones are il ducce's map.
    i upload a pdf and a dwg (with proper image which will be loaded into cad).
    dwg is an autocad file, think you might open only with similar programs, maybe indesign, do not know.
    if you're able to open the dwg you may copy and paste directly the region name into descr_region, which makes things easier.
    hope there are no errors, never had problems anyway.

    bye.

    as not said. it doesn't allow me to upload dwg files.
    if someone may think he needs the dwg, let me know, i'll upload it on mediafire

  9. #9

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    I quite like this idea, but you don't need the full 16 hidden resources - due to MTW2's region limit of 199, you can get by with 10 (you might be able to do less if you were willing to use 'and not hidden resource' statements in the EDB; 10 C 4 gives you 210 unique codes without having to deal with that though).

    Laziness is the mother of invention - I did this to avoid having to code large AORs using this system, as it is somewhat of a pain.
    It is fantastic for single regions, and I would suppose necessary for an extensive, expanded map AOR system, but I didn't feel like overhauling the entire EDB when I could just free up several hidden resources with less work

    I've uploaded a list of region codes using 1 through 0 (0 as ten because I used nine resources before doing the math), which also neatly prevents any errors due to mis-capitalization of hidden resources.

    Edit: I now have uploaded the files needed to implement this system into vanilla TATW

    -removed the single region hidden_resources minas_tirith, lossarnach, amroth, pelargir, edoras, hornburg, erebor, bree, rivendell, mithlond, moria, shire, and gwaith and replaced with their region code equivalents

    -single region hidden_resources unchanged: annuminas, osgiliath_east, osgiliath_west, isengard

    I didn't change annuminas or the osgiliaths because I'm not 100% certain it would work with the rebuild osgiliath and reunite arnor scripts.
    isengard and horses appear to not be used, and I did not change them in case I missed something important - as far as I know these can just be deleted.
    Last edited by Chainsaw Schmalz; October 16, 2012 at 09:32 PM. Reason: Added descr_regions and EDB

  10. #10

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    Quote Originally Posted by Chainsaw Schmalz View Post
    Laziness is the mother of invention - I did this to avoid having to code large AORs using this system, as it is somewhat of a pain.
    Actually, coding large multiregion AORs is quite easy using this system. Just use a requires hidden_resource code with fewer digits that includes the desired regions, then add entries to exclude any regions you want to. Example:

    Spoiler Alert, click show to read: 
    Suppose you want to make a unit recruitable in (and only in) all Gondor starting regions. The codes I used for the Gondor starting regions (from descr_regions) are:

    1, A, 5, E,
    1, A, 5, F,
    1, A, 5, G,
    1, A, 5, H,
    1, A, 6, E,
    1, A, 6, F,
    1, A, 6, G,
    1, A, 6, H,
    1, A, 7, E,
    1, A, 7, F,
    1, A, 7, G,

    So I make a recruit pool in EDB that looks like this:

    recruit_pool "Gondor Couchpotatoes" 1 0.2 2 0 requires factions { sicily, } and hidden_resource 1 and hidden_resource A and hidden_resource 5 or hidden_resource 6 or hidden_resource 7

    Now I need to exclude the next region , Kings-Land (region code 1, A, 7, H) which is not a Gondor starting region, but has the hidden_resources 1, A, and 7, so that it is included in the above recruit_pool. Add this line:

    recruit_pool "Gondor Couchpotatoes" -1 -0.2 -2 0 requires factions { sicily, } and hidden_resource 1 and hidden_resource A and hidden_resource 7 and hidden_resource H

    The negative values will cancel out the recruit_pool in this region.

    As long as the regions in your AOR are contiguous (in descr_regions that is) or nearly so (which is almost always the case), you should never need to add more than a few extra lines to cancel out excluded regions.

    Using 4 sets of 4 hidden_resources as I did in the files attached to the OP makes this process much easier, by reducing the number of regions you will need to exclude and thus the number of extra lines of code with negative recruitment pools that you will need to add. The greater the number of possible digits in each position of the combination, the more likely it will be that you need to add many more extra lines and more complicated the exclusions will have to be.

    The only drawback to this method is that the original "Enables training of:" entry will still show up in the building information scroll, but this can be dealt with by some creative editing of the text files.
    I didn't change annuminas or the osgiliaths because I'm not 100% certain it would work with the rebuild osgiliath and reunite arnor scripts.
    I don't know of any way that campaign_script can reference hidden_resources so these should be fine to change. Campaign_script can read the region names themselves so I don't think it has any use for hidden_resources.

    isengard and horses appear to not be used, and I did not change them in case I missed something important - as far as I know these can just be deleted.
    AFAIK any hidden_resources that aren't assigned to any units in descr_regions can be safely removed from EDB.
    Last edited by Spice Master; October 16, 2012 at 11:43 PM.

  11. #11

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    Of course you could just add a recruit_pool line for each region in your AOR. Unless you've got a really big AOR this is just a matter of hitting ctrl-v a few times.

  12. #12
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    Nice one Spice Master. The idea has been around for quite a while I think but good of you to post one already set up for TATW.

    Might I suggest that you put some kind of prefix on those names? e.g. hrA, hr3, etc. Searching EDB and descr_regions for "3" would return many results that have nothing to do with hidden resource 3.

    @cino
    To attach an invalid-type file just zip it up first.
    Last edited by Withwnar; October 17, 2012 at 01:54 AM.

  13. #13

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    Thanks Withwnar. Good suggestions.

    I also never knew until I started playing around with this that negative numbers in recruit_pools work. I wonder what other uses that might have?

  14. #14

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    That is ingenious! I had no idea negative recruit pools worked, and I didn't even consider how the region codes would be laid out on the map. I also missed the fact that I could use OR in the recruit pool conditionals entirely, and thought I had to do an entire separate line for each region in the AOR

    A slightly separate question - the OR condition appears to work like this:
    (condition A) and (condition B) and (condition C or condition D or condition E)

    Is there any way to make it work like this instead?
    (condition A and condition B) or (condition C and condition D)

    Basically, I'm asking if the order of operations in the recruit pool (I guess EDB in general) is at all mutable.



    Edit: one possible use for negative recruit pools is to turn off or limit a troop or troops based on event_counters
    Last edited by Chainsaw Schmalz; October 17, 2012 at 01:13 PM. Reason: Idea!

  15. #15

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2

    Quote Originally Posted by Chainsaw Schmalz View Post
    A slightly separate question - the OR condition appears to work like this: (condition A) and (condition B) and (condition C or condition D or condition E)

    Is there any way to make it work like this instead?
    (condition A and condition B) or (condition C and condition D)

    Basically, I'm asking if the order of operations in the recruit pool (I guess EDB in general) is at all mutable.
    I'm not sure. Try it and see?

    Edit: one possible use for negative recruit pools is to turn off or limit a troop or troops based on event_counters
    I think you can already do this directly with requires event_counter conditions in EDB. One possiblilty I see is that you could use it to reduce the availability of non-AOR troops in an AOR. This is something I'm considering for my Dunland mod "Oaths and Deeds" - if you complete the quests and develop Dunland regions so that the new Dunlendings are recruitable, it will also mean your regular troops will be not (or less) available there.

    Example:

    Suppose I want to make Pelargir Marines the primary troops of that city, once some condtiion is met in the campaign_script and at the same time reduce the availability of Gondor Militia under the same conditions. I could add these line to EDB:

    Spoiler Alert, click show to read: 
    recruit_pool "Marines" 1 0.15 2 0 requires factions { sicily, } and hidden_resource 1 and hidden_resource A and hidden_resource 5 and hidden_resource H and event_counter captain_of_ships 1
    recruit_pool "Dismounted Kofm" -1 -0.20 -3 0 requires factions { sicily, } and hidden_resource 1 and hidden_resource A and hidden_resource 5 and hidden_resource H and event_counter captain_of_ships 1
    So, once you complete the event captain_of_ships, you get additional Marines recruitable in Pelargir, but no more Gondor Militia.

    Or you could do the same thing referring to another building in the settlement instead of an event:
    Spoiler Alert, click show to read: 
    recruit_pool "Marines" 1 0.15 2 0 requires factions { sicily, } and building_present_min_level marine marine_amphibious_base
    recruit_pool "Dismounted Kofm" -1 -0.20 -3 0 requires factions { sicily, } and building_present_min_level marine marine_amphibious_base
    So now, when you build the marine_amphibious_base, your barracks will produce Marines instead of Militia. You could also include these last in the capabilities section of the marine_amphibious_base itself instead.

    I haven't testing any of these uses of negative recruitment yet, so no promises.
    Last edited by Spice Master; October 17, 2012 at 03:43 PM.

  16. #16
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Submodders' Resource - Unlimited AOR's for TATW 3.2



    recruit_pool "Marines" 1 0.15 2 0 requires factions { sicily, } and building_present_min_level marine marine_amphibious_base
    recruit_pool "Dismounted Kofm" -1 -0.20 -3 0 requires factions { sicily, } and building_present_min_level marine marine_amphibious_base
    building_present_min_level doesn't work in recruitment lines. But these two lines could be moved to the marine buildings instead, without the building_present_min_level condition. (Oh, just realised you said that already. )

    EDIT:
    building_present_min_level doesn't work in recruitment lines
    Sorry, that isn't quite correct. It does work but only if the building doesn't also provide bonuses.
    Last edited by Withwnar; October 18, 2012 at 01:10 PM.

Posting Permissions

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