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

generate_governance_outcome_effect

generate_governance_outcome_effect = { OPTIONS = … }

game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt, line 3585 (112 lines). Parameters: $OPTIONS$.

generate_governance_outcome_effect is a scripted effect in Crusader Kings III, in the Roads to Power files, written at line 3585 of its file. A call passes 1 parameter: OPTIONS. The game's script calls it in 42 places, among them A Confusion of Tongues (event tgp_governor_contract_event.0027), An Evil Presence (event governor_contract_event.2051) and Bountiful Harvest (event governor_contract_event.1020). Patch 1.20.1.2, from game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt.

What it does

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

The script as written (112 lines of game script)
generate_governance_outcome_effect = {
	# INFO: We use this effect to randomize the options you get when doing a governor contract.
	# $OPTIONS$ is the number of options the event has - Never use less than four, and try to have six if possible.

	# Unlock a bonus option if you have enough exp in the Governor trait - We do this here (and not in the option) to avoid blocking the option due to exp decay (if game is unpaused).
	if = {
		limit = {
			has_trait = governor
			has_trait_xp = {
				trait = governor
				value >= 50
			}
		}
		save_scope_as = governance_option_a
	}

	# Check if you have the Governor trait
	if = {
		limit = { # If you have the trait with at least rank 1, we generate an extra option.
			has_trait = governor
			has_trait_xp = {
				trait = governor
				value >= 25
			}
		}
		save_scope_value_as = { name = governance_number_of_options value = 3 }
	}
	else = { # Otherwise, you only get two base options.
		save_scope_value_as = { name = governance_number_of_options value = 2 }
	}

	# Generate the options
	set_local_variable = {
		name = current_value
		value = 0
	}
	while = {
		limit = {
			local_var:current_value < scope:governance_number_of_options
		}
		random_list = {
			# There is no option A, as A should be unlocked for having the Governor trait at rank 2 (which is done in the corresponding event)
			20 = {
				trigger = {
					NOT = { exists = scope:governance_option_b }
				}
				save_scope_value_as = {
					name = governance_option_b
					value = yes
				}
				change_local_variable = {
					name = current_value
					add = 1
				}
			}
			20 = {
				trigger = {
					NOT = { exists = scope:governance_option_c }
				}
				save_scope_value_as = {
					name = governance_option_c
					value = yes
				}
				change_local_variable = {
					name = current_value
					add = 1
				}
			}
			20 = {
				trigger = {
					NOT = { exists = scope:governance_option_d }
				}
				save_scope_value_as = {
					name = governance_option_d
					value = yes
				}
				change_local_variable = {
					name = current_value
					add = 1
				}
			}
			20 = {
				trigger = {
					NOT = { exists = scope:governance_option_e }
					$OPTIONS$ >= 5
				}
				save_scope_value_as = {
					name = governance_option_e
					value = yes
				}
				change_local_variable = {
					name = current_value
					add = 1
				}
			}
			20 = {
				trigger = {
					NOT = { exists = scope:governance_option_f }
					$OPTIONS$ >= 6
				}
				save_scope_value_as = {
					name = governance_option_f
					value = yes
				}
				change_local_variable = {
					name = current_value
					add = 1
				}
			}
		}
	}
}

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

Events (42)

36 more

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?