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

Scripted effect

begin_contract_scheme_with_agents_effect

begin_contract_scheme_with_agents_effect = { AGENT_1 = … AGENT_2 = … AGENT_3 = … AGENT_4 = … AGENT_5 = … SCHEME_TYPE = … TARGET_SCOPE = … TARGET_TYPE = … TASK_CONTRACT = … }

game/common/scripted_effects/00_scheme_scripted_effects.txt, line 16354 (64 lines). Parameters: $AGENT_1$, $AGENT_2$, $AGENT_3$, $AGENT_4$, $AGENT_5$, $SCHEME_TYPE$, $TARGET_SCOPE$, $TARGET_TYPE$, $TASK_CONTRACT$.

begin_contract_scheme_with_agents_effect is a scripted effect in Crusader Kings III, written at line 16354 of its file. A call passes 9 parameters: AGENT_1, AGENT_2, AGENT_3, AGENT_4, AGENT_5, SCHEME_TYPE, TARGET_SCOPE, TARGET_TYPE and TASK_CONTRACT. The game's script calls it in 8 places, among them Generate Claim (Scheme) (interaction), Steal Artifact (Scheme) (interaction) and Contract: Eyes in the Shadows (event ep3_contract_event.0100). Patch 1.20.1.2, from game/common/scripted_effects/00_scheme_scripted_effects.txt.

What it does

Every line of it is script with no tooltip text: the script is below.

The script as written (64 lines of game script)
begin_contract_scheme_with_agents_effect = {
	# Log our scheme launcher so that we can refer to them down the line.
	save_scope_as = scheme_launcher
	# Flag that we _don't_ need more agents.
	set_variable = {
		name = agents_added
		value = yes
		days = 1
	}
	every_scheme = { add_to_list = current_schemes_list }
	# check if you have to attach a contract to the scheme
	# Now start the scheme.
	start_scheme = {
		type = $SCHEME_TYPE$
		$TARGET_TYPE$ = $TARGET_SCOPE$
		contract = $TASK_CONTRACT$
	}
	# And grab the scheme's scope.
	random_scheme = {
		limit = {
			NOT = { is_in_list = current_schemes_list }
		}
		save_scope_as = new_scheme
	}
	scope:new_scheme ?= {
		# Add our starting agents.
		add_agent_slot = $AGENT_1$
		add_agent_slot = $AGENT_2$
		add_agent_slot = $AGENT_3$
		add_agent_slot = $AGENT_4$
		add_agent_slot = $AGENT_5$
		# If we have a custom charge threshold to complete, set that here.
		## Overthrow Regent.
		if = {
			limit = { scheme_type = overthrow_regent }
			set_variable = {
				name = custom_charge_threshold
				value = 1
			}
		}
		# Set up our grace period.
		set_variable = {
			name = secrecy_grace_period
			value = secrecy_grace_character_total_starting_value
		}
		set_variable = {
			name = attached_task_contract
			value = $TASK_CONTRACT$
		}
	}
	if = { # start_scheme can fail, leaving no scheme to attach the contract to
		limit = { exists = scope:new_scheme }
		$TASK_CONTRACT$ = {
			set_variable = {
				name = attached_scheme
				value = scope:new_scheme
			}
		}
		open_view = {
			view = intrigue_window
			player = scope:new_scheme.scheme_owner
		}
	}
}

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

Where it is used

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

Events (6)

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