Developer Resource

Code Resources

Millennium Dawn unique modifiers, effects and tutorials for modders

This document provides reference documentation for Millennium Dawn’s unique systems, including custom modifiers, scripted effects, and how-to guides for common modding tasks.

Note: This is not fully up-to-date. For the latest systems, check the codebase directly.


Quick Reference

Custom Modifier Categories

Scripted Effects Categories

How-To Guides


Modifiers

Modifiers in Millennium Dawn follow standard HOI4 syntax but include many unique economic, political, and energy systems.

Economic Modifiers

These modifiers affect the economy, taxes, trade, and productivity.

General Economic

ModifierDescriptionNotes
interest_rate_multiplier_modifierAdjusts interest rateWhole numbers only
personnel_cost_multiplier_modifierMilitary wages
army_personnel_cost_multiplier_modifierArmy wages
navy_personnel_cost_multiplier_modifierNavy wages
airforce_personnel_cost_multiplier_modifierAirforce wages
equipment_cost_multiplier_modifierEquipment upkeep
bureaucracy_cost_multiplier_modifierBureaucracy spending
police_cost_multiplier_modifierPolice spending
education_cost_multiplier_modifierEducation spending
health_cost_multiplier_modifierHealthcare spending
social_cost_multiplier_modifierSocial spending
tax_rate_change_multiplier_modifierTax law change PP cost
projects_cost_modifierEconomic project costs
civ_facs_worker_requirement_modifierCivilian factory workers
mil_facs_worker_requirement_modifierMilitary factory workers
offices_worker_requirement_modifierOffice workers
agriculture_district_worker_requirement_modifierAgriculture workers
microchip_plant_worker_requirement_modifierMicrochip plant workers
composite_plant_worker_requirement_modifierComposite plant workers
synthetic_refinery_worker_requirement_modifierSynthetic refinery workers
buildings_worker_requirement_modifierAll building workers
tax_gain_multiplier_modifierAll tax income
population_tax_income_multiplier_modifierPopulation taxes
corporate_tax_income_multiplier_modifierCorporate taxes
return_on_investment_modifierInternational investment ROIUse decimals (0.02 = 2%)
productivity_growth_modifierNational productivityKeep small to avoid snowballing
state_productivity_growth_modifierPer-state productivity
country_productivity_growth_modifierCountry productivity growth
international_market_income_modifierEquipment sales income
international_market_purchase_modifierEquipment purchase costs
inflation_cost_multiplier_modifierInflation costs

Exports & Resources

ModifierDescription
resource_export_multiplier_modifierAll resource exports
oil_export_multiplier_modifierOil exports
steel_export_multiplier_modifierSteel exports
aluminium_export_multiplier_modifierAluminium exports
tungsten_export_multiplier_modifierTungsten exports
chromium_export_multiplier_modifierChromium exports
rubber_export_multiplier_modifierRubber exports
microchip_export_multiplier_modifierMicrochip exports
composite_export_multiplier_modifierComposite exports

Industry Productivity

ModifierDescription
agricolture_productivity_modifierAgriculture productivity
microchip_plants_productivity_modifierMicrochip plant productivity
composite_plants_productivity_modifierComposite plant productivity
synthetic_refinery_productivity_modifierSynthetic refinery productivity
civilian_factories_productivityCivilian factory productivity
military_factories_productivityMilitary factory productivity
dockyard_productivityDockyard productivity
offices_productivityOffice productivity

Industry Income Taxes

ModifierDescription
office_park_income_tax_modifierOffice tax income
agriculture_district_income_tax_modifierAgriculture tax income
microchip_plant_income_tax_modifierMicrochip plant tax income
composite_plant_income_tax_modifierComposite plant tax income
synthetic_refinery_income_tax_modifierSynthetic refinery tax income
dockyard_income_tax_modifierDockyard tax income
military_industry_tax_modifierMilitary industry tax
civilian_industry_tax_modifierCivilian industry tax
agriculture_tax_modifierAgriculture tax
microchip_plant_tax_modifierMicrochip plant tax
composite_plant_tax_modifierComposite plant tax
synthetic_plant_tax_modifierSynthetic plant tax

Campaign Costs

ModifierDescription
salafist_outlook_campaign_cost_modifierSalafist campaign cost
nonaligned_outlook_campaign_cost_modifierNonaligned campaign cost
western_outlook_campaign_cost_modifierWestern campaign cost
emerging_outlook_campaign_cost_modifierEmerging campaign cost
nationalist_outlook_campaign_cost_modifierNationalist campaign cost
propaganda_campaign_cost_modifierPropaganda campaign cost

Investment Modifiers

