Ideology modding

From Hearts of Iron 4 Wiki
Jump to navigation Jump to search

Ideologies represent all of the different political beliefs or alignments in the selected nation. An ideology will help to determine the choices and paths that the nation will take.

Ideologies are found in /Hearts of Iron IV/common/ideologies/*.txt.

Ideologies[edit | edit source]

An ideology definition follows this format:

ideologies = {
	anarchist = {
		types = {
			anarcho_syndicalism = { # Used when assigning ideologies to leaders. Eg. democratic has conservatism, liberalism, and socialism. One value can be defined (yes/no)
				can_be_randomly_selected = # If no, the subideology will not be randomly selected when creating a new random leader
		dynamic_faction_names = {
			"FACTION_NAME_ANARCHIST_1" # Faction names used by the ai when an ai with this ideology creates a faction. Can be defined in any localisation file.
		color = { 169 42 42 } # RGB ideology colour, used in the political pie chart or next to the chart.
		rules = { # Rules for the ideology.  (yes/no)
                        can_create_collaboration_government = # Can create a collaboration government
			can_declare_war_on_same_ideology = # Declare war on same ideology. Not required
			can_force_government = # Can change ideology in peace deal. Required
			can_send_volunteers = # Can send volunteers. Required
			can_puppet = # Can puppet a nation at peace deal. Required
			can_lower_tension = # Lowers tension at peace deal. Not required
			can_only_justify_war_on_threat_country = # Can only justify on a nation that has generated world tension/threat. Not required
			can_guarantee_other_ideologies = # Can guarantee nations with different ideologies. Not required

                can_host_government_in_exile = no #Can host a government in exile
		war_impact_on_world_tension = # Goes from -1 to 1. Increases or decreases the world tension created by this nation
		faction_impact_on_world_tension = # Goes from -1 to 1. Increases or decreases a faction of this ideologies impact on tension
		modifiers = { # More rules for the ideology. Every country [[Modifiers|modifier]] can apply.
			generate_wargoal_tension = # Required world tension to start justifying a war (0 to 1)
			join_faction_tension = # Required world tension to join a faction (0 to 1)
			lend_lease_tension = # Required tension to start a lend-lease (0 to 1)
			send_volunteers_tension = # Required tension to send volunteers (0 to 1)
			guarantee_tension = # Required tension to guarantee a nation (0 to 1)
			take_states_cost_factor = # Changes the cost of states in a peace deal. 0.25 would increase state cost by 25% (-1 to 1)
			annex_cost_factor = # Changes the cost of entirely annexing a nation in a peace deal. 0.5 would increase annexing cost by 50% (-1 to 1)
			justify_war_goal_when_in_major_war_time = # Changes the cost of justifying a war while in a major war. 0.5 would decrease time by 50% (0 to 1)
			drift_defence_factor = # Natural drift defence for the ideology # 0.3 would grant 30% drift defence (-1 to 1)
			puppet_cost_factor = # Changes the cost of puppeting a nation in a peace deal (-1 to 1)

		can_be_boosted = # Can you boost this ideologies popularity in another country (yes/no)
		can_collaborate = #
		faction_modifiers = {    # Applies to the entire faction if the faction leader has this ideology. Every country [[Modifiers|modifier]] can apply.
			faction_trade_opinion_factor = 0.50 #plus 50% trade opinion
		ai_<ideology> = yes # Determines what ai this ideology will use (democratic, communism, fascism, neutral or make a new one.)

Ai peace[edit | edit source]

AI peace determines the AI's behaviour in a peace deal. The triggers can be seen inside of enable = {} in the files, and they are generally reliant on ideologies.

The files are located in /Hearts of Iron IV/common/ai_peace/*.txt and every ideology has its own file. Unless the triggers are adjusted, AI will be likely to use /Hearts of Iron IV/common/ai_peace/1_fascist.txt. It is recommended to change the triggers in these files to assign a proper peace AI to the ideology or to create a new file.

Getting the ideology in your game[edit | edit source]

Localisation[edit | edit source]

The localisation for the ideologies is located in /Hearts of Iron IV/localisation/parties_l_<language>.txt, although it does not make a difference which localisation file is used to add them. This file also houses the names given to the political parties in each nation.

Ideologies are localised like so:

<ideology>:0 "<The name you want to be displayed>"
<ideology>_noun:0 "<The ideology's noun>"
<ideology>_desc:0 "<How you would refer to a nation with that ideology>" # Ie. Democratic Regime, Fascist Dictatorship, Anarcho-Capitalist Regime

Localisation for countries can be added like so:

TAG_anarchist:0 "Anarchist Republic of Test"
TAG_anarchist_ADJ:0 "Generic"
TAG_anarchist_DEF:0 "the Anarchist Republic of Test"

If you do not define the ideology and just leave it as TAG:0 "Test", it will apply to the country regardless of the ideology unless an ideology-specific name takes priority.

GFX[edit | edit source]

Icons are assigned to ideologies in .gfx files in the /Hearts of Iron IV/interface/ folder. A spriteType assigned to the anarchist ideology will look like so:

	spriteType = {
		name = "GFX_ideology_anarchist_group"
		texturefile = "gfx/interface/ideologies/"

In order to assign an icon to a sub-ideology, say anarcho_syndicalism, _group at the end needs to be removed so the name is GFX_ideology_anarcho_syndicalism. Country-specific ideology icons are also a possibility, defined as GFX_ideology_TAG_anarchist_group or GFX_ideology_TAG_anarcho_syndicalism.

Every nation will either need a flag for this ideology or a generic national flag. To assign a flag to an ideology just name it <TAG>_<ideology>.tga or create a flag for the nation to use that doesn't have a specific ideology by just naming the flag <TAG>.tga. Doing it the last way makes it easier to add flags when you have added a lot of similar ideologies.

Country history[edit | edit source]

If you want the ideology to appear in a country you will have to add it like this to a countries history file like this: In France, for example /Hearts of Iron IV/history/countries/FRA - France.txt

set_politics = {
	ruling_party = democratic
	last_election = "1932.5.1"
	election_frequency = 48
	elections_allowed = yes
set_popularities = { #This MUST add up to 100 otherwise the ideologies break
	democratic = 69
	fascism = 1
	communism = 30

France will now need a new leader

create_country_leader = {
	name = "Édouard Daladier"
	picture = ""
	expire = "1965.1.1"
	ideology = socialism
	traits = {

Political advisor[edit | edit source]

In order to add a political advisor increasing the popularity of the ideology, first, a trait that will be added to that advisor must be added in /Hearts of Iron IV/common/country_leader/*.txt

<ideology>_booster = {
	random = no
	sprite = 13
	<ideology>_drift = 0.1
	ai_will_do = {
		factor = 0

Localisation can be added like so:

<ideology>_booster:0 "Ideology booster" #Whatever you want to call the person that supports the ideology. Eg. Democratic Politician, Communist Politician, Fascist Politician

It is recommended to add the generic advisors in /Hearts of Iron IV/common/ideas/zzz_generic.txt to ensure the file is loaded after the country-specific ones. A generic advisor can be added following this example:

 <name> = {
	allowed = {
		NOT = {
			has_available_idea_with_traits = { idea = <ideology>_booster limit = 1 }		#In order to prevent it from appearing alongside country-specific ones.
	traits = { <ideology>_booster }
	available = {
		if = {
			limit = { has_dlc = "Man the Guns" }	
			NOT = { has_autonomy_state = autonomy_supervised_state }
	do_effect = {
		NOT = {
			has_government = <ideology> # You can only select it if your current ideology isn't your new one

	ai_will_do = {
		factor = 0

More information about GFX and localisation can be found in the Idea modding page.