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

Scripted trigger · Silk and Silver files

gdp_merchant_diplo_range_trigger

gdp_merchant_diplo_range_trigger = { MERCHANT = … TARGET = … }

game/common/scripted_triggers/gdp_merchant_triggers.txt, line 607 (35 lines). Parameters: $MERCHANT$, $TARGET$.

gdp_merchant_diplo_range_trigger is a scripted trigger in Crusader Kings III, in the Silk and Silver files, written at line 607 of its file. A call passes 2 parameters: MERCHANT and TARGET. The game's script calls it in 12 places, among them Loan Gold (interaction), Merge Company (interaction) and Sell Artifact (interaction). Patch 1.21.0, from game/common/scripted_triggers/gdp_merchant_triggers.txt.

The comment above it in the file

Merchant diplo range

What it checks

  • $MERCHANT$ = { … }
  • $TARGET$ = { … }
  • … Capital is in range of their Company.

• 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 (35 lines of game script)
gdp_merchant_diplo_range_trigger = {
	$MERCHANT$ = {
		save_temporary_scope_as = merchant_temp
		scope:merchant_temp.domicile.domicile_location ?= { save_temporary_scope_as = company_temp }
	}
	$TARGET$ = {
		save_temporary_scope_as = ruler_temp
		trigger_if = {
			limit = { exists = capital_province }
			capital_province ?= { save_temporary_scope_as = capital_temp }
		}
		trigger_else_if = {
			limit = { exists = host.capital_province }
			host.capital_province ?= { save_temporary_scope_as = capital_temp }
		}
		trigger_else = {
			location ?= { save_temporary_scope_as = capital_temp }
		}
	}
	custom_description = {
		text = gdp_merchant_diplo_range_trigger_tt
		subject = scope:merchant_temp
		object = scope:ruler_temp
		scope:company_temp ?= {
			trigger_if = { # Check range
				limit = { exists = scope:capital_temp }
				squared_distance = {
					target = scope:capital_temp
					value < 1000000 # more than adventurers
				}
			}
			trigger_else = { always = no }
		}
	}
}

As written in game/common/scripted_triggers/gdp_merchant_triggers.txt.

Where it is used

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

Source: game/common/scripted_triggers/gdp_merchant_triggers.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?