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

Scripted effect

recruit_terrain_specialist_effect

recruit_terrain_specialist_effect = { SPECIALIST_TEMPLATE_CHARACTER = … SPECIALIST_TRAIT = … }

game/common/scripted_effects/00_commander_effects.txt, line 411 (93 lines). Parameters: $SPECIALIST_TEMPLATE_CHARACTER$, $SPECIALIST_TRAIT$.

recruit_terrain_specialist_effect is a scripted effect in Crusader Kings III, written at line 411 of its file. A call passes 2 parameters: SPECIALIST_TEMPLATE_CHARACTER and SPECIALIST_TRAIT. The game's script calls it in 2 places, among them Recruit Terrain Specialist (decision) and conqueror.0500 (event). Its body carries 1 text of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/00_commander_effects.txt.

What it does

  • If

    Then

    Otherwise

    • create_character = { … }
  • If

    a check the game hides

    Then

    • If

      • scope:new_commander:
        • NOT = { is_courtier_of = root }

      Then

      • add_courtier = scope:new_commander
    • … joined your court!

• 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 (93 lines of game script)
recruit_terrain_specialist_effect = {
	if = {
		limit = {
			exists = root.capital_province
			any_pool_character = {
				is_adult = yes
				province = root.capital_province
				can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
				martial >= medium_skill_rating
				culture = root.culture
				opinion = { # Just to make sure you don't pull in rivals or similar
					value >= -30
					target = root
				}
			}
		}
		random_pool_character = {
			province = root.capital_province
			limit = {
				is_adult = yes
				can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
				martial >= medium_skill_rating
				culture = root.culture
				opinion = { # Just to make sure you don't pull in rivals or similar
					value >= -30
					target = root
				}
			}
			if = {
				limit = {
					NOT = {
						has_trait = $SPECIALIST_TRAIT$
					}
				}
				add_trait = $SPECIALIST_TRAIT$
			}
			random = {
				chance = 50
				wanderer_give_random_commander_trait_effect = yes
			}
			save_scope_as = new_commander
		}
	}
	else = {
		create_character = {
			employer = root
			template = $SPECIALIST_TEMPLATE_CHARACTER$
			faith = root.faith
			rite = root.rite
			culture = root.culture
			gender_female_chance = {
				if = {
					limit = { root.culture = { has_cultural_parameter = martial_custom_male_only_combatant } }
					add = 0
				}
				else_if = {
					limit = { root.culture = { has_cultural_parameter = martial_custom_female_only_combatant } }
					add = 100
				}
				else = {
					add = 50
				}
			}
			save_scope_as = new_commander
		}
	}
	if = { # Error suppression
		limit = {
			exists = scope:new_commander
		}
		scope:new_commander = {
			add_character_flag = {
				flag = blocked_from_leaving
				years = 25
			}
		}
		if = {
			limit = {
				scope:new_commander = {
					NOT = {
						is_courtier_of = root
					}
				}
			}
			add_courtier = scope:new_commander
		}
		send_interface_toast = {
			title = commander_recruited.t
			left_icon = scope:new_commander
			custom_tooltip = commander_recruited.desc
		}
	}
}

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

Where it is used

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

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