Results 1 to 8 of 8

Thread: Multiple core buildings for the same settlement level.

  1. #1
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Icon1 Multiple core buildings for the same settlement level.

    You can have as many core buildings of the same level as you want in export_descr_buildings.txt.
    You can have, for example, two different core buildings for large castle.

    So for example, in export_descr_buildings.txt, the upgrade part of wooden_wall core building looks like this:

    Code:
    upgrades
    {
    stone_wall
    }
    stone_wall is the upgrade, and its own section is detailed right after the wooden_wall section.

    So if you want one more type of stone_wall core building, just add it to the wooden_wall upgrade part, for example:

    Code:
    upgrades
    {
    stone_wall
    stone_wall_for_france
    }
    And then create the stone_wall_for_france section right after the stone_wall one.

    As we know, we can add requirements for buildings, so by adding requires factions { france, } to the newly core building created (stone_wall_for_france), this will allow only France to build this upgrade.

    You can remove France from the original stone_wall so that France will only be able to build the stone_wall_for_france, but you can also keep it there so to allow France to choose wich one will be built! (no idea on how the AI will make this decision).

    This trick of adding new core buildings comes useful when you want to have settlements in specific regions that should be upgraded only by a specific faction. For example, in TATW, only Gondor can upgrade Osgiliath, so changing it from a large city (ruined Osgiliath custom settlement) to a huge city (rebuilt Osgiliath custom settlement). To make sure that only Gondor can do it, you can create a new core building for huge city level and limit it only for Gondor with the "requires" thing. To make sure that Gondor can only upgrade to huge city in that specific region, use a hidden resource as a limiter, otherwise Gondor will go around building Osgiliaths everywhere!

    You can use this trick for even more complex stuff.
    For example, I have an extra core building for each settlement level, that can only be built by dwarves, the same dwarves cannot build the vanilla core buildings.

    I've made this because I wanted to make settlements built by dwarves to have cannon towers, and I added this feature by editing the capability part of this new exclusive dwarven core building like this:

    Code:
    capability
                {
                    wall_level 2
                    tower_level 3
                    gate_strength 1
                   gate_defences 2
                }
    I could simply use the original vanilla core building and limit the tower_level 3 only for dwarves, like this:

    Code:
    capability
                {
                    wall_level 2
                    tower_level 3 requires factions { dwarves, }
                    gate_strength 1
                   gate_defences 2
                }
    So that only dwarves would be able to use the cannon towers in any settlement around, but this way every vanilla settlement with a third 3d model level of towers would fire cannon balls if the settlement is owned by dwarves. Since I have made custom settlements for dwarves with catapults on the walls for my mod, these are the only settlements that should be able to have this feature. In other words, only settlements originally upgraded by dwarves. Thats why I had to create a new core building instead of using the "requires" thing for the tower_level in the vanilla core building.

    Bonus


    You can have multiple upgrade entries for the same settlement level. As you can see in this example, the fortress level has 3 different lines of upgrade leading to the same citadel level. All 3 will upgrade to the same citadel level, but each one has its restrictions.
    For example, the first upgrade line make sure that sicily is one of the factions that can build citadels, but only in a region with the hidden_resource osgiliath_west in it. In TATW, sicily is Gondor, so this method basically makes only Gondor able to rebuild Osgiliath, since ruined Osgiliath custom settlement is a fortress in the region with the osgiliath_west hidden resource, and restored Osgiliath is the citadel settlement of sicily.



    Code:
    fortress castle requires factions { gondor, northern_european, middle_eastern, }  and hidden_resource big_city  and hidden_resource custom_settlement
            {
                capability
                {
                    wall_level 3
                    tower_level 1
                    gate_strength 2
                   gate_defences 2
                    free_upkeep bonus 5
                    free_upkeep bonus 4 requires event_counter is_the_ai 1
                    recruitment_slots 3
            recruits_morale_bonus bonus 3 requires event_counter is_the_ai 1
            law_bonus bonus 20 requires event_counter is_the_ai 1
            ;income_bonus bonus 400 requires event_counter is_the_ai 1
            construction_cost_bonus_stone bonus 50 requires event_counter is_the_ai 1
            construction_cost_bonus_wooden bonus 50 requires event_counter is_the_ai 1
            taxable_income_bonus 50 requires event_counter is_the_ai 1            ;used only for correct display of construction bonus
            trade_base_income_bonus bonus 7 requires event_counter is_the_ai 1
                }
                material stone
                construction  7
                cost  6500 
                settlement_min large_town
                upgrades
                {
                    citadel requires factions { sicily, }  and hidden_resource osgiliath_west
            citadel requires factions { turks, byzantium, }  and hidden_resource fornost
            citadel requires factions { portugal, }  and hidden_resource angmar
                }
            }
        citadel castle requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, }
            {
                capability
                {
                    wall_level 4
                    tower_level 1
                    gate_strength 2
    ;                gate_defences 2
                    free_upkeep bonus 5
                    free_upkeep bonus 4 requires event_counter is_the_ai 1
                    recruitment_slots 3
            recruits_morale_bonus bonus 3 requires event_counter is_the_ai 1
            law_bonus bonus 20 requires event_counter is_the_ai 1
            ;income_bonus bonus 500 requires event_counter is_the_ai 1
            construction_cost_bonus_stone bonus 50 requires event_counter is_the_ai 1
            construction_cost_bonus_wooden bonus 50 requires event_counter is_the_ai 1
            taxable_income_bonus 50 requires event_counter is_the_ai 1            ;used only for correct display of construction bonus
            trade_base_income_bonus bonus 7 requires event_counter is_the_ai 1
                }
                material stone
                construction  10
                cost  12000 
                settlement_min city
                upgrades
                {
                }
            }
        }
        plugins 
        {
        }

    Limitations

    You can set lots of upgrade types for each settlement level in export_descr_buildings, but only 1 battlemap settlement model for each level
    per faction. Thats because of the the .worldpkgdesc files.
    There are 11 levels of settlement for each faction and this is hardcoded.
    So no matter if you have, for example, multiple citadel types for the same faction in export_descr_buildings, once this faction upgrade a settlement to citadel, it will always load the same custom settlement in battlemap, wich is the one set in the citadel .worldpkgdesc file of that faction.
    Last edited by leo.civil.uefs; April 23, 2020 at 04:20 PM.

  2. #2
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Multiple core buildings for the same settlement level.

    Interesting use of the multiple upgrade principle. Pity it's limited by the total number of levels you can have in one tree.










  3. #3
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Multiple core buildings for the same settlement level.

    One cool idea is that with this trick we could make different upgrade paths for settlements.

    For example, when a town reaches the needed population and is ready to be upgraded to large town, not only 1 upgrade building would show up available but actually two, so you could chose between them, like the first one gives you something like more free upkeep slots and wall strenght, while the other one gives bonuses to economy or something else.

    And each one of these options would have subsequent upgrades with even different features.

    I never tested something like this, but seems possible.

  4. #4
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Multiple core buildings for the same settlement level.

    EBII has used that principle for a number of building trees, just not for the core building, some instances are fairly elaborate.

    Your tutorial should encourage others to explore the possibilities this opens, it's mechanics are simply not well known.










  5. #5
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Multiple core buildings for the same settlement level.

    Freaking awesome! Thanks for share!

    Could you post a working example of the whole working building tree?
    Last edited by bitterhowl; April 14, 2020 at 12:54 AM.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  6. #6
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Multiple core buildings for the same settlement level.

    Quote Originally Posted by bitterhowl View Post
    Freaking awesome! Thanks for share!

    Could you post a working example of the whole working building tree?
    Here's the core building section of cities from my submod. Works perfectly fine.

    Code:
    ;############################################################
    ;###################### CORE BUILDINGS ######################
    ;############################################################
    building core_building
    {
    ;    convert_to core_castle_building
        levels wooden_pallisade wooden_wall stone_wall dwarf_stone_wall large_stone_wall dwarf_large_stone_wall huge_stone_wall 
        {
            wooden_pallisade city requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, }  and hidden_resource custom_settlement
            {
                capability
                {
                    wall_level 0
                    tower_level 1
                    free_upkeep bonus 1
                    free_upkeep bonus 3 requires event_counter is_the_ai 1
                    recruitment_slots 2
    		recruits_morale_bonus bonus 2 requires event_counter is_the_ai 1
    		law_bonus bonus 8 requires event_counter is_the_ai 1
    		;income_bonus bonus 100 requires event_counter is_the_ai 1
    		construction_cost_bonus_stone bonus 50 requires event_counter is_the_ai 1
    		construction_cost_bonus_wooden bonus 50 requires event_counter is_the_ai 1
    		taxable_income_bonus 50 requires event_counter is_the_ai 1			;used only for correct display of construction bonus
    		trade_base_income_bonus bonus 4 requires event_counter is_the_ai 1
                }
                material wooden
                construction  3 
                cost  1000
                settlement_min village
                upgrades
                {
                    wooden_wall
                }
            }
            wooden_wall city requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, }  and hidden_resource custom_settlement
            {
                capability
                {
                    wall_level 1
                    gate_strength 1
                    tower_level 1
                    free_upkeep bonus 2
                    free_upkeep bonus 3 requires event_counter is_the_ai 1
                    recruitment_slots 2
    		recruits_morale_bonus bonus 2 requires event_counter is_the_ai 1
    		law_bonus bonus 8 requires event_counter is_the_ai 1
    		;income_bonus bonus 200 requires event_counter is_the_ai 1
    		construction_cost_bonus_stone bonus 50 requires event_counter is_the_ai 1
    		construction_cost_bonus_wooden bonus 50 requires event_counter is_the_ai 1
    		taxable_income_bonus 50 requires event_counter is_the_ai 1			;used only for correct display of construction bonus
    		trade_base_income_bonus bonus 5 requires event_counter is_the_ai 1
                }
                material wooden
                construction  5 
                cost  1800
                settlement_min town
                upgrades
                {
                    stone_wall
    				dwarf_stone_wall
                }
            }
            stone_wall city requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, }  and hidden_resource custom_settlement
            {
                capability
                {
                    wall_level 2
                    tower_level 1
                    gate_strength 1
    ;                gate_defences 2
                    free_upkeep bonus 3
                    free_upkeep bonus 3 requires event_counter is_the_ai 1
                    recruitment_slots 2
    		recruits_morale_bonus bonus 3 requires event_counter is_the_ai 1
    		law_bonus bonus 8 requires event_counter is_the_ai 1
    		;income_bonus bonus 300 requires event_counter is_the_ai 1
    		construction_cost_bonus_stone bonus 50 requires event_counter is_the_ai 1
    		construction_cost_bonus_wooden bonus 50 requires event_counter is_the_ai 1
    		taxable_income_bonus 50 requires event_counter is_the_ai 1			;used only for correct display of construction bonus
    		trade_base_income_bonus bonus 6 requires event_counter is_the_ai 1
                }
                material stone
                construction  7
                cost  5200
                settlement_min large_town
                upgrades
                {
                    large_stone_wall
                }
            }
    		dwarf_stone_wall city requires factions { southern_european, }  and hidden_resource custom_settlement
            {
                capability
                {
                    wall_level 2
                    tower_level 3
                    gate_strength 1
    ;                gate_defences 2
                    free_upkeep bonus 3
                    free_upkeep bonus 3 requires event_counter is_the_ai 1
                    recruitment_slots 2
    		recruits_morale_bonus bonus 3 requires event_counter is_the_ai 1
    		law_bonus bonus 8 requires event_counter is_the_ai 1
    		;income_bonus bonus 300 requires event_counter is_the_ai 1
    		construction_cost_bonus_stone bonus 50 requires event_counter is_the_ai 1
    		construction_cost_bonus_wooden bonus 50 requires event_counter is_the_ai 1
    		taxable_income_bonus 50 requires event_counter is_the_ai 1			;used only for correct display of construction bonus
    		trade_base_income_bonus bonus 6 requires event_counter is_the_ai 1
                }
                material stone
                construction  7
                cost  5200
                settlement_min large_town
                upgrades
                {
                    dwarf_large_stone_wall
                }
            }
            large_stone_wall city requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, }  and hidden_resource big_city  and hidden_resource custom_settlement
            {
                capability
                {
                    wall_level 3
                    tower_level 1
                    gate_strength 2
                    free_upkeep bonus 4
                    free_upkeep bonus 3 requires event_counter is_the_ai 1
                    recruitment_slots 2
    		recruits_morale_bonus bonus 3 requires event_counter is_the_ai 1
    		law_bonus bonus 9 requires event_counter is_the_ai 1
    		;income_bonus bonus 400 requires event_counter is_the_ai 1
    		construction_cost_bonus_stone bonus 50 requires event_counter is_the_ai 1
    		construction_cost_bonus_wooden bonus 50 requires event_counter is_the_ai 1
    		taxable_income_bonus 50 requires event_counter is_the_ai 1			;used only for correct display of construction bonus
    		trade_base_income_bonus bonus 7 requires event_counter is_the_ai 1
                }
                material stone
                construction  8
                cost  7800
                settlement_min city
                upgrades
                {
                    huge_stone_wall requires factions { sicily, }  and hidden_resource osgiliath_west
    				huge_stone_wall requires factions { turks, byzantium, }  and hidden_resource fornost
    				huge_stone_wall requires factions { egypt, }  and hidden_resource eregion
                }
            }
    		dwarf_large_stone_wall city requires factions { southern_european, }  and hidden_resource big_city  and hidden_resource custom_settlement
            {
                capability
                {
                    wall_level 3
                    tower_level 3
                    gate_strength 1
                    free_upkeep bonus 4
                    free_upkeep bonus 3 requires event_counter is_the_ai 1
                    recruitment_slots 2
    		recruits_morale_bonus bonus 3 requires event_counter is_the_ai 1
    		law_bonus bonus 9 requires event_counter is_the_ai 1
    		;income_bonus bonus 400 requires event_counter is_the_ai 1
    		construction_cost_bonus_stone bonus 50 requires event_counter is_the_ai 1
    		construction_cost_bonus_wooden bonus 50 requires event_counter is_the_ai 1
    		taxable_income_bonus 50 requires event_counter is_the_ai 1			;used only for correct display of construction bonus
    		trade_base_income_bonus bonus 7 requires event_counter is_the_ai 1
                }
                material stone
                construction  8
                cost  7800
                settlement_min city
                upgrades
                {
                }
            }
    		huge_stone_wall city requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, }
            {
                capability
                {
                    wall_level 4
                    tower_level 1
                    gate_strength 2
                    free_upkeep bonus 4
                    free_upkeep bonus 3 requires event_counter is_the_ai 1
                    recruitment_slots 2
    		recruits_morale_bonus bonus 3 requires event_counter is_the_ai 1
    		law_bonus bonus 10 requires event_counter is_the_ai 1
    		;income_bonus bonus 500 requires event_counter is_the_ai 1
    		construction_cost_bonus_stone bonus 50 requires event_counter is_the_ai 1
    		construction_cost_bonus_wooden bonus 50 requires event_counter is_the_ai 1
    		taxable_income_bonus 50 requires event_counter is_the_ai 1			;used only for correct display of construction bonus
    		trade_base_income_bonus bonus 7 requires event_counter is_the_ai 1
                }
                material stone
                construction  10
                cost  12000
                settlement_min large_city
                upgrades
                {
                }
            }
        }
        plugins 
        {
        }
    }

  7. #7
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Multiple core buildings for the same settlement level.

    Just an idea that came to my mind.

    With the trick explained in this tutorial, one can make a unique settlement that has its own unique levels.
    Lets say, a custom village, that is upgraded to a custom town, then custom large town etc. While the rest of the settlements in campaign remain generic.

    This is basically what osgiliath is in TATW, it evolves from ruined (large_city) to restored (huge_city), always keeping its uniqueness as a custom settlement. Im just saying this could be done from village level on for a specific settlement.


    I forgot about the .worldpackage file limitation. You can do as I said, but still every faction can only build 6 levels of settlements (village, town, large town etc).

    So there's not enough slots for a faction to have both generic settlements that can be built all around and a complete row of custom settlements for a single settlement.
    Last edited by leo.civil.uefs; April 19, 2020 at 06:22 AM.

  8. #8
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Multiple core buildings for the same settlement level.

    Quote Originally Posted by leo.civil.uefs View Post
    So there's not enough slots for a faction to have both generic settlements that can be built all around and a complete row of custom settlements for a single settlement.
    However, this is exactly what the plan_set is intended to do.

    Check here and here.

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
  •