Scripted Effect

cache_distance_map

Country temp scope
  • Every owned non rural locationwhere
    Add to list: cities
  • Every owned location
    • Add to local variable map
      • Name: preferred_city
      • Key: This
      • Value: Country temp scopeCapital
    • Add to local variable map
      • Name: preferred_city_score
      • Key: This
      • Value: distance_to(scope:country_temp_scope.capital)
    • Every in list
      • List: cities
      • If
        Number one › distance_to(scope:number_two) < local_variable_map(preferred_city_score|scope:number_one)
        Then
        • Add to local variable map
          • Name: preferred_city
          • Key: Number one
          • Value: Number two
        • Add to local variable map
          • Name: preferred_city_score
          • Key: Number one
          • Value: scope:number_one.distance_to(scope:number_two)
Exact script

Script that calls it fills these in, as each caller in Connections shows.

  • $country$

Scripting 2

Uses 1

Used by 1

$country$ = {
save_temporary_scope_as = country_temp_scope
}

© 2026 Soft Santa Cruz, S.L.U. All rights reserved. Unofficial fan project, not affiliated with Paradox Interactive. Game content © Paradox Interactive. · About · Privacy · Legal notice