CK3 DatabaseCrusader Kings III · 1.20.1.2 “Crozier” · unofficial
Silk & Silverout Tue, Nov 17What's free, what needs the DLC, price →

Scripted effect

game_rule_exclave_independence_effect

game_rule_exclave_independence_effect = yes

game/common/scripted_effects/00_game_rule_effects.txt, line 1149 (1964 lines). No parameters.

game_rule_exclave_independence_effect is a scripted effect in Crusader Kings III, written at line 1149 of its file. It takes no parameters: game_rule_exclave_independence_effect = yes. The game's script calls it in 2 places, among them game_rule.2 (event) and game_rule.3 (event). Patch 1.20.1.2, from game/common/scripted_effects/00_game_rule_effects.txt.

What it does

  • If

    • Game rule set to “Limited (AI Only)”
    • Is played by the AI
    • None of these

      • Any player:
        • is_vassal_or_below_of = scope:exclaver

    Then

    • Their capital province’s county › Every connected county:
      • invert = yes
      • max_naval_distance = 2000
      • allow_one_county_land_gap = yes
    • while = { … }
    • Every in list:
      • Where:
        • holder.primary_title.tier = tier_kingdom
        • None of these

          • holder = scope:exclaver
          • Their holder › Any sub realm title:
            • Title tier exactly County
            • NOT = { is_in_list = disconnected_counties }
      • Their holder:
        • becomes_independent = { change = scope:change }
    • Every in list:
      • Where:
        • holder.primary_title.tier = tier_duchy
        • None of these

          • holder = scope:exclaver
          • Their holder › Any sub realm title:
            • Title tier exactly County
            • NOT = { is_in_list = disconnected_counties }
      • Their holder:
        • becomes_independent = { change = scope:change }
    • Every in list:
      • Where:
        • holder.primary_title.tier = tier_county
        • None of these

          • holder = scope:exclaver
          • Their holder › Any sub realm title:
            • Title tier exactly County
            • NOT = { is_in_list = disconnected_counties }
      • Their holder:
        • becomes_independent = { change = scope:change }
    • Every in list:
      • Where:
        • One of these

          • holder.top_liege = scope:exclaver
          • or

            holder = scope:exclaver
      • Every pool character:
      • Every pool character:
        • Where:
        • province = scope:county_of_origin.holder.capital_province
      • If

        Then

        • create_character = { … }
      • One random in list:
        • Where:
          • is_available_adult = yes
          • has_claim_on = scope:county_of_origin
          • Their faith:
            • has_dominant_ruling_gender = prev
        • Every in list:
          • Where:
            • One of these

              • holder.top_liege = scope:exclaver
              • or

                holder = scope:exclaver
            • is_connected_to = { target = scope:county_of_origin }
            • NOT = { is_connected_to = { target = scope:exclaver.capital_province.county } }
          • Gains the … Title (new county holder)
        • becomes_independent = { change = scope:change }
        • If

          • Government is Nomadic
          • domicile.domicile_culture != scope:new_county_holder.capital_county.culture

          Then

          • Their domicile:
            • set_domicile_culture = scope:new_county_holder.capital_county.culture
        • If

          • Government is Nomadic
          • domicile.domicile_rite != scope:new_county_holder.capital_county.rite

          Then

          • Their domicile:
            • set_domicile_rite = scope:new_county_holder.capital_county.rite
        • If gold less than 500: They gets +500

    Else if

    • Game rule set to “Significant (AI Only)”
    • Is played by the AI
    • None of these

      • Any player:
        • is_vassal_or_below_of = scope:exclaver

    Then

    • Their capital province’s county › Every connected county:
      • invert = yes
      • max_naval_distance = 2000
    • while = { … }
    • Every in list:
      • Where:
        • holder.primary_title.tier = tier_kingdom
        • None of these

          • holder = scope:exclaver
          • Their holder › Any sub realm title:
            • Title tier exactly County
            • NOT = { is_in_list = disconnected_counties }
      • Their holder:
        • becomes_independent = { change = scope:change }
    • Every in list:
      • Where:
        • holder.primary_title.tier = tier_duchy
        • None of these

          • holder = scope:exclaver
          • Their holder › Any sub realm title:
            • Title tier exactly County
            • NOT = { is_in_list = disconnected_counties }
      • Their holder:
        • becomes_independent = { change = scope:change }
    • Every in list:
      • Where:
        • holder.primary_title.tier = tier_county
        • None of these

          • holder = scope:exclaver
          • Their holder › Any sub realm title: … (more in the script below)
      • … (more in the script below)
    • … (more in the script below)
  • … (more in the script below)

