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_diarchy_swing_with_perspective_effect

update_diarchy_swing_with_perspective_effect = { LIEGE = … SWING = … }

game/common/scripted_effects/00_diarchy_scripted_effects.txt, line 2080 (237 lines). Parameters: $LIEGE$, $SWING$.

update_diarchy_swing_with_perspective_effect is a scripted effect in Crusader Kings III, written at line 2080 of its file. A call passes 2 parameters: LIEGE and SWING. The game's script calls it in 32 places, among them diarch_swing_scales_currency_interaction (interaction), Discharge Entrenched Regent (interaction) and Swing the Scales of Power (interaction). Its body carries 36 texts of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/00_diarchy_scripted_effects.txt.

The comment above it in the file

Diarchy swing can be good or bad for you depending on whether you're the liege, the diarch, or neutral, so we need different tooltips accordingly.
Please note: for technical reasons this'll break if you don't use the pre-set script values or update it to include whatever new value you want to use.

What it does

  • $LIEGE$ = { … }
  • If

    • $SWING$ >= 1

    Then

    • If

      • $SWING$ = miniscule_sop_swing_diarch_gain

      Then

      • If

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.miniscule_sop_swing_diarch_gain.tt }

        Else if

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.miniscule_sop_swing_diarch_gain.tt }

        Otherwise

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.miniscule_sop_swing_diarch_gain.tt }

      Else if

      • $SWING$ = minor_sop_swing_diarch_gain

      Then

      • If

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.minor_sop_swing_diarch_gain.tt }

        Else if

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.minor_sop_swing_diarch_gain.tt }

        Otherwise

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.minor_sop_swing_diarch_gain.tt }

      Else if

      • $SWING$ = medium_sop_swing_diarch_gain

      Then

      • If

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.medium_sop_swing_diarch_gain.tt }

        Else if

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.medium_sop_swing_diarch_gain.tt }

        Otherwise

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.medium_sop_swing_diarch_gain.tt }

      Else if

      • $SWING$ = major_sop_swing_diarch_gain

      Then

      • If

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.major_sop_swing_diarch_gain.tt }

        Else if

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.major_sop_swing_diarch_gain.tt }

        Otherwise

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.major_sop_swing_diarch_gain.tt }

      Else if

      • $SWING$ = massive_sop_swing_diarch_gain

      Then

      • If

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.massive_sop_swing_diarch_gain.tt }

        Else if

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.massive_sop_swing_diarch_gain.tt }

        Otherwise

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.massive_sop_swing_diarch_gain.tt }

      Else if

      • $SWING$ = monumental_sop_swing_diarch_gain

      Then

      • If

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.monumental_sop_swing_diarch_gain.tt }

        Else if

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.monumental_sop_swing_diarch_gain.tt }

        Otherwise

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.monumental_sop_swing_diarch_gain.tt }

    Else if

    • $SWING$ <= -1

    Then

    • If

      • $SWING$ = miniscule_sop_swing_liege_gain

      Then

      • If

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.miniscule_sop_swing_liege_gain.tt }

        Else if

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.miniscule_sop_swing_liege_gain.tt }

        Otherwise

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.miniscule_sop_swing_liege_gain.tt }

      Else if

      • $SWING$ = minor_sop_swing_liege_gain

      Then

      • If

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.minor_sop_swing_liege_gain.tt }

        Else if

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.minor_sop_swing_liege_gain.tt }

        Otherwise

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.minor_sop_swing_liege_gain.tt }

      Else if

      • $SWING$ = medium_sop_swing_liege_gain

      Then

      • If

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.medium_sop_swing_liege_gain.tt }

        Else if

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.medium_sop_swing_liege_gain.tt }

        Otherwise

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.medium_sop_swing_liege_gain.tt }

      Else if

      • $SWING$ = major_sop_swing_liege_gain

      Then

      • If

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.major_sop_swing_liege_gain.tt }

        Else if

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.major_sop_swing_liege_gain.tt }

        Otherwise

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.major_sop_swing_liege_gain.tt }

      Else if

      • $SWING$ = massive_sop_swing_liege_gain

      Then

      • If

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.massive_sop_swing_liege_gain.tt }

        Else if

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.massive_sop_swing_liege_gain.tt }

        Otherwise

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.massive_sop_swing_liege_gain.tt }

      Else if

      • $SWING$ = monumental_sop_swing_liege_gain

      Then

      • If

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.monumental_sop_swing_liege_gain.tt }

        Else if

        a check the game hides

        Then

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.monumental_sop_swing_liege_gain.tt }

        Otherwise

        • $LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.monumental_sop_swing_liege_gain.tt }

