I have a custom religion that the player can found by decision. I would like to randomly decide what its holy sites are based on proximity to the player at the time the religion is founded. (Similar to how Alternate Start randomly generates holy sites based on proximity to centers of that religion.)
I know of theset_holy_site
command, but I'm not sure how to tell the game to choose holy sites based on proximity in the same manner as Alternate Start's holy site randomization. Can someone point me in a direction for this, please? Thanks.
Theholy_site_spread
parameter in \common\alternate_start\01_spread.txt gives some ideas, but I'm completely lost on how to translate that to a scripted command activated by the religion-founding decision.
A rough idea that'll need some expansion:
Code:
set_up_holy_sites_effect = { # Put in the scripted_effects folder, call from the religion creator after swapping their religion to the new religion
any_province = {
limit = {
is_holy_site = ROOT
}
remove_holy_site = ROOT
}
# Creator's capital should probably be a holy site
capital_scope = {
county = {
save_event_target_as = holy_site_1
}
}
# Add four additional holy site locations
any_province = {
limit = {
is_land = yes
has_owner = yes
NOR = {
province = event_target:holy_site_1
any_neighbor_province = {
province = event_target:holy_site_1
}
}
# Possibly add more limits, e.g. having a temple holding, being within a certain distance, being further than a certain distance
}
score_value = {
value = 10
holy_site_province_selection_score = yes
}
county = {
save_event_target_as = holy_site_2
}
}
any_province = {
limit = {
is_land = yes
has_owner = yes
NOR = {
province = event_target:holy_site_1
any_neighbor_province = {
province = event_target:holy_site_1
}
province = event_target:holy_site_2
any_neighbor_province = {
province = event_target:holy_site_2
}
}
# Possibly add more limits, e.g. having a temple holding, being within a certain distance, being further than a certain distance
}
score_value = {
value = 10
holy_site_province_selection_score = yes
}
county = {
save_event_target_as = holy_site_3
}
}
any_province = {
limit = {
is_land = yes
has_owner = yes
NOR = {
province = event_target:holy_site_1
any_neighbor_province = {
province = event_target:holy_site_1
}
province = event_target:holy_site_2
any_neighbor_province = {
province = event_target:holy_site_2
}
province = event_target:holy_site_3
any_neighbor_province = {
province = event_target:holy_site_3
}
}
# Possibly add more limits, e.g. having a temple holding, being within a certain distance, being further than a certain distance
}
score_value = {
value = 10
holy_site_province_selection_score = yes
}
county = {
save_event_target_as = holy_site_4
}
}
any_province = {
limit = {
is_land = yes
has_owner = yes
NOR = {
province = event_target:holy_site_1
any_neighbor_province = {
province = event_target:holy_site_1
}
province = event_target:holy_site_2
any_neighbor_province = {
province = event_target:holy_site_2
}
province = event_target:holy_site_3
any_neighbor_province = {
province = event_target:holy_site_3
}
province = event_target:holy_site_4
any_neighbor_province = {
province = event_target:holy_site_4
}
}
# Possibly add more limits, e.g. having a temple holding, being within a certain distance, being further than a certain distance
}
score_value = {
value = 10
holy_site_province_selection_score = yes
}
county = {
save_event_target_as = holy_site_5
}
}
# Actually add the new holy sites
event_target:holy_site_1 = {
set_holy_site = ROOT
}
event_target:holy_site_2 = {
set_holy_site = ROOT
}
event_target:holy_site_3 = {
set_holy_site = ROOT
}
event_target:holy_site_4 = {
set_holy_site = <ROOT
}
event_target:holy_site_5 = {
set_holy_site = ROOT
}
}
holy_site_province_selection_score = { # Put in the scripted_score_values folder
# Put weights here
}
The above, with some distance checks and possibly some weights should allow you to get five holy sites with a reasonable spread.
- 1