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

Scripted effect · Roads to Power files

create_noble_family_effect

create_noble_family_effect = { GOVERNMENT_GIVER = … }

game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt, line 3255 (114 lines). Parameters: $GOVERNMENT_GIVER$.

create_noble_family_effect is a scripted effect in Crusader Kings III, in the Roads to Power files, written at line 3255 of its file. A call passes 1 parameter: GOVERNMENT_GIVER. The game's script calls it in 18 places, among them Create Cadet Branch (decision), Make Courtier Noble Family (interaction) and Eminent Eunuch: … (event ep3_story_cycle_admin_eunuch.1001). Its body carries 1 text of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt.

What it does

  • If

    • scope:government_giver: Government allows: noble families

    Then

    • scope:new_noble_family_holder:
      • If

        Then

      • scope:new_title.holder:
        • If

          • Is not landed
          • scope:liege.highest_held_title_tier > highest_held_title_tier

          Then

          • change_liege = { liege = scope:liege change = scope:change }
      • Becomes head of a new Noble Family
      • Every player:
        • Where:
          • top_liege = scope:new_noble_family_holder.top_liege
          • Government does not allow: merit
        • Event ep3_emperor_yearly.2410 (after 1 days)

• 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 (114 lines of game script)
create_noble_family_effect = {
	debug_log = create_noble_family_title
	save_scope_as = new_noble_family_holder
	$GOVERNMENT_GIVER$ = { save_scope_as = government_giver }
	if = {
		limit = { scope:government_giver ?= { government_allows = noble_families } }
		if = {
			limit = {
				is_ruler = no
			}
			if = {
				limit = {
					scope:government_giver = { is_ruler = yes }
				}
				scope:government_giver = {
					if = {
						limit = {
							highest_held_title_tier <= tier_duchy
						}
						top_liege = {
							save_scope_as = liege
						}
					}
					else = {
						save_scope_as = liege
					}
				}
			}
			else = {
				liege_or_court_owner ?= {
					save_scope_as = liege
				}
			}
		}
		hidden_effect = { # NF can only be held by house heads
			if = { # Start by checking that we are not the house head already
				limit = {
					exists = house.house_head
					NOT = { house.house_head = scope:new_noble_family_holder }
				}
				if = { # If not, let's see if it would be reasonable to become house head...
					limit = {
						house.house_head ?= {
							is_ai = yes # Don't steal house head from a player
							OR = {
								# Within same realm but less important
								AND = {
									top_liege = scope:new_noble_family_holder.top_liege
									OR = {
										is_ruler = no
										highest_held_title_tier < scope:new_noble_family_holder.highest_held_title_tier
									}
								}
								# Wanderer
								NOT = { exists = liege }
							}
						}
					}
					house = { set_house_head = scope:new_noble_family_holder }
				}
				else = { # ... Otherwise, we create a cadet branch
					create_cadet_house_with_name_effect = yes
				}
			}
		}
		scope:new_noble_family_holder = {
			if = {
				limit = {
					NOT = {
						any_held_title = { is_noble_family_title = yes }
					}
				}
				give_noble_family_title_effect = { GOVERNMENT_GIVER = scope:government_giver }
			}
			scope:new_title.holder ?= {
				if = {
					limit = {
						is_landed = no
						exists = scope:liege
						scope:liege.highest_held_title_tier > highest_held_title_tier
					}
					create_title_and_vassal_change = {
						type = swear_fealty
						save_scope_as = change
					}
					change_liege = {
						liege = scope:liege
						change = scope:change
					}
					resolve_title_and_vassal_change = scope:change
				}
			}
			custom_description = { text = create_noble_family_tt }

			#Notifications
			every_player = {
				limit = {
					top_liege = scope:new_noble_family_holder.top_liege
					this != scope:new_noble_family_holder
					# China has hundreds of Noble Families, it gets spammy
					NOT = { government_allows = merit }
				}
				trigger_event = {
					id = ep3_emperor_yearly.2410
					days = 1
				}
			}
		}
	}
	else = {
		debug_log = "try create NF title but goverment does not allow"
	}
	debug_log_scopes = yes
}

As written in game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt.

Where it is used

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

Decisions (1)

Character interactions (1)

  • Make Courtier Noble Family

Events (3)

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

  • on_county_auto_granted_to_liege_culture
  • on_county_auto_granted_to_local_culture
  • on_ruler_designer_finished
  • on_vassal_change

Source: game/common/scripted_effects/07_dlc_ep3_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?