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

Scripted effect · Silk and Silver files

gdp_found_a_republic_effect

gdp_found_a_republic_effect = yes

game/common/scripted_effects/gdp_republic_effects.txt, line 8 (260 lines). No parameters.

gdp_found_a_republic_effect is a scripted effect in Crusader Kings III, in the Silk and Silver files, written at line 8 of its file. It takes no parameters: gdp_found_a_republic_effect = yes. The game's script calls it in 11 places, among them Adopt Republican Ideals (decision), Adopt Republican Ways (decision) and Guelphs & Ghibellines: Join the Lombard League? (event gdp_guelph_ghibelline.7005). Its body carries 5 texts of the game's own for the player. Patch 1.21.0, from game/common/scripted_effects/gdp_republic_effects.txt.

The comment above it in the file

Effect for founding and becoming a republic
Use on founder or character scope
NOTE: Order of operation is important here

What it does

  • If

    • scope:old_title.tier > tier_county

    Then

    • …
  • If

    • house.house_head != scope:republican_founder

    Then

    • …
  • Adopts Republic Government
  • If

    • None of these

      • Their domicile:
        • is_domicile_type = merchant_company

    Then

    Else if

    • Their domicile:
      • is_domicile_type = merchant_company

    Then

    • …
  • If

    • Any held title: Title tier more than County

    Then

    • Every held title:
      • Where: Title tier more than County
      • scope:republican_founder:
        • destroy_title = prev
  • If

    • One of these

      • scope:old_title: Title tier at least Duchy
      • or

        scope:new_republic_title: Title tier at least Duchy

    Then

  • Gains the modifier “Republican Founder”
  • add_treasury = { … }
  • Their domicile:
    • If

      • domicile_location != scope:republican_founder.capital_province

      Then

      • move_domicile = scope:republican_founder.capital_province
  • gdp_hre_elector_loss_warning_effect = yes

• 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)
gdp_found_a_republic_effect = {
	## Pre-setup
	add_character_flag = gdp_founding_republic
	# Save scopes for later use
	save_scope_as = republican_founder
	if = {
		limit = {
			is_landed = yes
		}
		primary_title ?= { save_scope_as = old_title }
	}
	if = {
		limit = {
			OR = {
				NOT = { exists = domicile }
				domicile ?= {
					NOT = { is_domicile_type = merchant_company }
				}
			}
		}
		save_temporary_scope_as = create_merchant_title
	}

	# Let's save your current base income, to use as a base for how big your starting treasury will be
	save_scope_value_as = {
		name = income_treasury_conversion
		value = monthly_character_income
	}

	## Base setup
	# 1. Are we already landed and do we have a higher tier title?
	if = {
		limit = {
			exists = scope:old_title
			scope:old_title.tier > tier_county
		}
		custom_tooltip = {
			text = found_a_republic_new_title_desc

			# Then create a new republican title of the corresponding tier
			random_list = {
				10 = {
					trigger = {
						scope:old_title.tier = tier_kingdom
					}
					create_dynamic_title = {
						type = title_type_republic
						tier = kingdom
						holder = scope:republican_founder
						name = NEW_REPUBLIC_TITLE_NAME
						adj = NEW_REPUBLIC_TITLE_ADJ
						save_scope_as = new_republic_title
					}
				}
				10 = {
					trigger = {
						scope:old_title.tier = tier_duchy
					}
					create_dynamic_title = {
						type = title_type_republic
						tier = duchy
						holder = scope:republican_founder
						name = NEW_REPUBLIC_TITLE_NAME
						adj = NEW_REPUBLIC_TITLE_ADJ
						save_scope_as = new_republic_title
					}
				}
			}

			# Set up the new title
			if = {
				limit = {
					exists = scope:new_republic_title
				}
				scope:new_republic_title ?= {
					set_coa = scope:republican_founder.capital_county
					set_color_from_title = scope:republican_founder.capital_county
					set_capital_county = scope:republican_founder.capital_county
					set_no_automatic_claims = yes
				}
				set_primary_title_to = scope:new_republic_title
			}
		}
	}
	# Fallback: county-only purchases and landless founders have no higher title, so we still make a duchy-tier republic title
	else_if = {
		limit = {
			NOT = {
				exists = scope:new_republic_title
			}
		}
		hidden_effect = {
			create_dynamic_title = {
				type = title_type_republic
				tier = duchy
				holder = scope:republican_founder
				name = NEW_REPUBLIC_TITLE_NAME
				adj = NEW_REPUBLIC_TITLE_ADJ
				save_scope_as = new_republic_title
			}
			if = {
				limit = { exists = scope:new_republic_title }
				scope:new_republic_title ?= {
					set_coa = scope:republican_founder.capital_county
					set_color_from_title = scope:republican_founder.capital_county
					set_capital_county = scope:republican_founder.capital_county
					set_no_automatic_claims = yes
				}
				set_primary_title_to = scope:new_republic_title
			}
		}
	}

	# 2. Are we house head? If not, form a cadet branch
	if = {
		limit = {
			exists = house.house_head
			house.house_head != scope:republican_founder
		}
		custom_tooltip = {

As written in game/common/scripted_effects/gdp_republic_effects.txt.

The first 120 of its 260 lines; the rest is in game/common/scripted_effects/gdp_republic_effects.txt from line 8.

Where it is used

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

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

Spotted a mistake on this page, or have an idea for the site?