• 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 (120 lines of game script)
update_diarchy_swing_with_perspective_effect = {
	$LIEGE$ = {
		# Sort the effect.
		hidden_effect = { change_diarchy_swing = $SWING$ }
		# Grab $LIEGE$'s scope for loc.
		## We save a weirdy scope name so we don't accidentally overwrite common scopes.
		save_scope_as = liege_loc
	}
	# Right, now flick out the correct tooltips.
	## We can't easily access a number that doesn't yet exist as a variable within a custom tooltip, so this is gon' get _real_ gross and I'm sorry you have to watch it happen.
	## We also don't contain this in the above $LIEGE$ block because otherwise unusual (but valid) uses of the effect cause asserts.
	## Is the diarch gaining?
	if = {
		limit = { $SWING$ >= 1 }
		## Miniscule swing.
		if = {
			limit = { $SWING$ = miniscule_sop_swing_diarch_gain }
			# For the liege.
			if = {
				limit = { this = $LIEGE$ }
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.miniscule_sop_swing_diarch_gain.tt }
			}
			# For the diarch.
			else_if = {
				limit = { this = $LIEGE$.diarch }
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.miniscule_sop_swing_diarch_gain.tt }
			}
			# For everyone else.
			else = {
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.miniscule_sop_swing_diarch_gain.tt }
			}
		}
		## Minor swing.
		else_if = {
			limit = { $SWING$ = minor_sop_swing_diarch_gain }
			# For the liege.
			if = {
				limit = { this = $LIEGE$ }
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.minor_sop_swing_diarch_gain.tt }
			}
			# For the diarch.
			else_if = {
				limit = { this = $LIEGE$.diarch }
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.minor_sop_swing_diarch_gain.tt }
			}
			# For everyone else.
			else = {
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.minor_sop_swing_diarch_gain.tt }
			}
		}
		## Medium swing.
		else_if = {
			limit = { $SWING$ = medium_sop_swing_diarch_gain }
			# For the liege.
			if = {
				limit = { this = $LIEGE$ }
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.medium_sop_swing_diarch_gain.tt }
			}
			# For the diarch.
			else_if = {
				limit = { this = $LIEGE$.diarch }
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.medium_sop_swing_diarch_gain.tt }
			}
			# For everyone else.
			else = {
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.medium_sop_swing_diarch_gain.tt }
			}
		}
		## Major swing.
		else_if = {
			limit = { $SWING$ = major_sop_swing_diarch_gain }
			# For the liege.
			if = {
				limit = { this = $LIEGE$ }
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.major_sop_swing_diarch_gain.tt }
			}
			# For the diarch.
			else_if = {
				limit = { this = $LIEGE$.diarch }
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.major_sop_swing_diarch_gain.tt }
			}
			# For everyone else.
			else = {
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.major_sop_swing_diarch_gain.tt }
			}
		}
		## Massive swing.
		else_if = {
			limit = { $SWING$ = massive_sop_swing_diarch_gain }
			# For the liege.
			if = {
				limit = { this = $LIEGE$ }
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.massive_sop_swing_diarch_gain.tt }
			}
			# For the diarch.
			else_if = {
				limit = { this = $LIEGE$.diarch }
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.massive_sop_swing_diarch_gain.tt }
			}
			# For everyone else.
			else = {
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.massive_sop_swing_diarch_gain.tt }
			}
		}
		## Monumental swing.
		else_if = {
			limit = { $SWING$ = monumental_sop_swing_diarch_gain }
			# For the liege.
			if = {
				limit = { this = $LIEGE$ }
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.liege_perspective.monumental_sop_swing_diarch_gain.tt }
			}
			# For the diarch.
			else_if = {
				limit = { this = $LIEGE$.diarch }
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.diarch_perspective.monumental_sop_swing_diarch_gain.tt }
			}
			# For everyone else.
			else = {
				$LIEGE$ = { custom_tooltip = update_diarchy_swing_with_perspective_effect.neutral_perspective.monumental_sop_swing_diarch_gain.tt }

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

The first 120 of its 237 lines; the rest is in game/common/scripted_effects/00_diarchy_scripted_effects.txt from line 2080.

Where it is used

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

Character interactions (3)

Events (10)

4 more

Scripted effects inside an event file (18)

  • bp2_yearly_0621_accept_basic_gift_effect
  • bp2_yearly_roll_chance_of_extra_stuff_effect
  • diarchy_1201_successful_swing_resolve_effect
  • diarchy_1211_successful_swing_resolve_effect
  • diarchy_1221_successful_swing_resolve_effect
  • diarchy_1231_successful_swing_resolve_effect
12 more
  • diarchy_1241_successful_swing_resolve_effect
  • diarchy_1701_successful_swing_resolve_effect
  • diarchy_1711_successful_swing_resolve_effect
  • diarchy_1721_successful_swing_resolve_effect
  • diarchy_1731_successful_swing_resolve_effect
  • diarchy_1741_successful_swing_resolve_effect
  • diarchy_2201_successful_swing_resolve_effect
  • diarchy_2211_successful_swing_resolve_effect
  • diarchy_2221_successful_swing_resolve_effect
  • diarchy_2231_successful_swing_resolve_effect
  • diarchy_2241_successful_swing_resolve_effect
  • vizierate_1001_duel_for_vizierate_effect

Scripted effects (1)

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