Results 1 to 3 of 3

Thread: Question: altering EDB to force AI build Mumakil/Troll/Warg diversification bldgs?

Hybrid View

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

    Default Question: altering EDB to force AI build Mumakil/Troll/Warg diversification bldgs?

    To be sure to fight some epic battles against Mumakil, Trolls and Wargs playing the custom WoM campaigns, I want to somehow force AI Harad and Adunabar to build the Mumakil, Troll and Warg diversification buildings. As sometimes the AI goes for other diversification options and denies me having insane fun battling these mighty beasts - damn spoil sport. To achieve that, I was thinking about altering the EDB(s) in the Batch-folder in the following fashion, and wanted to know if that could do the trick… (note: all changes below were applied to the Main/All-factions EDB)

    To make AI Harad definitively build the Mumakil diversification building in at least the two non-costal of the four "Ivory"-provinces - changes highlighted in red:
    Spoiler Alert, click show to read: 
    Note: I added and not hidden_resource uc as requirement to the non-Corsair-Stronghold buildings, because selecting Umbar city on the campaign map without this addition results in a CTD. Maybe because it already has a Corsair Stronghold at the beginning?
    Code:
    building cd_temple_of_healing ;HARAD DIVERSIFICATION
    {
        levels temple_of_healing_shrine temple_of_healing_temple  temple_of_healing_large_temple harad_temple_network  harad_temple_brotherhood harad_temple_mumak
        {
            temple_of_healing_shrine requires factions { eastern, } and  building_present_min_level academic scriptorium ;CITY DEVELOPMENT
            {
                capability
                {
                    ;recruit "rhun settler" 0 requires factions { franks, }  and not hidden_resource freefolk and not hidden_resource khand
                    ;recruit "rhun vagrant" 0 requires factions { franks, } and hidden_resource khand
                    recruit "harad settler" 0 requires factions { sassanids,  } and hidden_resource great_fert or factions { sassanids, } and  hidden_resource mod_fert and hidden_resource desert_hru
                    ;recruit "rk settler" 0 requires factions { empire_east, } and hidden_resource freefolk
                    happiness_bonus bonus 4 requires factions { sassanids, }
                    law_bonus bonus 4 requires factions { sassanids, }
                   
                }
                construction  8 
                cost  6400
                settlement_min large_city
                upgrades
                {
                    temple_of_healing_temple
                    temple_of_healing_large_temple
                    harad_temple_network
                    harad_temple_brotherhood
                    harad_temple_mumak
                }
            }
            temple_of_healing_temple requires factions { eastern, } and building_present_min_level port_buildings dockyard ;CORSAIR STRONGHOLD
            {
                capability
                {
                    ;recruit "rhun settler" 0 requires factions { franks, }  and not hidden_resource freefolk and not hidden_resource khand
                    ;recruit "rhun vagrant" 0 requires factions { franks, } and hidden_resource khand
                    recruit "harad settler" 0 requires factions { sassanids,  } and hidden_resource great_fert or factions { sassanids, } and  hidden_resource mod_fert and hidden_resource desert_hru
                    ;recruit "rk settler" 0 requires factions { empire_east, } and hidden_resource freefolk
                    trade_base_income_bonus bonus 2 requires factions { sassanids, }
                    recruit "harad corsair archer" 4 requires factions { sassanids, } and hidden_resource harad
                    recruit "harad corsair archer" 5 requires factions {  sassanids, } and not hidden_resource freefolk and not hidden_resource  harad
                    recruit "harad corsair archer" 6 requires factions {  sassanids, } and hidden_resource freefolk and hidden_resource coastal
                    recruit "harad corsair" 4 requires factions { sassanids, } and hidden_resource harad
                    recruit "harad corsair" 5 requires factions { sassanids,  } and not hidden_resource freefolk and not hidden_resource harad
                    recruit "harad corsair" 6 requires factions { sassanids, } and hidden_resource freefolk
                    recruit "harad flagship" 0 requires factions { sassanids, } 
                    happiness_bonus bonus 4 requires factions { sassanids, }
                    law_bonus bonus 4 requires factions { sassanids, }
                }
                construction  4 
                cost  3200 
                settlement_min large_city
                upgrades
                {
                }
            }
            temple_of_healing_large_temple requires factions { eastern, }  and building_present_min_level caravans silk_rd and  building_present_min_level equestrian_harad cavalry_barracks_harad and not resource lead and not hidden_resource uc ;IVORY TRADEMASTER
            {
                capability
                {
                    ;recruit "rhun settler" 0 requires factions { franks, }  and not hidden_resource freefolk and not hidden_resource khand
                    ;recruit "rhun vagrant" 0 requires factions { franks, } and hidden_resource khand
                    recruit "harad settler" 0 requires factions { sassanids,  } and hidden_resource great_fert or factions { sassanids, } and  hidden_resource mod_fert and hidden_resource desert_hru
                    ;recruit "rk settler" 0 requires factions { empire_east, } and hidden_resource freefolk
                    happiness_bonus bonus 4 requires factions { sassanids, }
                    law_bonus bonus 4 requires factions { sassanids, }
                    trade_level_bonus 7 requires factions { sassanids, }
                    trade_base_income_bonus bonus 12 requires factions { sassanids, }
                    recruit "harad harnenhorse" 4 requires factions { sassanids, }
                }
                construction  4 
                cost  3200 
                settlement_min large_city
                upgrades
                {
                }
            }
             harad_temple_network requires factions { eastern, } and building_present_min_level despotic_law secret_police_hq and not resource lead and not hidden_resource uc ;HIGH INQUISITOR'S NETWORK
            {
                capability
                {
                    ;recruit "rhun settler" 0 requires factions { franks, }  and not hidden_resource freefolk and not hidden_resource khand
                    ;recruit "rhun vagrant" 0 requires factions { franks, } and hidden_resource khand
                    recruit "harad settler" 0 requires factions { sassanids,  } and hidden_resource great_fert or factions { sassanids, } and  hidden_resource mod_fert and hidden_resource desert_hru
                    ;recruit "rk settler" 0 requires factions { empire_east, } and hidden_resource freefolk
                    happiness_bonus bonus 4 requires factions { sassanids, }
                    law_bonus bonus 6 requires factions { sassanids, }
                    agent spy  4  requires factions { sassanids, }
                    recruit "harad scarletshield" 5 requires factions { sassanids, } and hidden_resource harad
                    recruit "harad scarletshield" 4 requires factions { sassanids, } and not hidden_resource harad
                }
                construction  4 
                cost  3200 
                settlement_min large_city
                upgrades
                {
                }
            }
             harad_temple_brotherhood requires factions { eastern, } and not resource lead and not hidden_resource uc ;BROTHERHOOD OF ASSASSINS
            {
                capability
                {
                    ;recruit "rhun settler" 0 requires factions { franks, }  and not hidden_resource freefolk and not hidden_resource khand
                    ;recruit "rhun vagrant" 0 requires factions { franks, } and hidden_resource khand
                    recruit "harad settler" 0 requires factions { sassanids,  } and hidden_resource great_fert or factions { sassanids, } and  hidden_resource mod_fert and hidden_resource desert_hru
                    ;recruit "rk settler" 0 requires factions { empire_east, } and hidden_resource freefolk
                    happiness_bonus bonus 4 requires factions { sassanids, }
                    law_bonus bonus 4 requires factions { sassanids, }
                    ;AGENTS
                    agent assassin  4  requires factions { sassanids, }
                    
                }
                construction  4 
                cost  3200 
                settlement_min large_city
                upgrades
                {
                }
            }
            harad_temple_mumak requires factions { eastern, } and resource lead and not hidden_resource uc ;MUMAKIL TRAINING GROUND
            {
                capability
                {
                    ;recruit "rhun settler" 0 requires factions { franks, }  and not hidden_resource freefolk and not hidden_resource khand
                    recruit "harad settler" 0 requires factions { sassanids,  } and hidden_resource great_fert or factions { sassanids, } and  hidden_resource mod_fert and hidden_resource desert_hru
                    recruit "harad mumak" 3 requires factions { sassanids, }
                    happiness_bonus bonus 4 requires factions { sassanids, }
                    law_bonus bonus 4 requires factions { sassanids, }
                    
                }
                construction  4 
                cost  3200 
                settlement_min large_city
                upgrades
                {
                }
            }
        }
        plugins 
        {
        }
    }
    I was going to give the Corsair Stronghold (temple_of_healing_temple) and not resource lead as requirement (so all 4 provinces with lead/"Ivory" would definitively only build Mumakil-bldgs, and not just the two inland ones which is the case atm), but that resulted in this message always popping up after exiting RTW:
    Script Error in bi\ci/data/export_descr_buildings.txt, at line 5806, column 3.

    Building DB error - faction sassanids has gap in building prior to harad_temple_mumak
    I assume because Umbar city has a Corsair Stronghold preconstructed at the beginning. I'd like to make all 4 lead/"Ivory" provinces only being able to construct the Mumakil-bldgs if possible, but I don't know how to do so!?

    To make AI Adunabar build the diversification buildings with the following priorities... 1. Trolls, 2. Wargs (if no trolls available) and 3. any of the others (if neither trolls nor wargs available) ...I hope this could do the trick - changes highlighted in red:
    Spoiler Alert, click show to read: 
    Code:
    building cd_temple_of_hunting_lots ;ADUNABAR  DIVERSIFICATION
    {
        levels temple_of_hunting_lots_shrine temple_of_hunting_lots_temple  temple_of_hunting_lots_large_temple mf_troll_cave mf_orc_outpost
        {
            temple_of_hunting_lots_shrine requires factions {  empire_east_rebels, } and building_present_min_level mf_memorial  mf_high_temple ; City Development
            {
                capability
                {
                    recruit "mf settler" 0 requires factions { empire_east_rebels, } and hidden_resource great_fert
                    happiness_bonus bonus 4 requires factions { empire_east_rebels, }
                    law_bonus bonus 4 requires factions { empire_east_rebels, }
                    
                }
                construction  8
                cost  6400 
                settlement_min large_city
                upgrades
                {
                    temple_of_hunting_lots_temple
                    temple_of_hunting_lots_large_temple
                    mf_troll_cave
                    mf_orc_outpost
                }
            }
            temple_of_hunting_lots_temple requires factions {  empire_east_rebels, } and building_present_min_level  orkish_infestation_mf uruk_hold and not hidden_resource warg_hru and not hidden_resource warg2_hru and not hidden_resource troll_hru ;Uruk Breeder
            {
                capability
                {
                       ;recruit "mf settler" 0 requires factions { empire_east_rebels, } and hidden_resource great_fert
                    ;happiness_bonus bonus 4 requires factions { empire_east_rebels, }
                    ;law_bonus bonus 4 requires factions { empire_east_rebels, }
                    recruit "orc urukberserker" 2 requires factions { empire_east_rebels, } and hidden_resource rg
                    recruit "orc urukhalberd" 2 requires factions { empire_east_rebels, } and hidden_resource rg
                }
                construction  4
                cost  3200 
                settlement_min large_city
                upgrades
                {
                    ;temple_of_hunting_lots_large_temple
                }
            }
            temple_of_hunting_lots_large_temple requires factions {  empire_east_rebels, } and hidden_resource warg2_hru or factions {  empire_east_rebels, } and hidden_resource warg_hru and not hidden_resource troll_hru ;Warg Dens
            {
                capability
                {
                       ;recruit "mf settler" 0 requires factions { empire_east_rebels, } and hidden_resource great_fert
                    ;happiness_bonus bonus 4 requires factions { empire_east_rebels, }
                    ;law_bonus bonus 4 requires factions { empire_east_rebels, }
                    recruit "orc warg" 1 requires factions { empire_east_rebels, } and hidden_resource warg_hru ;greater wargs
                    recruit "orc wargarcher" 1 requires factions { empire_east_rebels, } and hidden_resource warg2_hru ;lesser wargs
                    recruit "orc wargrider" 2 requires factions { empire_east_rebels, } ; intermediate wargs
                }
                construction  4 
                cost  3200 
                settlement_min large_city
                upgrades
                {
                }
            }
            mf_troll_cave requires factions { empire_east_rebels, } and hidden_resource troll_hru ; Troll Caverns
            {
                capability
                {
                    ;recruit "mf settler" 0 requires factions { empire_east_rebels, } and hidden_resource great_fert
                    ;happiness_bonus bonus 4 requires factions { empire_east_rebels, }
                    ;law_bonus bonus 4 requires factions { empire_east_rebels, }
                    recruit "orc troll" 1 requires factions { empire_east_rebels, } and hidden_resource rg
                }
                construction  4 
                cost  3200 
                settlement_min large_city
                upgrades
                {
                }
            }
            mf_orc_outpost requires factions { empire_east_rebels, } and not  hidden_resource harad and not hidden_resource khand and not  hidden_resource orcs and not hidden_resource warg_hru and not hidden_resource warg2_hru and not hidden_resource troll_hru ; Orc Outpost
            {
                capability
                {
                    ;recruit "mf settler" 0 requires factions { empire_east_rebels, } and hidden_resource great_fert
                    ;happiness_bonus bonus 2 requires factions { empire_east_rebels, }
                    ;law_bonus bonus -2 requires factions { empire_east_rebels, }
                    recruit "orc band" 1 requires factions { empire_east_rebels, }
                    recruit "orc snagahunter" 2 requires factions {  empire_east_rebels, } and hidden_resource rg and hidden_resource dunland
                    recruit "orc hunter" 2 requires factions { empire_east_rebels, }
                    recruit "orc raider" 2 requires factions { empire_east_rebels, }
                    recruit "orc champion" 3 requires factions { empire_east_rebels, } and hidden_resource rg
                }
                construction  4 
                cost  3200 
                settlement_min large_city
                upgrades
                {
                }
            }
        }
        plugins 
        {
        }
    }
    I hope someone from the team can confirm or correct this. I'm really enjoying this grand mod atm, and to have Harad and Adunabar levy armies with a nice share of Mumakil, Trolls and Wargs in all my campaigns would be a delicious cream topping.
    Last edited by Casual Tactician; August 07, 2011 at 03:15 AM.

  2. #2

    Default Re: Question: altering EDB to force AI build Mumakil/Troll/Warg diversification bldgs?

    The thing with negative conditionals is that if you have them at tier X of a building tree, then you must also add them to all the subsequent ones; so, if the second-to-last bldg requires "not lead", the last one must also have "and not lead" in its conditional. There's a complicated way around (which is heavily used in DoM), that goes like this:


    tier 2 requires factions { whatever, } and not hidden_resource X
    tier 3 requires factions { whatever, } and hidden_resource sughdian and not hidden_resource X or factions { whatever, } and proper_conditional

    where HR sughdian exists nowhere, which means the first case where the building would be available won't ever occur.



    Generally EDB is very weird with the way it parses conditionals and it's guaranteed to frustrate you a bit (or a lot). It will require some trial and error before you get things perfectly right.

  3. #3

    Default Re: Question: altering EDB to force AI build Mumakil/Troll/Warg diversification bldgs?

    Quote Originally Posted by Aradan View Post
    The thing with negative conditionals is that if you have them at tier X of a building tree, then you must also add them to all the subsequent ones; so, if the second-to-last bldg requires "not lead", the last one must also have "and not lead" in its conditional. There's a complicated way around (which is heavily used in DoM), that goes like this:


    tier 2 requires factions { whatever, } and not hidden_resource X
    tier 3 requires factions { whatever, } and hidden_resource sughdian and not hidden_resource X or factions { whatever, } and proper_conditional

    where HR sughdian exists nowhere, which means the first case where the building would be available won't ever occur.
    Heh, that’s a neat trick. Regarding the tiers of the building tree, is this example labelled correctly?
    Code:
    building cd_temple_of_hunting_lots ;ADUNABAR DIVERSIFICATION
    {
        levels temple_of_hunting_lots_shrine temple_of_hunting_lots_temple temple_of_hunting_lots_large_temple mf_troll_cave mf_orc_outpost
        {
            temple_of_hunting_lots_shrine (= tier 1) requires factions { empire_east_rebels, } and building_present_min_level mf_memorial mf_high_temple ; City Development
            {
                capability
                {
                    ;recruit "mf settler" 0 requires factions { empire_east_rebels, } and hidden_resource great_fert
                    happiness_bonus bonus 4 requires factions { empire_east_rebels, }
                    law_bonus bonus 4 requires factions { empire_east_rebels, }
                    
                }
                construction  4
                cost  5000 
                settlement_min large_city
                upgrades
                {
                    temple_of_hunting_lots_temple tier 2
                    temple_of_hunting_lots_large_temple tier 3
                    mf_troll_cave tier 4
                    mf_orc_outpost tier 5
                }
            }
    If that’s the case, I believe that “way around” will solve the problem that caused the error message after exiting RTW I posted in the OP. The thing was I gave the Corsair Stronghold (tier 2) "and not resource lead", but the Mumakil Training Ground (tier 6) didn't have "and not resource lead". But now it should be easy to get exactly what I'm aiming for.
    The same for the problem I had, when giving the Uruk Breeder (tier 2) "and not hidden resource troll_hru" whereas the Troll Caves (tier 4) didn't have it. As that didn't work, I simply gave the Uruk Breeder the capability to recruit the troll unit --not very elegant-- , but now I can get it done proberly.

    And as I saw in the descr_regions.txt some resources for Warg Dens, (Orc Outpost), Uruk Breeder and Troll Caves don't overlap, so I don't have to do that many changes for the Adunabar diversification bldgs after all. Also after thinking about it again, I will only make the Orc Outpost non-constructable in the two Rhovanion provinces with wrag_hru and not also in the other five with warg2_hru only - that would result in too many warg units pouring down form the north, I reckon.

    Quote Originally Posted by Aradan View Post
    Generally EDB is very weird with the way it parses conditionals and it's guaranteed to frustrate you a bit (or a lot). It will require some trial and error before you get things perfectly right.
    True, but your tip (if I got it right, that is) will help me a great deal. I wonder how it's actually possible to create such an elaborate and stabil mod as FATW. You guys truely did a great job!

Posting Permissions

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