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_rank_up_republic_effect

gdp_rank_up_republic_effect = yes

game/common/scripted_effects/gdp_republic_effects.txt, line 984 (238 lines). No parameters.

gdp_rank_up_republic_effect is a scripted effect in Crusader Kings III, in the Silk and Silver files, written at line 984 of its file. It takes no parameters: gdp_rank_up_republic_effect = yes. The game's script calls it in 3 places, among them Grand Republic (law), Most Serene Republic (law) and Republic (law). Its body carries 3 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

Rank up Republic - Use on the ruler of the republic

What it does

  • Their primary title:
    • title_confederation ?= { … }
  • If

    • primary_title.tier = tier_kingdom

    Then

    Else if

    • primary_title.tier = tier_duchy

    Then

    Else if

    • primary_title.tier = tier_county

    Then

• 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_rank_up_republic_effect = {
	save_scope_as = republican_founder
	primary_title = {
		save_scope_as = old_republic_title
		title_confederation ?= {
			if = {
				limit = { confederation_type = confederation_type:trade_league }
				save_scope_as = trade_league
				leading_title = { save_scope_as = old_league_leader }
			}
		}
	}

	# Create a title of your next tier
	if = {
		limit = {
			primary_title.tier = tier_kingdom
		}
		create_dynamic_title = {
			type = title_type_republic
			tier = empire
			holder = scope:republican_founder
			name = NEW_REPUBLIC_TITLE_TIER_NAME
			adj = NEW_REPUBLIC_TITLE_TIER_ADJ
			save_scope_as = new_republic_title
		}
		custom_tooltip = republic_rank_up_empire_title_desc
	}
	else_if = {
		limit = {
			primary_title.tier = tier_duchy
		}
		create_dynamic_title = {
			type = title_type_republic
			tier = kingdom
			holder = scope:republican_founder
			name = NEW_REPUBLIC_TITLE_TIER_NAME
			adj = NEW_REPUBLIC_TITLE_TIER_ADJ
			save_scope_as = new_republic_title
		}
		custom_tooltip = republic_rank_up_kingdom_title_desc
	}
	else_if = { # I.e. county
		limit = {
			primary_title.tier = tier_county
		}
		create_dynamic_title = {
			type = title_type_republic
			tier = duchy
			holder = scope:republican_founder
			name = NEW_REPUBLIC_TITLE_TIER_NAME
			adj = NEW_REPUBLIC_TITLE_TIER_ADJ
			save_scope_as = new_republic_title
		}
		custom_tooltip = republic_rank_up_duchy_title_desc
	}

	# We'll hide the following effects for clarity - the important part above use already custom tooltips
	hidden_effect = {
		if = {
			limit = { exists = scope:new_republic_title }
			# Set up the new title
			scope:new_republic_title ?= {
				# CoA and color
				set_coa = scope:old_republic_title
				set_color_from_title = scope:old_republic_title
				# Copy old title history
				copy_title_history = scope:old_republic_title
				# Set capital
				set_capital_county = scope:old_republic_title.title_capital_county
				set_no_automatic_claims = yes
			}
			# Move Title MaAs to new title
			if = {
				limit = {
					scope:old_republic_title = {
						any_title_maa_regiment = { }
					}
				}
				scope:old_republic_title = { transfer_title_maa_ownership = scope:new_republic_title }
			}
			# Update Trade League member/leader if relevant
			scope:trade_league ?= {
				# For blocking on_member_join/leave effects
				add_to_variable_list = {
					name = rank_change_members
					target = scope:republican_founder
				}
				add_to_variable_list = {
					name = rank_change_titles
					target = scope:old_republic_title
				}
				add_to_variable_list = {
					name = rank_change_titles
					target = scope:new_republic_title
				}
				# Must remove first or code blocks holder from 'joining' again
				remove_confederation_member_title = scope:old_republic_title
				add_confederation_member_title = scope:new_republic_title
				if = {
					limit = { scope:old_league_leader ?= scope:old_republic_title }
					scope:republican_founder = { save_scope_as = league_creator }
					set_leading_title = scope:new_republic_title
					if = { # For safety, as title member changes can mess things up
						limit = { exists = var:is_hanseatic_league }
						set_coa = k_hansa
						set_confederation_name = HANSEATIC_LEAGUE_NAME
					}
					else = {
						set_coa = scope:new_republic_title
						set_confederation_name = TRADE_LEAGUE_BASE_NAME
					}
				}
				clear_variable_list = rank_change_members
				clear_variable_list = rank_change_titles
			}
			# Transfer existing monopolies to the new title
			if = {
				limit = {
					scope:old_republic_title = {

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

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

Where it is used

Every place in common/, events/ and history/ that calls gdp_rank_up_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?