Idea modding

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

Quick check-list[edit]

  • Create a file in /Hearts of Iron IV/common/ideas
  • Add localisation

Categories[edit]

Ideas fall into one of three main categories, National Spirits, Designers, and Ministers, with each generally fulfilling a different kind of role.

Hidden Ideas[edit]

Hidden ideas are a special kind of national spirit that can be used if you wish to give a country a hidden modifier. For example if you wished to secretly wished to reduce a country's recruitable pop because of an unforseen consequence, you could do this (under the country = { } brackets):

hidden_ideas = {
      XXX_hidden_problem = {
           modifier = {
                conscription = -0.01 # Reduces recruitable manpower by 1%
           }
      }
 }


Allowed[edit]

Allowed determines whether or not a country gets this idea or not. Especially important for ministers and designers, since not putting an allowed will mean that every country in the game will have access to that designer or minister. For most ministers and designers, original_tag = XXX is generally enough, since you want a country (and possible rebellions) to have access to that minister or designer.

allowed = { original_tag = DEN }

Allowed Civil War[edit]

A variant of allowed that determines if an idea can be transferred to a rebelling country during a civil war. Its mainly useful for making sure that if a democratic country has a communist revolt, the democratic half won't keep any of the ideas that add communism to the country:

allowed_civil_war = { has_government = communism }

Available[edit]

Availability says if a country can select it. If a country does not meet the requirements detailed under "available", then you will not be able to select it (If a minister/designer) or it will be cancelled (national spirit). For example, if you want an idea you can only select while being at peace:

available = { has_war = no }

Cancel[edit]

Cancel determines if an idea is cancelled when certain conditions are met. Don't want your country to continue having an add autonomy idea after becoming free, this is for you:

cancel = { has_autonomy_level = free }

Picture[edit]

Picture gives the idea its picture. National Spirits should be 60 x 68, Designers should be 64 x 64, and Ministers should be 65 x 67. File format needs to be either TGA or DDS. Pictures are called with the name set in a .gfx file in the interface folder. (For reference you can check the ideas.gfx file, but you should probably create your own .gfx file for maximum compatibility) Note that the game is set to ignore the GFX_idea at the start of the name for an idea, so when you call an idea, you only put the part after that. Also note that the name of the file itself may not be the name that you need to call in order to get an idea, so be sure to check the .gfx file. Now, here's an example of how to get the neutrality idea icon:

picture = neutrality_idea

Modifiers[edit]

Modifiers add modifier's to the country that has them, they can be positive or negative. Modifiers are listed one after another in a modifier's bracket. Here's an example of an idea that would increase a country's Recruitable Population as well as lowering its factory output:

modifier = {
     conscription = 0.1 #Adds 10% recruitable pop
     industrial_capacity_factory = -0.05 #Reduces factory output by 5%
}

Equipment Bonus[edit]

Similar to a modifier, equipment bonuses add or subtract values related to specific equipment. For example, if you wanted to make your subs have more attack at the expense of your capital ships you could do this:

equipment_bonus = {
      capital_ship = {
           attack = -0.1 # Reduces capital ship attack by 10%
      }
      submarine = {
           attack = 0.25 # Increases submarine attack by 25%
      }
}

Research Bonus[edit]

Determines if the idea gives you any research bonuses. If I wanted to give land doctrine research time reduction, I could do so like this:

research_bonus = { land_doctrine = 0.1 } #Gives a 10% reduction to land doctrine research time

You can also make it take longer to research something instead by making the number negative instead. (-0.1 would make it take 10% longer instead)

Traits[edit]

Generally used for designers and ministers, traits determines what name appears under the minister/designer, (e.g Fast Tank Manufacturer or Fascist Demagogue) and can also give modifiers/equipment bonuses to a country. To check what trait gives, look at the 00_traits file located in common/country_leader, again, make sure to create your own file if you wish to create your own traits. Ideas can have multiple traits, but the names may not fit correctly due to how they are formatted. If I wanted to create a communist revolutionary I would do so like this:

traits = { communist_revolutionary }

Cost[edit]

Determines how much an idea costs, default is 150pp. An idea that you can get for free looks like this:

cost = 0

Removal Cost[edit]

A rarely used stat that determines how much political power it costs to remove an idea.

removal_cost = 150

Designer[edit]

Unlike other ideas, designers need to be designated as such.

XXX_generic_designer = {
     designer = yes
}

AI Will Do[edit]

Determines if an AI will pick an idea, the higher the value the more likely they are to do so. A value of 0 means that they will never pick an idea.

ai_will_do = 0

Full Idea Example[edit]

An example of an idea that uses as many things as possible:

 XXX_example_idea = {
      designer = no			
      
      picture = generic_coastal_navy
      
      cost = 200
      removal_cost = 1000
      
      available = {
           has_government = fascism
      }
      
      allowed = {
           has_war = yes
      }
      		
      allowed_civil_war = {
           always = yes
      }
      
      modifier = {
           license_armor_purchase_cost = -0.5
      }
      
      research_bonus = {
           land_doctrine = -0.05
      }
      		
      equipment_bonus = {
           capital_ship = {
                attack = 0.1
           }
           screen_ship = {
                sub_detection = 0.1 build_cost_ic = -0.1
           }
           submarine = {
                sub_visibility = -0.1
           }
      }
      
      traits = { fascist_demagogue }
      
      ai_will_do = 1
}

Implementing An Idea[edit]

Ideas can be added to a country in different ways, depending on the type of idea and the intent behind adding it. Ministers and designers will be added automatically based upon their "allowed" area. National spirits can be added in the country's history file, which will add it upon loading, through a national focus, or through an event. There are a couple of ways to add or remove ideas from a nation.

Add Idea[edit]

You can add an idea to a country by using the following line:

add_ideas = example_idea

Remove Idea[edit]

You can remove an idea from a country by using the following line:

remove_ideas = example_idea

Swap Ideas[edit]

Sometimes you want to switch out one idea for another. If the swapped ideas have the same localization name, the game will assume that you are modifying that idea rather than replacing one with another. Here's an example of how to swap ideas:

swap_ideas = {
     remove_idea = example_idea1
     add_idea = example_idea2
}
Modding
Documentation EffectsTriggersModifiersScopesLocalisation
Scripting AIBookmarksBuildingsCosmetic tagsCountriesDivisionsDecisionsEquipmentEventsIdeasIdeologiesNational FocusesResourcesTechnologyUnits
Map MapTerrainStatesSupply areasStrategic regions
Graphical InterfaceGraphical Assets
Cosmetic PortraitsNamelistsMusicSound
Other Console commandsTroubleshootingMod structure