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

Scripted effect · All Under Heaven files

got_minister_position_effect

got_minister_position_effect = { MINISTER_POSITION = … MINISTER_TITLE = … }

game/common/scripted_effects/10_dlc_tgp_scripted_effects.txt, line 1683 (261 lines). Parameters: $MINISTER_POSITION$, $MINISTER_TITLE$.

got_minister_position_effect is a scripted effect in Crusader Kings III, in the All Under Heaven files, written at line 1683 of its file. A call passes 2 parameters: MINISTER_POSITION and MINISTER_TITLE. The game's script calls it in 12 places, among them on_title_gain (on action), fill_the_ministry_effect (scripted effect) and fired_minister_position_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/10_dlc_tgp_scripted_effects.txt.

The comment above it in the file

When scoped character is appointed as a minister

What it does

  • If

    Then

    • If

      • NOT = { has_title = title:$MINISTER_TITLE$ }

      Then

    • If

      • title:$MINISTER_TITLE$ = title:e_minister_grand_marshal
      • None of these

        • $MINISTER TITLE$:
          • has_title_law = celestial_grand_marshal_appointment_succession_law

      Then

      • $MINISTER TITLE$:
        • add_title_law = celestial_grand_marshal_appointment_succession_law

      Else if

      • None of these

        • title:$MINISTER_TITLE$ = title:e_minister_grand_marshal
        • $MINISTER TITLE$:
          • has_title_law = celestial_ministry_appointment_succession_law

      Then

      • $MINISTER TITLE$:
        • add_title_law = celestial_ministry_appointment_succession_law
    • If

      • NOT = { has_council_position = $MINISTER_POSITION$ }

      Then

      • Their top liege:
        • assign_councillor_type = { type = $MINISTER_POSITION$ target = scope:new_minister remove_existing_councillor = yes }
    • If vassal count more than 0 › Every vassal:
      • change_liege = { liege = top_liege change = scope:minister_vassal_change }
    • If

      • One of these

        • All of these

          • Their top liege: Has the Grand Chancellor Law
          • Chancellery:
            • this = title:$MINISTER_TITLE$
            • holder = scope:new_minister
        • or

          All of these

          • Their top liege: Has the Grand Marshal Law
          • Commission:
            • this = title:$MINISTER_TITLE$
            • holder = scope:new_minister
        • or

          All of these

          • Their top liege: Has the Imperial Censor Law
          • Censorate:
            • this = title:$MINISTER_TITLE$
            • holder = scope:new_minister

      Then

      • Their top liege:
        • If

          • diarch != scope:new_minister

          Then

          • If

            • NOT = { has_diarchy_type = grand_secretariat }

            Then

            • If

              • has_active_diarchy = yes

              Then

              • end_diarchy = yes
            • try_start_diarchy = grand_secretariat
          • set_diarch = scope:new_minister
    • If

      • Chancellery:
        • holder = scope:new_minister

      Then

      • scope:new_minister.house › Their house head:
    • If

      • Commission:
        • holder = scope:new_minister

      Then

      • scope:new_minister.house › Their house head:
    • If

      • None of these

        • Any character situation:
          • situation_type = dynastic_cycle
      • Their top liege › Any character situation:
        • situation_type = dynastic_cycle

      Then

    • If does not have the Modifier: Head of Ministry:
    • If

      • scope:councillor_liege.capital_county != title:$MINISTER_TITLE$.title_capital_county

      Then

      • $MINISTER TITLE$:
        • set_capital_county = scope:capital_county
    • Every held title:
    • Their domicile:
      • move_domicile = scope:capital_county.title_province
    • If

      • is_in_army = no
      • Is not traveling

• 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)
got_minister_position_effect = {
	save_scope_as = new_minister

	if = { # If your liege has a ministry, set up titles if needed
		limit = {
			scope:councillor_liege = {
				this != scope:new_minister
				tgp_has_access_to_ministry_trigger = yes
			}
			not = { exists = scope:swapped_position }
		}
		# Grant the ministry title if councillor doesn't have it
		if = {
			limit = {
				NOT = { has_title = title:$MINISTER_TITLE$ }
			}

			create_title_and_vassal_change = {
				type = appointment
				save_scope_as = minister_title_change
				add_claim_on_loss = no
			}

			if = {
				limit = {
					scope:councillor_liege = {
						tgp_has_access_to_ministry_trigger = yes
					}
				}
				# retire from other ministry primary titles
				scope:new_minister = {
					every_held_title = {
						limit = {
							this != title:$MINISTER_TITLE$
							tgp_is_minister_title = yes
						}
						change_title_holder = {
							holder = current_heir
							change = scope:minister_title_change
						}
					}
				}
			}

			title:$MINISTER_TITLE$ = {
				change_title_holder = {
					holder = scope:new_minister
					change = scope:minister_title_change
				}
			}
			resolve_title_and_vassal_change = scope:minister_title_change
		}
		# Add the correct title law if it doesn't have it already
		if = {
			limit = {
				exists = title:$MINISTER_TITLE$.holder
				title:$MINISTER_TITLE$ = title:e_minister_grand_marshal
				NOT = {
					title:$MINISTER_TITLE$ = {
						has_title_law = celestial_grand_marshal_appointment_succession_law
					}
				}
			}
			title:$MINISTER_TITLE$ = {
				add_title_law = celestial_grand_marshal_appointment_succession_law
			}
		}
		else_if = {
			limit = {
				exists = title:$MINISTER_TITLE$.holder
				NOR = {
					title:$MINISTER_TITLE$ = title:e_minister_grand_marshal
					title:$MINISTER_TITLE$ = {
						has_title_law = celestial_ministry_appointment_succession_law
					}
				}
			}
			title:$MINISTER_TITLE$ = {
				add_title_law = celestial_ministry_appointment_succession_law
			}
		}

		# Make them a minister if they don't have the council position
		if = {
			limit = {
				NOT = { has_council_position = $MINISTER_POSITION$ }
			}
			top_liege = {
				assign_councillor_type = {
					type = $MINISTER_POSITION$
					target = scope:new_minister
					remove_existing_councillor = yes
				}
			}
		}
		# If we have any vassals remaining, let's move them to where they are supposed to be
		if = {
			limit = {
				vassal_count > 0
			}
			create_title_and_vassal_change = {
				type = granted
				save_scope_as = minister_vassal_change
			}
			every_vassal = {
				change_liege = {
					liege = top_liege # I.e. the top liege
					change = scope:minister_vassal_change
				}
			}
			resolve_title_and_vassal_change = scope:minister_vassal_change
		}
		# If the new minister should be the diarch, make it so
		if = {
			limit = {
				OR = {
					AND = {
						top_liege ?= {
							has_realm_law = grand_chancellor_law
						}

As written in game/common/scripted_effects/10_dlc_tgp_scripted_effects.txt.

The first 120 of its 261 lines; the rest is in game/common/scripted_effects/10_dlc_tgp_scripted_effects.txt from line 1683.

Where it is used

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

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

  • on_title_gain

Council positions (9)

  • Chancellor
  • Court Chaplain
  • Grand Marshal
  • Marshal
  • Minister of Justice
  • Minister of Personnel
3 more
  • Minister of Works
  • Spymaster
  • Steward

Source: game/common/scripted_effects/10_dlc_tgp_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?