Crusader Kings III

Crusader Kings III

Dynamic Holy Sites - Conquer, Sanctify, Exile
MegaPoggy 31 Aug, 2022 @ 2:21pm
extra_holy_site_building_slots_scripted_effect.txt
extra_holy_site_building_slots_game_start_scripted_effect = { every_county = { every_county_province = { limit = { exists = barony barony = { is_holy_site = yes } NOT = { has_variable = has_extra_building_slot } } barony = { is_holy_site = yes add_building_slot = 1 set_variable = { name = has_extra_building_slot value = yes } } } } } extra_holy_site_building_slots_conversion_scripted_effect = { every_county = { every_county_province = { limit = { exists = barony barony = { is_holy_site_of = scope:mark_faith } NOT = { has_variable = has_extra_building_slot } } barony = { is_holy_site = yes add_building_slot = 1 set_variable = { name = has_extra_building_slot value = yes } } } } }
Last edited by MegaPoggy; 31 Aug, 2022 @ 2:23pm
< >
Showing 1-8 of 8 comments
Morven  [developer] 31 Aug, 2022 @ 3:28pm 
Thanks. There could be an issue with the province vs barony (landed_title) scope. add_building_slot effect requires a province scope, while is_holy_site trigger requires a barony scope. I'll test first before commenting, although they are blurred scopes for many things they are different scopes and some effects and triggers will only apply to one scope and not the other. The every_county_province effect sets the scope as province rather than the barony landed_title associated with the province.

Which holy site county were you testing on?
Last edited by Morven; 31 Aug, 2022 @ 3:28pm
MegaPoggy 1 Sep, 2022 @ 10:10pm 
Hm. just kidding, this doesnt seem to work. Im not sure what i observed before. im also not entirely sure how to fix this, i just tried to steal the formatting from the default decisions i knew of that add building slots. The difference is all of the current vanilla decisions that add building slots also add the building into those slots. This would be easy peasy if this decision was meant to also build a temple. thats a whole new can on worms though because of the faith specific temples
Morven  [developer] 1 Sep, 2022 @ 11:15pm 
The building requirements are independent of the extra slot and the scripted effect and on_action that creates them, they're set here:
\common\buildings\dynamic_holy_sites_generic_special_buildings.txt

I can replicate the problem. Using Kent as an example at the 867 start, Catholic Wessex can build a Grand Cathetral in both b_canterbury and b_dover. I think the problem is that holy_sites are given a county definition in religion\holy_sites, while is_holy_site and is_holy_site_of check baronies. It appears the check returns yes for all baronies in the holy_site county when used in province triggers, despite the active holy_site being located in just one barony (either defined or the de jure county capital).

#From \common\buildings\dynamic_holy_sites_generic_special_buildings.txt holy_site_cathedral_01 = { asset = { type = pdxmesh name = "building_special_cathedral_generic_mesh" } #construction_time = very_slow_construction_time construction_time = very_slow_construction_time type_icon = "icon_structure_cologne_cathedral.dds" can_construct_potential = { building_requirement_tribal = no } can_construct = { custom_description = { text = holy_site_building_trigger barony = { is_holy_site_of = scope:holder.faith is_holy_site_of = scope:holder.top_liege.faith } } scope:holder = { culture = { has_innovation = innovation_crop_rotation } faith = { religion_tag = christianity_religion } } scope:holder.top_liege = { culture = { has_innovation = innovation_crop_rotation } faith = { religion_tag = christianity_religion } } } is_enabled = { custom_description = { text = holy_site_building_trigger barony = { is_holy_site_of = scope:holder.faith is_holy_site_of = scope:holder.top_liege.faith } } scope:holder = { faith = { religion_tag = christianity_religion } } scope:holder.top_liege = { faith = { religion_tag = christianity_religion } } } cost_gold = 1000 county_holder_character_modifier = { monthly_piety = 0.25 monthly_dynasty_prestige_mult = 0.05 holy_order_hire_cost_mult = -0.15 clergy_opinion = 5 monthly_county_control_change_factor = 0.05 } county_modifier = { tax_mult = 0.2 development_growth_factor = 0.2 development_growth = 0.1 } province_modifier = { monthly_income = 2 } ai_value = { base = 100 } type = regular }

The Canterbury holy site in Kent, borrowed over from vanilla
#From \common\religion\holy_sites\catholic_holy_sites.txt kent_catholic = { county = c_kent barony = b_canterbury is_active = no character_modifier = { name = holy_site_kent_effect_name religious_vassal_opinion = 5 sway_scheme_power_mult = 0.1 } }

I'll try a few things.
MegaPoggy 2 Sep, 2022 @ 12:10am 
If what you suspect is correct, it would be as simple as changing the various holy_sites lists to only include a specific barony and not list the entire county. in the kent example canterbury is already specified, although i suppose thats to differentiate it from dover, the capital of that county.
The reason im saying this here and not just testing it myself before sharing this thought with you, is your holy_sites lists are frigging exhaustive due to how this mod works. i understand why this has to be but i dont want to change the files for EVERY religion just to test a theory and i dont know if your mod just uses one list or something for initialization on game start up
Last edited by MegaPoggy; 2 Sep, 2022 @ 12:15am
Morven  [developer] 2 Sep, 2022 @ 5:50am 
You'll find the vanilla holy sites are all defined first by county, with baronies just an option applied to some. I don't think you can remove the county, although it's worth a try. Another option is to build a barony list of all the holy site baronies and have the can_construct trigger check the province is one of those baronies, may be easier to do as the barony list doesn't need to be customised for each faith.
MegaPoggy 3 Sep, 2022 @ 12:44am 
Thats a good idea, but it doesnt stop the first script i was trying to fix at the top from adding a building slot to whole counties.
Morven  [developer] 3 Sep, 2022 @ 1:58am 
You could use the same scripted trigger there, make it check it's a valid barony before applying the add slot effect.

Leave it with me, I'll make the trigger.
Morven  [developer] 3 Sep, 2022 @ 4:47am 
Should be fixed now, let me know if there's any problems. Thanks again m8.
< >
Showing 1-8 of 8 comments
Per page: 1530 50