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

Scripted effect

update_embassies_effect

update_embassies_effect = yes

game/common/scripted_effects/00_diplomacy_perk_effects.txt, line 710 (59 lines). No parameters.

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

What it does

  • If

    Then

    • remove_all_character_modifier_instances = embassies_perk_modifier
    • If

      a check the game hides

      Then

      • Every ally › prev › If current embassies perk value less than embassies max:
        • Gains the modifier “Embassies”
          • Diplomacy +1

• 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 (59 lines of game script)
update_embassies_effect = {
	if = {
		limit = {
			has_perk = embassies_perk
			is_landless_adventurer = no
		}
		remove_all_character_modifier_instances = embassies_perk_modifier

		set_variable = {
			name = current_embassies_perk_value
			value = 0
		}
		set_variable = {
			name = previous_current_embassies_perk_value
			value = 0
		}

		if = {
			limit = {
				exists = var:previous_current_embassies_perk_value
				exists = var:current_embassies_perk_value
			}

			every_ally = {
				prev = {
					change_variable = {
						name = previous_current_embassies_perk_value
						add = 1
					}
					if = {
						limit = {
							exists = var:current_embassies_perk_value
							var:current_embassies_perk_value < embassies_max
						}
						change_variable = {
							name = current_embassies_perk_value
							add = 1
						}
						add_character_modifier = {
							modifier = embassies_perk_modifier
						}
					}
				}
			}

			# For players that were over the cap before the change so that they don't feel like they've "lost progress"
			save_temporary_scope_as = variable_check
			if = {
				limit = {
					var:current_embassies_perk_value < scope:variable_check.var:previous_current_embassies_perk_value
				}
				set_variable = {
					name = current_embassies_perk_value
					value = var:previous_current_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_embassies_effect.

Lifestyle perks (1)

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

  • on_alliance_added
  • on_alliance_broken
  • on_alliance_removed
  • on_rank_down
  • on_rank_up

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.20.1.2.

Spotted a mistake on this page?