ModifierDescription
investment_duration_modifierYour project duration
receiving_investment_duration_modifierForeign project duration
investment_cost_modifierYour project costs
receiving_investment_cost_modifierForeign project costs
internal_investments_pp_cost_modifierInternal investment PP cost
internal_investments_money_cost_modifierInternal investment money

Workforce & Labor

ModifierDescription
total_workforce_modifierTotal workforce
high_unemployment_threshold_modifierUnemployment threshold
agriculture_workers_modifierAgriculture workers %
resource_sector_workers_modifierResource sector workers %
gdp_from_resource_sector_modifierGDP from resources
border_control_multiplier_modifierBorder control effectiveness
civilian_chip_consumption_modifierCivilian microchip use
industry_chip_consumption_modifierIndustry microchip use

Upgrade & Special Costs

ModifierDescription
econ_cycle_upg_cost_multiplier_modifierEconomic cycle upgrade cost
cyber_cost_multiplier_modifierCyber system cost

Education

ModifierDescription
literacy_rate_education_modifierLiteracy/education rate

Law Modifiers

These modify political power costs for changing government laws.

ModifierDescription
expected_adm_modifierBureau/Government spending
expected_police_modifierInternal Security spending
expected_education_modifierEducation spending
expected_healthcare_modifierHealthcare spending
expected_welfare_modifierSocial Spending
expected_mil_modifierMilitary spending
corruption_cost_factorCorruption change cost
economic_cycles_cost_factorEconomic cycle change cost
internal_factions_cost_factorInternal faction change cost
bureaucracy_cost_factorBureaucracy change cost
trade_laws_cost_factorTrade law change cost
Conscription_Law_cost_factorConscription change cost
migration_rate_value_factorMigration law cost

Migration Modifiers

These affect population migration.

ModifierDescription
base_migration_rate_valueBase migration rate (law only)
maximum_migration_rate_valueMaximum migration rate (law only)
migration_rate_value_factorMigration rate multiplier

Influence Modifiers

These affect the foreign influence system.

ModifierDescription
foreign_influence_modifierInfluence action effectiveness
foreign_influence_defense_modifierDefense against influence
foreign_influence_auto_influence_cap_modifierAuto-influence slots
influence_coup_modifierCoup success rate
foreign_influence_continent_modifierCross-continent influence
foreign_influence_home_continent_modifierHome continent influence
foreign_influence_monthly_domestic_independence_gain_modifierMonthly independence gain
foreign_influence_monthly_domestic_independence_gain_factorIndependence gain factor

Energy Modifiers

These control power generation and consumption.

General Energy

ModifierDescription
energy_gainFlat energy gain
energy_gain_multiplierPercentage energy gain
energy_useStatic energy use
energy_use_multiplierTotal energy consumption
renewable_energy_gainRenewable energy specifically
renewable_energy_gain_multiplierSolar/wind energy multiplier
resource_storage_gainEnergy storage gain

Population Energy

ModifierDescription
pop_energy_use_multiplierPopulation energy use
non_electric_fuel_consumption_modifierDirect fuel consumption

Fossil Fuels

ModifierDescription
fossil_energy_gainFossil fuel energy gain
fossil_pp_energy_generation_modifierFossil fuel plant output
fossil_fuel_consumptionFossil fuel consumption
fossil_pp_fuel_consumption_modifierFossil plant fuel use

Nuclear Energy

ModifierDescription
nuclear_energy_gainNuclear energy gain
nuclear_energy_generation_modifierNuclear reactor output
nuclear_fuel_consumptionNuclear fuel consumption
nuclear_fuel_consumption_modifierNuclear fuel use multiplier

Building Energy Use

ModifierDescription
energy_use_modifier_civsCivilian factory energy use
energy_use_modifier_milsMilitary factory energy use
energy_use_modifier_officesOffice energy use
energy_use_modifier_agriculture_districtAgriculture energy use
energy_use_modifier_microchip_plantsMicrochip plant energy use
energy_use_modifier_composite_plantsComposite plant energy use
energy_use_modifier_synthetic_refinerySynthetic refinery energy use

Renewable Infrastructure

ModifierDescription
hydroelectric_energy_storageHydroelectric storage
hydroelectric_power_generation_modifierHydroelectric output
geothermal_power_generation_modifierGeothermal output
state_renewable_capacity_factor_modifierState renewable capacity
state_renewable_energy_generation_modifierState renewable generation

Battery & Storage

ModifierDescription
battery_park_construction_costBattery park costs
battery_park_storage_size_modifierBattery storage size

Political Modifiers

These affect internal politics.

