From 9361d32aee5277f33fcdd8c0c912d733b23aec5a Mon Sep 17 00:00:00 2001 From: dudechris33 Date: Sat, 16 Mar 2024 04:20:33 -0700 Subject: [PATCH] second go at pop --- common/scripted_effects/popgrowth_effects.txt | 812 +++++++----------- .../03_popgrowth_scripted_triggers.txt | 7 +- events/migrations.txt | 10 +- events/population_capacity.txt | 134 +-- events/population_grow.txt | 137 ++- events/population_upgrade.txt | 209 +++-- 6 files changed, 556 insertions(+), 753 deletions(-) diff --git a/common/scripted_effects/popgrowth_effects.txt b/common/scripted_effects/popgrowth_effects.txt index 61968b8fc8..a1b68410c0 100644 --- a/common/scripted_effects/popgrowth_effects.txt +++ b/common/scripted_effects/popgrowth_effects.txt @@ -1,12 +1,6 @@ - - - ########## # POPGROWTH EFFECTS, where most of the code is stored. Hard to understand, but does wonders ########## - - - PG_add_river_ports = { 134 = { set_province_flag = PG_river_port } # Beticus 135 = { set_province_flag = PG_river_port } # Beticus @@ -372,41 +366,38 @@ PG_add_river_ports = { PG_winter_rurcap = { if = { - limit = { OR = { - blast_furnace_institution = 100 - advanced_hydraulics_institution = 100 - owner = { has_reform = steppe_horde_reform } # Nomads act like if they had the most tech; but can't get pop from buildings - } } + limit = { + OR = { + blast_furnace_institution = 100 + advanced_hydraulics_institution = 100 + owner = { has_reform = steppe_horde_reform } # Nomads act like if they had the most tech; but can't get pop from buildings + } + } multiply_variable = { rural_capacity = $tier3$ } - } - - else_if = { - limit = { OR = { - siege_engineering_institution = 100 - cast_iron_institution = 100 - owner = { government = tribal } # Tribals (other than nomads) are like having "some" technology, but 1/2 build effs. - } } + } else_if = { + limit = { + OR = { + siege_engineering_institution = 100 + cast_iron_institution = 100 + owner = { government = tribal } # Tribals (other than nomads) are like having "some" technology, but 1/2 build effs. + } + } multiply_variable = { rural_capacity = $tier2$ } - } - - - else = { multiply_variable = { rural_capacity = $tier1$ } } - - + } else = { multiply_variable = { rural_capacity = $tier1$ } } } - PG_terrain_rurcap = { - if = { limit = { has_building = hospital } multiply_variable = { rural_capacity = $tier4$ } } - else_if = { limit = { has_building = medicus } multiply_variable = { rural_capacity = $tier3$ } } - else_if = { limit = { has_building = herbalist } multiply_variable = { rural_capacity = $tier2$ } } - else = { multiply_variable = { rural_capacity = $tier1$ } } + if = { limit = { has_building = hospital } multiply_variable = { rural_capacity = $tier4$ } } + else_if = { limit = { has_building = medicus } multiply_variable = { rural_capacity = $tier3$ } } + else_if = { limit = { has_building = herbalist } multiply_variable = { rural_capacity = $tier2$ } } + else = { multiply_variable = { rural_capacity = $tier1$ } } } PS_terr_max = { - set_variable = { which = PS_terrmax which = PS_rur2 } multiply_variable = { PS_terrmax = $max$ } - + set_variable = { which = PS_terrmax which = PS_rur2 } + multiply_variable = { PS_terrmax = $max$ } } + PG_growth_modify_all = { multiply_variable = { PG_trb_grow = $trb$ } multiply_variable = { PG_com_grow = $com$ } @@ -414,103 +405,100 @@ PG_growth_modify_all = { } PG_urban_buildings = { - trigger_switch = { on_trigger = has_building - small_harbor = { change_variable = { urban_capacity = 0.1 } } - big_harbor = { change_variable = { urban_capacity = 0.3 } } - harbor_district = { change_variable = { urban_capacity = 0.5 } } + small_harbor = { change_variable = { urban_capacity = 0.1 } } + big_harbor = { change_variable = { urban_capacity = 0.3 } } + harbor_district = { change_variable = { urban_capacity = 0.5 } } } trigger_switch = { on_trigger = has_building - small_shipyard = { change_variable = { urban_capacity = 0.3 } } - big_shipyard = { change_variable = { urban_capacity = 0.5 } } - military_wharf = { change_variable = { urban_capacity = 0.7 } } + small_shipyard = { change_variable = { urban_capacity = 0.3 } } + big_shipyard = { change_variable = { urban_capacity = 0.5 } } + military_wharf = { change_variable = { urban_capacity = 0.7 } } } trigger_switch = { on_trigger = has_building - aqueduct = { change_variable = { urban_capacity = 0.2 } } + aqueduct = { change_variable = { urban_capacity = 0.2 } } } trigger_switch = { on_trigger = has_building - small_market = { change_variable = { urban_capacity = 0.1 } } - medium_market = { change_variable = { urban_capacity = 0.3 } } - great_market = { change_variable = { urban_capacity = 0.5 } } + small_market = { change_variable = { urban_capacity = 0.1 } } + medium_market = { change_variable = { urban_capacity = 0.3 } } + great_market = { change_variable = { urban_capacity = 0.5 } } } trigger_switch = { on_trigger = has_building - small_army_camp = { change_variable = { urban_capacity = 0.2 } } - small_military_settlement = { change_variable = { urban_capacity = 0.5 } } - big_military_settlement = { change_variable = { urban_capacity = 1.2 } } + small_army_camp = { change_variable = { urban_capacity = 0.2 } } + small_military_settlement = { change_variable = { urban_capacity = 0.5 } } + big_military_settlement = { change_variable = { urban_capacity = 1.2 } } } trigger_switch = { on_trigger = has_building - gravel_road = { change_variable = { urban_capacity = 0.1 } } - paved_road = { change_variable = { urban_capacity = 0.3 } } - imperial_road = { change_variable = { urban_capacity = 0.5 } } + gravel_road = { change_variable = { urban_capacity = 0.1 } } + paved_road = { change_variable = { urban_capacity = 0.3 } } + imperial_road = { change_variable = { urban_capacity = 0.5 } } } trigger_switch = { on_trigger = has_building - shrine = { change_variable = { urban_capacity = 0.2 } } - small_temple = { change_variable = { urban_capacity = 0.5 } } - great_temple = { change_variable = { urban_capacity = 1.2 } } + shrine = { change_variable = { urban_capacity = 0.2 } } + small_temple = { change_variable = { urban_capacity = 0.5 } } + great_temple = { change_variable = { urban_capacity = 1.2 } } } trigger_switch = { on_trigger = has_building - big_theater = { change_variable = { urban_capacity = 0.3 } } - great_theater = { change_variable = { urban_capacity = 0.6 } } - huge_theater = { change_variable = { urban_capacity = 1.5 } } + big_theater = { change_variable = { urban_capacity = 0.3 } } + great_theater = { change_variable = { urban_capacity = 0.6 } } + huge_theater = { change_variable = { urban_capacity = 1.5 } } } trigger_switch = { on_trigger = has_building - taxman = { change_variable = { urban_capacity = 0.2 } } - tax_collector = { change_variable = { urban_capacity = 0.5 } } + taxman = { change_variable = { urban_capacity = 0.2 } } + tax_collector = { change_variable = { urban_capacity = 0.5 } } } trigger_switch = { on_trigger = has_building - big_townhall = { change_variable = { urban_capacity = 0.2 } } - government_palace = { change_variable = { urban_capacity = 0.4 } } - government_district = { change_variable = { urban_capacity = 0.6 } } + big_townhall = { change_variable = { urban_capacity = 0.2 } } + government_palace = { change_variable = { urban_capacity = 0.4 } } + government_district = { change_variable = { urban_capacity = 0.6 } } } - trigger_switch = { # Soldiers live somewhere, don't you think? + trigger_switch = { # Soldiers live somewhere, don't you think? on_trigger = has_building - small_city_walls = { change_variable = { urban_capacity = 0.4 } } - large_city_walls = { change_variable = { urban_capacity = 1.0 } } - fortress_building = { change_variable = { urban_capacity = 1.8 } } - border_garrison = { change_variable = { urban_capacity = 0.2 } } + small_city_walls = { change_variable = { urban_capacity = 0.4 } } + large_city_walls = { change_variable = { urban_capacity = 1.0 } } + fortress_building = { change_variable = { urban_capacity = 1.8 } } + border_garrison = { change_variable = { urban_capacity = 0.2 } } } - trigger_switch = { on_trigger = has_building - great_library = { change_variable = { urban_capacity = 1.5 } } - library = { change_variable = { urban_capacity = 0.3 } } + great_library = { change_variable = { urban_capacity = 1.5 } } + library = { change_variable = { urban_capacity = 0.3 } } } trigger_switch = { on_trigger = has_building - mathematician_academy = { change_variable = { urban_capacity = 0.5 } } + mathematician_academy = { change_variable = { urban_capacity = 0.5 } } } trigger_switch = { on_trigger = has_building - philosophers_academy = { change_variable = { urban_capacity = 0.5 } } + philosophers_academy = { change_variable = { urban_capacity = 0.5 } } } trigger_switch = { on_trigger = has_building - military_academy = { change_variable = { urban_capacity = 0.5 } } + military_academy = { change_variable = { urban_capacity = 0.5 } } } trigger_switch = { on_trigger = has_building - imperial_palace = { change_variable = { urban_capacity = 1.0 } } - palace_garden = { change_variable = { urban_capacity = 0.5 } } + imperial_palace = { change_variable = { urban_capacity = 1.0 } } + palace_garden = { change_variable = { urban_capacity = 0.5 } } } - } PG_urban_buildings_details = { trigger_switch = { on_trigger = has_building - small_harbor = { change_variable = { urban_capacity = 0.1 } set_variable = { which = PS_urb_bld1 value = 0.1 } } - big_harbor = { change_variable = { urban_capacity = 0.3 } set_variable = { which = PS_urb_bld1 value = 0.3 } } - harbor_district = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld1 value = 0.5 } } + small_harbor = { change_variable = { urban_capacity = 0.1 } set_variable = { which = PS_urb_bld1 value = 0.1 } } + big_harbor = { change_variable = { urban_capacity = 0.3 } set_variable = { which = PS_urb_bld1 value = 0.3 } } + harbor_district = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld1 value = 0.5 } } } trigger_switch = { on_trigger = has_building @@ -518,197 +506,189 @@ PG_urban_buildings_details = { } trigger_switch = { on_trigger = has_building - small_shipyard = { change_variable = { urban_capacity = 0.3 } set_variable = { which = PS_urb_bld2 value = 0.3 } } - big_shipyard = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld2 value = 0.5 } } - military_wharf = { change_variable = { urban_capacity = 0.7 } set_variable = { which = PS_urb_bld2 value = 0.7 } } + small_shipyard = { change_variable = { urban_capacity = 0.3 } set_variable = { which = PS_urb_bld2 value = 0.3 } } + big_shipyard = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld2 value = 0.5 } } + military_wharf = { change_variable = { urban_capacity = 0.7 } set_variable = { which = PS_urb_bld2 value = 0.7 } } } trigger_switch = { on_trigger = has_building - small_market = { change_variable = { urban_capacity = 0.1 } set_variable = { which = PS_urb_bld3 value = 0.1 } } - medium_market = { change_variable = { urban_capacity = 0.3 } set_variable = { which = PS_urb_bld3 value = 0.3 } } - great_market = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld3 value = 0.5 } } + small_market = { change_variable = { urban_capacity = 0.1 } set_variable = { which = PS_urb_bld3 value = 0.1 } } + medium_market = { change_variable = { urban_capacity = 0.3 } set_variable = { which = PS_urb_bld3 value = 0.3 } } + great_market = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld3 value = 0.5 } } } trigger_switch = { on_trigger = has_building - small_army_camp = { change_variable = { urban_capacity = 0.2 } set_variable = { which = PS_urb_bld4 value = 0.2 } } - small_military_settlement = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld4 value = 0.5 } } - big_military_settlement = { change_variable = { urban_capacity = 1.2 } set_variable = { which = PS_urb_bld4 value = 1.2 } } + small_army_camp = { change_variable = { urban_capacity = 0.2 } set_variable = { which = PS_urb_bld4 value = 0.2 } } + small_military_settlement = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld4 value = 0.5 } } + big_military_settlement = { change_variable = { urban_capacity = 1.2 } set_variable = { which = PS_urb_bld4 value = 1.2 } } } trigger_switch = { on_trigger = has_building - gravel_road = { change_variable = { urban_capacity = 0.1 } set_variable = { which = PS_urb_bld5 value = 0.1 } } - paved_road = { change_variable = { urban_capacity = 0.3 } set_variable = { which = PS_urb_bld5 value = 0.3 } } - imperial_road = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld5 value = 0.5 } } + gravel_road = { change_variable = { urban_capacity = 0.1 } set_variable = { which = PS_urb_bld5 value = 0.1 } } + paved_road = { change_variable = { urban_capacity = 0.3 } set_variable = { which = PS_urb_bld5 value = 0.3 } } + imperial_road = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld5 value = 0.5 } } } trigger_switch = { on_trigger = has_building - shrine = { change_variable = { urban_capacity = 0.2 } set_variable = { which = PS_urb_bld6 value = 0.2 } } - small_temple = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld6 value = 0.5 } } - great_temple = { change_variable = { urban_capacity = 1.2 } set_variable = { which = PS_urb_bld6 value = 1.2 } } + shrine = { change_variable = { urban_capacity = 0.2 } set_variable = { which = PS_urb_bld6 value = 0.2 } } + small_temple = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld6 value = 0.5 } } + great_temple = { change_variable = { urban_capacity = 1.2 } set_variable = { which = PS_urb_bld6 value = 1.2 } } } trigger_switch = { on_trigger = has_building - big_theater = { change_variable = { urban_capacity = 0.3 } set_variable = { which = PS_urb_bld7 value = 0.3 } } - great_theater = { change_variable = { urban_capacity = 0.6 } set_variable = { which = PS_urb_bld7 value = 0.6 } } - huge_theater = { change_variable = { urban_capacity = 1.5 } set_variable = { which = PS_urb_bld7 value = 1.5 } } + big_theater = { change_variable = { urban_capacity = 0.3 } set_variable = { which = PS_urb_bld7 value = 0.3 } } + great_theater = { change_variable = { urban_capacity = 0.6 } set_variable = { which = PS_urb_bld7 value = 0.6 } } + huge_theater = { change_variable = { urban_capacity = 1.5 } set_variable = { which = PS_urb_bld7 value = 1.5 } } } trigger_switch = { on_trigger = has_building - taxman = { change_variable = { urban_capacity = 0.2 } set_variable = { which = PS_urb_bld8 value = 0.2 } } - tax_collector = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld8 value = 0.5 } } + taxman = { change_variable = { urban_capacity = 0.2 } set_variable = { which = PS_urb_bld8 value = 0.2 } } + tax_collector = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld8 value = 0.5 } } } trigger_switch = { on_trigger = has_building - big_townhall = { change_variable = { urban_capacity = 0.2 } set_variable = { which = PS_urb_bld9 value = 0.2 } } - government_palace = { change_variable = { urban_capacity = 0.4 } set_variable = { which = PS_urb_bld9 value = 0.4 } } - government_district = { change_variable = { urban_capacity = 0.6 } set_variable = { which = PS_urb_bld9 value = 0.6 } } + big_townhall = { change_variable = { urban_capacity = 0.2 } set_variable = { which = PS_urb_bld9 value = 0.2 } } + government_palace = { change_variable = { urban_capacity = 0.4 } set_variable = { which = PS_urb_bld9 value = 0.4 } } + government_district = { change_variable = { urban_capacity = 0.6 } set_variable = { which = PS_urb_bld9 value = 0.6 } } } trigger_switch = { on_trigger = has_building - small_city_walls = { change_variable = { urban_capacity = 0.4 } set_variable = { which = PS_urb_bld10 value = 0.4 } } - large_city_walls = { change_variable = { urban_capacity = 1.0 } set_variable = { which = PS_urb_bld10 value = 1.0 } } - fortress_building = { change_variable = { urban_capacity = 1.8 } set_variable = { which = PS_urb_bld10 value = 1.8 } } - border_garrison = { change_variable = { urban_capacity = 0.2 } set_variable = { which = PS_urb_bld10 value = 0.2 } } + small_city_walls = { change_variable = { urban_capacity = 0.4 } set_variable = { which = PS_urb_bld10 value = 0.4 } } + large_city_walls = { change_variable = { urban_capacity = 1.0 } set_variable = { which = PS_urb_bld10 value = 1.0 } } + fortress_building = { change_variable = { urban_capacity = 1.8 } set_variable = { which = PS_urb_bld10 value = 1.8 } } + border_garrison = { change_variable = { urban_capacity = 0.2 } set_variable = { which = PS_urb_bld10 value = 0.2 } } } - trigger_switch = { on_trigger = has_building - great_library = { change_variable = { urban_capacity = 1.5 } set_variable = { which = PS_urb_bld11 value = 1.5 } } - library = { change_variable = { urban_capacity = 0.3 } set_variable = { which = PS_urb_bld11 value = 0.3 } } + great_library = { change_variable = { urban_capacity = 1.5 } set_variable = { which = PS_urb_bld11 value = 1.5 } } + library = { change_variable = { urban_capacity = 0.3 } set_variable = { which = PS_urb_bld11 value = 0.3 } } } set_variable = { which = PS_urb_bld12 value = 0.0 } trigger_switch = { on_trigger = has_building - mathematician_academy = { change_variable = { urban_capacity = 0.5 } change_variable = { which = PS_urb_bld12 value = 0.5 } } + mathematician_academy = { change_variable = { urban_capacity = 0.5 } change_variable = { which = PS_urb_bld12 value = 0.5 } } } trigger_switch = { on_trigger = has_building - philosophers_academy = { change_variable = { urban_capacity = 0.5 } change_variable = { which = PS_urb_bld12 value = 0.5 } } + philosophers_academy = { change_variable = { urban_capacity = 0.5 } change_variable = { which = PS_urb_bld12 value = 0.5 } } } trigger_switch = { on_trigger = has_building - military_academy = { change_variable = { urban_capacity = 0.5 } change_variable = { which = PS_urb_bld12 value = 0.5 } } + military_academy = { change_variable = { urban_capacity = 0.5 } change_variable = { which = PS_urb_bld12 value = 0.5 } } } trigger_switch = { on_trigger = has_building - imperial_palace = { change_variable = { urban_capacity = 1.0 } set_variable = { which = PS_urb_bld13 value = 1.0 } } - palace_garden = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld13 value = 0.5 } } + imperial_palace = { change_variable = { urban_capacity = 1.0 } set_variable = { which = PS_urb_bld13 value = 1.0 } } + palace_garden = { change_variable = { urban_capacity = 0.5 } set_variable = { which = PS_urb_bld13 value = 0.5 } } } - - } PG_ruralupper_buildings = { trigger_switch = { on_trigger = has_building - big_townhall = { change_variable = { PG_ruralupper = 0.2 } } - government_palace = { change_variable = { PG_ruralupper = 0.4 } } - government_district = { change_variable = { PG_ruralupper = 1.0 } } + big_townhall = { change_variable = { PG_ruralupper = 0.2 } } + government_palace = { change_variable = { PG_ruralupper = 0.4 } } + government_district = { change_variable = { PG_ruralupper = 1.0 } } } trigger_switch = { on_trigger = has_building - shrine = { change_variable = { PG_ruralupper = 0.2 } } - small_temple = { change_variable = { PG_ruralupper = 0.5 } } - great_temple = { change_variable = { PG_ruralupper = 1.0 } } + shrine = { change_variable = { PG_ruralupper = 0.2 } } + small_temple = { change_variable = { PG_ruralupper = 0.5 } } + great_temple = { change_variable = { PG_ruralupper = 1.0 } } } - } + PG_ruralupper_buildings_detail = { trigger_switch = { on_trigger = has_building - big_townhall = { change_variable = { PG_ruralupper = 0.2 } set_variable = { which = PS_rur_upp1 value = 0.2 } } - government_palace = { change_variable = { PG_ruralupper = 0.4 } set_variable = { which = PS_rur_upp1 value = 0.4 } } - government_district = { change_variable = { PG_ruralupper = 1.0 } set_variable = { which = PS_rur_upp1 value = 1.0 } } + big_townhall = { change_variable = { PG_ruralupper = 0.2 } set_variable = { which = PS_rur_upp1 value = 0.2 } } + government_palace = { change_variable = { PG_ruralupper = 0.4 } set_variable = { which = PS_rur_upp1 value = 0.4 } } + government_district = { change_variable = { PG_ruralupper = 1.0 } set_variable = { which = PS_rur_upp1 value = 1.0 } } } trigger_switch = { on_trigger = has_building - shrine = { change_variable = { PG_ruralupper = 0.2 } set_variable = { which = PS_rur_upp2 value = 0.2 } } - small_temple = { change_variable = { PG_ruralupper = 0.5 } set_variable = { which = PS_rur_upp2 value = 0.5 } } - great_temple = { change_variable = { PG_ruralupper = 1.0 } set_variable = { which = PS_rur_upp2 value = 1.0 } } + shrine = { change_variable = { PG_ruralupper = 0.2 } set_variable = { which = PS_rur_upp2 value = 0.2 } } + small_temple = { change_variable = { PG_ruralupper = 0.5 } set_variable = { which = PS_rur_upp2 value = 0.5 } } + great_temple = { change_variable = { PG_ruralupper = 1.0 } set_variable = { which = PS_rur_upp2 value = 1.0 } } } - } + PG_urbanupper_buildings = { trigger_switch = { on_trigger = has_building - big_townhall = { change_variable = { PG_urbanupper = 0.2 } } - government_palace = { change_variable = { PG_urbanupper = 0.4 } } - government_district = { change_variable = { PG_urbanupper = 1.0 } } + big_townhall = { change_variable = { PG_urbanupper = 0.2 } } + government_palace = { change_variable = { PG_urbanupper = 0.4 } } + government_district = { change_variable = { PG_urbanupper = 1.0 } } } trigger_switch = { on_trigger = has_building - shrine = { change_variable = { PG_urbanupper = 0.2 } } - small_temple = { change_variable = { PG_urbanupper = 0.5 } } - great_temple = { change_variable = { PG_urbanupper = 1.0 } } + shrine = { change_variable = { PG_urbanupper = 0.2 } } + small_temple = { change_variable = { PG_urbanupper = 0.5 } } + great_temple = { change_variable = { PG_urbanupper = 1.0 } } } trigger_switch = { on_trigger = has_building - great_library = { change_variable = { PG_urbanupper = 1.0 } } - library = { change_variable = { PG_urbanupper = 0.2 } } - + great_library = { change_variable = { PG_urbanupper = 1.0 } } + library = { change_variable = { PG_urbanupper = 0.2 } } } trigger_switch = { on_trigger = has_building - mathematician_academy = { change_variable = { PG_urbanupper = 0.5 } } + mathematician_academy = { change_variable = { PG_urbanupper = 0.5 } } } trigger_switch = { on_trigger = has_building - philosophers_academy = { change_variable = { PG_urbanupper = 0.5 } } + philosophers_academy = { change_variable = { PG_urbanupper = 0.5 } } } trigger_switch = { on_trigger = has_building - military_academy = { change_variable = { PG_urbanupper = 0.5 } } + military_academy = { change_variable = { PG_urbanupper = 0.5 } } } trigger_switch = { on_trigger = has_building - imperial_palace = { change_variable = { PG_urbanupper = 1.0 } } - palace_garden = { change_variable = { PG_urbanupper = 0.5 } } - + imperial_palace = { change_variable = { PG_urbanupper = 1.0 } } + palace_garden = { change_variable = { PG_urbanupper = 0.5 } } } - } + PG_urbanupper_buildings_detail = { trigger_switch = { on_trigger = has_building - big_townhall = { change_variable = { PG_urbanupper = 0.2 } set_variable = { which = PS_urb_upp1 value = 0.2 } } - government_palace = { change_variable = { PG_urbanupper = 0.4 } set_variable = { which = PS_urb_upp1 value = 0.4 } } - government_district = { change_variable = { PG_urbanupper = 1.0 } set_variable = { which = PS_urb_upp1 value = 1.0 } } + big_townhall = { change_variable = { PG_urbanupper = 0.2 } set_variable = { which = PS_urb_upp1 value = 0.2 } } + government_palace = { change_variable = { PG_urbanupper = 0.4 } set_variable = { which = PS_urb_upp1 value = 0.4 } } + government_district = { change_variable = { PG_urbanupper = 1.0 } set_variable = { which = PS_urb_upp1 value = 1.0 } } } trigger_switch = { on_trigger = has_building - shrine = { change_variable = { PG_urbanupper = 0.2 } set_variable = { which = PS_urb_upp2 value = 0.2 } } - small_temple = { change_variable = { PG_urbanupper = 0.5 } set_variable = { which = PS_urb_upp2 value = 0.5 } } - great_temple = { change_variable = { PG_urbanupper = 1.0 } set_variable = { which = PS_urb_upp2 value = 1.0 } } + shrine = { change_variable = { PG_urbanupper = 0.2 } set_variable = { which = PS_urb_upp2 value = 0.2 } } + small_temple = { change_variable = { PG_urbanupper = 0.5 } set_variable = { which = PS_urb_upp2 value = 0.5 } } + great_temple = { change_variable = { PG_urbanupper = 1.0 } set_variable = { which = PS_urb_upp2 value = 1.0 } } } trigger_switch = { on_trigger = has_building - great_library = { change_variable = { PG_urbanupper = 1.0 } set_variable = { which = PS_urb_upp3 value = 1.0 } } - library = { change_variable = { PG_urbanupper = 0.2 } set_variable = { which = PS_urb_upp3 value = 0.2 } } - + great_library = { change_variable = { PG_urbanupper = 1.0 } set_variable = { which = PS_urb_upp3 value = 1.0 } } + library = { change_variable = { PG_urbanupper = 0.2 } set_variable = { which = PS_urb_upp3 value = 0.2 } } } set_variable = { which = PS_urb_upp4 value = 0.0 } trigger_switch = { on_trigger = has_building - mathematician_academy = { change_variable = { PG_urbanupper = 0.5 } change_variable = { which = PS_urb_upp4 value = 0.5 } } + mathematician_academy = { change_variable = { PG_urbanupper = 0.5 } change_variable = { which = PS_urb_upp4 value = 0.5 } } } trigger_switch = { on_trigger = has_building - philosophers_academy = { change_variable = { PG_urbanupper = 0.5 } change_variable = { which = PS_urb_upp4 value = 0.5 } } + philosophers_academy = { change_variable = { PG_urbanupper = 0.5 } change_variable = { which = PS_urb_upp4 value = 0.5 } } } trigger_switch = { on_trigger = has_building - military_academy = { change_variable = { PG_urbanupper = 0.5 } change_variable = { which = PS_urb_upp4 value = 0.5 } } + military_academy = { change_variable = { PG_urbanupper = 0.5 } change_variable = { which = PS_urb_upp4 value = 0.5 } } } trigger_switch = { on_trigger = has_building - imperial_palace = { change_variable = { PG_urbanupper = 1.0 } set_variable = { which = PS_urb_upp5 value = 1.0 } } - palace_garden = { change_variable = { PG_urbanupper = 0.5 } set_variable = { which = PS_urb_upp5 value = 0.5 } } - + imperial_palace = { change_variable = { PG_urbanupper = 1.0 } set_variable = { which = PS_urb_upp5 value = 1.0 } } + palace_garden = { change_variable = { PG_urbanupper = 0.5 } set_variable = { which = PS_urb_upp5 value = 0.5 } } } - } -PG_detail_zerovalues = { +PG_detail_zerovalues = {s # Must set zeros if the variables are not found. Otherwise, the modifier will be giving errors in the error.log and bloat the file if = { limit = { NOT = { check_variable = { PS_urb_bld1 = 0.001 } } } set_variable = { which = PS_urb_bld1 value = 0 } } if = { limit = { NOT = { check_variable = { PS_urb_bld2 = 0.001 } } } set_variable = { which = PS_urb_bld2 value = 0 } } @@ -734,10 +714,6 @@ PG_detail_zerovalues = { if = { limit = { NOT = { check_variable = { PS_urb_upp5 = 0.001 } } } set_variable = { which = PS_urb_upp5 value = 0 } } if = { limit = { NOT = { check_variable = { PS_urb_upp1 = 0.001 } } } set_variable = { which = PS_urb_upp1 value = 0 } } - - - - } PG_urbanupper_capital = { @@ -753,24 +729,35 @@ PG_urbanupper_capital = { PG_update_inforange = { # Set main province's value, and compare - export_to_variable = { which = tp_base value = province_trade_power } set_variable = { which = tp_compare which = tp_base } - export_to_variable = { which = tp_infomod value = modifier:local_institution_spread } change_variable = { tp_infomod = 0.5 } # info: base -50% - if = { limit = { check_variable = { tp_infomod = 0.9 } } set_variable = { which = tp_infomod value = 0.9 } } # max 90%, at least 10% attrition + export_to_variable = { which = tp_base value = province_trade_power } + set_variable = { which = tp_compare which = tp_base } + export_to_variable = { which = tp_infomod value = modifier:local_institution_spread } + change_variable = { tp_infomod = 0.5 } # info: base -50% + if = { + limit = { check_variable = { tp_infomod = 0.9 } } + set_variable = { which = tp_infomod value = 0.9 } # max 90%, at least 10% attrition + } # Look at each of the neighbours values, and "compare" while updating every_neighbor_province = { + limit = { is_city = yes } export_to_variable = { which = tp_compare value = province_trade_power } - set_variable = { which = tp_infomod which = PREV } multiply_variable = { which = tp_compare which = tp_infomod } # use info % from base prov - if = { limit = { check_variable = { which = tp_old which = tp_compare } } set_variable = { which = tp_compare which = tp_old } } + set_variable = { which = tp_infomod which = PREV } + multiply_variable = { which = tp_compare which = tp_infomod } # use info % from base prov + if = { + limit = { check_variable = { which = tp_old which = tp_compare } } + set_variable = { which = tp_compare which = tp_old } + } if = { limit = { check_variable = { which = tp_compare which = PREV } } # here which prev = the original province PREV = { set_variable = { which = tp_compare which = PREV } } # here which prev = the neighbor, so, moving the neighbors to you } } - set_variable = { which = PG_info_range which = tp_compare } set_variable = { which = tp_old which = tp_compare } - set_variable = { which = tp_infodisp which = tp_infomod } multiply_variable = { which = tp_old which = tp_infomod } + set_variable = { which = PG_info_range which = tp_compare } + set_variable = { which = tp_old which = tp_compare } + set_variable = { which = tp_infodisp which = tp_infomod } + multiply_variable = { which = tp_old which = tp_infomod } # compare after passing all neighboring values (highest possible value). Final will be used for travel; old to check later on - } ########## @@ -788,15 +775,17 @@ PG_find_target_province = { # very high CoT if = { limit = { - any_province = { - NOT = { province_distance = { who = PREV distance = $range$ } } check_variable = { urban_growth = 1.2 } - NOT = { has_province_modifier = PG_new_pop } province_has_center_of_trade_of_level = 2 + any_neighbor_province = { + province_has_center_of_trade_of_level = 2 + check_variable = { urban_growth = 1.2 } + NOT = { has_province_modifier = PG_new_pop } } } - random_province = { + random_neighbor_province = { limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } check_variable = { urban_growth = 1.2 } - NOT = { has_province_modifier = PG_new_pop } province_has_center_of_trade_of_level = 2 + province_has_center_of_trade_of_level = 2 + check_variable = { urban_growth = 1.2 } + NOT = { has_province_modifier = PG_new_pop } } save_event_target_as = PG_target } @@ -804,15 +793,17 @@ PG_find_target_province = { # "normal" CoT else_if = { limit = { - any_province = { - NOT = { province_distance = { who = PREV distance = $range$ } } check_variable = { urban_growth = 1.2 } - NOT = { has_province_modifier = PG_new_pop } province_has_center_of_trade_of_level = 1 + any_neighbor_province = { + province_has_center_of_trade_of_level = 1 + check_variable = { urban_growth = 1.2 } + NOT = { has_province_modifier = PG_new_pop } } } - random_province = { + random_neighbor_province = { limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } check_variable = { urban_growth = 1.2 } - NOT = { has_province_modifier = PG_new_pop } province_has_center_of_trade_of_level = 1 + province_has_center_of_trade_of_level = 1 + check_variable = { urban_growth = 1.2 } + NOT = { has_province_modifier = PG_new_pop } } save_event_target_as = PG_target } @@ -820,15 +811,21 @@ PG_find_target_province = { # any other place else_if = { limit = { - any_province = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { has_province_modifier = PG_new_pop } - OR = { check_variable = { rural_growth = 1.2 } check_variable = { urban_growth = 1.2 } } + any_neighbor_province = { + OR = { + check_variable = { rural_growth = 1.2 } + check_variable = { urban_growth = 1.2 } + } + NOT = { has_province_modifier = PG_new_pop } } } - random_province = { + random_neighbor_province = { limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { has_province_modifier = PG_new_pop } - OR = { check_variable = { rural_growth = 1.2 } check_variable = { urban_growth = 1.2 } } + OR = { + check_variable = { rural_growth = 1.2 } + check_variable = { urban_growth = 1.2 } + } + NOT = { has_province_modifier = PG_new_pop } } save_event_target_as = PG_target } @@ -836,10 +833,8 @@ PG_find_target_province = { else = { # nowhere to go -> starvation! set_province_flag = PG_starvation_start } - } - PG_find_target_province_2 = { # Destination priorities for those who want to leave: # 1- High CoT (lv 5 or higher, or lv2 in old system) @@ -853,17 +848,19 @@ PG_find_target_province_2 = { # 1- high CoT if = { limit = { - any_province = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - check_variable = { PG_com_grow = 120 } province_has_center_of_trade_of_level = 5 + any_neighbor_province = { + province_has_center_of_trade_of_level = 5 + check_variable = { PG_com_grow = 120 } NOT = { has_province_flag = PG_trib_migr_target } + NOT = { PG_trigger_has_new_pop = yes } } } - random_province = { + random_neighbor_province = { limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - check_variable = { PG_com_grow = 120 } province_has_center_of_trade_of_level = 5 + province_has_center_of_trade_of_level = 5 + check_variable = { PG_com_grow = 120 } NOT = { has_province_flag = PG_trib_migr_target } + NOT = { PG_trigger_has_new_pop = yes } } PG_migr_target_fixed = yes } @@ -871,17 +868,19 @@ PG_find_target_province_2 = { # 2- "normal" CoT else_if = { limit = { - any_province = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - check_variable = { PG_com_grow = 120 } province_has_center_of_trade_of_level = 2 + any_neighbor_province = { + province_has_center_of_trade_of_level = 2 + check_variable = { PG_com_grow = 120 } NOT = { has_province_flag = PG_trib_migr_target } + NOT = { PG_trigger_has_new_pop = yes } } } - random_province = { + random_neighbor_province = { limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - check_variable = { PG_com_grow = 120 } province_has_center_of_trade_of_level = 2 + province_has_center_of_trade_of_level = 2 + check_variable = { PG_com_grow = 120 } NOT = { has_province_flag = PG_trib_migr_target } + NOT = { PG_trigger_has_new_pop = yes } } PG_migr_target_fixed = yes } @@ -889,19 +888,25 @@ PG_find_target_province_2 = { # 3- Same culture else_if = { limit = { - any_province = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - OR = { check_variable = { PG_trb_grow = 120 } check_variable = { PG_com_grow = 120 } } + any_neighbor_province = { culture = PREV + OR = { + check_variable = { PG_trb_grow = 120 } + check_variable = { PG_com_grow = 120 } + } NOT = { has_province_flag = PG_trib_migr_target } + NOT = { PG_trigger_has_new_pop = yes } } } - random_province = { + random_neighbor_province = { limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - OR = { check_variable = { PG_trb_grow = 120 } check_variable = { PG_com_grow = 120 } } culture = PREV + OR = { + check_variable = { PG_trb_grow = 120 } + check_variable = { PG_com_grow = 120 } + } NOT = { has_province_flag = PG_trib_migr_target } + NOT = { PG_trigger_has_new_pop = yes } } PG_migr_target_fixed = yes } @@ -909,19 +914,25 @@ PG_find_target_province_2 = { # 4- Same culture group else_if = { limit = { - any_province = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - OR = { check_variable = { PG_trb_grow = 120 } check_variable = { PG_com_grow = 120 } } + any_neighbor_province = { culture_group = PREV + OR = { + check_variable = { PG_trb_grow = 120 } + check_variable = { PG_com_grow = 120 } + } NOT = { has_province_flag = PG_trib_migr_target } + NOT = { PG_trigger_has_new_pop = yes } } } - random_province = { + random_neighbor_province = { limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - OR = { check_variable = { PG_trb_grow = 120 } check_variable = { PG_com_grow = 120 } } culture_group = PREV + OR = { + check_variable = { PG_trb_grow = 120 } + check_variable = { PG_com_grow = 120 } + } NOT = { has_province_flag = PG_trib_migr_target } + NOT = { PG_trigger_has_new_pop = yes } } PG_migr_target_fixed = yes } @@ -929,19 +940,25 @@ PG_find_target_province_2 = { # 5- Same religion else_if = { limit = { - any_province = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - OR = { check_variable = { PG_trb_grow = 120 } check_variable = { PG_com_grow = 120 } } + any_neighbor_province = { religion = PREV + OR = { + check_variable = { PG_trb_grow = 120 } + check_variable = { PG_com_grow = 120 } + } NOT = { has_province_flag = PG_trib_migr_target } + NOT = { PG_trigger_has_new_pop = yes } } } - random_province = { + random_neighbor_province = { limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - OR = { check_variable = { PG_trb_grow = 120 } check_variable = { PG_com_grow = 120 } } religion = PREV + OR = { + check_variable = { PG_trb_grow = 120 } + check_variable = { PG_com_grow = 120 } + } NOT = { has_province_flag = PG_trib_migr_target } + NOT = { PG_trigger_has_new_pop = yes } } PG_migr_target_fixed = yes } @@ -949,180 +966,35 @@ PG_find_target_province_2 = { # 6- any other place else_if = { limit = { - any_province = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - OR = { check_variable = { PG_trb_grow = 120 } check_variable = { PG_com_grow = 120 } } + any_neighbor_province = { + OR = { + check_variable = { PG_trb_grow = 120 } + check_variable = { PG_com_grow = 120 } + } NOT = { has_province_flag = PG_trib_migr_target } + NOT = { PG_trigger_has_new_pop = yes } } } - random_province = { + random_neighbor_province = { limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - OR = { check_variable = { PG_trb_grow = 120 } check_variable = { PG_com_grow = 120 } } + OR = { + check_variable = { PG_trb_grow = 120 } + check_variable = { PG_com_grow = 120 } + } NOT = { has_province_flag = PG_trib_migr_target } + NOT = { PG_trigger_has_new_pop = yes } } PG_migr_target_fixed = yes } } - else = { # nowhere to go -> starvation! set_province_flag = PG_starvation_start } - -} - - - -PG_find_target_prov_active_tn = { - # Same as the number 2, but limited to provinces with an active merchant. And 75% chance, to spice things a bit - - # Destination priorities for those who want to leave: - # 1- High CoT (lv 5 or higher, or lv2 in old system) - # 2- Simple CoT (lv2 / lv1) - # 3- Same culture - # 4- Same culture group - # 5- Same religion - # 6- Owned by same country - # 7- Anything else, both tribal and commoner - - set_variable = { which = PS_travel_total value = $range$ } - - # Important note for those reading the code. Compared to the other two "province searchers", this has MANY IFs at once, not a single if/else_if long chain. Therefore, it will actually search in all those provinces, and it depends on whether it found something or not (the province flag you see as "target success"). Careful with that. - # The main reason of that was to avoid having the scopes "any province" and "random province", since these are "global" and require lot of computing power. - - # Scopes: origin province: THIS, ROOT (doesn't work), or nothing. Owner: event_target:PG_migr_start_owner - - # 1- high CoT - if = { - limit = { NOT = { has_province_flag = PG_target_success } } # will block future ifs with this - owner = { - random_active_trade_node = { - random_trade_node_member_province = { - limit = { - NOT = { province_distance = { who = event_target:PG_migr_origin_prov distance = $range$ } } - NOT = { PG_trigger_has_new_pop = yes } - check_variable = { PG_com_grow = 120 } province_has_center_of_trade_of_level = 1 - NOT = { has_province_flag = PG_trib_migr_target } #has_merchant = event_target:PG_migr_start_owner - } - #random = { - # chance = 75 - PG_migr_target_fixed = yes - event_target:PG_migr_origin_prov = { set_province_flag = PG_provtarget_highcot } - #} - } - } - } - } - # 2- "normal" CoT - if = { - limit = { NOT = { has_province_flag = PG_target_success } } # will block future ifs with this - owner = { - random_active_trade_node = { - random_trade_node_member_province = { - limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - check_variable = { PG_com_grow = 120 } province_has_center_of_trade_of_level = 1 - NOT = { has_province_flag = PG_trib_migr_target } has_merchant = event_target:PG_migr_start_owner - } - random = { - chance = 40 - PG_migr_target_fixed = yes - event_target:PG_migr_origin_prov = { set_province_flag = PG_provtarget_lowcot } - } - } - } - } - } - # 3- Same culture - if = { - limit = { NOT = { has_province_flag = PG_target_success } } # will block future ifs with this - owner = { - random_active_trade_node = { - random_trade_node_member_province = { - limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - OR = { check_variable = { PG_trb_grow = 120 } check_variable = { PG_com_grow = 120 } } - culture = PREV - NOT = { has_province_flag = PG_trib_migr_target } has_merchant = event_target:PG_migr_start_owner - } - random = { - chance = 40 - PG_migr_target_fixed = yes - event_target:PG_migr_origin_prov = { set_province_flag = PG_provtarget_samecult } - } - } - } - } - } - # 4- Same culture group - if = { - limit = { NOT = { has_province_flag = PG_target_success } } # will block future ifs with this - owner = { - random_active_trade_node = { - random_trade_node_member_province = { - limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - OR = { check_variable = { PG_trb_grow = 120 } check_variable = { PG_com_grow = 120 } } - culture_group = PREV - NOT = { has_province_flag = PG_trib_migr_target } has_merchant = event_target:PG_migr_start_owner - } - random = { - chance = 40 - PG_migr_target_fixed = yes - event_target:PG_migr_origin_prov = { set_province_flag = PG_provtarget_samegroup } - } - } - } - } - } - # 5- Same religion - if = { - limit = { NOT = { has_province_flag = PG_target_success } } # will block future ifs with this - owner = { - random_active_trade_node = { - random_trade_node_member_province = { - limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - OR = { check_variable = { PG_trb_grow = 120 } check_variable = { PG_com_grow = 120 } } - religion = PREV - NOT = { has_province_flag = PG_trib_migr_target } has_merchant = event_target:PG_migr_start_owner - } - random = { - chance = 40 - PG_migr_target_fixed = yes - event_target:PG_migr_origin_prov = { set_province_flag = PG_provtarget_samerel } - } - } - } - } - } - # 6- any other place - if = { - limit = { NOT = { has_province_flag = PG_target_success } } # will block future ifs with this - owner = { - random_active_trade_node = { - random_trade_node_member_province = { - limit = { - NOT = { province_distance = { who = PREV distance = $range$ } } NOT = { PG_trigger_has_new_pop = yes } - OR = { check_variable = { PG_trb_grow = 120 } check_variable = { PG_com_grow = 120 } } - NOT = { has_province_flag = PG_trib_migr_target } has_merchant = event_target:PG_migr_start_owner - } - PG_migr_target_fixed = yes - event_target:PG_migr_origin_prov = { set_province_flag = PG_provtarget_other } - } - } - } - } - - if = { - limit = { NOT = { has_province_flag = PG_target_success } } # still has not found a suitable place, and nowhere to go -> starvation! - set_province_flag = PG_starvation_start - } - } +# PG_find_target_prov_active_tn = removed -PG_migr_target_fixed = { # Must be scoped to the target province, and Prev is the origin province +PG_migr_target_fixed = { # Must be scoped to the target province, and Prev is the origin province set_variable = { which = prov_id which = prov_id_base } save_event_target_as = PG_prov_targeted set_province_flag = PG_trib_migr_target @@ -1132,7 +1004,6 @@ PG_migr_target_fixed = { # Must be scoped to the target province, and Prev is set_province_flag = PG_trib_migr_start set_province_flag = PG_target_success } - } mig_dist_budget = { @@ -1145,8 +1016,8 @@ mig_dist_budget = { else_if = { limit = { province_distance = { who = PREV distance = 120 } } PREV = { set_variable = { which = PG_mig_budget value = 40 } } } else_if = { limit = { province_distance = { who = PREV distance = 50 } } PREV = { set_variable = { which = PG_mig_budget value = 20 } } } else_if = { PREV = { set_variable = { which = PG_mig_budget value = 10 } } } - } + mig_dist_budget1 = { if = { limit = { province_distance = { who = PREV distance = 1500 } } PREV = { set_variable = { which = PG_mig_budget1 value = 150 } } } else_if = { limit = { province_distance = { who = PREV distance = 1000 } } PREV = { set_variable = { which = PG_mig_budget1 value = 120 } } } @@ -1157,8 +1028,8 @@ mig_dist_budget1 = { else_if = { limit = { province_distance = { who = PREV distance = 120 } } PREV = { set_variable = { which = PG_mig_budget1 value = 40 } } } else_if = { limit = { province_distance = { who = PREV distance = 50 } } PREV = { set_variable = { which = PG_mig_budget1 value = 20 } } } else_if = { PREV = { set_variable = { which = PG_mig_budget1 value = 10 } } } - } + mig_dist_budget2 = { if = { limit = { province_distance = { who = PREV distance = 1500 } } PREV = { set_variable = { which = PG_mig_budget2 value = 150 } } } else_if = { limit = { province_distance = { who = PREV distance = 1000 } } PREV = { set_variable = { which = PG_mig_budget2 value = 120 } } } @@ -1169,10 +1040,8 @@ mig_dist_budget2 = { else_if = { limit = { province_distance = { who = PREV distance = 120 } } PREV = { set_variable = { which = PG_mig_budget2 value = 40 } } } else_if = { limit = { province_distance = { who = PREV distance = 50 } } PREV = { set_variable = { which = PG_mig_budget2 value = 20 } } } else_if = { PREV = { set_variable = { which = PG_mig_budget2 value = 10 } } } - } - mig_dist_cost = { if = { limit = { province_distance = { who = PREV distance = 1500 } } PREV = { owner = { add_treasury = -150 } } } else_if = { limit = { province_distance = { who = PREV distance = 1000 } } PREV = { owner = { add_treasury = -120 } } } @@ -1183,75 +1052,53 @@ mig_dist_cost = { else_if = { limit = { province_distance = { who = PREV distance = 120 } } PREV = { owner = { add_treasury = -40 } } } else_if = { limit = { province_distance = { who = PREV distance = 50 } } PREV = { owner = { add_treasury = -20 } } } else = { PREV = { owner = { add_treasury = -10 } } } - } # MIGRATION EFFECTS # I have divided them in several types. Basically which kind of pop comes (tribal or commoner), and their reason to leave (normal, refugees, expelled, etc). This depends on what will happen with the origin country. # Migration from tribal, "happy" (voluntary, with money/skills, with happy origin country) - - PG_migrate_tribal_happy = { # Origin province PREV = { - add_base_manpower = -$size$ change_variable = { PS_rur_emig = $size$ } + add_base_manpower = -$size$ + change_variable = { PS_rur_emig = $size$ } set_variable = { which = prov_id which = prov_id_base } } # Destination province if = { limit = { check_variable = { PG_com_grow = 120 } } add_base_production = $size$ - - } - else = { - add_base_manpower = $size$ - - } - set_variable = { which = prov_id which = PREV } set_variable = { which = PG_mig_trb_origin which = prov_id } + } else = { add_base_manpower = $size$ } + set_variable = { which = prov_id which = PREV } + set_variable = { which = PG_mig_trb_origin which = prov_id } set_variable = { which = prov_id which = prov_id_base } # Newcomer modifier, depending on culture and religion if = { - limit = { culture = PREV religion = PREV } + limit = { culture = PREV religion = PREV } add_province_modifier = { name = PG_migr_new_allsame duration = 730 } - } - else_if = { - limit = { culture_group = PREV religion = PREV } # no primary culture, but same culture group AND religion + } else_if = { + limit = { culture_group = PREV religion = PREV } # no primary culture, but same culture group AND religion add_province_modifier = { name = PG_migr_new_cultgroup duration = 730 } - # latent event, pending - } - else_if = { - limit = { culture_group = PREV NOT = { religion = PREV } } # culture group, but different religion + } else_if = { + limit = { culture_group = PREV NOT = { religion = PREV } } # culture group, but different religion add_province_modifier = { name = PG_migr_new_otherrelg duration = 730 } # latent event - } - else_if = { - limit = { - owner = { culture_group = event_target:PG_origin_prov } # newcomers are the same culture group as the destination owner - NOT = { culture_group = PREV } - } - + } else_if = { + limit = { owner = { culture_group = event_target:PG_origin_prov } } # newcomers are the same culture group as the destination owner add_province_modifier = { name = PG_migr_new_rulercult duration = 730 } # latent event - } - else_if = { - limit = { NOT = { culture_group = PREV } religion = PREV } # No culture group, but same religion - + } else_if = { + limit = { religion = PREV } # No culture group, but same religion add_province_modifier = { name = PG_migr_new_none_neutral duration = 730 } - # latent event - } - else_if = { - limit = { NOT = { culture_group = PREV } } # totally alien: no culture group nor religion + } else = { + # totally alien: no culture group nor religion random_list = { - 70 = { - add_province_modifier = { name = PG_migr_new_none_neutral duration = 730 } - } - 30 = { - add_province_modifier = { name = PG_migr_new_none_tension duration = 730 } - } + 70 = { add_province_modifier = { name = PG_migr_new_none_neutral duration = 730 } } + 30 = { add_province_modifier = { name = PG_migr_new_none_tension duration = 730 } } # latent event, tries to change culture } } @@ -1271,23 +1118,25 @@ PG_change_culture_attempt = { limit = { check_variable = { which = PG_cultconv_points which = PG_cultconv_denominator } } # if already >30%, capped set_variable = { which = PG_cultconv_points which = PG_cultconv_denominator } } - change_variable = { which = PG_cultconv_points which = PG_trb_migsize } subtract_variable = { PG_cultconv_points = 1 } + change_variable = { which = PG_cultconv_points which = PG_trb_migsize } + subtract_variable = { PG_cultconv_points = 1 } export_to_variable = { which = PG_cultconv_denominator value = development } # Final division, will determine the randomizer divide_variable = { which = PG_cultconv_points which = PG_cultconv_denominator } - if = { limit = { check_variable = { PG_cultconv_points = 0.8 } } PG_change_culture_random = { perc_chance = 80 } } - else_if = { limit = { check_variable = { PG_cultconv_points = 0.7 } } PG_change_culture_random = { perc_chance = 70 } } - else_if = { limit = { check_variable = { PG_cultconv_points = 0.6 } } PG_change_culture_random = { perc_chance = 60 } } - else_if = { limit = { check_variable = { PG_cultconv_points = 0.5 } } PG_change_culture_random = { perc_chance = 50 } } - else_if = { limit = { check_variable = { PG_cultconv_points = 0.4 } } PG_change_culture_random = { perc_chance = 40 } } - else_if = { limit = { check_variable = { PG_cultconv_points = 0.3 } } PG_change_culture_random = { perc_chance = 30 } } - else_if = { limit = { check_variable = { PG_cultconv_points = 0.2 } } PG_change_culture_random = { perc_chance = 20 } } - else_if = { limit = { check_variable = { PG_cultconv_points = 0.1 } } PG_change_culture_random = { perc_chance = 15 } } - else = { PG_change_culture_random = { perc_chance = 10 } } + if = { limit = { check_variable = { PG_cultconv_points = 0.8 } } PG_change_culture_random = { perc_chance = 80 } } + else_if = { limit = { check_variable = { PG_cultconv_points = 0.7 } } PG_change_culture_random = { perc_chance = 70 } } + else_if = { limit = { check_variable = { PG_cultconv_points = 0.6 } } PG_change_culture_random = { perc_chance = 60 } } + else_if = { limit = { check_variable = { PG_cultconv_points = 0.5 } } PG_change_culture_random = { perc_chance = 50 } } + else_if = { limit = { check_variable = { PG_cultconv_points = 0.4 } } PG_change_culture_random = { perc_chance = 40 } } + else_if = { limit = { check_variable = { PG_cultconv_points = 0.3 } } PG_change_culture_random = { perc_chance = 30 } } + else_if = { limit = { check_variable = { PG_cultconv_points = 0.2 } } PG_change_culture_random = { perc_chance = 20 } } + else_if = { limit = { check_variable = { PG_cultconv_points = 0.1 } } PG_change_culture_random = { perc_chance = 15 } } + else = { PG_change_culture_random = { perc_chance = 10 } } set_variable = { which = PG_cultconv_points value = 0 } set_variable = { which = PG_cultconv_denominator value = 0 } } + PG_change_culture_random = { random = { chance = $perc_chance$ @@ -1295,25 +1144,21 @@ PG_change_culture_random = { change_culture = PREV } } + PG_change_culture_def = { export_to_variable = { which = PG_previous_culture value = culture } # Stores previous culture in a variable, in case it fights back change_culture = $new_culture$ - } - PG_migrate_freedmen = { # Origin province - ROOT = { - subtract_variable = { freedmen_new = 10 } - } + ROOT = { subtract_variable = { freedmen_new = 10 } } # Destination province if = { limit = { check_variable = { PG_com_grow = 120 } } add_base_production = 1 change_variable = { PS_urb_imig = 1 } - } - else_if = { + } else_if = { limit = { check_variable = { PG_trb_grow = 120 } } # it should always fire, but who knows add_base_manpower = 1 change_variable = { PS_rur_imig = 1 } @@ -1321,10 +1166,8 @@ PG_migrate_freedmen = { # Newcomer modifier add_province_modifier = { name = PG_new_freedmen duration = 730 } - } - # to be done later: # Migration from tribal, "poor" (voluntary, but without money/skills) -> only go for Tribal jobs, even if common jobs are available. # They may settle in places where there is not enough growth (range 90% to 120%), will create discontent @@ -1338,12 +1181,15 @@ mig_rural_to_urban = { PREV = { subtract_variable = { which = mig_size value = $no$ } add_base_manpower = -$no$ change_variable = { PS_rur_emig = $no$ } - } # Destination province - add_base_production = $no$ add_province_modifier = { name = PG_new_pop duration = 365 } change_variable = { PS_urb_imig = $no$ } - set_variable = { which = PG_newpop value = $no$ } set_variable = { which = PG_provid which = PREV } - set_variable = { which = PG_idorigin which = PG_provid } set_variable = { which = PG_provid value = 0 } + add_base_production = $no$ + add_province_modifier = { name = PG_new_pop duration = 365 } + change_variable = { PS_urb_imig = $no$ } + set_variable = { which = PG_newpop value = $no$ } + set_variable = { which = PG_provid which = PREV } + set_variable = { which = PG_idorigin which = PG_provid } + set_variable = { which = PG_provid value = 0 } } mig_rural_to_rural = { @@ -1353,21 +1199,25 @@ mig_rural_to_rural = { add_base_manpower = -$no$ change_variable = { PS_rur_emig = $no$ } } # Destination province - add_base_manpower = $no$ add_province_modifier = { name = PG_new_pop duration = 365 } change_variable = { PS_rur_imig = $no$ } - set_variable = { which = PG_newpop value = $no$ } set_variable = { which = PG_provid which = PREV } - set_variable = { which = PG_idorigin which = PG_provid } set_variable = { which = PG_provid value = 0 } + add_base_manpower = $no$ + add_province_modifier = { name = PG_new_pop duration = 365 } + change_variable = { PS_rur_imig = $no$ } + set_variable = { which = PG_newpop value = $no$ } + set_variable = { which = PG_provid which = PREV } + set_variable = { which = PG_idorigin which = PG_provid } + set_variable = { which = PG_provid value = 0 } } PG_inland_navalsize = { # cleanup previous modifiers - if = { limit = { has_province_modifier = PG_navsize_16 } remove_province_modifier = PG_navsize_16 } - if = { limit = { has_province_modifier = PG_navsize_8 } remove_province_modifier = PG_navsize_8 } - if = { limit = { has_province_modifier = PG_navsize_4 } remove_province_modifier = PG_navsize_4 } - if = { limit = { has_province_modifier = PG_navsize_2 } remove_province_modifier = PG_navsize_2 } - if = { limit = { has_province_modifier = PG_navsize_1 } remove_province_modifier = PG_navsize_1 } - if = { limit = { has_province_modifier = PG_navsize_0.5 } remove_province_modifier = PG_navsize_0.5 } - if = { limit = { has_province_modifier = PG_navsize_0.25 } remove_province_modifier = PG_navsize_0.25 } - if = { limit = { has_province_modifier = PG_navsize_0.125 } remove_province_modifier = PG_navsize_0.125 } + remove_province_modifier = PG_navsize_16 + remove_province_modifier = PG_navsize_8 + remove_province_modifier = PG_navsize_4 + remove_province_modifier = PG_navsize_2 + remove_province_modifier = PG_navsize_1 + remove_province_modifier = PG_navsize_0.5 + remove_province_modifier = PG_navsize_0.25 + remove_province_modifier = PG_navsize_0.125 # calculate export_to_variable = { which = PG_nav value = base_manpower } multiply_variable = { PG_nav = 0.05 } @@ -1388,29 +1238,28 @@ PG_inland_navalsize = { if = { limit = { check_variable = { PG_nav = 0.25 } } PG_reduce_navalsize = { amt = 0.25 } } if = { limit = { check_variable = { PG_nav = 0.125 } } PG_reduce_navalsize = { amt = 0.125 } } set_variable = { which = PG_nav value = 0 } - } PG_riverport_navalsize = { # cleanup previous modifiers - if = { limit = { has_province_modifier = PG_riversize_16 } remove_province_modifier = PG_riversize_16 } - if = { limit = { has_province_modifier = PG_riversize_8 } remove_province_modifier = PG_riversize_8 } - if = { limit = { has_province_modifier = PG_riversize_4 } remove_province_modifier = PG_riversize_4 } - if = { limit = { has_province_modifier = PG_riversize_2 } remove_province_modifier = PG_riversize_2 } - if = { limit = { has_province_modifier = PG_riversize_1 } remove_province_modifier = PG_riversize_1 } - if = { limit = { has_province_modifier = PG_riversize_0.5 } remove_province_modifier = PG_riversize_0.5 } - if = { limit = { has_province_modifier = PG_riversize_0.25 } remove_province_modifier = PG_riversize_0.25 } - if = { limit = { has_province_modifier = PG_riversize_0.125 } remove_province_modifier = PG_riversize_0.125 } + remove_province_modifier = PG_riversize_16 + remove_province_modifier = PG_riversize_8 + remove_province_modifier = PG_riversize_4 + remove_province_modifier = PG_riversize_2 + remove_province_modifier = PG_riversize_1 + remove_province_modifier = PG_riversize_0.5 + remove_province_modifier = PG_riversize_0.25 + remove_province_modifier = PG_riversize_0.125 # calculate # different from before: buildings also affected. These buildings can't exist in-land, so no need to code it set_variable = { which = PG_nav value = 0 } - trigger_switch = { # Should be the same as in the common/buildings file + trigger_switch = { # Should be the same as in the common/buildings file on_trigger = has_building - small_harbor = { change_variable = { PG_nav = 2 } } - big_harbor = { change_variable = { PG_nav = 3 } } - harbor_district = { change_variable = { PG_nav = 4 } } + small_harbor = { change_variable = { PG_nav = 2 } } + big_harbor = { change_variable = { PG_nav = 3 } } + harbor_district = { change_variable = { PG_nav = 4 } } } #if = { limit = { province_has_center_of_trade_of_level = 3 } change_variable = { PG_nav = 5 } } # Same as in common/cot #else_if = { limit = { province_has_center_of_trade_of_level = 2 } change_variable = { PG_nav = 3 } } @@ -1425,7 +1274,9 @@ PG_riverport_navalsize = { # River port effect: -50% naval forcelimit multiply_variable = { PG_nav = 0.5 } - set_variable = { which = PG_tnav value = 0 } set_variable = { which = PG_cnav value = 0 } set_variable = { which = PG_unav value = 0 } + set_variable = { which = PG_tnav value = 0 } + set_variable = { which = PG_cnav value = 0 } + set_variable = { which = PG_unav value = 0 } # Now we have the amount of ships to be deducted if = { limit = { check_variable = { PG_nav = 16 } } PG_reduce_riversize = { amt = 16 } } @@ -1437,21 +1288,14 @@ PG_riverport_navalsize = { if = { limit = { check_variable = { PG_nav = 0.25 } } PG_reduce_riversize = { amt = 0.25 } } if = { limit = { check_variable = { PG_nav = 0.125 } } PG_reduce_riversize = { amt = 0.125 } } set_variable = { which = PG_nav value = 0 } - } - PG_reduce_navalsize = { subtract_variable = { which = PG_nav value = $amt$ } add_province_modifier = { name = PG_navsize_$amt$ duration = -1 hidden = yes } - } + PG_reduce_riversize = { subtract_variable = { which = PG_nav value = $amt$ } add_province_modifier = { name = PG_riversize_$amt$ duration = -1 hidden = yes } # Different modifier - -} - - - - +} \ No newline at end of file diff --git a/common/scripted_triggers/03_popgrowth_scripted_triggers.txt b/common/scripted_triggers/03_popgrowth_scripted_triggers.txt index fe6ad04139..29ece45457 100644 --- a/common/scripted_triggers/03_popgrowth_scripted_triggers.txt +++ b/common/scripted_triggers/03_popgrowth_scripted_triggers.txt @@ -1,4 +1,3 @@ - SD_trigger_recently_attacked = { OR = { has_province_modifier = SD_was_raided # raid: limited attack, without options @@ -7,11 +6,7 @@ SD_trigger_recently_attacked = { has_province_modifier = SD_was_enslaved # enslave: 20% income value, 10% devast, population enslaved has_province_modifier = SD_was_destroyed # destroy: 30% income value, 60% building destruction, 40% devastation, enslaved, x% refugees has_province_modifier = SD_was_delenda # delenda est: all of the above - } - - - } PG_any_prod_port_trade = { @@ -58,6 +53,7 @@ PG_any_prod_port_trade = { has_building = big_shipyard } } + PG_any_gov_tax_temple = { OR = { has_building = shrine @@ -75,7 +71,6 @@ PG_any_gov_tax_temple = { } } - PG_trigger_has_new_pop = { OR = { has_province_modifier = PG_migr_new_allsame diff --git a/events/migrations.txt b/events/migrations.txt index e2cf0c86bc..efbb0c56b4 100644 --- a/events/migrations.txt +++ b/events/migrations.txt @@ -52,12 +52,7 @@ province_event = { is_triggered_only = yes - trigger = { - base_manpower = 2 # does not let the last rural pop to leave, obviously - has_global_flag = popgrowth_running # to only affect if the popgrowth mechanic is active - NOT = { check_variable = { PG_trb_grow = 100 } } # negative growth, anything under 1.00 (100%) - NOT = { has_province_modifier = rural_pause } # condition that initial values are kept for 100 years - } + trigger = { } immediate = { hidden_effect = { @@ -83,8 +78,7 @@ province_event = { 20 = { multiply_variable = { PG_travel_range = 0.40 } } 10 = { multiply_variable = { PG_travel_range = 0.60 } } } - } - else = { + } else = { trigger_switch = { on_trigger = prosperity 99 = { multiply_variable = { PG_travel_range = 1.50 } } # will be able to travel further diff --git a/events/population_capacity.txt b/events/population_capacity.txt index 198135bad4..4c76679fb1 100644 --- a/events/population_capacity.txt +++ b/events/population_capacity.txt @@ -13,11 +13,9 @@ country_event = { # BI-YEARLY EVENT, UPDATES ESSENTIAL POPGROWTH VALUES picture = peasant_woman hidden = yes - is_triggered_only = yes # Happens ALWAYS, either having Popgrowth turned or on off. It does many other things + is_triggered_only = yes - trigger = { # Changed: affects only the human player. This trigger forces this - # ai = no - } + trigger = { } # Happens ALWAYS, either having Popgrowth turned or on off. It does many other things immediate = { hidden_effect = { @@ -30,7 +28,10 @@ country_event = { # BI-YEARLY EVENT, UPDATES ESSENTIAL POPGROWTH VALUES province_event = { id = population_capacity.4 } } # SS: Sieges and repairs - if = { limit = { has_building = building_ruins } SS_cleanup_old_ruins = yes } # checks if any is older than 5 years, deletes it + if = { + limit = { has_building = building_ruins } + SS_cleanup_old_ruins = yes # checks if any is older than 5 years, deletes it + } # Trade limits, update province economic output DE_update_goods = yes @@ -82,11 +83,9 @@ country_event = { trigger = { has_global_flag = popgrowth_initiated } country_event = { id = popgrowth_stats.1 } } - option = { name = "population_capacity.2.6" # Keep playing with vanilla mechanics trigger = { has_global_flag = popgrowth_vanilla } - } #option = { # name = "population_capacity.2.6" # Show menu for automated migration options and variables @@ -105,7 +104,6 @@ country_event = { trigger = { NOT = { has_global_flag = popgrowth_running } NOT = { has_global_flag = popgrowth_vanilla } - } } } @@ -119,9 +117,6 @@ province_event = { # PROVINCE INTERACTION MENU #hidden = yes #fire_only_once = yes - #mean_time_to_happen = { - # months = 2 - #} immediate = { hidden_effect = { export_to_variable = { which = PS_trb_now value = base_manpower } @@ -134,27 +129,22 @@ province_event = { # PROVINCE INTERACTION MENU option = { name = "population_capacity.3.1" # Show only detailed capacities in this province province_event = { id = population_capacity.5 } - } option = { name = "population_capacity.3.2" # Explain me the detailed Capacities, choose scope owner = { country_event = { id = popgrowth_stats.401 } } - } option = { name = "population_capacity.3.3" # Show population variations, only this province province_event = { id = popgrowth_stats.6 } - } option = { name = "population_capacity.3.4" # Show population variations, choose scope owner = { country_event = { id = popgrowth_stats.402 } } - } option = { name = "population_capacity.3.5" # Paint the map, based on this province owner = { country_event = { id = popgrowth_stats.5 } } - } option = { name = "population_capacity.3.6" # Add a new center of trade @@ -163,15 +153,11 @@ province_event = { # PROVINCE INTERACTION MENU base_production = 1 } province_event = { id = dyneconomy.1 } - } - option = { name = "population_capacity.3.99" # (nothing, close this) - } - } ###### @@ -180,14 +166,13 @@ province_event = { # PROVINCE INTERACTION MENU province_event = { id = population_capacity.4 # Population capacity heavily re-written. This is version 4, as of March 2022 title = "population_capacity.4.t" # v1 was Feb'19, v2 June'20, v3 (first in the public mod) Oct'21 - desc = "population_capacity.4.d" + desc = "population_capacity.4.d" # Optimized as of 3/6/2024 picture = peasant_woman hidden = yes is_triggered_only = yes # will fire after what may have changed the rural population, every two years - immediate = { # Remember that in the Popgrowth System, we start with the Rural / Urban divide, and then transform it into Tribal, Commoner and Upper population. This means that it could be that someone living in rural areas actually is working "as a commoner", because is exporting extra goods and is contributing to the state equally. @@ -555,46 +540,64 @@ province_event = { # Condition: having certain basic buildings will allow at least 1 commoner or 1 upper, if it's not there. Taken from tribal cap if = { - limit = { NOT = { check_variable = { PG_com_cap = 1 } } PG_any_prod_port_trade = yes } # scripted trigger, several buildings exist + limit = { + NOT = { check_variable = { PG_com_cap = 1 } } + PG_any_prod_port_trade = yes # scripted trigger, several buildings exist + } set_variable = { which = PG_com_now value = 1 } - subtract_variable = { which = PG_com_now which = PG_com_cap } subtract_variable = { which = PG_trb_cap which = PG_com_now } - change_variable = { which = PG_com_cap which = PG_com_now } set_variable = { which = PG_com_now value = 0 } + subtract_variable = { which = PG_com_now which = PG_com_cap } + subtract_variable = { which = PG_trb_cap which = PG_com_now } + change_variable = { which = PG_com_cap which = PG_com_now } + set_variable = { which = PG_com_now value = 0 } } if = { - limit = { NOT = { check_variable = { PG_upp_cap = 1 } } PG_any_gov_tax_temple = yes } # scripted trigger, several buildings exist + limit = { + NOT = { check_variable = { PG_upp_cap = 1 } } + PG_any_gov_tax_temple = yes # scripted trigger, several buildings exist + } set_variable = { which = PG_upp_now value = 1 } - subtract_variable = { which = PG_upp_now which = PG_upp_cap } subtract_variable = { which = PG_trb_cap which = PG_upp_now } - change_variable = { which = PG_upp_cap which = PG_upp_now } set_variable = { which = PG_upp_now value = 0 } + subtract_variable = { which = PG_upp_now which = PG_upp_cap } + subtract_variable = { which = PG_trb_cap which = PG_upp_now } + change_variable = { which = PG_upp_cap which = PG_upp_now } + set_variable = { which = PG_upp_now value = 0 } } # Condition: avoid having less than 1 tribal - if = { limit = { NOT = { check_variable = { PG_trb_cap = 1 } } } set_variable = { which = PG_trb_cap value = 1 } } # at least 1 tribal - + if = { + limit = { NOT = { check_variable = { PG_trb_cap = 1 } } } # at least 1 tribal + set_variable = { which = PG_trb_cap value = 1 } + } # Condition: if there is not enough upper capacity to get one, or not enough commoner cap, these are given back to other pops, like tribals. - set_variable = { which = PG_new_cap which = PG_com_cap } change_variable = { which = PG_new_cap which = PG_upp_cap } + set_variable = { which = PG_new_cap which = PG_com_cap } + change_variable = { which = PG_new_cap which = PG_upp_cap } if = { limit = { NOT = { check_variable = { PG_new_cap = 1 } } } # Sum of com + upp <1 set_province_flag = PG_move_all - } - else_if = { - limit = { NOT = { check_variable = { PG_upp_cap = 1 } } check_variable = { PG_new_cap = 1 } } # Com + upp = 1, but upp <1 - set_province_flag = PG_move_upp_com # Will move upper into commoner + } else_if = { + limit = { + NOT = { check_variable = { PG_upp_cap = 1 } } + check_variable = { PG_new_cap = 1 } # Com + upp = 1, but upp <1 + } + set_province_flag = PG_move_upp_com # Will move upper into commoner } if = { limit = { has_province_flag = PG_move_all } - set_variable = { which = PG_trb_old which = PG_trb_cap } set_variable = { which = PG_com_old which = PG_com_cap } + set_variable = { which = PG_trb_old which = PG_trb_cap } + set_variable = { which = PG_com_old which = PG_com_cap } set_variable = { which = PG_upp_old which = PG_upp_cap } - change_variable = { which = PG_trb_cap which = PG_com_cap } change_variable = { which = PG_trb_cap which = PG_upp_cap } - set_variable = { which = PG_com_cap value = 0 } set_variable = { which = PG_upp_cap value = 0 } - } - else_if = { + change_variable = { which = PG_trb_cap which = PG_com_cap } + change_variable = { which = PG_trb_cap which = PG_upp_cap } + set_variable = { which = PG_com_cap value = 0 } + set_variable = { which = PG_upp_cap value = 0 } + } else_if = { limit = { has_province_flag = PG_move_upp_com } set_variable = { which = PG_trb_old which = PG_trb_cap } set_variable = { which = PG_com_old which = PG_com_cap } set_variable = { which = PG_upp_old which = PG_upp_cap } - change_variable = { which = PG_com_cap which = PG_upp_cap } set_variable = { which = PG_upp_cap value = 0 } + change_variable = { which = PG_com_cap which = PG_upp_cap } + set_variable = { which = PG_upp_cap value = 0 } } ###################### @@ -607,9 +610,12 @@ province_event = { export_to_variable = { which = PG_trb_now value = base_manpower } export_to_variable = { which = PG_com_now value = base_production } export_to_variable = { which = PG_upp_now value = base_tax } - set_variable = { which = PG_tot_now which = PG_trb_now } change_variable = { which = PG_tot_now which = PG_com_now } # tot = total - change_variable = { which = PG_tot_now which = PG_upp_now } set_variable = { which = PG_tot_cap which = PG_trb_cap } - change_variable = { which = PG_tot_cap which = PG_com_cap } change_variable = { which = PG_tot_cap which = PG_upp_cap } + set_variable = { which = PG_tot_now which = PG_trb_now } + change_variable = { which = PG_tot_now which = PG_com_now } # tot = total + change_variable = { which = PG_tot_now which = PG_upp_now } + set_variable = { which = PG_tot_cap which = PG_trb_cap } + change_variable = { which = PG_tot_cap which = PG_com_cap } + change_variable = { which = PG_tot_cap which = PG_upp_cap } # Growths # avoid zero values @@ -635,7 +641,7 @@ province_event = { 60 = { PG_growth_modify_all = { trb = 0.35 com = 0.25 upp = 0.25 } } 40 = { PG_growth_modify_all = { trb = 0.60 com = 0.50 upp = 0.40 } } 20 = { PG_growth_modify_all = { trb = 0.75 com = 0.70 upp = 0.60 } } - 10 = { multiply_variable = { PG_upp_grow = 0.80 } } # Raised to 10, to avoid devastation from piracy + 10 = { multiply_variable = { PG_upp_grow = 0.80 } } # Raised to 10, to avoid devastation from piracy } trigger_switch = { on_trigger = prosperity @@ -658,7 +664,6 @@ province_event = { multiply_variable = { which = PG_com_grow which = PG_grow_extra } multiply_variable = { which = PG_upp_grow which = PG_grow_extra } - # MODIFIERS, country level # Country modifiers affect ADDITIVELY export_to_variable = { which = PG_grow_country value = modifier:development_cost who = owner } @@ -668,33 +673,41 @@ province_event = { change_variable = { which = PG_upp_grow which = PG_grow_country } - - ###################### # OTHER EFFECTS ###################### # check whether max capacity has increased and no further need for the "Pause" modifier (added at startup event, to avoid losing the initial population) - if = { limit = { check_variable = { which = PG_trb_cap which = PS_trb_init } } remove_province_modifier = rural_pause } - if = { limit = { check_variable = { which = PG_com_cap which = PS_urb_init } } remove_province_modifier = urban_pause } + if = { + limit = { check_variable = { which = PG_trb_cap which = PS_trb_init } } + remove_province_modifier = rural_pause + } + if = { + limit = { check_variable = { which = PG_com_cap which = PS_urb_init } } + remove_province_modifier = urban_pause + } # Find how much information is flowing to this province. Will allow for long-range migration PG_update_inforange = yes # If there was not enough capacity for upper or commoner, change the modifier. Otherwise, return to the old one if = { - limit = { OR = { has_province_flag = PG_move_all has_province_flag = PG_move_upp_com } } + limit = { + OR = { + has_province_flag = PG_move_all + has_province_flag = PG_move_upp_com + } + } remove_province_modifier = popgrowth_viewer add_permanent_province_modifier = { name = popgrowth_viewer2 duration = -1 } - } - else_if = { + } else_if = { limit = { has_province_modifier = popgrowth_viewer2 } remove_province_modifier = popgrowth_viewer2 add_permanent_province_modifier = { name = popgrowth_viewer duration = -1 } } # Update naval forcelimit nerfs, in inland and river ports - if = { limit = { has_port = no } PG_inland_navalsize = yes } - else_if = { limit = { has_port = yes has_province_flag = PG_river_port } PG_riverport_navalsize = yes } + if = { limit = { has_port = no } PG_inland_navalsize = yes } + else_if = { limit = { has_port = yes has_province_flag = PG_river_port } PG_riverport_navalsize = yes } # Clean variables to be good-looking (/100 for rounding; x100 for percentages) @@ -1344,8 +1357,6 @@ province_event = { } - - province_event = { # POP CAPACITY, EXPERIMENTAL THINGS id = population_capacity.99 title = "population_capacity.99.t" @@ -1355,9 +1366,6 @@ province_event = { # POP CAPACITY, EXPERIMENTAL THINGS #hidden = yes #fire_only_once = yes - #mean_time_to_happen = { - # months = 2 - #} immediate = { export_to_variable = { which = PG_nav value = base_manpower } multiply_variable = { PG_nav = 0.05 } export_to_variable = { which = PG_cnav value = base_production } multiply_variable = { PG_cnav = 0.10 } @@ -1432,8 +1440,4 @@ province_event = { # POP CAPACITY, EXPERIMENTAL THINGS } -} - - - - +} \ No newline at end of file diff --git a/events/population_grow.txt b/events/population_grow.txt index c1ac63c698..147a720fb3 100644 --- a/events/population_grow.txt +++ b/events/population_grow.txt @@ -126,9 +126,7 @@ country_event = { } } } - 1 = { - province_event = { id = population_grow.1 } - } + 1 = { province_event = { id = population_grow.1 } } } } if = { @@ -239,9 +237,7 @@ country_event = { } } } - 1 = { - province_event = { id = population_grow.2 } - } + 1 = { province_event = { id = population_grow.2 } } } } if = { @@ -352,9 +348,7 @@ country_event = { } } } - 1 = { - province_event = { id = population_grow.3 } - } + 1 = { province_event = { id = population_grow.3 } } } } } @@ -372,15 +366,10 @@ province_event = { is_triggered_only = yes - trigger = { - base_manpower = 1 - has_global_flag = popgrowth_vanilla # vanilla = not using Popgrowth. It will also be tracked, with "PVS" pop vanilla statistics - } - + trigger = { } - ####################################################### immediate = { - export_to_variable = { variable_name = tribal_pop_grow value = trigger_value:base_manpower } + export_to_variable = { which = tribal_pop_grow value = trigger_value:base_manpower } multiply_variable = { tribal_pop_grow = 0.25 } change_variable = { which = tribal_pop which = tribal_pop_grow } @@ -398,12 +387,13 @@ province_event = { } } } - ####################################################### + option = { name = "province_development.1.a" } } + ######################################################################################## # yearly grow - commoner population ######################################################################################## @@ -416,22 +406,15 @@ province_event = { is_triggered_only = yes - trigger = { - base_production = 1 - has_global_flag = popgrowth_vanilla - } - + trigger = { } - ####################################################### immediate = { - export_to_variable = { variable_name = commoner_pop_grow value = trigger_value:base_production } + export_to_variable = { which = commoner_pop_grow value = trigger_value:base_production } multiply_variable = { which = commoner_pop_grow value = 0.25 } change_variable = { which = commoner_pop which = commoner_pop_grow } while = { - limit = { - check_variable = { which = commoner_pop value = 2 } - } + limit = { check_variable = { which = commoner_pop value = 2 } } set_variable = { which = commoner_pop value = 0 } set_variable = { which = commoner_pop_grow value = 0 } add_base_production = 1 @@ -444,12 +427,13 @@ province_event = { } } } - ####################################################### + option = { name = "province_development.1.a" } } + ######################################################################################## # yearly grow - upper population ######################################################################################## @@ -462,14 +446,10 @@ province_event = { is_triggered_only = yes - trigger = { - base_tax = 1 - has_global_flag = popgrowth_vanilla - } + trigger = { } - ####################################################### immediate = { - export_to_variable = { variable_name = upper_pop_grow value = trigger_value:base_tax } + export_to_variable = { which = upper_pop_grow value = trigger_value:base_tax } multiply_variable = { upper_pop_grow = 0.25 } change_variable = { which = upper_pop which = upper_pop_grow } @@ -487,17 +467,15 @@ province_event = { } } } - ####################################################### + option = { name = "province_development.1.a" - } } -#### +######################################################################################## # POPULATION GROWTH EVENT - POPGROWTH MECHANICS VERSION -#### - +######################################################################################## country_event = { id = population_grow.104 title = "population_grow.4.t" @@ -526,64 +504,65 @@ country_event = { modifier = { factor = 0.2 # Needs a kickstart for those at only 1 tribal. Starting at 2.0 growth + NOT = { base_manpower = 2 } check_variable = { PG_trb_grow = 200 } - base_manpower = 1 NOT = { base_manpower = 2 } } modifier = { factor = 0.95 # base value, almost untouched. Similar to modern age Europe (late 1600s) - check_variable = { PG_trb_grow = 100 } NOT = { check_variable = { PG_trb_grow = 130 } } + NOT = { check_variable = { PG_trb_grow = 130 } } } modifier = { factor = 0.65 # 0.85% yearly, early 19th Century France (slow demographic explosion). // check: 1/(8*360/12*0.65) = 0.641% - check_variable = { PG_trb_grow = 130 } NOT = { check_variable = { PG_trb_grow = 160 } } + check_variable = { PG_trb_grow = 130 } + NOT = { check_variable = { PG_trb_grow = 160 } } } modifier = { factor = 0.4 # 1,35%, 1890s UK (demographic explosion) - check_variable = { PG_trb_grow = 160 } NOT = { check_variable = { PG_trb_grow = 200 } } + check_variable = { PG_trb_grow = 160 } + NOT = { check_variable = { PG_trb_grow = 200 } } } modifier = { factor = 0.2 # 2,7%, usual growth of India 1970s - check_variable = { PG_trb_grow = 200 } NOT = { check_variable = { PG_trb_grow = 500 } } + check_variable = { PG_trb_grow = 200 } + NOT = { check_variable = { PG_trb_grow = 500 } } } modifier = { factor = 0.1 # 5,5% yearly growth, based in sub-saharan africa 1990s, or Ireland before the potato pandemic. Doubles every 24 years check_variable = { PG_trb_grow = 500 } - } } - 1 = { - province_event = { id = population_grow.4 } - } + 1 = { province_event = { id = population_grow.4 } } } } if = { - limit = { check_variable = { PG_com_grow = 100 } } + limit = { check_variable = { PG_com_grow = 100 } } random_list = { 44 = { modifier = { factor = 0.95 # base value, almost untouched. Similar to modern age Europe (late 1600s) - check_variable = { PG_com_grow = 100 } NOT = { check_variable = { PG_com_grow = 130 } } + NOT = { check_variable = { PG_com_grow = 130 } } } modifier = { factor = 0.65 # 0.6%, early 19th Century France - check_variable = { PG_com_grow = 130 } NOT = { check_variable = { PG_com_grow = 160 } } + check_variable = { PG_com_grow = 130 } + NOT = { check_variable = { PG_com_grow = 160 } } } modifier = { factor = 0.4 # 1%, 1890s UK - check_variable = { PG_com_grow = 160 } NOT = { check_variable = { PG_com_grow = 200 } } + check_variable = { PG_com_grow = 160 } + NOT = { check_variable = { PG_com_grow = 200 } } } modifier = { factor = 0.2 # 2%, usual growth of India 1970s - check_variable = { PG_com_grow = 200 } NOT = { check_variable = { PG_com_grow = 500 } } + check_variable = { PG_com_grow = 200 } + NOT = { check_variable = { PG_com_grow = 500 } } } modifier = { factor = 0.1 # 4% yearly growth, based in sub-saharan africa 1990s, or Ireland before the potato pandemic check_variable = { PG_com_grow = 500 } } } - 1 = { - province_event = { id = population_grow.2 } - } + 1 = { province_event = { id = population_grow.2 } } } } } @@ -599,12 +578,7 @@ province_event = { is_triggered_only = yes - trigger = { - base_manpower = 1 - has_global_flag = popgrowth_running # event population_capacity.2, the Popgrowth menu. Allows to switch btw popgrowth and vanilla - check_variable = { PG_trb_grow = 100 } # Added, since it seems growth was getting out of hand even adding a factor 30 to <0.8 - - } + trigger = { } ####################################################### # How this works: every time this event fires (remember, base mtth is 60 years), the amount of rural population is added to the "counter". Once the counter reaches 6, a new pop is created and the previous counter resetted to zero. @@ -618,18 +592,25 @@ province_event = { if = { limit = { check_variable = { PG_trib_counter = 6 } } - set_variable = { which = PG_trib_counter value = 0 } set_variable = { which = PG_trib_count value = 0 } - add_base_manpower = 1 change_variable = { PS_rur_grow = 1 } # track total done - owner = { if = { limit = { ai = no } change_variable = { tribal_increased_var = 1 } } } + set_variable = { which = PG_trib_counter value = 0 } + set_variable = { which = PG_trib_count value = 0 } + add_base_manpower = 1 + change_variable = { PS_rur_grow = 1 } # track total done + owner = { + if = { + limit = { ai = no } + change_variable = { tribal_increased_var = 1 } + } + } province_event = { id = population_capacity.4 } # Recalculate capacity, once the new population is created (growth also rec'd) } } - ####################################################### + option = { name = "population_grow.4.a" - } } + ######################################################################################## # yearly grow - commoner population / POPGROWTH VERSION ######################################################################################## @@ -642,13 +623,8 @@ province_event = { is_triggered_only = yes - trigger = { - #base_production = 1 # no need, any province may grow it - has_global_flag = popgrowth_running - check_variable = { PG_com_grow = 100 } - } + trigger = { } - ####################################################### immediate = { export_to_variable = { which = PG_com_growth value = base_production } if = { @@ -659,13 +635,20 @@ province_event = { if = { limit = { check_variable = { PG_com_counter = 4 } } - set_variable = { which = PG_com_counter value = 0 } set_variable = { which = PG_com_growth value = 0 } - add_base_production = 1 change_variable = { PS_urb_grow = 1 } - owner = { if = { limit = { ai = no } change_variable = { commoner_increased_var = 1 } } } + set_variable = { which = PG_com_counter value = 0 } + set_variable = { which = PG_com_growth value = 0 } + add_base_production = 1 + change_variable = { PS_urb_grow = 1 } + owner = { + if = { + limit = { ai = no } + change_variable = { commoner_increased_var = 1 } + } + } province_event = { id = population_capacity.4 } } } - ####################################################### + option = { name = "population_grow.5.a" diff --git a/events/population_upgrade.txt b/events/population_upgrade.txt index 8f15eeb147..6f2a9684cd 100644 --- a/events/population_upgrade.txt +++ b/events/population_upgrade.txt @@ -110,9 +110,7 @@ country_event = { NOT = { base_manpower = 8 } } } - 1 = { - province_event = { id = population_upgrade.1 } - } + 1 = { province_event = { id = population_upgrade.1 } } } } if = { @@ -128,54 +126,63 @@ country_event = { ##### NEGATIVE modifier = { factor = 0.9 - OR = { has_climate = arid has_climate = tropical } + OR = { + has_climate = arid + has_climate = tropical + } } modifier = { factor = 0.9 - devastation = 5 NOT = { devastation = 10 } + devastation = 5 + NOT = { devastation = 10 } } modifier = { factor = 0.8 - devastation = 10 NOT = { devastation = 15 } + devastation = 10 + NOT = { devastation = 15 } } modifier = { factor = 0.7 - devastation = 15 NOT = { devastation = 20 } + devastation = 15 + NOT = { devastation = 20 } } modifier = { factor = 0.6 - devastation = 20 NOT = { devastation = 25 } + devastation = 20 + NOT = { devastation = 25 } } modifier = { factor = 0.5 - devastation = 25 NOT = { devastation = 30 } + devastation = 25 + NOT = { devastation = 30 } } modifier = { factor = 0.4 - devastation = 30 NOT = { devastation = 35 } + devastation = 30 + NOT = { devastation = 35 } } modifier = { factor = 0.35 - devastation = 35 NOT = { devastation = 40 } + devastation = 35 + NOT = { devastation = 40 } } modifier = { factor = 0.3 - devastation = 40 NOT = { devastation = 50 } + devastation = 40 + NOT = { devastation = 50 } } modifier = { factor = 0.25 devastation = 50 } } - 1 = { - province_event = { id = population_upgrade.2 } - } + 1 = { province_event = { id = population_upgrade.2 } } } } if = { limit = { - base_production = 2 NOT = { devastation = 1 } + base_production = 2 } random_list = { 5 = { @@ -207,17 +214,17 @@ country_event = { } modifier = { factor = 0.95 - prosperity = 25 + prosperity = 25 NOT = { prosperity = 50 } } modifier = { factor = 0.9 - prosperity = 50 + prosperity = 50 NOT = { prosperity = 75 } } modifier = { factor = 0.85 - prosperity = 75 + prosperity = 75 NOT = { prosperity = 99 } } modifier = { @@ -290,14 +297,13 @@ country_event = { } } } - 1 = { - province_event = { id = population_grow.3 } - } + 1 = { province_event = { id = population_grow.3 } } } } } } } + ######################################################################################## # rank up - tribal population ######################################################################################## @@ -310,21 +316,13 @@ province_event = { is_triggered_only = yes - trigger = { - base_manpower = 3 - NOT = { devastation = 1 } - NOT = { has_global_flag = popgrowth_running } - } + trigger = { } - ####################################################### immediate = { - change_variable = { which = pop_upgrade_rate value = 15 } while = { - limit = { - check_variable = { which = pop_upgrade_rate value = 100 } - } + limit = { check_variable = { which = pop_upgrade_rate value = 100 } } set_variable = { which = pop_upgrade_rate value = 0 } if = { @@ -353,12 +351,13 @@ province_event = { } } } - ####################################################### + option = { name = "province_development.1.a" } } + ######################################################################################## # rank down - tribal population ######################################################################################## @@ -371,24 +370,13 @@ province_event = { is_triggered_only = yes - trigger = { - devastation = 1 - OR = { - base_production = 2 - base_tax = 2 - } - NOT = { has_global_flag = popgrowth_running } - } + trigger = { } - ####################################################### immediate = { - change_variable = { which = pop_upgrade_rate value = -15 } while = { - limit = { - NOT = { check_variable = { which = pop_upgrade_rate value = -100 } } - } + limit = { NOT = { check_variable = { which = pop_upgrade_rate value = -100 } } } set_variable = { which = pop_upgrade_rate value = 0 } if = { @@ -417,12 +405,13 @@ province_event = { } } } - ####################################################### + option = { name = "province_development.1.a" } } + ######################################################################################## # rank up - commoner population ######################################################################################## @@ -435,31 +424,14 @@ province_event = { is_triggered_only = yes - trigger = { - base_production = 2 - NOT = { devastation = 1 } - NOT = { has_global_flag = popgrowth_running } - } - - - mean_time_to_happen = { - months = 360 - - - } - + trigger = { } - ####################################################### immediate = { - change_variable = { which = c_pop_upgrade_rate value = 15 } while = { - limit = { - check_variable = { which = c_pop_upgrade_rate value = 100 } - } + limit = { check_variable = { which = c_pop_upgrade_rate value = 100 } } set_variable = { which = c_pop_upgrade_rate value = 0 } - add_base_production = -1 add_base_tax = 1 change_variable = { PVS_urb_upp = 1 } @@ -472,16 +444,16 @@ province_event = { } } - ####################################################### + option = { name = "province_development.1.a" } } -#### +######################################################################################## # POPGROWTH UPGRADE EVENTS - alternate version of population growth. See Population Capacity events -#### +######################################################################################## country_event = { id = population_upgrade.104 @@ -502,7 +474,6 @@ country_event = { if = { limit = { base_manpower = 2 - has_global_flag = popgrowth_running check_variable = { which = PG_com_grow value = 100 } } random_list = { @@ -527,11 +498,11 @@ country_event = { } if = { limit = { + NOT = { has_province_modifier = urban_pause } # to avoid going lower than starting value OR = { AND = { NOT = { check_variable = { PG_com_grow = 100 } } base_production = 2 } AND = { NOT = { check_variable = { PG_upp_grow = 100 } } base_tax = 2 } } - NOT = { has_province_modifier = urban_pause } # to avoid going lower than starting value } random_list = { 19 = { @@ -575,6 +546,7 @@ country_event = { } } } + ######################################################################################## # POPGROWTH: rank up (promotion) - tribal to commoner population ######################################################################################## @@ -587,13 +559,8 @@ province_event = { is_triggered_only = yes - trigger = { - base_manpower = 2 - has_global_flag = popgrowth_running - check_variable = { which = PG_com_grow value = 100 } - } + trigger = { } - ####################################################### immediate = { change_variable = { pop_upgrade_rate = 34 } # needs only three increments if = { @@ -601,18 +568,27 @@ province_event = { set_variable = { which = pop_upgrade_rate value = 0 } if = { limit = { base_manpower = 2 } - add_base_manpower = -1 add_base_production = 1 change_variable = { PS_urb_prom = 1 } change_variable = { PS_rur_goup = 1 } - owner = { if = { limit = { ai = no } change_variable = { which = tribal_to_commoner_var value = 1 } } } + add_base_manpower = -1 + add_base_production = 1 + change_variable = { PS_urb_prom = 1 } + change_variable = { PS_rur_goup = 1 } + owner = { + if = { + limit = { ai = no } + change_variable = { which = tribal_to_commoner_var value = 1 } + } + } } province_event = { id = population_capacity.4 } } } - ####################################################### + option = { name = "province_development.1.a" } } + ######################################################################################## # POPGROWTH: rank down (demotion) - both pops: first Upper to Commoner, if not then Commoner to Tribal ######################################################################################## @@ -625,18 +601,9 @@ province_event = { is_triggered_only = yes - trigger = { - OR = { - AND = { NOT = { check_variable = { PG_com_grow = 100 } } base_production = 2 } - AND = { NOT = { check_variable = { PG_upp_grow = 100 } } base_tax = 2 } - } - has_global_flag = popgrowth_running - NOT = { has_province_modifier = urban_pause } # to avoid going lower than starting value - } + trigger = { } - ####################################################### immediate = { - change_variable = { pop_upgrade_rate = -34 } if = { @@ -644,24 +611,43 @@ province_event = { set_variable = { which = pop_upgrade_rate value = 0 } if = { - limit = { base_tax = 2 NOT = { check_variable = { PG_upp_grow = 1 } } } - add_base_production = 1 add_base_tax = -1 change_variable = { PS_urb_dem = 1 } change_variable = { PS_upp_down = 1 } - owner = { if = { limit = { ai = no } change_variable = { uppers_to_commoner_var = 1 } } } - } - else_if = { + limit = { + base_tax = 2 + NOT = { check_variable = { PG_upp_grow = 1 } } + } + add_base_production = 1 + add_base_tax = -1 + change_variable = { PS_urb_dem = 1 } + change_variable = { PS_upp_down = 1 } + owner = { + if = { + limit = { ai = no } + change_variable = { uppers_to_commoner_var = 1 } + } + } + } else_if = { limit = { base_production = 2 } - add_base_manpower = 1 add_base_production = -1 change_variable = { PS_rur_dem = 1 } change_variable = { PS_urb_down = 1 } - owner = { if = { limit = { ai = no } change_variable = { commoner_to_tribal_var = 1 } } } + add_base_manpower = 1 + add_base_production = -1 + change_variable = { PS_rur_dem = 1 } + change_variable = { PS_urb_down = 1 } + owner = { + if = { + limit = { ai = no } + change_variable = { commoner_to_tribal_var = 1 } + } + } } province_event = { id = population_capacity.4 } } } - ####################################################### + option = { name = "province_development.1.a" } } + ######################################################################################## # POPGROWTH: rank up - commoner population to Upper population ######################################################################################## @@ -674,30 +660,27 @@ province_event = { is_triggered_only = yes - trigger = { - base_production = 2 - has_global_flag = popgrowth_running - check_variable = { which = PG_upp_grow value = 100 } - } - - - mean_time_to_happen = { - months = 360 - - } + trigger = { } - ####################################################### immediate = { change_variable = { c_pop_upgrade_rate = 34 } if = { limit = { check_variable = { c_pop_upgrade_rate = 100 } } set_variable = { which = c_pop_upgrade_rate value = 0 } - add_base_production = -1 add_base_tax = 1 change_variable = { PS_upp_prom = 1 } change_variable = { PS_urb_goup = 1 } - owner = { if = { limit = { ai = no } change_variable = { commoner_to_upper_var = 1 } } } + add_base_production = -1 + add_base_tax = 1 + change_variable = { PS_upp_prom = 1 } + change_variable = { PS_urb_goup = 1 } + owner = { + if = { + limit = { ai = no } + change_variable = { commoner_to_upper_var = 1 } + } + } province_event = { id = population_capacity.4 } } } - ####################################################### + option = { name = "province_development.1.a"