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_scheme_with_agents_effect

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

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

begin_scheme_with_agents_effect is a scripted effect in Crusader Kings III, written at line 16270 of its file. A call passes 8 parameters: AGENT_1, AGENT_2, AGENT_3, AGENT_4, AGENT_5, SCHEME_TYPE, TARGET_SCOPE and TARGET_TYPE. The game's script calls it in 27 places, among them Abduct (Scheme) (interaction), Boundary Dispute (Scheme) (interaction) and Challenge Status (Scheme) (interaction). Patch 1.20.1.2, from game/common/scripted_effects/00_scheme_scripted_effects.txt.

The comment above it in the file

Start a (non-contract) scheme with agents
Arguments:
 SCHEME_TYPE - Type of scheme
 TARGET_TYPE - What type of thing to target (character or title)
 TARGET_SCOPE - Individual game object to target (character or title)
 AGENT_1..5 - Scheme agent slots for the scheme.

What it does

  • start_scheme = { type = $SCHEME_TYPE$ $TARGET_TYPE$ = $TARGET_SCOPE$ save_scope_as = new_scheme }
  • scope:new_scheme:
    • 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

      • scope:scheme_launcher: Is played by the AI

      Then

      • auto_assign_scheme_agents = yes
    • If

      a check the game hides

      Then

      • expose_scheme_to = scope:scheme_launcher.puppeteer

• 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 (83 lines of game script)
begin_scheme_with_agents_effect = {
	save_scope_as = scheme_launcher

	# Flag that we _don't_ need more agents.
	set_variable = {
		name = agents_added
		value = yes
		days = 1
	}

	# Start the scheme.
	start_scheme = {
		type = $SCHEME_TYPE$
		$TARGET_TYPE$ = $TARGET_SCOPE$

		save_scope_as = new_scheme
	}

	# Assign agent slots et al. to the newly created 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$

		# Assign initial agents for non-player schemers.
		if = {
			limit = {
				scope:scheme_launcher = {
					is_ai = yes
				}
			}
			auto_assign_scheme_agents = yes
		}

		# 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
		}

		# puppet schemes are always exposed to their puppeteer
		if = {
			limit = {
				exists = scope:scheme_launcher.puppeteer
			}
			expose_scheme_to = scope:scheme_launcher.puppeteer
		}		

		# We tag commanding_puppeteer only on puppeteer-ordered schemes
		if = {
			limit = {
				exists = scope:actor
				exists = scope:puppet_or_actor
				scope:is_puppet_action ?= yes
				scheme_owner = scope:puppet_or_actor
			}
			set_variable = {
				name = commanding_puppeteer
				value = scope:actor
			}
		}
	}

	if = { # start_scheme can fail, leaving no scheme to open the view on
		limit = { exists = 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_scheme_with_agents_effect.

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?