ModifierDescriptionNotes
popularity_attack_modifierParty attack effectivenessNot percentage (2.0 = 2x)
popularity_boost_modifierParty boost effectivenessNot percentage (2.0 = 2x)

Counter-Terror Modifiers

These affect the counter-terrorism system.

ModifierDescription
terror_threat_detection_modifierThreat detection chance
terror_threat_base_detect_modifierBase detection value
terror_threat_base_defense_modifierBase defense value

Missile & Space Modifiers

These affect missile and satellite production.

ModifierDescription
olv_production_speed_modifierOrbital launch vehicle
gnss_production_speed_modifierNavigation satellites
comsat_production_speed_modifierCommunications satellites
spysat_production_speed_modifierSpy satellites
killsat_production_speed_modifierKill satellites
nuclear_reactor_fuel_productionNuclear fuel production

Nation-Specific Modifiers

Czech Republic

ModifierDescription
CZE_skoda_superb_productivity_modifierŠkoda productivity

Italy

ModifierDescription
ITA_ageing_population_drift_modifierAging population drift
ITA_reform_expectance_driftReform expectation drift

Scripted Effects

All scripted effects automatically generate tooltips. Do not add extra localization for these.

Building Effects

Location: common/scripted_effects/00_scripted_effects.txt

Buildings can be added using state scope or random scope:

State Scope (Predefined State)

117 = {
    one_state_industrial_complex = yes
}

Random Scope (Any Owned State)

one_random_industrial_complex = yes
two_random_industrial_complex = yes
three_random_industrial_complex = yes
four_random_industrial_complex = yes

Available Building Effects

BuildingRandom EffectsState Scope Effects
Civilian Factoryone_random_industrial_complexone_state_industrial_complex
Military Factoryone_random_arms_factoryone_state_arms_factory
Dockyardone_random_dockyardone_state_dockyard
Officesone_office_constructionone_state_office_construction
Infrastructureone_random_infrastructureone_state_infrastructure
Air Baseone_air_baseone_state_air_base
Network Infrastructureone_random_network_infrastructureone_state_network_infrastructure
Anti-Air/SAMone_anti_airone_state_anti_air
Radarone_radar_stationone_state_radar_station
Nuclear Reactorone_random_nuclear_reactorone_state_nuclear_reactor
Agriculture Districtone_random_agriculture_districtone_state_agriculture_district

Building Costs (State-Level)

The cost implies the INCLUSION of a building slot. A single building slot is $1.00 so if you want to give a Civilian Industry it’s $6.50 without a building slot.

BuildingCost
Civilian/Military Factory, Dockyard$7.50
Offices$12.00
Commercialized Agriculture$3.75
Infrastructure$3.50
Air Base$2.50
SAM Site$3.25
Renewable Infrastructure$8.50
Fuel Silo$3.00
Radar$1.75
Network Infrastructure$3.00
Missile Site$3.00
Nuclear Reactor$9.00
Fossil Powerplant$2.25
Microchip Plant$10.50
Composite Plant$7.50

Economic Effects

Treasury Management

# Modify treasury
set_temp_variable = { treasury_change = -10.00 }
modify_treasury_effect = yes

# Preset expenditures
small_expenditure = yes
medium_expenditure = yes
large_expenditure = yes

Debt Management

set_temp_variable = { debt_change = 0.1 }
modify_debt_effect = yes

Productivity

# Adjust productivity (flat value)
set_temp_variable = { temp_productivity_change = 0.025 }
flat_productivity_change_effect = yes

Economic Cycles

increase_economic_growth = yes
decrease_economic_growth = yes
depression = yes
recession = yes
stagnation = yes
stable_growth = yes
fast_growth = yes
economic_boom = yes

Government Spending Laws

# Bureaucracy
increase_centralization = yes
decrease_centralization = yes

# Social Spending
increase_social_spending = yes
decrease_social_spending = yes

# Education
increase_education_budget = yes
decrease_education_budget = yes

# Healthcare
increase_healthcare_budget = yes
decrease_healthcare_budget = yes

# Policing
increase_policing_budget = yes
decrease_policing_budget = yes

# Trade Law
increase_exports = yes
decrease_exports = yes

# Military Spending
increase_military_spending = yes
decrease_military_spending = yes

Internal Faction Effects

Changing Faction Opinions

set_temp_variable = { temp_opinion = 5 }
change_small_medium_business_owners_opinion = yes

Available Faction Effects

