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

Scripted effect · Khans of the Steppe files

clean_up_ai_nomad_effect

clean_up_ai_nomad_effect = yes

game/common/scripted_effects/09_dlc_mpo_scripted_effects.txt, line 5947 (133 lines). No parameters.

clean_up_ai_nomad_effect is a scripted effect in Crusader Kings III, in the Khans of the Steppe files, written at line 5947 of its file. It takes no parameters: clean_up_ai_nomad_effect = yes. The game's script calls it in 3 places, among them mpo_the_great_steppe_yearly_pulse_random (on action), three_year_playable_pulse (on action) and yearly_playable_pulse (on action). Patch 1.20.1.2, from game/common/scripted_effects/09_dlc_mpo_scripted_effects.txt.

What it does

  • If

    • Is played by the AI
    • Is at not War
    • domicile.herd < 500
    • Is not landed
    • Any held title:
    • Is not imprisoned
    • One of these

    • is_migrating = no
    • is_in_activity = no

    Then

    • Every held title › scope:nomad_capital_ruler:
      • destroy_title = prev
    • Every in list:
      • Where:
        • Is not imprisoned
        • NOT = { is_in_pool_at = scope:place_to_stay }
      • move_to_pool_at = scope:place_to_stay
    • …% chance of:
    • If

      • scope:nomad_capital_ruler: Is not a ruler

      Then

      • Every in list:
        • Where:
          • Is not imprisoned
          • NOT = { is_in_pool_at = scope:place_to_stay }
        • move_to_pool_at = scope:place_to_stay

• 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)
clean_up_ai_nomad_effect = {
	save_temporary_scope_as = nomad_capital_ruler
	if = {
		limit = {
			is_ai = yes
			is_at_war = no
			domicile.herd < 500
			is_landed = no
			any_held_title = {
				exists = title_domicile
				NOT = { exists = var:player_domicile_title }
			}
			is_imprisoned = no
			OR = {
				is_independent_ruler = yes
				liege ?= { is_ai = yes }
			}
			is_migrating = no
			is_in_activity = no
		}
		domicile.domicile_location = { save_scope_as = place_to_stay }
		if = {
			limit = {
				location = scope:place_to_stay
			}
			add_to_list = movers
		}
		every_courtier = {
			limit = {
				location = scope:place_to_stay
			}
			add_to_list = movers
		}
		every_held_title = {
			limit = {
				exists = title_domicile
				NOT = { exists = var:player_domicile_title }
			}
			scope:nomad_capital_ruler = { destroy_title = prev }
		}
		every_in_list = {
			list = movers
			limit = {
				is_imprisoned = no
				NOR = {
					this = scope:nomad_capital_ruler
					is_in_pool_at = scope:place_to_stay
				}
			}
			move_to_pool_at = scope:place_to_stay
		}

		random = {
			chance = {
				value = 20
				if = {
					limit = {
						any_player = {
							OR = {
								is_close_or_extended_family_of = scope:nomad_capital_ruler
								is_consort_of = scope:nomad_capital_ruler
								has_important_relationship_with_character_trigger = { CHARACTER = scope:nomad_capital_ruler }
								is_allied_in_war = scope:nomad_capital_ruler
								is_allied_to = scope:nomad_capital_ruler
								is_at_war_with = scope:nomad_capital_ruler
							}
						}
					}
					add = 80
				}
			}
			if = {
				limit = {
					has_dlc_feature = roads_to_power
					is_physically_able_adult = yes
					exists = location.county
					ai_can_valid_to_create_laamp_trigger = yes
				}
				create_landless_adventurer_title_effect = {
					REASON = flag:voluntary
					FLAVOR_CHAR = root
				}
				every_in_list = {
					list = movers
					limit = {
						NOR = {
							this = scope:nomad_capital_ruler
							is_courtier_of = scope:nomad_capital_ruler
							is_in_pool_at = scope:place_to_stay
						}
					}
					move_to_pool_at = scope:place_to_stay
				}
				if = {
					limit = {
						NOT = {
							exists = global_var:nomad_adventurer_spawn
						}
					}
					set_global_variable = {
						name = nomad_adventurer_spawn
						value = 1
					}
				}
				else = {
					change_global_variable = {
						name = nomad_adventurer_spawn
						add = 1
					}
				}
			}
		}

		if = {
			limit = {
				scope:nomad_capital_ruler = {
					is_ruler = no
				}
			}
			every_in_list = {

As written in game/common/scripted_effects/09_dlc_mpo_scripted_effects.txt.

The first 120 of its 133 lines; the rest is in game/common/scripted_effects/09_dlc_mpo_scripted_effects.txt from line 5947.

Where it is used

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

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

  • mpo_the_great_steppe_yearly_pulse_random
  • three_year_playable_pulse
  • yearly_playable_pulse

Source: game/common/scripted_effects/09_dlc_mpo_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?