Results 1 to 6 of 6

Thread: Correct syntax for EDB: units that require buildings

  1. #1

    Default Correct syntax for EDB: units that require buildings

    I have a consistent CTD when I click to go the strat map on Grand Campaign menu. I'm pretty sure it's due to my modifications of the EDB. I put building reqs on units that have armors above ug level 0 and on gunpowder units. I'm wondering if that causing the CTDs.

    Code:
    recruit_pool "gun holk"  1   1   3  0  requires factions { northern_european, } and building_present_min_level academic alchemists_lab 
    recruit_pool "Dismounted Broken Lances"  1   0.7   6  0  requires factions { sicily, } and building_present_min_level smith plate_armourer

  2. #2
    Alondite's Avatar Semisalis
    Join Date
    Sep 2018
    Location
    Taiwan
    Posts
    407

    Default Re: Correct syntax for EDB: units that require buildings

    Yes when you tie building_present to recruit_pool you'll basically get CTD.
    However I have the impression that if the building doesn't have entries for other types of capability, i.e. "recruit_pool"s only, they work fine without CTD.

    I saw this in a thread on TWC but cannot find it just now.

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

    Default Re: Correct syntax for EDB: units that require buildings

    Quote Originally Posted by Alondite View Post
    However I have the impression that if the building doesn't have entries for other types of capability, i.e. "recruit_pool"s only, they work fine without CTD.
    That is correct.

    Barracks, for example, usually have a law_bonus. So one way to avoid the CTD is to remove the recruit_pool line from the barracks and put it instead into a brand new building which has no capabilities other than recruit_pool ones.

  4. #4
    QuintusSertorius's Avatar EBII Hod Carrier
    Artifex

    Join Date
    Feb 2008
    Location
    UK
    Posts
    11,749

    Default Re: Correct syntax for EDB: units that require buildings

    Yep, you can't use buildings as requirements for recruit_pool lines. Only event_counters, hidden_resources, resources, region_religion and a few others.

    As suggested, you can make it a requirement for a new building, or a new level of an existing building (which can be either on the upgrade line, or the main building requirement line), which features the unit you want.

    You could do it with the script (generating an event_counter), but that's going to be hugely complicated and more effort that its worth.

  5. #5

    Default Re: Correct syntax for EDB: units that require buildings

    you could also have 2 seperatet recruit_pools diviedetet betwen two buildings
    Building 1 provides max pool
    recruit_pool "Unit" 0 0 3 0 requires factions { faction, }
    Building 2 provides unit growth
    recruit_pool "Unit" 1 0.13 0 0 requires factions { faction, }
    you just need comunicate this to the player

  6. #6

    Default Re: Correct syntax for EDB: units that require buildings

    I think it would be better to move the units that require a building in order to build them, to said building, just providing unit pools based on the amour's production. These might not cause a CTD, as such buildings already exist in native:
    Code:
     levels caravan_stop caravanersary 
        {
            caravan_stop castle requires factions { moors, } 
            {
                capability
                {
                    recruit_pool "Tuareg Camel Spearmens"  1   0.5   4  0  requires factions { moors, } 
                    trade_level_bonus bonus 2
                }
                material wooden
                construction  2 
                cost  1200 
                settlement_min large_town
                upgrades
                {
                    caravanersary
                }
            }

Tags for this Thread

Posting Permissions

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