Wiki

effect · create_navy_leader

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

create navy leader for country

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

create_navy_leader is commonly used in mods to dynamically generate historical or fictional naval commanders for specific nations, such as upon focus completion, when specific events trigger, or in bulk during the game's initial history scripts to populate fleet commanders. Below is a typical example of generating a naval leader within an event option:

country_event = {
    id = my_mod.10
    option = {
        name = my_mod.10.a
        create_navy_leader = {
            name = "Isoroku Yamamoto"
            portrait_path = "gfx/leaders/JAP/Portrait_Japan_Yamamoto.dds"
            traits = { navy_career_officer }
            skill = 4
            attack_skill = 4
            defense_skill = 3
            maneuvering_skill = 4
            coordination_skill = 3
        }
    }
}

Synergy

  • [add_naval_commander_role](/wiki/effect/add_naval_commander_role) — After creating a character via generate_character or similar methods, you can add a naval commander role; it complements create_navy_leader, with the former focused on character definition and the latter on character assignment.
  • [any_navy_leader](/wiki/trigger/any_navy_leader) — Check before execution whether a country already has naval commanders meeting specific conditions, preventing redundant duplicate generation of similar commanders.
  • [add_trait](/wiki/effect/add_trait) — Immediately append additional traits after leader creation, enabling more flexible trait combinations without hardcoding all traits within the creation block.
  • [every_navy_leader](/wiki/effect/every_navy_leader) — After generation, use this command to apply effects in bulk to all naval leaders of that nation (including newly created ones), such as uniformly adding a dynamic modifier.

Common Pitfalls

  1. Forgetting that scope must be COUNTRY: Novices sometimes call this command directly under STATE or UNIT_LEADER scope, resulting in silent script errors and the leader not being generated; the scope mismatch is only discovered when checking logs.
  2. Skill total value and individual components don't correspond: HOI4's naval leader skill field is not the automatic sum of its components—both must be filled in separately by hand. If you only set the overall skill and omit individual components, the leader's actual performance in-game will deviate from expectations.