Scripted effect · Roads to Power files
ep3_adventurer_ai_contract_find_next_kingdom_effect
ep3_adventurer_ai_contract_find_next_kingdom_effect = yesgame/common/scripted_effects/07_dlc_ep3_story_cycle_adventurer_ai_scripted_effects.txt, line 1137 (355 lines). No parameters.
ep3_adventurer_ai_contract_find_next_kingdom_effect is a scripted effect in Crusader Kings III, in the Roads to Power files, written at line 1137 of its file. It takes no parameters: ep3_adventurer_ai_contract_find_next_kingdom_effect = yes. The game's script calls it in 1 place, among them story_adventurer_ai (story cycle). Patch 1.20.1.2, from game/common/scripted_effects/07_dlc_ep3_story_cycle_adventurer_ai_scripted_effects.txt.
What it does
- var:active_kingdom › Else, if all of these hold:
- Conditions › scope:story.story_owner:
One of these
- Has the Explorers Law
or
All of these
- Their culture: The Culture has the Characters are much more likely to become Adventurers Tradition
- Ai boldness at least 50
- Ai energy at least 50
or
All of these
- Their culture:
- The Culture has the Characters are much more likely to become Adventurers Tradition
- The Culture has the Can recruit one regiment of Varangian Veterans as Men-at-Arms Tradition
- Their religion:
is_in_family = rf_pagan
- Ai greed at least 0
- Their culture:
- Then › Their empire › One random title to title neighboring and across water empire › One random in de jure hierarchy:
- Where: Title tier exactly Kingdom
continue = { tier > tier_kingdom }
- Conditions › scope:story.story_owner:
If
a check the game hides
Then
story_owner.location.empire ?= { … }
If
a check the game hides
Then
scope:new_kingdom:If
character:90028 ?= scope:story.story_owner
Then
- 1 of 10 things will happen:
- 0%: Nothing else happens
- 0%: Nothing else happens
- 0%: Nothing else happens
- 0%: Nothing else happens
- 99%: Nothing else happens
- 0%: Nothing else happens
- 0%: Nothing else happens
- 0%: Nothing else happens
- 0%: Nothing else happens
- 0%: Nothing else happens
story_owner = { … }
story_owner = { … }
• 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 (120 lines of game script)
ep3_adventurer_ai_contract_find_next_kingdom_effect = {
save_scope_as = story
# Save previous kingdom for easy reference
var:previous_kingdom ?= { save_scope_as = previous_kingdom }
# Find de jure kingdom neighboring active kingdom
var:active_kingdom ?= {
save_scope_as = current_kingdom
# If we've pre-scripted story content, stay in our current kingdom.
if = {
limit = {
scope:story.story_owner = { has_character_flag = laamp_stay_same_kingdom }
}
save_scope_as = new_kingdom
}
# If we're an explorer, go further afield.
else_if = {
limit = {
scope:story.story_owner = {
OR = {
has_realm_law = camp_purpose_explorers
#Normans gonna Norman
AND = {
culture = { has_cultural_parameter = much_more_likely_to_be_laamps }
#But not all of them...
ai_boldness >= high_positive_ai_value
ai_energy >= high_positive_ai_value
}
#Vikings gonna Viking
AND = {
culture = {
has_cultural_parameter = more_likely_to_be_laamps
has_cultural_parameter = unlock_maa_varangian_veterans
}
religion = { is_in_family = rf_pagan }
#But not all of them...
ai_greed >= 0
}
}
}
}
empire = {
random_title_to_title_neighboring_and_across_water_empire = {
weight = {
base = 1
ep3_adventurer_ai_contract_find_next_kingdom_modifier = { ADVENTURER = scope:story.story_owner }
}
random_in_de_jure_hierarchy = {
continue = { tier > tier_kingdom }
limit = { tier = tier_kingdom }
weight = {
base = 1
ep3_adventurer_ai_contract_find_next_kingdom_modifier = { ADVENTURER = scope:story.story_owner }
}
save_scope_as = new_kingdom
}
}
}
}
# Otherwise, we're not, so stay at home.
else = {
random_title_to_title_neighboring_and_across_water_kingdom = {
limit = {
save_temporary_scope_as = new_kingdom_temp
NOT = { # Prefer variety
scope:story = {
is_target_in_variable_list = {
name = recent_kingdoms
target = scope:new_kingdom_temp
}
}
}
any_title_to_title_neighboring_kingdom = { this = scope:current_kingdom } # Prefer to not sail
}
alternative_limit = {
any_title_to_title_neighboring_kingdom = { this = scope:current_kingdom } # Prefer to not sail
}
alternative_limit = { always = yes }
weight = {
base = 1
# Prefer to stay around the same general area
modifier = {
scope:previous_kingdom ?= this
factor = 2
}
modifier = {
scope:previous_kingdom.empire ?= this.empire
factor = 2
}
modifier = {
scope:current_kingdom.empire ?= this.empire
factor = 2
}
ep3_adventurer_ai_contract_find_next_kingdom_modifier = { ADVENTURER = scope:story.story_owner }
}
save_scope_as = new_kingdom
}
}
}
if = {
limit = {
NOT = { exists = scope:new_kingdom }
}
story_owner.location.empire ?= {
random_direct_de_jure_vassal_title = {
limit = {
this != scope:current_kingdom
}
alternative_limit = { always = yes }
weight = {
base = 1
# Prefer to stay around the same general area
modifier = {
scope:previous_kingdom ?= this
factor = 2
}
modifier = {
scope:previous_kingdom.empire ?= this.empire
factor = 2
}
modifier = {As written in game/common/scripted_effects/07_dlc_ep3_story_cycle_adventurer_ai_scripted_effects.txt.
The first 120 of its 355 lines; the rest is in game/common/scripted_effects/07_dlc_ep3_story_cycle_adventurer_ai_scripted_effects.txt from line 1137.
Where it is used
Every place in common/, events/ and history/ that calls ep3_adventurer_ai_contract_find_next_kingdom_effect.
Story cycles (1)
- story_adventurer_ai
Source: game/common/scripted_effects/07_dlc_ep3_story_cycle_adventurer_ai_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.