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

Scripted effect · The Royal Court files

get_animal_hunt_location_effect

get_animal_hunt_location_effect = yes

game/common/scripted_effects/01_ep1_court_artifact_creation_effects.txt, line 367 (111 lines). No parameters.

get_animal_hunt_location_effect is a scripted effect in Crusader Kings III, in the The Royal Court files, written at line 367 of its file. It takes no parameters: get_animal_hunt_location_effect = yes. The game's script calls it in 5 places, among them create_artifact_animal_hide_effect (scripted effect), create_artifact_animal_trinket_effect (scripted effect) and create_artifact_bird_feather_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/01_ep1_court_artifact_creation_effects.txt.

The comment above it in the file

If the animal has been hunted we need to provide a location

What it does

  • If

    a check the game hides

    Then

    • Otherwise › scope:owner › 1 of 3 things will happen:
      • 49%: Nothing else happens
      • 49%: Nothing else happens
      • 2%: Nothing else happens

• 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 (111 lines of game script)
get_animal_hunt_location_effect = {
	if = {
		limit = {
			NOT = { exists = scope:location }
		}
		if = {
			limit = {
				scope:owner = {
					has_variable = animal_type
					OR = {
						var:animal_type = flag:cat
						var:animal_type = flag:dog
					}
				}
			}
			scope:owner = {
				if = {
					limit = { exists = capital_province }
					capital_province = { save_scope_as = location }
				}
				else_if = {
					limit = { exists = location }
					location = { save_scope_as = location }
				}
			}
		}
		else_if = {
			limit = {
				exists = scope:owner.involved_activity
				scope:owner.involved_activity = { has_activity_type = activity_hunt }
			}
			scope:owner.involved_activity.activity_location = { save_scope_as = location }
		}
		else = {
			scope:owner = {
				random_list = {
					30 = { #It's hunted in your own realm
						trigger = {
							any_sub_realm_county = {
								exists = this
							}
						}
						random_sub_realm_county = {
							random_county_province = { save_scope_as = location }
						}
					}
					30 = { #It's hunted in a neighbors realm
						trigger = {
							highest_held_title_tier >= tier_county
							any_neighboring_realm_same_rank_owner = {
								exists = capital_county
							}
						}
						random_neighboring_realm_same_rank_owner = {
							limit = { 
								exists = capital_county
							}
							capital_county = {
								random_county_province = { save_scope_as = location }
							}
						}
					}
					1 = { # It's hunted in our current location (as a fallback if we're unlanded or only a baron).
						trigger = {
							OR = {
								highest_held_title_tier < tier_county 
								is_landed = no
							}
						}
						location.county = {
							random_county_province = { save_scope_as = location }
						}
					}
				}
			}
		}
	}
	scope:owner = {
		if = {
			limit = {
				NOT = { has_variable = adventure_artifact_location }
			}
			set_variable = {
				name = adventure_artifact_location
				value = scope:location
				days = 1
			}
		}
		if = {
			limit = {
				NOT = { has_variable = adventure_artifact_hunter }
				exists = scope:creator
			}
			set_variable = {
				name = adventure_artifact_hunter
				value = scope:creator
				days = 1
			}
		}
		else_if = {
			limit = {
				NOT = { has_variable = adventure_artifact_hunter }
			}
			set_variable = {
				name = adventure_artifact_hunter
				value = scope:owner
				days = 1
			}
		}
	}
}

As written in game/common/scripted_effects/01_ep1_court_artifact_creation_effects.txt.

Where it is used

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

Source: game/common/scripted_effects/01_ep1_court_artifact_creation_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?