CategoryEffects
Economicchange_small_medium_business_owners_opinion, change_industrial_conglomerates_opinion, change_fossil_fuel_industry_opinion, change_international_bankers_opinion, change_oligarchs_opinion
Militaristicchange_defense_industry_opinion, change_maritime_industry_opinion, change_the_military_opinion, change_intelligence_community_opinion
Special Interestchange_labour_unions_opinion, change_landowners_opinion, change_farmers_opinion, change_communist_cadres_opinion
Religiouschange_the_clergy_opinion, change_the_ulema_opinion, change_the_priesthood_opinion, change_the_wahabi_ulema_opinion
Nation-Specificchange_the_bazaar_opinion (Iran), change_the_donju_opinion (North Korea), change_saudi_royal_family_opinion, change_irgc_opinion, change_chaebols_opinion (South Korea), change_wall_street_opinion (USA)

Influence Effects

Basic Influence

# Domestic influence
set_temp_variable = { percent_change = 10 }
change_domestic_influence_percentage = yes

# General influence (requires target)
set_temp_variable = { percent_change = 5 }
set_temp_variable = { tag_index = ROOT }
set_temp_variable = { influence_target = GER }
change_influence_percentage = yes

Index-Based Influence

set_temp_variable = { percent_change = 5 }
set_temp_variable = { influencer_index = 0 }
change_current_influencer_index_percentage = yes

Political Effects

Party Popularity

# Set party index (0-23) and change popularity
set_temp_variable = { party_index = 2 }
set_temp_variable = { party_popularity_increase = 0.10 }  # 10% = 0.10
add_relative_party_popularity = yes

# Or set to ruling party automatically
set_party_index_to_ruling_party = yes

Ruling Party Changes

# Set ruling party
set_temp_variable = { rul_party_temp = 20 }
change_ruling_party_effect = yes
set_politics = {
    ruling_party = nationalist
    elections_allowed = no
}

Coalition Management

# Add to coalition
set_temp_variable = { add_col_one = 5 }
add_coalition_members_effect = yes

# Remove from coalition
set_temp_variable = { remove_col_one = 5 }
remove_coalition_members_effect = yes

Ban/Allow Parties

# Ban party
set_temp_variable = { party_index = 1 }
ban_party_scripted_call = yes

# Allow party
set_temp_variable = { party_index = 1 }
unban_party_scripted_call = yes

Special System Effects

Euroscepticism (EU)

# Single country
set_temp_variable = { modify_eurosceptic = 0.05 }
set_temp_variable = { modify_eurosceptic_target = GER }
eurosceptic_change = yes

# All EU members
set_temp_variable = { modify_eurosceptic = -0.05 }
EU_eurosceptic_change = yes

Energy Systems

# Build enrichment facilities (cost: 25.00 each)
set_temp_variable = { temp_change = 2 }
build_enrichment_facilities_effect = yes

# Build battery parks (cost: 100.00 each)
set_temp_variable = { temp_change = 2 }
build_battery_park_effect = yes

Cartel Effects

Handles cartel strength and political influence changes.

# Modify cartel variables
set_temp_variable = { cart_strength_change = 2 }
set_temp_variable = { cart_influence_change = 2 }
modify_cartel_variables_effect = yes

How-To Guides

Adding Subideology Parties

Adding a new party requires edits to four files. Follow the steps below in order.

Step 1 — Choose a Slot

Consult the Subideology Slots table below to pick the subideology key and its index for the ideology group your party belongs to. Note both — you will need the key for localisation and the index for the history file.

Step 2 — Add Localisation

In localisation/english/MD_subideology_parties_l_english.yml, add three entries for the party using the format below:

TAG.subideology: "£TAG_icon_name (ABBRV) - Party Name"
TAG.subideology_icon: "£TAG_icon_name"
TAG.subideology_desc: "(Dominant Ideology) - Party Name (Native name, ABBRV)\n\nDescription"

If the party changes over time (e.g. a coalition partner becomes dominant), add _alt variants:

TAG.subideology_alt: "£TAG_icon_name_alt (ABBRV) - Alternate Party Name"
TAG.subideology_icon_alt: "£TAG_icon_name_alt"
TAG.subideology_desc_alt: "(Dominant Ideology) - Alternate Party Name (Native name, ABBRV)\n\nDescription"

Step 3 — Register the Icon

a) Add the GFX entry to interface/MD_parties_icons.gfx, keeping entries sorted alphabetically by tag:

spriteType = {
	name = "GFX_TAG_icon_name"
	texturefile = "gfx/texticons/parties_icons/country_name_lowercase/TAG_icon_name.dds"
	legacy_lazy_load = no
}

The name value must match the icon referenced in localisation (without the £ prefix, prefixed with GFX_).

b) Place the DDS file at gfx/texticons/parties_icons/{country_name_lowercase}/TAG_icon_name.dds. Party icon DDS files are typically 20×20 px text icons.

