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_move_company_departure_effect

gdp_move_company_departure_effect = { MERCHANT = … NEW_MARKET = … NEW_PATRON = … OLD_MARKET = … OLD_PATRON = … }

game/common/scripted_effects/gdp_merchant_scripted_effects.txt, line 5355 (92 lines). Parameters: $MERCHANT$, $NEW_MARKET$, $NEW_PATRON$, $OLD_MARKET$, $OLD_PATRON$.

gdp_move_company_departure_effect is a scripted effect in Crusader Kings III, in the Silk and Silver files, written at line 5355 of its file. A call passes 5 parameters: MERCHANT, NEW_MARKET, NEW_PATRON, OLD_MARKET and OLD_PATRON. The game's script calls it in 1 place, among them gdp_merchant.9000 (event). Its body carries 1 text of the game's own for the player. Patch 1.21.0, from game/common/scripted_effects/gdp_merchant_scripted_effects.txt.

What it does

  • $MERCHANT$ = { … }
  • If

    • scope:old_patron != scope:new_patron

    Then

    • scope:merchant_temp:
  • scope:merchant_temp:
  • scope:new_market_temp:
    • If

      • Any character in market:
        • NOT = { house ?= scope:merchant_temp.house }
        • trade_competitiveness > scope:merchant_temp.trade_competitiveness

      Then

    • If

      • NOT = { scope:old_market_temp ?= this }

      Then

      • Every in list › Their house:
        • If

          • NOT = { has_house_relation_with = scope:merchant_temp.house }

          Then

          • set_house_relation = { target = scope:merchant_temp.house level = quarrel description = house_relation_reason_moved_in_desc }

          Otherwise

• 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 (92 lines of game script)
gdp_move_company_departure_effect = {
	$MERCHANT$ = {
		save_temporary_scope_as = merchant_temp
		domicile.domicile_location.barony.trade_market ?= { save_scope_as = old_market_temp }
	}
	$OLD_PATRON$ = { save_temporary_scope_as = old_patron }
	$NEW_PATRON$ = { save_temporary_scope_as = new_patron }
	$OLD_MARKET$ = { save_temporary_scope_as = old_market_temp }
	$NEW_MARKET$ = { save_temporary_scope_as = new_market_temp }
	if = {
		limit = { scope:old_patron != scope:new_patron }
		scope:merchant_temp = {
			# Handle Patron handover
			if = {
				limit = { is_tributary = yes }
				hidden_effect = { end_tributary = yes }
			}
			start_tributary_interaction_effect = {
				TRIBUTARY = scope:merchant_temp
				SUZERAIN = scope:new_patron
			}
			if = {
				limit = { scope:new_patron.prestige_level > scope:old_patron.prestige_level }
				add_prestige = major_prestige_gain
			}
		}
	}
	scope:merchant_temp = { gdp_move_company_invalidate_trade_effect = yes }
	scope:new_market_temp = {
		# Relative competitiveness warning
		if = {
			limit = {			
				any_character_in_market = {
					NOR = {
						this = scope:merchant_temp
						house ?= scope:merchant_temp.house
					}
					trade_competitiveness > scope:merchant_temp.trade_competitiveness
				}
			}
			custom_tooltip = move_company_interaction.low_competitiveness
		}
		if = {
			limit = {
				NOT = { scope:old_market_temp ?= this }
			}
			# Handle relationships with other merchant families
			every_character_in_market = {
				limit = {
					government_has_flag = government_is_merchant
					NOR = {
						this = scope:merchant_temp
						house ?= scope:merchant_temp.house
					}
					potential_trade_rival = {
					    target = scope:merchant_temp
					    trade_market = scope:new_market_temp
					}
				}
				add_to_list = merchant_competitors
			}
			every_in_list = {
				list = merchant_competitors
				save_scope_as = competitor
				save_scope_as = target_char
				scope:merchant_temp = { save_scope_as = char }
				house ?= {
					if = {
						limit = {
							NOT = { has_house_relation_with = scope:merchant_temp.house }
						}
						set_house_relation = {
							target = scope:merchant_temp.house
							level = quarrel
							description = house_relation_reason_moved_in_desc
						}
					}
					else = {
						change_house_relation_effect = {
							HOUSE = scope:merchant_temp.house
							VALUE = house_relation_damage_minor_value
							REASON = moved_in
							CHAR = scope:merchant_temp
							TARGET_CHAR = scope:competitor
							TITLE = scope:dummy_gender
						}
					}
				}
			}
		}
	}
}

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

Where it is used

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

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?