Console commands - Hearts of Iron 4 Wiki (2024)

This is a community maintained wiki. If you spot a mistake, please help with fixing it.

This page lists the codes which may be input into the Console Window, a special debugging window which may be accessed on non-ironman games by hitting ^ , ° or tilde (~) (key varies based on keyboard layout). Press the up or down arrow keys to traverse through previously executed commands. Many codes can be turned off by repeating the command, but sometimes reloading the save or exiting the game is necessary. Please note that many of these commands come in and out with each DLC making some of them not work. Mods may introduce commands and more commonly, tags into the game to enhance their gameplay.

Also of note, commands may not work in ironman games by design.

Press Shift+2, §, ~, \, `, ", ^ or ALT+2+1, or Shift+3 to access the console (key varies based on keyboard layout)

Console commands use internal IDs, which may be obtained in a variety of different ways.

An easy way to tell internal IDs is debug mode. debug as a console command will turn on debug mode which can provide information about certain database entries, such as focuses, national spirits (and other ideas such as laws or designers), or technologies when hovering over them, as well as obtaining information when hovering over a province of IDs of the state and the province, as well as the 3-letter country tag of the country it belongs to. Note that while modding, the console command does not do everything that the launch option does and cannot serve as a substitute.

If that is impossible, using localisation is an alternative. To do that, navigate to the folder where the game is contained, then to the /Hearts of Iron IV/localisation/english/ folder. Each file in there contains localisation keys with values that actually appear in-game assigned to them. Using a non-default text editor can also allow using the 'Search in files' function (Such as in Notepad++, Sublime Text, or Visual Studio Code) in order to search through every single localisation file at the same time to find a specified value.

CommandEffectExample/Commenthelp [command name]Print out all console commands or a specific command description.tag [<Country tag>]Changes the country that the player controls.event [<event id>] [Target country tag]Executes an eventEvent pages can be used to tell the IDs of events. If the event has a trigger = { ... } block, it says which triggers were met and which weren't.add_ideas [<idea name>]Adds ideas with <id> to the countryremove_ideas [<idea name>]Removes national idea.gain_xp [<amount>]Adds experience to selected Leader/General/Admiralgain_xp 100000(level capped at 9)gain_xp [<trait>]Adds gainable trait to selected Leader/General/Admiralie: gain_xp seawolf

Note To make it work with new, generic created Admirals:
1. Open 'Documents\Paradox Interactive\Hearts of Iron IV\settings.txt' with a text editor and change "save_as_binary=yes" to "save_as_binary=no".
2. Start game, load savegame and save as new file, exit game.
3. Open 'Documents\Paradox Interactive\Hearts of iron IV\Save Games' , open the newly created savegame file, search (CTRL-F) for the name of your generic created Admiral
4. Go a few lines below to max_traits=0.000 and add the following code block behind it

in_progress={seawolf=0.000superior_tactician=0.000spotter=0.000fly_swatter=0.000ironside=0.000air_controller=0.000}

5. Make sure to save the file with ANSI encoding format.
6. Start game, load save game, use gain_xp command, enjoy.
(Optional turn back on binarization in settings.txt)

cp [<amount>]Adds Command Powercp 100 (capped at 100)st [<amount>]Adds Stabilityst 100 (capped at 100)add_war_support(ws) [<amount>]Adds War Supportws 100 (capped at 100)allowtraitsAllows free assignment of general traitsadd_equipment(ae) [<equipment amount>] [<equipment name>]Adds equipmentEquipment uses the basic name so 'ae 1000 infantry_equipment_1'.You can only add researched equipment. Does not support Naval equipment. (with the exception of convoy: 'ae 1000 convoy_1') To add ships, consider using instantconstruction(ic) (ic also effects AI).

To add modified equipment, you have to address it by given name. Example: You create a variant of 'Matilda LP'-tank with better Armor and Main Gun and name it 'Matilda LP Mk. IV'.Now use 'add_equipment 1000 Matilda LP Mk. IV'.

add_latest_equipment(ale) [<equipment amount>]Gives player amount of latest equipment variantsTo add only a specific type of your latest equipment, you have to address it's given name. Example: You create a variant of 'Matilda LP'-tank with better Armor and Main Gun and name it 'Matilda LP Mk. IV'.

Now use 'add_latest_equipment 1000 Matilda LP Mk. IV'.

addfundsAdds funds to all MIOsAdds 1000 funds to every MIO (military industrial organisation)addTaskCapacity [number]Adds task capacity to all MIOsDefaults to 1 if no input given.

To add task capacity to only a specific MIO, you will need to find the MIO id in \Hearts of Iron IV\common\military_industrial_organization\organizations\<your country's tag>.txtThen you use addTaskCapacity [<MIO id>] [number]

addSize [number]Adds trait points to all MIOsDefaults to 1 if no input given.

To add trait points to only a specific MIO, you will need to find the MIO id in \Hearts of Iron IV\common\military_industrial_organization\organizations\<your country's tag>.txtThen you use addSize [<MIO id>] [number]

add_cic_bank [number]Adds Economic Capacity Surplus for the player in the International MarketDefaults to 1 if no input givenwhitepeace(wp) [<country tags>]White peace with the specified countries.teleport(tp)Activates the Teleportation toolCan teleport units where ever you tell them to go (right click a province with a selected unit)allowdiplo(adiplo,nocb)Allows to use all diplomatic actions for no matter the rules. (Can declare war without justification)This is likely the most effective way of wanting to start a war without needing to wait for the justification. If you only want instant justification and not the extra options it comes with, then use (instant_wargoal).debug_crash(crash)Crashes the game.debug_nukingAllows to nuke every province without checking any conditions.instantconstruction (ic)Toggles instant construction cheat.Affects AI. Ships are also constructed instantly.research [<slot id> or "all"]Researches a technology from research slot or all.Research all will instant research all technologiesresearch_on_icon_click (roic)Research a technology when clicking on technology tree iconWill Allow you to research an item without its prerequisite or two mutually exclusive itemsannex [<Target Country Tag> or "all"]Begin annex/annexes the specified tagannex USA or annex d01 or annex allpuppet [<Puppeteer Country Tag>] [<Puppet Target Country Tag>]Turns the target country into a puppet of the puppeteerpuppet GER CZE (Czechoslovakia becomes a puppet of German Reich)manpower [amount]Adds manpower to playerDefaults to 10 million if the number isn't specified.add_opinion [<Country tag>]Add opinion to/from tagAdds 100 opinion (hardcoded number) to and from target country (add_opinion ENG for instance). A successfull call prints "<country> have 100 more opinion about you" and it appears as "cheat_opinion_modified_good" in the diplomacy screenobserve(spectator)Switches to play no country at all, and no longer shows messages or pauses the game. However, it also interferes with AI performance and is not a good indication of what the AI will do if observe mode is not used.tdebugToggles Debug infoHelpful for finding nation tags and ID'soccupationpaint(op)Toggles occupation painting. If used with country tag occupies all of their owned, not controlled, land,op JAPsetowner [<country tag>]Sets state ownerSelect the state you would like to set owner as. Select a state by clicking it. You need to click the state as the state id no longer works.setcontroller [<country tag>] [province id]Sets province controllerxp [<XP amount>]Gives Army, navy and air experience to playerCan be used once per daypp(fuhrer_mana,political_power) [PP amount]Gives(or removes) political power to playerDefaults to 1000 if the amount is unset.fuel [<amount>]Adds Fuelfuel 100000 (capped at your deposits capacity, adding much more will result in decreasing fuel)civilwar [<ideology>] [<target country tag>]Spawns a civil warcivilwar fascism ENG:

Other Valid ideologies "communism" "democratic" "neutrality"

add_party_popularity <ideology group> <value>Adds party popularityideology group has shortcuts d f n c for vanilla HOI groups.set_ruling_party <ideology group>Sets ruling partyideology group has shortcuts d f n c for vanilla HOI groups.Focus.AutoComplete (fa)Allows national focuses to be instantly finishedAffects AIFocus.NoChecksIgnores focus requirementsAffects AIFocus.IgnorePrerequisitesIgnores focus prerequisitesAllows you to start a focus in the middle of the tree. Affects AIDecision.FastRemoveShortens decisions to 1 dayDecision.NoChecksIgnores decision requirementsAlso disables cost, affects AIinstant_prepareInstantly prepares naval invasionsOnly works in debug mode.instanttraining (it)Instantly trains divisions and shipsAffects AInuke [number]Adds nukesAdd 100 or 1000ai_acceptAI will accept all diplomatic offersadd_core <state_id>Adds coresAgency.InstantMakes everything regarding agencies instant.Equivalent to a combination of Operation.Instant, IntelNetwork.Instant, Agency.InstantSlotUnlock, and Agency.AutocompleteAgency.InstantSlotUnlockRemoves wait time between agent recruitsAgency.AutocompleteInstantly completes agency upgradesprevent_operative_detectionYour operatives/spies won't be detected anymoreforce_operative_detectionYour operatives/spies will be detectedOperation.instantInstantly finishes all operationsMight affect aiagency.keepexcessoperativesdeleteallunits(delall) [country]Delete all armies and fleets of the specified countries.deleteallunits SPRdeleteallunitsbut(delallbut) [country]Delete all countries' armies and fleets, with the exception of one country.delallbut SPRadd_autonomy [<Target Country Tag>] [num]Changes a country's autonomy leveladd_autonomy PHI -200resistanceIncreases resistance in the selected province by set amountex: (selects one of the provinces in Berlin) resistance 100complianceIncreases compliance in the selected province in game by set amountex: (selects one of the provinces in Danzig) compliance 100add_intel [<Country tag 1>] [Country Tag 2] [civilian,army,navy,airforce]=[number]

add_intel [<Target Country tag>] [civilian,army,navy,airforce]=[number]

Sets the inputted intel the first tag has against the second tag. The set intel amount is a static value (will be permanent for the rest of the game).ex (sets intel player has against France to max): add_intel FRA

ex (sets army intel Germany has against USA to 20%): add_intel GER USA army=20

ex (sets airforce and civilian intel Player has against Japan to 90% and 76% respectively): add_intel JAP airforce=90 civilian=76

add_minesMaximises player owned naval mines in the selected regionsacclimization [<climate type>] [<number>]Sets the selected division's acclimization to the specified climate type and its percentage (reduces penalties from cold/hot weather or temperature debuffs)ex: acclimization cold_climate 75

ex: acclimization hot_climate 20Note that it resets the opposite climate type to 0%

Several other commands previously mentioned, such as event, are useful in modding too.

CommandEffectExample/Commentguibounds(gui)Toggles the GUI bounds debug, allowing to test for different window sizes easier.Also grants the name of the sprite and the interface element the player is hovering on, allowing to find the location of the image by searching every /Hearts of Iron IV/interface/*.gfx file at the same time.set_var [<variable>] [<value>]Changes the value of a variable to the specified value.get_var [<variable>]Shows the value of a variable in the consolelist_varsLists the variables set in the selected scope and their values.set_country_flag [<Country Flag>]Adds a country flag to currently played nation.Does not work if you put another nations tag in the command such as "set_country_flag flag AUS", even if it says in console that it does.set_global_flag [<Global Flag>]Adds a global flag.list_flagsLists currently active flags in the console windows.Context senstive if nothing (global_flag), country (country_flag) or state (state_flag) is selected when entering this command.trigger [<scripted_trigger_name>]Checks if a scripted trigger is true or not.effect (eval_effect) (e) [<scripted_effect_name>]Executes a scripted effect, within the currently selected scope.Example: e POL_remove_danzig_effect on a state will execute that effect on the state.ai [country tag...]Toggles the AI on or offWithout parameters toggles the AI for all countries. With parameters, toggles exceptions for those countries from the general rule. Can be used to confirm if a crash is AI-related.aiviewEnable AI debug infohuman_aiMakes the AI control the country currently led by the player while the player also remains in control.AI will also create logs within /Hearts of Iron IV/logs/scripted_ai.log in the user directory.set_cosmetic_tag [<country tag>] [<cosmetic tag>]changes the name and flag of the countryset_cosmetic_tag USA SOVreload [<type>]Reloads files of a given type. Also accepts individual files within the /Hearts of Iron IV/interface/ folder. Equivalent to the effect done automatically when saving over a file with debug mode turned on via launch options.
  • reload loc (reloads localisation files)
  • reload focus (reloads focuses)
  • reload landcombat.gui (reloads land combat interface)
reloadoob [<Target Country Tag>]Reloads orders of battle.reloadinterfaceReloads the entire interfacereloadtechnologiesReloads the technology databaseupdateequipmentsUpdates the equipment databaseupdatesubunitsUpdates the subunit databaseupdate_loc [localization tag]Updates the localization tag fileerrorOpens the error log file.If there are special characters in the folder path, this won't work. Equivalent to pressing on the error dog if enabling debug mode in launch options.imguiControls ImGui UIs. Use imgui show to list the available subcommands. These UIs cover a wide variety of useful modding tools, such as script profiling, AI debugging, and listing characters.goto_province [province id]Moves the camera position to the specified province.goto_state [state id]Moves the camera position to the specified state.
CommandEffectExample/CommentShowTechBonusUnknown what it does, however with the name we can make a guess it has to do something with tech bonuses. Filed as developer only.normalsUnknown what it does. Filed as developer only.rendertypeReports what render backend is usedtweakerguiSpawns a tweaker GUItimeWhat time is it?reloadfx [Arguments: map/mapname/postfx or *.fx filename]Reloads the shaderparticle_editorSpawns a particle editoranalyzetheatres(anth)Analyze theatres for errors.massconquer(massc)Mass conquer tool. Requires direct province names. Filed under developer only.aircombat(airc) [<scenario name>] [<result name>] [<province id>] [<state id with airbase>] [<state id with airbase>] [<equipment type>] [<equipment type>] [<equipment creator country>] [<equipment creator country>]Spawns an air combat in desired location.frontsToggle visibility of the foreign frontsai_front_dump (aifrontdump)Dump AI front data to log file, needs to have a unit selectedtraderoutesToggle visibility of trade routesdebug_tacticsToggle visibility of debug tooltip for tacticsreloadsupply(relsup)Reinitializes the supply systems.deltat [<speed factor>]control animation speedsbuilding_health(bhealth) [<building type>] [<state or prov id>] [<building level>] [<health to add>]Changes specified building healthnomapiconsToggles map icons.nopausetextToggles the pausebanner for nicer screenshots.nextsongChanges the currently playing soundtrack.combatsoundHow often does the combat view give a random sound? 0-50morehumans(humans) [num]Adds more humanswindow(wnd) [Arguments: open/close] [window gui name]Opens or closes the specified windowpollPolls valid Eventspause_in_hoursPauses the game after X hours have passed after command is calledwinwarsGives max war score in all wars for the countryCommand no longer exists as of patch 1.9.1testevent [<Event ID>] [<Character ID>]Tests an event without triggering itresignResign from the gameadd_interest [<Country tag>]Add specified country tag to your interestremove_interest [<Country tag>]Removes specified country tag from your interestadd_diploAdds diplomatic entroutePrintSynchStuffPrints random count and seedSetRandomCountSets the random count to 0 or argai_invasionToggles AI AI naval invasionsai_pp_logPrints AI use of PP to logai_idea_desire_logPrints AI desire for ideas to log. For current country onlyai_force_templateForce the AI to only spend army XP on template designai_force_equipmentForce the AI to only spend army XP on equipment designai_front_idGet the address of selected group's front debug IDfow(debug_fow) [Province ID]Turns off fog of war, only within a province if specified.collision(debug_collision)Toggles debug display of normals/bounding boxes/collisionsavegameCreates a savefile.savecheckMakes a save file (Test_01), loads the save file, makes a new savegame (Test_02). Those save files should look the same.IPShows your IPrequestgamestateRequests the gamestate from hostnudgeGo to the nudge toolmapmode [Mapmode type (int)]Change mapmode.fullscreenToggles fullscreenpricesPrice Inforemove_core [<State ID>] [<Country Tag>]Remove core. Note:Does not Workdebug_zoomZooms in the gamedebug_typesWill print the data type for all dynamic reference objects. Can only be used if using RTTI.debug_show_event_IDShows event IDdebug_commandsPrinting commandcount to message.logdebug_eventsStart Counting eventsdebug_dumpeventsDump Event data to game logdebug_diploactionsStart Counting diplomatic actionsdebug_dumpdiploactionsDump diplomatic action data to game logdebug_assertToggles asserts on/offdebug_smoothToggle framesmoothingdebug_nomouseToggles mouse scrollwheel on/offdebug_terrainToggles Terrain on/offdebug_citiesToggles Cities painting mode on/offdebug_waterToggles Water on/offdebug_frontsToggles interpolated fronts debugdebug_off_front_snap(dbg_fsnap)Toggles offensive fronts snapping debugdebug_bordersToggles Borders on/offdebug_treesToggles Trees on/offdebug_riversToggles Rivers on/offdebug_postfxToggles PostFX on/offdebug_skyToggles Sky on/offdebug_bloomToggles Bloom on/offdebug_tooltipToggles Tooltips on/offflagsoutput [<path>]Creates texture atlas files from memory.cityreloadReloads the citiesversionShow current game versiondebug_noguiToggles GUI on/offdebug_volume [<Volume Delta>]Modifies music volumedebug_lockcameraToggles Camera locked on/offdebug_linesToggles Debuglinesdebug_entitiesToggles Debug entitiesdebug_infoToggles Debug infodebug_particleToggles Particles Debug infodebug_ai_budget [CountryTag]Show ai budget datadebug_texturesWrites Texture info to application debug logdebug_texturedraws textures like bloomdebug_wireframeToggles forced wireframe on/offdebug_achievements_clearClear all achievements and user statsonly for developermoveunit [<Unit ID>] [<Province ID>]Moves a unit to a provincespawnactor [<Actorname>] [<Province ID>] [<Animation> OPTIONAL]Spawns an actor with an optional animationcameraclampToggles the camera clampingprovtooltipdebug(tdebug)Toggles the debug info in province tooltipreloadweather [<randomseed>]Reload and regenerate weatherweatherToggle weather simulationdebug_air_vs_land(dbg_cas)Toggle debug mode for air vs land combat.mapnamesToggle map namesgbreloadReloads gradient bordersonly for developersgbpaint [layer] [channel]Toggles gradient border paintingprofilelogPrints out the profiling informations into time.logrunRuns the specified file with list of commandsoosOut of Synchtrigger_docs(effect_docs, scripting_docs, docs)Print docs for triggers, effects, and variablesDocumentation for triggers/effects printed to game.log filethreat [Threat amount]Adds or show threat level of the current tag, which is the world tension generated by the tag.Positive values will add to the world tension generated by the active tag, while negative values will subtract from the world tension generated by the active tag, with corresponding entries in the world tension history log. By tag-switching, it is possible to raise or lower the world tension generated by any particular country. If one does "threat 999999999" it will reset the world tension to 0.3dstatsToggles 3D StatshdrToggles hdrhdr_debugToggles hdr debuggingsrgbToggles sRGBbloomToggles bloomPostEffectVolumes.Default [posteffect_values name]Toggles default posteffect valuesnightToggles night*as of 1.01 this does not seem to work (filed under developer-only command) This command can be emulated via the day/night loop option at the bottom right toolbar (shortcut key 'N')filewatcherToggles filewatchercreateleanCreate LEAN textureshelplogPrint out all console commands to game.log file.helphelpDouble Rainbow help.hsvConverts RGB to HSVtag_colorTest setting a country's colorbrowser [url]Show browser windowbrowser_base_url [url]Set browser base urlairealismEnable realistic AIAn easter egg making the AI smacktalk in chats. Useless since unactivable in multiplayer and chat unactivable in singleplayer.[1]instant_wargoalWill allow instant justificatiion of war goals on countriesallowideasAllows the player to pick any idea even if normally unavailableThis overrides the available and visible triggers of ideas, but not the allowed triggerrelease [<country tag>]Releases a country or releasable nationrelease slv releases SloveniaInternationalMarket.AddSubsidyForTags [<economic capacity>] [<equipment>] [<country tag>]Adds a subsidy for the player to buy off from a specified country.ex (Adds a subsidy for the player to be able to help buy German sold light tanks for up to 5k EC): InternationalMarket.AddSubsidyForTags 5000 light_tank_chassis GERrandom_seedRandomises the current seed the game is usingThe AI uses this seed to decide all their focuses and decisions.

You can use this to generate a more favourable outcome to any ai action you dislike (e.g. you want to ally with country)

Console commands - Hearts of Iron 4 Wiki (2024)

References

Top Articles
Latest Posts
Article information

Author: Edmund Hettinger DC

Last Updated:

Views: 6258

Rating: 4.8 / 5 (58 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Edmund Hettinger DC

Birthday: 1994-08-17

Address: 2033 Gerhold Pine, Port Jocelyn, VA 12101-5654

Phone: +8524399971620

Job: Central Manufacturing Supervisor

Hobby: Jogging, Metalworking, Tai chi, Shopping, Puzzles, Rock climbing, Crocheting

Introduction: My name is Edmund Hettinger DC, I am a adventurous, colorful, gifted, determined, precious, open, colorful person who loves writing and wants to share my knowledge and understanding with you.