• the game's own tooltip text · ◦ our reading of the script line · code the script where neither exists

“They” is whatever it runs on (the scope it is called in). The scripted triggers and effects it calls link to their own pages; $PARAMETERS$ stay as written: each call fills them in.

The script as written (120 lines of game script)
game_rule_exclave_independence_effect = {
	save_temporary_scope_as = exclaver

	if = { # Limited, AI only
		limit = {
			has_game_rule = ai_limited_exclave_independence
			is_ai = yes
			NOT = {
				any_player = { is_vassal_or_below_of = scope:exclaver }
			}
		}
		
		remove_character_flag = delayed_cleanse
	
		capital_province.county = {
			every_connected_county = { # Start off by making a list of all disconnected Counties
				invert = yes
				max_naval_distance = 2000
				allow_one_county_land_gap = yes
				add_to_list = disconnected_counties
			}
		}
		
		every_in_list = {
			list = disconnected_counties
			
			limit = {
				any_connected_county = {
					NOT = { is_in_list = disconnected_counties }
					max_naval_distance = 2000
				}
			}
			add_to_list = cull_naval_connection_counties
		}
		
		while = {
			limit = {
				any_in_list = {
					list = cull_naval_connection_counties
				}
			}
			random_in_list = {
				list = cull_naval_connection_counties
				
				save_scope_as = cull_origin_county
				
				every_connected_county = {
					remove_from_list = cull_naval_connection_counties
					remove_from_list = disconnected_counties
				}
				remove_from_list = cull_naval_connection_counties
				remove_from_list = disconnected_counties
			}
		}
		
		every_in_list = {
			list = disconnected_counties
			
			limit = {
				target_is_de_jure_liege_or_above = scope:exclaver.primary_title
			}
			add_to_list = cull_de_jure_connection_counties
		}
		
		while = {
			limit = {
				any_in_list = {
					list = cull_de_jure_connection_counties
				}
			}
			random_in_list = {
				list = cull_de_jure_connection_counties
				
				save_scope_as = cull_origin_county
				
				every_connected_county = {
					remove_from_list = cull_de_jure_connection_counties
					remove_from_list = disconnected_counties
				}
				remove_from_list = cull_de_jure_connection_counties
				remove_from_list = disconnected_counties
			}
		}
		
		every_in_list = { # Release Kings first
			list = disconnected_counties
			
			limit = {
				holder.primary_title.tier = tier_kingdom
				NOR = {
					holder = scope:exclaver
					holder = {
						any_sub_realm_title = {
							tier = tier_county
							NOT = { is_in_list = disconnected_counties }
						}
					}
				}
			}
			holder = {
				create_title_and_vassal_change = {
					type = independency
					save_scope_as = change
					add_claim_on_loss = yes
				}
				becomes_independent = {
					change = scope:change
				}
				resolve_title_and_vassal_change = scope:change
			}
		}
		
		every_in_list = { # Release Dukes second
			list = disconnected_counties
			
			limit = {
				holder.primary_title.tier = tier_duchy
				NOR = {
					holder = scope:exclaver
					holder = {

As written in game/common/scripted_effects/00_game_rule_effects.txt.

The first 120 of its 1964 lines; the rest is in game/common/scripted_effects/00_game_rule_effects.txt from line 1149.

Where it is used

Every place in common/, events/ and history/ that calls game_rule_exclave_independence_effect.

Source: game/common/scripted_effects/00_game_rule_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.

Spotted a mistake on this page?