Results 1 to 3 of 3

Thread: EDB: how to set different conditions for different factions to build the same building

  1. #1
    Laetus
    Join Date
    Jan 2015
    Location
    Colorado, USA
    Posts
    22

    Default EDB: how to set different conditions for different factions to build the same building

    Hi all, I discovered something last night I wanted to share.

    I play EB 1.6 which I have modded very heavily to suit my own tastes, but one thing that has always presented a challenge to me was how to restrict urban growth and in particular large barbarian settlements, in order to simulate romanization/hellenization when barbarian territory is conquered. But the problem has been to do it in a way that doesn't restrict large settlements for non-barbarian factions, which means different conditions are necessary for the same building - the core settlement building.

    In the past, it has not really been possible to do this in a way that doesn't screw up the game. The EB devs figured out a way to set some different conditions for different factions, but the way the EDB parses conditionals makes what you can do very limited unless you really think outside the box.

    Here's an example of how EB did it:

    Code:
    building hinterland_farms
    {
        levels farms farms+1 farms+2
        {
            farms requires factions { germans, britons, scythia, dacia,  spain, gauls, romans_brutii, egypt, romans_scipii, carthage, numidia,  thrace, greek_cities, macedon, romans_julii, seleucid, saba, } or  factions { parthia, armenia, pontus, } and building_present_min_level  minimumbuilding pastoralism and not building_present_min_level nomadcamp  warlordm
            {
                capability
                {
                    farming_level 1
                }
                construction  4
                cost  1200
                settlement_min town
                upgrades
                {
                    farms+1
                }
            }
    Notice that the second set of factions can have requirements (factions { parthia, armenia, pontus, }) but the first set cannot. If you try to add "and building_present/hidden_resource/etc." after the first set of factions but before the second set ("or factions"), the "and" requirements after the second faction set will be ignored thanks to clunky parsing. Thus the limited capability.

    However, there IS a way around this!

    The key here is to put your "or" conditional between the two faction sets, and nothing else. You can then parse your buildings, resources, and other conditionals backwards from the CA default ( "requires factions" first, everything else after) to ensure this happens. For example:

    Code:
    buildingalpha requires building_present buildingbeta and hidden_resource gamma and factions { x, y, } or factions { z, } and building_present buildingbeta and hidden_resource delta
    Notice how the parsing resembles a palindrome, hehehe

    So here is my code for the governors_palace in EDB. Conditioned so that barbarians can only build it in regions with the "barbcity" hidden resource, while leaving the other cultures unaffected and still maintaining the building and resource requirements for all factions. Voila!

    Code:
    governors_palace requires building_present government and hidden_resource city and factions { saba, slave, romans_brutii, egypt, romans_scipii, carthage, parthia, numidia, thrace, greek_cities, macedon, romans_julii, seleucid, } or factions { barbarian, nomad, } and building_present government and hidden_resource city and hidden_resource barbcity
            {
                capability
                {
                    agent diplomat  0  requires factions { barbarian, armenia, pontus, romans_brutii, egypt, romans_scipii, carthage, parthia, saba, numidia, thrace, greek_cities, macedon, romans_julii, seleucid, }
                    law_bonus bonus 1  requires factions { armenia, pontus, }
                    recruit "generic militia" 1 requires factions { slave, }
                    population_health_bonus bonus -3
                    }
                faction_capability
                {
                    upgrade_bodyguard 1 requires factions { barbarian, armenia, }
                }
                construction  6
                cost  3200
                settlement_min large_town
                upgrades
                {
                    proconsuls_palace
                }
            }
    Tested and working. Doesn't break any culture stuff either, as far as I can tell. I'm excited to see how you guys use it in your mods!

  2. #2
    Frunk's Avatar Form Follows Function
    Artifex took an arrow to the knee

    Join Date
    Jun 2009
    Location
    Gold Coast
    Posts
    6,504

    Default Re: EDB: how to set different conditions for different factions to build the same building

    Nice work mate! +rep

  3. #3
    Laetus
    Join Date
    Jul 2014
    Location
    Glasgow Scotland
    Posts
    13

    Default Re: EDB: how to set different conditions for different factions to build the same building

    I tried to expand current buildings capabilities by adding some more upgrade options to existing building
    for whatever reason game is having none of it and there is no error message in log.txt file
    i am confused, where i can get some help?

Posting Permissions

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