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

new_republic_population_effect

new_republic_population_effect = yes

game/common/scripted_effects/gdp_merchant_scripted_effects.txt, line 2893 (282 lines). No parameters.

new_republic_population_effect is a scripted effect in Crusader Kings III, in the Silk and Silver files, written at line 2893 of its file. It takes no parameters: new_republic_population_effect = yes. The game's script calls it in 2 places, among them Republic (law) and gdp_found_a_republic_effect (scripted effect). Patch 1.21.0, from game/common/scripted_effects/gdp_merchant_scripted_effects.txt.

What it does

Every line of it is script with no tooltip text: the script is below.

The script as written (120 lines of game script)
new_republic_population_effect = {
	save_scope_as = republican
	set_variable = {
		name = new_republic_invited_count
		value = 0
	}

	# Step 1: Find eligible AI merchants domiciled in the new capital's duchy
	# Skip those with negative house relations (feud or rivalry) or at war with the founder
	hidden_effect = {
		scope:republican.capital_county.duchy ?= {
			every_de_jure_county = {
				every_county_province = {
					every_province_domicile = {
						limit = {
							owner ?= {
								gdp_merchant_ai_logic_valid_trigger = yes
								this != scope:republican
								NOT = {
									is_at_war_with = scope:republican
								}
								NOT = {
									house ?= {
										any_house_relation = {
											any_relation_house = {
												scope:republican.house ?= this
											}
											OR = {
												has_house_relation_level = rivalry
												has_house_relation_level = feud
											}
										}
									}
								}
								# Founder's faith is not considered worse than astray
								faith = {
									faith_hostility_level = {
										target = scope:republican.faith
										value <= faith_astray_level
									}
								}
								# Culture is tolerated
								OR = {
									culture = scope:republican.culture
									culture = {
										OR = {
											has_same_culture_heritage = scope:republican.culture
											has_same_culture_language = scope:republican.culture
										}
										"cultural_acceptance(scope:republican.culture)" >= 25
									}
									AND = {
										knows_language_of_character = scope:republican
										"culture.cultural_acceptance(scope:republican.culture)" >= 50
									}
									"culture.cultural_acceptance(scope:republican.culture)" >= 75
								}
							}
						}
						owner ?= {
							add_to_list = invited_merchants
						}
					}
				}
			}
		}
	}

	# Invite existing merchants — they already have merchant titles, only need liege+government
	if = {
		limit = {
			any_in_list = {
				list = invited_merchants
			}
		}
		every_in_list = {
			list = invited_merchants
			save_scope_as = vassal
			hidden_effect = {
				gdp_merchant_becomes_patrician_effect = { LIEGE = scope:republican }
				scope:republican = {
					change_variable = {
						name = new_republic_invited_count
						add = 1
					}
				}
				scope:vassal = { save_scope_as = joining_patrician } # For message scope
				scope:republican ?= {
					send_interface_message = {
						type = msg_patrician_joined
						title = msg_patrician_joined_republic_title
						desc = msg_patrician_joined_republic_desc
						left_icon = scope:joining_patrician
					}
				}
			}
			if = {
				limit = { exists = scope:portrait_2 }
				save_scope_as = portrait_3
			}
			else_if = {
				limit = { exists = scope:portrait_1 }
				save_scope_as = portrait_2
			}
			else = {
				save_scope_as = portrait_1
			}
		}
	}

	# Step 2: If fewer than 2 merchants were invited, generate the remainder dynamically
	if = {
		limit = {
			exists = var:new_republic_invited_count # tooltip error suppression when invoked via decision
			var:new_republic_invited_count < 2
		}
		save_scope_value_as = {
			name = generate_count
			value = {
				value = 2

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

The first 120 of its 282 lines; the rest is in game/common/scripted_effects/gdp_merchant_scripted_effects.txt from line 2893.

Where it is used

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

Laws (1)

Scripted effects (1)

Source: game/common/scripted_effects/gdp_merchant_scripted_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?