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

player_adventurer_contract_generation_on_domicile_moved_effect

player_adventurer_contract_generation_on_domicile_moved_effect = yes

game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt, line 2713 (69 lines). No parameters.

player_adventurer_contract_generation_on_domicile_moved_effect is a scripted effect in Crusader Kings III, in the Roads to Power files, written at line 2713 of its file. It takes no parameters: player_adventurer_contract_generation_on_domicile_moved_effect = yes. The game's script calls it in 3 places, among them on_game_start_after_lobby (on action), on_travel_plan_abort (on action) and on_travel_plan_complete (on action). Patch 1.20.1.2, from game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt.

What it does

• 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 (69 lines of game script)
player_adventurer_contract_generation_on_domicile_moved_effect = {
	if = {
		limit = { player_adventurer_sufficient_distance_for_contract_spawn_trigger = yes }
		save_temporary_scope_as = char_temp
		if = { # Explorers
			limit = { has_realm_law = camp_purpose_explorers }
			populate_task_contracts_for_area = {
				location = scope:char_temp.location
				amount = 1
				group = { laamp_contracts_transport_group }
			}
		}
		else_if = { # Mercenaries
			limit = { has_realm_law = camp_purpose_mercenaries }
			populate_task_contracts_for_area = {
				location = scope:char_temp.location
				amount = 1
				group = { laamp_contracts_war_group }
			}
			ordered_independent_ruler = {
				limit = {
					in_diplomatic_range = scope:char_temp
					scope:char_temp = {
						can_create_task_contract = {
							type_name = laamp_join_war_contract
							employer = prev
						}
					}
				}
				order_by = {
					value = 0
					subtract = "capital_county.squared_distance(scope:char_temp.domicile.domicile_location)"
				}
				ordered_character_war = {
					limit = {
						ep3_adventurer_mercenary_war_trigger = {
							EMPLOYER = prev
							LAAMP = scope:char_temp
						}
					}
					order_by = war_total_participants_current_strength_value
					primary_defender ?= { save_scope_as = defender }
					primary_attacker ?= { save_scope_as = attacker }
					save_scope_as = war
					scope:char_temp = {
						spawn_join_war_contracts_effect = {
							WAR = scope:war
							LAAMP = scope:char_temp
							ATTACKER = scope:attacker
							DEFENDER = scope:defender
						}
					}
				}
			}
			debug_log = "WAR_1"
			debug_log_scopes = yes
		}
		populate_location_with_contracts_effect = {
			AREA_CHAR = scope:char_temp
			AMOUNT = 3
		}
		# Log that we visited this place.
		add_to_variable_list = {
			name = laamp_recently_visited_kingdoms
			target = scope:kingdom_temp
			years = 5
		}
	}
}

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 player_adventurer_contract_generation_on_domicile_moved_effect.

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

  • on_game_start_after_lobby
  • on_travel_plan_abort
  • on_travel_plan_complete

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?