# Author(s): AngriestBird save_pp_for_laws = { allowed = { ai_for_units_is_not_disabled = yes } enable = { count_triggers = { amount = 2 has_country_flag = AI_economic_downspiral check_variable = { interest_rate > 10 } NOT = { OR = { has_idea = economic_boom has_idea = fast_growth has_idea = stable_growth } } NOT = { OR = { has_idea = corruption_level_02 has_idea = corruption_level_01 } } } } abort_when_not_enabled = yes ai_strategy = { type = pp_spend_priority id = relation value = -9999 } ai_strategy = { type = pp_spend_priority id = guarantee value = -9999 } ai_strategy = { type = pp_spend_priority id = general value = -9999 } ai_strategy = { type = pp_spend_priority id = admiral value = -9999 } ai_strategy = { type = pp_spend_priority id = decision value = -2000 } ai_strategy = { type = pp_spend_priority id = idea value = 2500 } #Focus on Editing LAWS ai_strategy = { type = pp_spend_amount id = idea value = 500 } } save_pp_for_laws_early = { allowed = { ai_for_units_is_not_disabled = yes } enable = { ai_has_moderate_economic_problems = yes NOT = { OR = { has_idea = economic_boom has_idea = fast_growth } } } abort_when_not_enabled = yes ai_strategy = { type = pp_spend_priority id = relation value = -9999 } ai_strategy = { type = pp_spend_priority id = guarantee value = -9999 } ai_strategy = { type = pp_spend_priority id = general value = -9999 } ai_strategy = { type = pp_spend_priority id = admiral value = -9999 } ai_strategy = { type = pp_spend_priority id = decision value = -500 } ai_strategy = { type = pp_spend_priority id = idea value = 2500 } ai_strategy = { type = pp_spend_amount id = idea value = 500 } } default_military_ratio_to_civvies = { allowed = { ai_for_units_is_not_disabled = yes } enable = { has_war = no threat < 0.30 NOT = { has_government = fascism } NOT = { any_of_scopes = { array = ROOT.potential_and_current_enemies OR = { is_justifying_wargoal_against = ROOT has_wargoal_against = ROOT } } } } abort_when_not_enabled = yes ai_strategy = { type = added_military_to_civilian_factory_ratio value = -20 } } ##Military Factories Reducers minor_production_of_factories = { allowed = { ai_for_units_is_not_disabled = yes NOT = { OR = { tag = USA tag = CHI tag = FRA tag = ITA tag = RAJ } } } enable = { OR = { has_idea = minor_power has_idea = non_power } } abort_when_not_enabled = yes ai_strategy = { type = building_target id = industrial_complex value = 50 } } major_production_of_factories1 = { allowed = { ai_for_units_is_not_disabled = yes NOT = { OR = { tag = USA tag = CHI tag = FRA tag = ITA tag = RAJ } } } enable = { OR = { has_idea = regional_power has_idea = large_power } } abort_when_not_enabled = yes ai_strategy = { type = building_target id = industrial_complex value = 10 } } major_production_of_factories2 = { allowed = { ai_for_units_is_not_disabled = yes NOT = { OR = { tag = USA tag = CHI tag = FRA tag = ITA tag = RAJ } } } enable = { has_idea = great_power } abort_when_not_enabled = yes ai_strategy = { type = building_target id = industrial_complex value = 12 } } major_production_of_factories3 = { allowed = { ai_for_units_is_not_disabled = yes NOT = { OR = { tag = USA tag = CHI tag = FRA tag = ITA tag = RAJ } } } enable = { has_idea = super_power } abort_when_not_enabled = yes ai_strategy = { type = building_target id = industrial_complex value = 15 } } minor_military_factories = { allowed = { ai_for_units_is_not_disabled = yes NOT = { OR = { #BRICS tag = SOV tag = CHI tag = BRA tag = SAF tag = RAJ #G7 tag = GER tag = FRA tag = ITA tag = CAN tag = USA tag = ITA tag = JAP } } } enable = { has_war = yes num_of_military_factories < 8 } abort_when_not_enabled = yes ai_strategy = { type = building_target id = arms_factory value = 8 } } #AI fix construction AI_production_of_factories_Russia = { allowed = { original_tag = SOV } enable = { date < 2004.1.1 } abort_when_not_enabled = yes ai_strategy = { type = building_target id = industrial_complex value = 15 } } AI_minor_military_factories = { allowed = { ai_for_units_is_not_disabled = yes NOT = { OR = { #BRICS tag = SOV tag = CHI tag = BRA tag = SAF tag = RAJ #G7 tag = GER tag = FRA tag = ITA tag = CAN tag = USA tag = ITA tag = JAP } } } enable = { has_war = no num_of_civilian_factories > 3 num_of_military_factories < 1 } abort_when_not_enabled = yes ai_strategy = { type = building_target id = arms_factory value = 1 } } AI_major_military_factories = { allowed = { ai_for_units_is_not_disabled = yes OR = { #BRICS #tag = SOV tag = CHI tag = BRA tag = SAF tag = RAJ #G7 tag = GER tag = FRA tag = ITA tag = CAN tag = USA tag = ITA tag = JAP } } enable = { has_war = no num_of_civilian_factories > 100 num_of_military_factories < 35 } abort_when_not_enabled = yes ai_strategy = { type = building_target id = arms_factory value = 35 } } AI_major_military_factories2 = { allowed = { ai_for_units_is_not_disabled = yes NOT = { OR = { tag = USA tag = CHI tag = FRA tag = ITA } } } enable = { has_war = yes num_of_military_factories < 8 } abort_when_not_enabled = yes ai_strategy = { type = building_target id = arms_factory value = 8 } } AI_military_factories_Russia = { allowed = { tag = SOV } enable = { has_war = no num_of_civilian_factories > 100 num_of_military_factories < 35 date > 2004.1.1 } abort_when_not_enabled = yes ai_strategy = { type = building_target id = arms_factory value = 35 } } AI_military_factories_India = { allowed = { tag = RAJ } enable = { num_of_civilian_factories > 120 num_of_military_factories < 100 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = arms_factory value = 15 } } AI_military_factories_China = { allowed = { tag = CHI } enable = { num_of_military_factories < 60 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = arms_factory value = 4 } } AI_military_factories_China2 = { allowed = { tag = CHI } enable = { num_of_military_factories < 100 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = arms_factory value = 2 } } AI_ratio_military = { allowed = { ai_for_units_is_not_disabled = yes } enable = { num_of_military_factories > 8 NOT = { ai_is_threatened = yes } } abort_when_not_enabled = yes ai_strategy = { type = added_military_to_civilian_factory_ratio value = -25 } } AI_block_ratio_military2 = { allowed = { ai_for_units_is_not_disabled = yes NOT = { tag = CHI } } enable = { num_of_military_factories > 200 } abort_when_not_enabled = yes ai_strategy = { type = added_military_to_civilian_factory_ratio value = -50 } } AI_block_ratio_military_china = { allowed = { tag = CHI } enable = { num_of_military_factories < 100 } abort_when_not_enabled = yes ai_strategy = { type = added_military_to_civilian_factory_ratio value = 40 } # } AI_block_ratio_military_china2 = { allowed = { tag = CHI } enable = { num_of_civilian_factories > 150 num_of_military_factories < 200 num_of_military_factories > 100 } abort_when_not_enabled = yes ai_strategy = { type = added_military_to_civilian_factory_ratio value = 20 } #A positive value means more military factories. } AI_ratio_military_india = { allowed = { tag = RAJ } enable = { num_of_available_civilian_factories > 120 num_of_military_factories < 100 } abort_when_not_enabled = yes ai_strategy = { type = added_military_to_civilian_factory_ratio value = 50 } } AI_generic_office_construction = { allowed = { ai_for_units_is_not_disabled = yes } enable = { has_war = no num_of_civilian_factories > 40 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = offices value = 1 } } AI_generic_office_construction_sup = { allowed = { OR = { tag = CHI tag = BRA tag = SAF tag = RAJ #G7 tag = GER tag = FRA tag = ITA tag = CAN tag = USA tag = JAP } } enable = { has_war = no num_of_civilian_factories > 180 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = offices value = 10 } } AI_generic_office_construction2_SOV = { allowed = { original_tag = SOV } enable = { has_war = no num_of_civilian_factories > 60 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = offices value = 3 } } AI_generic_office_construction3_SOV = { allowed = { original_tag = SOV } enable = { has_war = no num_of_civilian_factories > 100 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = offices value = 10 } } AI_minor_production_of_dockyard = { allowed = { ai_for_units_is_not_disabled = yes NOT = { OR = { tag = TRK tag = KAZ tag = UZB tag = AZE tag = TAJ tag = AFG tag = TAL } } } enable = { num_of_available_civilian_factories > 10 } abort_when_not_enabled = yes ai_strategy = { type = building_target id = dockyard value = 1 } } AI_major_production_of_dockyard = { allowed = { OR = { #BRICS tag = SOV tag = CHI tag = BRA tag = SAF tag = RAJ #G7 tag = GER tag = FRA tag = ITA tag = CAN tag = USA tag = JAP } } enable = { num_of_civilian_factories < 80 } abort_when_not_enabled = yes ai_strategy = { type = building_target id = dockyard value = 8 } } AI_major_production_of_dockyard2 = { allowed = { OR = { #BRICS tag = SOV tag = CHI tag = BRA tag = SAF tag = RAJ #G7 tag = GER tag = FRA tag = ITA tag = CAN tag = USA tag = JAP } } enable = { num_of_civilian_factories < 150 } abort_when_not_enabled = yes ai_strategy = { type = building_target id = dockyard value = 17 } } AI_idea_focus = { allowed = { ai_for_units_is_not_disabled = yes } enable = { check_variable = { treasury_rate > 5.00 } NOT = { OR = { has_idea = social_06 has_idea = health_06 has_idea = edu_05 } } } abort_when_not_enabled = yes ai_strategy = { type = pp_spend_priority id = idea value = 5000 } } # Energy AI AI_fuel_power_plant_focuses = { allowed = { ai_for_units_is_not_disabled = yes } enable = { has_an_energy_deficit = yes } abort_when_not_enabled = yes ai_strategy = { type = build_building id = fossil_powerplant value = 200 } } AI_build_fuel_silos = { allowed = { ai_for_units_is_not_disabled = yes } enable = { has_fuel < 1000000 date > 2005.1.1 } abort_when_not_enabled = yes ai_strategy = { type = building_target id = fuel_silo value = 50 } } AI_build_nuclear_reactors = { allowed = { ai_for_units_is_not_disabled = yes } enable = { date < 2008.1.1 has_tech = reactor1 check_variable = { nuclear_reactors < 5 } has_enrichment_facilities = yes } abort_when_not_enabled = yes ai_strategy = { type = building_target id = nuclear_reactor value = 5 } } AI_build_nuclear_reactors_2 = { allowed = { ai_for_units_is_not_disabled = yes } enable = { has_tech = reactor1 check_variable = { total_unemployed_percentage_display < 0.010 } # 1% unemployment date > 2003.1.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = nuclear_reactor value = 15 } } AI_build_renewable_energy_infrastructure = { allowed = { ai_for_units_is_not_disabled = yes } enable = { check_variable = { total_unemployed_percentage_display < 0.010 } # 1% unemployment date > 2010.1.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = renewable_energy_infra value = 20 } } AI_stop_building_civilian_industry = { allowed = { ai_for_units_is_not_disabled = yes } enable = { check_variable = { total_unemployed_percentage_display < 0.01 } } abort_when_not_enabled = yes ai_strategy = { type = build_building id = industrial_complex value = -50 } ai_strategy = { type = build_building id = arms_factory value = -50 } ai_strategy = { type = build_building id = dockyard value = -50 } ai_strategy = { type = build_building id = agriculture_district value = -50 } ai_strategy = { type = build_building id = microchip_plant value = -50 } ai_strategy = { type = build_building id = composite_plant value = -50 } # Create Other Infrastructure While Low unemployment ai_strategy = { type = build_building id = internet_station value = 25 } ai_strategy = { type = build_building id = infrastructure value = 25 } } AI_reduce_construction_on_deficit = { allowed = { ai_for_units_is_not_disabled = yes } enable = { has_war = no ai_has_high_deficit = yes } abort_when_not_enabled = yes ai_strategy = { type = build_building id = industrial_complex value = -20 } ai_strategy = { type = build_building id = arms_factory value = -20 } ai_strategy = { type = build_building id = dockyard value = -20 } ai_strategy = { type = build_building id = offices value = -10 } } AI_halt_construction_major_crisis = { allowed = { ai_for_units_is_not_disabled = yes } enable = { ai_has_major_economic_problems = yes } abort_when_not_enabled = yes ai_strategy = { type = build_building id = industrial_complex value = -50 } ai_strategy = { type = build_building id = arms_factory value = -50 } ai_strategy = { type = build_building id = dockyard value = -50 } ai_strategy = { type = build_building id = offices value = -50 } ai_strategy = { type = build_building id = microchip_plant value = -50 } ai_strategy = { type = build_building id = composite_plant value = -50 } } AI_accelerate_construction_on_surplus = { allowed = { ai_for_units_is_not_disabled = yes } enable = { has_war = no ai_has_acceptable_surplus_factories = yes ai_has_high_surplus = yes } abort_when_not_enabled = yes #ai_strategy = { type = build_building id = industrial_complex value = 10 } ai_strategy = { type = build_building id = offices value = 5 } } AI_build_agricultural_districts = { allowed = { ai_for_units_is_not_disabled = yes } enable = { check_variable = { overall_productivity < 850 } num_of_available_civilian_factories > 10 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = agriculture_district value = 50 } } AI_no_military_industry = { allowed = { ai_for_units_is_not_disabled = yes } enable = { has_war = no threat < 0.25 num_of_available_civilian_factories < 5 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = arms_factory value = -50 } } AI_build_internet_stations = { allowed = { ai_for_units_is_not_disabled = yes } enable = { num_of_available_civilian_factories > 0 any_owned_state = { free_building_slots = { building = internet_station size > 0 } } } abort_when_not_enabled = yes # Good for Keeping Productivity Up ai_strategy = { type = build_building id = internet_station value = 20 } } AI_build_rail_terminals = { allowed = { ai_for_units_is_not_disabled = yes } enable = { has_tech = post_conventional_rail any_owned_state = { free_building_slots = { building = rail_terminal size > 0 } } } abort_when_not_enabled = yes ai_strategy = { type = building_target id = rail_terminal value = 100 } } #Microchip & Composite AI default_build_chip_and_composite = { allowed = { ai_for_units_is_not_disabled = yes } enable = { OR = { has_idea = large_power has_idea = regional_power has_idea = super_power has_idea = great_power is_major = yes AND = { check_variable = { resource_consumed@microchips > resource_produced@microchips } check_variable = { resource_imported@microchips > resource_produced@microchips } } AND = { check_variable = { resource_consumed@composites > resource_produced@composites } check_variable = { resource_imported@composites > resource_produced@composites } } } } abort_when_not_enabled = yes ai_strategy = { type = build_building id = microchip_plant value = 15 } ai_strategy = { type = build_building id = composite_plant value = 15 } } want_chip_factories = { allowed = { ai_for_units_is_not_disabled = yes } enable = { #If we both import AND consume more than we produce, we need more internal production check_variable = { resource_consumed@microchips > resource_produced@microchips } check_variable = { resource_imported@microchips > resource_produced@microchips } #Don't try to make factories unless we have a surplus of the input supplies check_variable = { resource@chromium > 0 } check_variable = { resource@tungsten > 0 } num_of_available_civilian_factories > 14 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = microchip_plant value = 50 } } want_comp_factories = { allowed = { ai_for_units_is_not_disabled = yes } enable = { #If we both import AND consume more than we produce, we need more internal production check_variable = { resource_consumed@composites > resource_produced@composites } check_variable = { resource_imported@composites > resource_produced@composites } #Don't try to make facotires unless we have a surplus of the input supplies check_variable = { resource@chromium > 0 } check_variable = { resource@rubber > 0 } check_variable = { resource@oil > 0 } num_of_available_civilian_factories > 14 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = composite_plant value = 25 } } want_enrichment_facilities = { allowed = { ai_for_units_is_not_disabled = yes } enable = { num_of_civilian_factories > 50 has_nuclear_reactors = yes check_variable = { net_nuclear_fuel_display < 0 } } abort_when_not_enabled = yes ai_strategy = { type = build_building id = enrichment_facility value = 25 } }