Step 4 — Set Starting Popularity

In history/countries/TAG - Country.txt, set the party’s starting popularity using its slot index. A comment with the party abbreviation is required:

set_variable = { party_pop_array^N = 0.15 } # Party Abbreviation

Where N is the slot index from the slots table. Only set slots for parties that actually exist in the country — leave unused slots unset (they default to 0).

If the party holds government or is a coalition partner at game start, also add:

add_to_array = { ruling_party = N }          # if this party governs alone or leads the coalition
add_to_array = { gov_coalition_array = N }   # if this party is a junior coalition partner

For countries with elections, set the most recent election results separately:

set_variable = { party_pop_elect_array^N = 0.15 } # Party Abbreviation - election result

Step 5 — Add Leaders (Optional)

If the country has scripted leader rotation, add the leader’s create_country_leader block inside the appropriate if = { limit = { has_country_flag = set_subideology } } block in common/scripted_effects/TAG_political_leaders.txt. Create the file if it doesn’t yet exist for this tag.

Subideology Slots

IndexSlotIdeology Group
0Western_AutocracyPro-Western (democratic)
1conservatismPro-Western (democratic)
2liberalismPro-Western (democratic)
3socialismPro-Western (democratic)
4Communist-StateEmerging (communism)
5anarchist_communismEmerging (communism)
6ConservativeEmerging (communism)
7AutocracyEmerging (communism)
8Mod_Vilayat_e_FaqihEmerging (communism)
9Vilayat_e_FaqihEmerging (communism)
10KingdomSalafist (fascism)
11CaliphateSalafist (fascism)
12Neutral_Muslim_BrotherhoodNon-Aligned (neutrality)
13Neutral_AutocracyNon-Aligned (neutrality)
14Neutral_conservatismNon-Aligned (neutrality)
15oligarchismNon-Aligned (neutrality)
16Neutral_LibertarianNon-Aligned (neutrality)
17Neutral_greenNon-Aligned (neutrality)
18neutral_SocialNon-Aligned (neutrality)
19Neutral_CommunismNon-Aligned (neutrality)
20Nat_PopulismNationalist (nationalist)
21Nat_FascismNationalist (nationalist)
22Nat_AutocracyNationalist (nationalist)
23MonarchistNationalist (nationalist)

Historical Events (ETD System)

Events should use the yearly effects system in common/scripted_effects/00_yearly_effects.txt:

# First year events
MD_event_on_startup_events = {
    CAM = { country_event = { id = Cameroon.1 days = 50 random_days = 50 } }
}

# Specific year events
trigger_year_2067_events = {
    USA = { country_event = { id = collapse_event.1 days = 30 random_days = 336 } }
}

Variable Basics

# Set variable
set_variable = { var = example_var value = 1 }

# Add to variable
add_to_variable = { var = example_var value = 1 }

# Set bounds
set_variable = { var = example_var value = 50 max = 100 min = 0 }

Energy Configuration

Hydroelectric/Geothermal

set_variable = { hydroelectric_energy_production_var = 5.636 }
set_variable = { hydroelectric_energy_storage_var = 300 }
add_dynamic_modifier = { modifier = hydroelectric_infrastructure_in_state }

Renewable Capacity (from Global Wind Atlas)

# Capacity factor = (Atlas value) - 0.25
set_variable = { state_renewable_capacity_factor_modifier_var = 0.55 }

Unique Terrain Photos

Adds custom terrain photos to specific provinces.

Step 1: Create Image

  • Size: 413x70px
  • Format: DDS
  • Location: gfx/interface/terrain/

Step 2: Register in GFX File

File: interface/MD_terrain_cities.gfx

spriteType = {
    name = "GFX_terrain_brussels"
    textureFile = "gfx/interface/terrain/your_image.dds"
}

Step 3: Create GUI Icon

File: interface/countrystateview.gui

iconType = {
    name = "terrain_brussels_icon"
    spriteType = "GFX_terrain_brussels"
    alwaystransparent = yes
}

Step 4: Create Empty Modifier

File: common/modifiers/01_province_modifiers.txt

terrain_brussels = { }

Step 5: Add to Startup Effects

File: common/scripted_effects/00_startup_effects.txt

# State ID 50, province ID 516
50 = {
    add_province_modifier = {
        static_modifiers = { terrain_brussels }
        province = { id = 516 }
    }
}

Tip: Use Tdebug console command in-game to find state and province IDs.


Additional Resources

  • Discord: @AngriestBird for questions
  • Error Codes: See docs/dev-resources/error-debug-codes.md
  • Focus Trees: See .cursor/.ai-guides/code_styling.md