Hearts of Iron IV

Hearts of Iron IV

Community Portrait Pack
MouToN  [developer] 4 Oct, 2022 @ 3:32pm
Tutorial: How to fix a missing portrait reference in Vanilla [WARNING: NOT compatible with achievments]
On this example, I am going show you how to fix Lindbergh's missing large (civilian) portrait.

It is probably not the easiest way to code it, but I think it is the lightest and most elegant one.

The idea is to do it by event, rather than by editing the character file. This way, you don't have to worry about the character file being updated in a next patch. Also, it is compatible with a game already started.

So the idea is to write a country_event, that is going to be fired only once and be hidden (no pop-up message).

I'll skip the part when you have to find the character's unique identifier. It is located in ".common/characters/USA.txt". The identifier is "USA_charles_lindbergh". If you don't know how do find it, just ask in a comment, and I'll explain it.

Simply put the following text in a new event file (for example "./events/portrait_reference_fixes.txt")

add_namespace = portrait_reference_fix ### template ### #country_event = { # # id = portrait_reference_fix.[number] # # hidden = yes # fire_only_once =yes # # trigger = { # has_original_tag = TAG # has_character = TAG_my_character # } # # immediate = { # set_portraits = { # character = TAG_my_character # civilian = { # large = [spriteType name] # small = [spriteType name] # } # army = { # large = [spriteType name] # small = [spriteType name] # } # } # } # #} country_event = { id = portrait_reference_fix.1 hidden = yes fire_only_once =yes trigger = { has_original_tag = USA has_character = USA_charles_lindbergh } immediate = { set_portraits = { character = USA_charles_lindbergh civilian = { large = "GFX_portrait_USA_charles_lindbergh" } } } }
Last edited by MouToN; 4 Oct, 2022 @ 3:40pm