gain_xp Console Command
Documentation and examples for the gain_xp command in Hearts of Iron IV.
gain_xp
Gain xp for selected leader or for a leader trait
| Parameter | Description |
|---|---|
Traitrequired |
Command builder
Fill in the parameters to build a ready-to-paste gain_xp command. Fields with a dropdown let you pick a valid ID.
Examples
Here are some examples of how to use gain_xp.
Give 1000 experience to the currently selected general, field marshal or admiral.
Remove 500 experience from the selected commander — negative values subtract.
Instead of experience, grant the Hill Fighter trait to the selected commander by passing a trait ID.
Overview
gain_xp (alias xp) does two different things depending on what you pass it. Select a commander first by clicking their portrait, then run the command.
Pass a number and it adds that much experience to the selected general, field marshal or admiral — e.g. gain_xp 1000 adds 1000 XP, enough to rank them up and unlock several trait slots at once. Negative values such as gain_xp -500 subtract experience instead.
Pass a trait ID and it grants that trait directly, skipping the experience entirely — e.g. gain_xp hill_fighter gives the selected commander the Hill Fighter trait. Any commander trait works this way; the builder above lists every valid trait ID. The command only ever affects the commander you currently have selected, so click the right portrait before running it.