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

Scripted effect

update_merchant_embassies_effect

update_merchant_embassies_effect = yes

game/common/scripted_effects/00_diplomacy_perk_effects.txt, line 771 (39 lines). No parameters.

update_merchant_embassies_effect is a scripted effect in Crusader Kings III, written at line 771 of its file. It takes no parameters: update_merchant_embassies_effect = yes. The game's script calls it in 3 places, among them Embassies (lifestyle perk), on_trade_route_created (on action) and on_trade_route_edited (on action). Patch 1.21.0, from game/common/scripted_effects/00_diplomacy_perk_effects.txt.

What it does

  • If

    Then

    • remove_all_character_modifier_instances = embassies_perk_modifier
    • remove_all_character_modifier_instances = merchant_embassies_perk_modifier
    • If

      a check the game hides

      Then

      • Every trade route › prev › If current merchant embassies perk value less than merchant embassies max:

• 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 (39 lines of game script)
update_merchant_embassies_effect = {
	if = {
		limit = {
			has_perk = embassies_perk
			government_has_flag = government_is_merchant
		}
		remove_all_character_modifier_instances = embassies_perk_modifier
		remove_all_character_modifier_instances = merchant_embassies_perk_modifier

		set_variable = {
			name = current_merchant_embassies_perk_value
			value = 0
		}

		if = {
			limit = {
				exists = var:current_merchant_embassies_perk_value
			}
			every_trade_route = {
				prev = {
					if = {
						limit = {
							exists = var:current_merchant_embassies_perk_value
							var:current_merchant_embassies_perk_value < merchant_embassies_max
						}
						change_variable = {
							name = current_merchant_embassies_perk_value
							add = 1
						}
						add_character_modifier = {
							modifier = merchant_embassies_perk_modifier
						}
					}
				}
			}
		}
		remove_variable = current_merchant_embassies_perk_value
	}
}

As written in game/common/scripted_effects/00_diplomacy_perk_effects.txt.

Where it is used

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

Lifestyle perks (1)

On actions (the game's own hooks) (2)

  • on_trade_route_created
  • on_trade_route_edited

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