How to change legendary buildings placement

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Lumion32

Second Lieutenant
44 Badges
May 12, 2017
105
3
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Res Publica
  • Surviving Mars: First Colony Edition
  • Crusader Kings III
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Federations
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Ancient Relics
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Rights of Man
  • Stellaris: Distant Stars
  • Cities: Skylines Industries
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Crusader Kings III: Royal Edition
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Stellaris - Path to Destruction bundle
  • Stellaris: Distant Stars Pre-Order
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Third Rome
  • Crusader Kings II
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
So I have finished my legend and can now build one of those special buildings. Issue is the game auto-chooses a weird barony that is a city. Might be the one in which the hunt happened that sparked it? Which I can ofc never hold. And as only the holder gets most the boni, that seems not ideal. Any ideas on this?
Thanks in advance
 
  • 2Like
Reactions:
you cant. sucks to be you idiot. enjoy your hunting lodge in plains instead of in all these nice forests you hold specifically for hunting

tbh im not super sure why they chose to do it like this but maybe we can get options in a patch some time down the line. for the moment you must suffer, however
 
  • 14Haha
  • 5Like
  • 1
Reactions:
as far as i can tell its completely random.

i tested it out in debug mode. first i thought it was for duchy county because that was what happened when i tried it the first time ( i held only 2 counties,1 was the duchy county) but i tested it further in a different kingdom & it seemed to just give completely random counties/baronies . Even if you give that county away and grant it independence the decision will still clear the grounds for the county you now no longer holds.

i think they did it like this to deter you from making insane duchies with 3/3 counties having a special building. so instead it gives a random county (it seems to at least select one of your personally held counties)
 
as far as i can tell its completely random.

i tested it out in debug mode. first i thought it was for duchy county because that was what happened when i tried it the first time ( i held only 2 counties,1 was the duchy county) but i tested it further in a different kingdom & it seemed to just give completely random counties/baronies . Even if you give that county away and grant it independence the decision will still clear the grounds for the county you now no longer holds.

i think they did it like this to deter you from making insane duchies with 3/3 counties having a special building. so instead it gives a random county (it seems to at least select one of your personally held counties)
I mean that would be fine if it at least would be a castle holding. Putting it on a city feels meh.
 
  • 1Haha
Reactions:
The only way you can do this is by having only the sole county which you want to have the legendary building in, I did this by granting every county to my heir and keeping 1 where I specifically want the legendary palace to be in.

Not the greatest way, I know, but it's the only way now, not sure if it's intended or the devs forgot to add a way to select the barony
 
  • 2
  • 1Like
Reactions:
The holding also seems to be set when you complete the legend. I closed my legend after a holy war but before I gave away the new holdings. Now my option to build a legendary building is in a holding I don't own. Granting that holding independence doesn't even change it.
 
  • 8Haha
  • 1
Reactions:
The holding also seems to be set when you complete the legend. I closed my legend after a holy war but before I gave away the new holdings. Now my option to build a legendary building is in a holding I don't own. Granting that holding independence doesn't even change it.


Ah, THAT is why that happened. Well my vassal got a nice palace, hope the git is happy.
 
  • 1Love
Reactions:
This is just lazy design imo. Should work like with holy orders. I had mine spawn in a useless county, what i wanted to give away eventually.
 
  • 10Like
  • 3
  • 2Haha
Reactions:
It's also weird since other benefits you get to choose - the one where you instantly get to de jure a duchy or kingdom, an event pops up where you can choose which one is relevant to you.

