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)
- A Confusion of Tongues
tgp_governor_contract_event.0027 - An Evil Presence
governor_contract_event.2051 - Bountiful Harvest
governor_contract_event.1020 - Burdensome Taxes
tgp_governor_contract_event.0007 - Buried Treasure
governor_contract_event.2071 - Contested Inheritance
tgp_governor_contract_event.0035
36 more
- Crumbling Bridge
tgp_governor_contract_event.0025 - Dam in Disrepair
tgp_governor_contract_event.0009 - Dangerous Trade
tgp_governor_contract_event.0008 - Destroyed by Nature
tgp_natural_disaster_contract_event.0006 - Discontent Soldiers
governor_contract_event.2000 - Doddering Magistrate
tgp_governor_contract_event.0006 - Escaped Justice
governor_contract_events_tova.0056 - Food Shortage
tgp_natural_disaster_contract_event.0002 - Fraud in Broad Daylight
tgp_governor_contract_event.0023 - Hoarding Grain
tgp_governor_contract_event.0005 - Hoarding Mayor
governor_contract_event.1011 - Hungry Times
governor_contract_event.2111 - Inept Mayor
governor_contract_event.2011 - Irregular Accounting
tgp_governor_contract_event.0003 - Jail Inspection
tgp_governor_contract_event.0001 - Lines in the Soil
tgp_governor_contract_event.0021 - Miraculous Healing
governor_contract_event.2060 - Missing Equipment: Success
tgp_governor_contract_event.2002 - Monopoly in the Marketplace
tgp_governor_contract_event.0033 - Overdue Taxes: Success
governor_contract_event.1003 - Potent Physick
tgp_governor_contract_event.0002 - Predatory Beasts
governor_contract_event.2041 - Provincial Investment
governor_contract_event.2020 - Public Land
governor_contract_event.2081 - Quaking in Panic
tgp_governor_contract_event.0031 - Raiding Peasants
governor_contract_event.2031 - Rampant Bandits
governor_contract_event.1032 - Reapers of Ruin
tgp_natural_disaster_contract_event.0016 - Salt Smugglers
tgp_governor_contract_event.0004 - Seditious Storytelling
tgp_governor_contract_event.0029 - The Mad Prophet
governor_contract_event.2091 - Titles for Sale
governor_contract_event.2100 - Treating the Unfortunate
tgp_natural_disaster_contract_event.0011 - Unsanctioned Deity
governor_contract_events_tova.0051 - Wartime Measures
governor_contract_event.2120 - Weaponize Monks
governor_contract_events_tova.0066
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.