Scripted effect
dynasty_perk_secondary_education_trait_effect
dynasty_perk_secondary_education_trait_effect = yesgame/common/scripted_effects/00_education_effects.txt, line 3182 (105 lines). No parameters.
dynasty_perk_secondary_education_trait_effect is a scripted effect in Crusader Kings III, written at line 3182 of its file. It takes no parameters: dynasty_perk_secondary_education_trait_effect = yes. The game's script calls it in 5 places, among them Coming of Age (event coming_of_age.0001), Coming of Age (event coming_of_age.0002) and Coming of Age (event coming_of_age.0003). Patch 1.20.1.2, from game/common/scripted_effects/00_education_effects.txt.
What it does
If
One of these
- Their dynasty: The Dynasty has the Republican Education Legacy
or
All of these
exists = scope:educator- scope:educator › Their dynasty: The Dynasty has the Republican Education Legacy
Then
- 1 of 2 things will happen:
- 0% (base chance; changed in play) › 1 of 4 things will happen:
- 50% (base chance; changed in play): Gains the Trait Town Dweller
- 35% (base chance; changed in play): Gains the Trait Mayor Trainee
- 15% (base chance; changed in play): Gains the Trait Town Maven
- 0% (base chance; changed in play): Gains the Trait Republican Heir
- 100% (base chance; changed in play): Nothing else happens
- 0% (base chance; changed in play) › 1 of 4 things will happen:
• 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 (105 lines of game script)
dynasty_perk_secondary_education_trait_effect = {
if = {
limit = {
OR = {
dynasty ?= { has_dynasty_perk = fp2_urbanism_legacy_2 }
AND = {
exists = scope:educator
scope:educator = {
dynasty ?= { has_dynasty_perk = fp2_urbanism_legacy_2 }
}
}
}
}
# Assign a trait, chance based on the development of the location
if = {
limit = { exists = current_travel_plan }
set_variable = {
name = chance_for_extra_trait
value = current_travel_plan.departure_location.county.development_level
}
}
else = {
set_variable = {
name = chance_for_extra_trait
value = location.county.development_level
}
}
random_list = {
# Success
0 = {
modifier = {
exists = var:chance_for_extra_trait
add = var:chance_for_extra_trait
}
# Select trait now
random_list = {
# Level 1: from 50% to 0%
50 = {
modifier = {
add = {
value = var:chance_for_extra_trait
multiply = -0.5
}
}
add_trait = education_republican_knowledge_1
}
# Level 2: from 35% to 50%
35 = {
modifier = {
add = {
value = var:chance_for_extra_trait
multiply = 0.05
}
}
add_trait = education_republican_knowledge_2
}
# Level 3: from 15% to 30%
15 = {
modifier = {
add = {
value = var:chance_for_extra_trait
multiply = 0.5
}
}
add_trait = education_republican_knowledge_3
}
# Level 4: from 0 to 20% chance
0 = {
modifier = {
add = {
value = var:chance_for_extra_trait
multiply = 0.5
}
}
add_trait = education_republican_knowledge_4
}
}
}
# Failing - There will be a:
# 84% chance at development 5
# 66% chance at development 10
# 50% chance at development 15
# 0% chance once development level 30 is reached
30 = {
modifier = {
exists = var:chance_for_extra_trait
add = {
value = var:chance_for_extra_trait
multiply = -1
}
}
#nothing happens
}
}
# remove the variable now that it has been used
remove_variable = chance_for_extra_trait
}
}As written in game/common/scripted_effects/00_education_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls dynasty_perk_secondary_education_trait_effect.
Events (5)
- Coming of Age
coming_of_age.0001 - Coming of Age
coming_of_age.0002 - Coming of Age
coming_of_age.0003 - Coming of Age
coming_of_age.0004 - Coming of Age
coming_of_age.0005
Source: game/common/scripted_effects/00_education_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.