Having said that, for me, the first several special buildings have been logical - only after that they become random. For example, when I got one for building a church, the special building was in that barony. The next one was my capital, and then next one was a statue in the neighboring county. But maybe when it runs out of relevant ones, then it just goes to random ones. (I think I have 6 special buildings now out of 3 generations, and that's probably not even a record.)
 
  • 1Like
Reactions:
The building location is set on legend completion. It defaults to the legend location (if any), then your capital, then a county capital you control, then a barony you control, then a barony in one of your counties, then a feudal barony in your realm, then a barony with a holding in your realm, and then finally any unbuilt barony in your realm. Note for all of these it has to be a barony without a special building slot (hence all the fall backs in case you build a lot of these).

So unless you directly controlled that city when the legend was completed or have built so many of these that all feudal holdings already have a special building slot, then the reason it is in a city is because the is the legend location.

Code:
give_legendary_building_location_standard_effect = {
    if = { # Prioritize the location of the legend if possible
        limit = {
            root = {
                locale_valid_for_legendary_buildings = yes
            }
        }
        scope:location = { save_scope_as = legendary_locale }
    }
    else_if = { # Otherwise, get the capital
        limit = {
            capital_province = { has_special_building_slot = no }
        }
        capital_province = { save_scope_as = legendary_locale }
    }
    else_if = { # Otherwise, prioritize a title you hold directly
        limit = {
            any_held_title = {
                tier = tier_county
                title_province = { has_special_building_slot = no }
            }
        }
        random_held_title = {
            limit = {
                tier = tier_county
                title_province = { has_special_building_slot = no }
            }
            title_province = { save_scope_as = legendary_locale }
        }
    }
    else_if = { #Otherwise, prioritize a barony that you hold directly
        limit = {
            any_held_title = {
                tier = tier_barony
                title_province = {
                    has_special_building_slot = no
                }
            }
        }
        random_held_title = {
            limit = {
                tier = tier_barony
                title_province = {
                    has_special_building_slot = no
                }
            }
            title_province = {
                save_scope_as = legendary_locale
            }
        }

    }
    else_if = { # Otherwise, prioritize a barony within a title you hold
        limit = {
            any_held_title = {
                tier = tier_county
                any_county_province = { has_special_building_slot = no }
            }
        }
        random_held_title = {
            limit = {
                tier = tier_county
                any_county_province = { has_special_building_slot = no }
            }
            random_county_province = {
                limit = {
                    has_special_building_slot = no
                }
                save_scope_as = legendary_locale
            }
        }
    }
    else_if = { # Find a feudal barony...
        limit = {
            any_sub_realm_barony = {
                title_province = {
                    has_special_building_slot = no
                    has_holding_type = castle_holding
                }
            }
        }
        random_sub_realm_barony = {
            limit = {
                title_province = {
                    has_special_building_slot = no
                    has_holding_type = castle_holding
                }
            }
            title_province = { save_scope_as = legendary_locale }
        }
    }
    else_if = { # Find a province with a holding
        limit = {
            any_sub_realm_barony = {
                title_province = {
                    has_special_building_slot = no
                    has_holding = yes
                }
            }
        }
        random_sub_realm_barony = {
            limit = {
                title_province = {
                    has_special_building_slot = no
                    has_holding = yes
                }
            }
            title_province = { save_scope_as = legendary_locale }
        }
    }
    else = { # Final fallback, just any barony in your realm
        random_sub_realm_barony = {
            limit = {
                title_province = { has_special_building_slot = no }
            }
            title_province = { save_scope_as = legendary_locale }
        }
    }
    ...

Note, I'm not opposed to an option to choose the location rather than have it picked for us. Maybe it gives this default location, but as @InsidiousMage mentioned we could change it similar to how we do for holy orders.

as far as i can tell its completely random.

i tested it out in debug mode. first i thought it was for duchy county because that was what happened when i tried it the first time ( i held only 2 counties,1 was the duchy county) but i tested it further in a different kingdom & it seemed to just give completely random counties/baronies . Even if you give that county away and grant it independence the decision will still clear the grounds for the county you now no longer holds.

i think they did it like this to deter you from making insane duchies with 3/3 counties having a special building. so instead it gives a random county (it seems to at least select one of your personally held counties)
Note because of the only one special building slot rule per barony, as you build more of these, they will get more random. But the first one at least should be deterministic unless you happen to already have special building slots in the relevant baronies. Though admittedly I do not know how prevalent or random legend locations can be.

The location is set on legend completion, hence why giving a county away when looking at the decision doesn't change the county chosen.
 
  • 10
  • 2Like
Reactions:
The building location is set on legend completion. It defaults to the legend location (if any), then your capital, then a county capital you control, then a barony you control, then a barony in one of your counties, then a feudal barony in your realm, then a barony with a holding in your realm, and then finally any unbuilt barony in your realm. Note for all of these it has to be a barony without a special building slot (hence all the fall backs in case you build a lot of these).

So unless you directly controlled that city when the legend was completed or have built so many of these that all feudal holdings already have a special building slot, then the reason it is in a city is because the is the legend location.

Code:
give_legendary_building_location_standard_effect = {
    if = { # Prioritize the location of the legend if possible
        limit = {
            root = {
                locale_valid_for_legendary_buildings = yes
            }
        }
        scope:location = { save_scope_as = legendary_locale }
    }
    else_if = { # Otherwise, get the capital
        limit = {
            capital_province = { has_special_building_slot = no }
        }
        capital_province = { save_scope_as = legendary_locale }
    }
    else_if = { # Otherwise, prioritize a title you hold directly
        limit = {
            any_held_title = {
                tier = tier_county
                title_province = { has_special_building_slot = no }
            }
        }
        random_held_title = {
            limit = {
                tier = tier_county
                title_province = { has_special_building_slot = no }
            }
            title_province = { save_scope_as = legendary_locale }
        }
    }
    else_if = { #Otherwise, prioritize a barony that you hold directly
        limit = {
            any_held_title = {
                tier = tier_barony
                title_province = {
                    has_special_building_slot = no
                }
            }
        }
        random_held_title = {
            limit = {
                tier = tier_barony
                title_province = {
                    has_special_building_slot = no
                }
            }
            title_province = {
                save_scope_as = legendary_locale
            }
        }

    }
    else_if = { # Otherwise, prioritize a barony within a title you hold
        limit = {
            any_held_title = {
                tier = tier_county
                any_county_province = { has_special_building_slot = no }
            }
        }
        random_held_title = {
            limit = {
                tier = tier_county
                any_county_province = { has_special_building_slot = no }
            }
            random_county_province = {
                limit = {
                    has_special_building_slot = no
                }
                save_scope_as = legendary_locale
            }
        }
    }
    else_if = { # Find a feudal barony...
        limit = {
            any_sub_realm_barony = {
                title_province = {
                    has_special_building_slot = no
                    has_holding_type = castle_holding
                }
            }
        }
        random_sub_realm_barony = {
            limit = {
                title_province = {
                    has_special_building_slot = no
                    has_holding_type = castle_holding
                }
            }
            title_province = { save_scope_as = legendary_locale }
        }
    }
    else_if = { # Find a province with a holding
        limit = {
            any_sub_realm_barony = {
                title_province = {
                    has_special_building_slot = no
                    has_holding = yes
                }
            }
        }
        random_sub_realm_barony = {
            limit = {
                title_province = {
                    has_special_building_slot = no
                    has_holding = yes
                }
            }
            title_province = { save_scope_as = legendary_locale }
        }
    }
    else = { # Final fallback, just any barony in your realm
        random_sub_realm_barony = {
            limit = {
                title_province = { has_special_building_slot = no }
            }
            title_province = { save_scope_as = legendary_locale }
        }
    }
    ...

Note, I'm not opposed to an option to choose the location rather than have it picked for us. Maybe it gives this default location, but as @InsidiousMage mentioned we could change it similar to how we do for holy orders.


Note because of the only one special building slot rule per barony, as you build more of these, they will get more random. But the first one at least should be deterministic unless you happen to already have special building slots in the relevant baronies. Though admittedly I do not know how prevalent or random legend locations can be.

The location is set on legend completion, hence why giving a county away when looking at the decision doesn't change the county chosen.
This is amazing thank you for the research. I only just started looking into the code myself, may I ask which file that part is in?
 
  • 4Like
Reactions:
The building location is set on legend completion. It defaults to the legend location (if any), then your capital, then a county capital you control, then a barony you control, then a barony in one of your counties, then a feudal barony in your realm, then a barony with a holding in your realm, and then finally any unbuilt barony in your realm. Note for all of these it has to be a barony without a special building slot (hence all the fall backs in case you build a lot of these).

So unless you directly controlled that city when the legend was completed or have built so many of these that all feudal holdings already have a special building slot, then the reason it is in a city is because the is the legend location.

Code:
give_legendary_building_location_standard_effect = {
    if = { # Prioritize the location of the legend if possible
        limit = {
            root = {
                locale_valid_for_legendary_buildings = yes
            }
        }
        scope:location = { save_scope_as = legendary_locale }
    }
    else_if = { # Otherwise, get the capital
        limit = {
            capital_province = { has_special_building_slot = no }
        }
        capital_province = { save_scope_as = legendary_locale }
    }
    else_if = { # Otherwise, prioritize a title you hold directly
        limit = {
            any_held_title = {
                tier = tier_county
                title_province = { has_special_building_slot = no }
            }
        }
        random_held_title = {
            limit = {
                tier = tier_county
                title_province = { has_special_building_slot = no }
            }
            title_province = { save_scope_as = legendary_locale }
        }
    }
    else_if = { #Otherwise, prioritize a barony that you hold directly
        limit = {
            any_held_title = {
                tier = tier_barony
                title_province = {
                    has_special_building_slot = no
                }
            }
        }
        random_held_title = {
            limit = {
                tier = tier_barony
                title_province = {
                    has_special_building_slot = no
                }
            }
            title_province = {
                save_scope_as = legendary_locale
            }
        }

    }
    else_if = { # Otherwise, prioritize a barony within a title you hold
        limit = {
            any_held_title = {
                tier = tier_county
                any_county_province = { has_special_building_slot = no }
            }
        }
        random_held_title = {
            limit = {
                tier = tier_county
                any_county_province = { has_special_building_slot = no }
            }
            random_county_province = {
                limit = {
                    has_special_building_slot = no
                }
                save_scope_as = legendary_locale
            }
        }
    }
    else_if = { # Find a feudal barony...
        limit = {
            any_sub_realm_barony = {
                title_province = {
                    has_special_building_slot = no
                    has_holding_type = castle_holding
                }
            }
        }
        random_sub_realm_barony = {
            limit = {
                title_province = {
                    has_special_building_slot = no
                    has_holding_type = castle_holding
                }
            }
            title_province = { save_scope_as = legendary_locale }
        }
    }
    else_if = { # Find a province with a holding
        limit = {
            any_sub_realm_barony = {
                title_province = {
                    has_special_building_slot = no
                    has_holding = yes
                }
            }
        }
        random_sub_realm_barony = {
            limit = {
                title_province = {
                    has_special_building_slot = no
                    has_holding = yes
                }
            }
            title_province = { save_scope_as = legendary_locale }
        }
    }
    else = { # Final fallback, just any barony in your realm
        random_sub_realm_barony = {
            limit = {
                title_province = { has_special_building_slot = no }
            }
            title_province = { save_scope_as = legendary_locale }
        }
    }
    ...

Note, I'm not opposed to an option to choose the location rather than have it picked for us. Maybe it gives this default location, but as @InsidiousMage mentioned we could change it similar to how we do for holy orders.


Note because of the only one special building slot rule per barony, as you build more of these, they will get more random. But the first one at least should be deterministic unless you happen to already have special building slots in the relevant baronies. Though admittedly I do not know how prevalent or random legend locations can be.

The location is set on legend completion, hence why giving a county away when looking at the decision doesn't change the county chosen.

So this is why clearing grounds after doing the heroic adventure cleared it in my old country.

I do believe that pdx will fix that issue.
 
  • 1Like
  • 1
Reactions:
So this is why clearing grounds after doing the heroic adventure cleared it in my old country.

I do believe that pdx will fix that issue.
I just tested it and it will still clear the grounds outside my realm if I lose the county with the legend location. If PDX have a fix for it, it is not in the live version yet
 
  • 1
Reactions: