#create an example array with 3 countries, named "array_example" add_to_array = { array_example = GER } add_to_array = { array_example = ITA } add_to_array = { array_example = TUR } # calculate total pp of these 3 countries set_temp_variable = { sum_pp = 0 } for_each_scope_loop = { array = array_example add_to_temp_variable = { sum_pp = political_power } } if = { # do they have more than 100 pp? limit = { check_variable = { sum_pp > 100 } } # remove 33 pp for_each_scope_loop = { array = array_example add_political_power = -33 } #pp spent, now do business }
add_equipment_to_stockpile = { type = infantry_equipment_2 amount = eq_amount }
set_temp_variable = { eq_type = 1 } set_temp_variable = { eq_amount = 10 } set_temp_variable = { eq_level = 2 } meta_effect = { text = { add_equipment_to_stockpile = { type = [EQ_TYPE]_[EQ_LEVEL] amount = eq_amount } } EQ_LEVEL = "[?eq_level|.0]" EQ_TYPE = "[This.GetEquipmentName]" } # scripted localization defined_text = { name = GetEquipmentName text = { trigger = { check_variable = { eq_type = 0 } } localization_key = "infantry_equipment" } text = { trigger = { check_variable = { eq_type = 1 } } localization_key = "artillery_equipment" } # give all equipment an index here }
add_equipment_to_stockpile = { type = artillery_equipment_2 amount = eq_amount }
dynamic_modifier_example = { political_power_factor = pp_factor_variable }
set_variable = { pp_factor_variable = 0.15 } add_dynamic_modifier = { modifier = dynamic_modifier_example }