Experienced generals and admirals win battles — their skill levels boost attack, defence, planning and logistics across every division they command. The gain_xp command levels up your selected leader instantly in Hearts of Iron IV.
How to use gain_xp
- Select a general or admiral on the map first — the command applies to whoever is selected.
- Open the console with the
~key. - Type
gain_xpfollowed by an amount (or a trait name) and pressEnter.
Examples
gain_xp 1000— gives 1000 experience to the selected leader, enough for several skill levels and trait slotsgain_xp seasoned_defender— grants a specific leader trait by name
Tips
- Experience unlocks skill levels (attack, defence, planning, logistics) and opens trait slots you can fill as the leader fights.
- Nothing happens if no leader is selected — reselect a general and run the command again.
See the full gain_xp command page for details.
Frequently asked questions
What is the gain_xp command in HOI4?
gain_xp [amount] gives experience to the general or admiral you currently have selected — gain_xp 1000 grants 1000, enough for several skill levels and trait slots. You must select a leader on the map before running it.
How do I level up a general in HOI4 with the console?
Click the general on the map to select them, open the console, then type gain_xp followed by an amount. The experience applies to that leader, raising their attack, defence, planning and logistics skills.
Can gain_xp give a specific trait?
Yes. gain_xp [trait name] grants a named leader trait directly to the selected commander — for example gain_xp seasoned_defender — instead of adding generic experience.
Does gain_xp work on the country leader and designers?
gain_xp affects the selected army or navy leader. Experience for designers and the political side comes from other systems, so select the general or admiral you want to level before using it.