Wiki

effect · set_portraits

Definition

  • Supported scope:COUNTRY, CHARACTER
  • Supported target:none

Description

set portraits for the target character. Syntax is similar to character files.

example:
set_portraits = {
		character = my_character # optional, use if not in a character scope		army = { small ="MySmallCharacterGFX"}
		civilian = { large ="MyLargeCharacterGFX" }
}

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

Hands-On Usage

set_portraits most commonly appears in dynamic character replacement scenarios: when a character undergoes an identity transformation due to a storyline event (such as exile, disguised infiltration, or promotion with costume change), their portrait needs to be swapped without rebuilding the character. It can also be used for DLC-style cosmetic mod packages, dynamically switching leader or general portraits based on the player's selected national appearance branch.

# Leader of a nation changes appearance after a coup
country_event = {
    id = my_mod.5
    option = {
        name = my_mod.5.a
        set_portraits = {
            character = GER_my_leader
            civilian = { large = "GFX_my_leader_disguised_large" }
        }
    }
}

Synergy

  • [set_character_name](/wiki/effect/set_character_name): Portrait changes often go hand-in-hand with renaming; using both together enables a complete "identity reinvention" with synchronized visual and name updates.
  • [add_country_leader_trait](/wiki/effect/add_country_leader_trait) / [remove_country_leader_trait](/wiki/effect/remove_country_leader_trait): Portrait replacement typically corresponds to changes in character abilities; combining these with trait additions/removals creates a more complete character transformation.
  • [promote_character](/wiki/effect/promote_character): When a character is promoted to a new position, pair set_portraits with exclusive portraits for their new role to avoid the awkwardness of sharing the same image across old and new positions.
  • [has_character](/wiki/trigger/has_character): Before execution, verify the target character actually exists in the country using this trigger to prevent script errors or silent failures.

Common Pitfalls

  1. Forgotten GFX definitions: set_portraits only specifies the GFX key name; if the corresponding spriteType is not declared in interface/*.gfx files, the game won't error but will display a default placeholder image. Beginners often mistakenly think the command itself is broken.
  2. Scope confusion: When used under country scope, the target character must be specified via character = <token>; if already within character scope it can be omitted, but mixing both (being in character scope while also writing character =) won't error but easily muddies intent and causes misreading during later maintenance.