Wiki

effect · add_naval_commander_role

Definition

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

Description

Add naval commander to character

Example:
add_naval_commander_role = {
	character = GER_Character_token # optional if inside character scope
	traits = { spotter }
	skill = 4
	attack_skill = 3
	defense_skill = 3
	maneuvering_skill = 3
	coordination_skill = 4
	}
}

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

add_naval_commander_role 常用于 mod 中为特定历史人物动态赋予海军指挥官身份,例如在某国完成特定国策或触发事件后,将预设角色提拔为舰队指挥官。它也可以用在战争爆发触发器中,即时生成具备专属技能与特质的海军将领,强化特定国家的海军作战能力。

# 在国策完成后为德国角色赋予海军指挥官角色
GER = {
    add_naval_commander_role = {
        character = GER_karl_doenitz
        traits = { spotter superior_tactician }
        skill = 4
        attack_skill = 3
        defense_skill = 3
        maneuvering_skill = 4
        coordination_skill = 3
    }
}

配合关系

  • [add_field_marshal_role](/wiki/effect/add_field_marshal_role) / [add_corps_commander_role](/wiki/effect/add_corps_commander_role):当同一角色需要根据剧情分支分别担任陆海职务时,与本命令互斥使用,确保角色职能清晰。
  • [add_trait](/wiki/effect/add_trait):在赋予海军指挥官角色之后,可进一步追加额外特质,实现分步骤的人物成长设计。
  • [remove_unit_leader_role](/wiki/effect/remove_unit_leader_role):若角色原先持有其他兵种指挥官角色,在调用本命令前先用此命令清除,避免角色角色冲突或显示异常。
  • [has_advisor_role](/wiki/trigger/has_advisor_role):常作为前置检查,确认该角色当前是否已在担任顾问职务,防止角色身份叠加导致的逻辑错误。

常见坑

  1. 在 COUNTRY scope 下遗漏 character 字段:只有在角色自身 scope(CHARACTER)内调用时才可省略 character 参数;在国家 scope 下若不指定 character = token,游戏将无法确定目标角色,导致效果静默失效且不报错,极难排查。
  2. 技能总分超出隐性上限仍可写入但显示异常:各分项技能(attack/defense/maneuvering/coordination)之和理论上应与 skill 字段保持一致的游戏内逻辑,若分项之和与 skill 差距过大,游戏会按自身公式重新计算显示值,导致实际表现与脚本设定不符。

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

add_naval_commander_role is commonly used in mods to dynamically assign naval commander status to specific historical figures. For example, after a nation completes a particular focus tree or triggers an event, you can promote a preset character to fleet commander. It can also be used in war outbreak triggers to instantly generate naval commanders with exclusive skills and traits, enhancing a specific nation's naval combat capabilities.

# Assign naval commander role to a German character after focus completion
GER = {
    add_naval_commander_role = {
        character = GER_karl_doenitz
        traits = { spotter superior_tactician }
        skill = 4
        attack_skill = 3
        defense_skill = 3
        maneuvering_skill = 4
        coordination_skill = 3
    }
}

Synergy

  • [add_field_marshal_role](/wiki/effect/add_field_marshal_role) / [add_corps_commander_role](/wiki/effect/add_corps_commander_role): When the same character needs to hold different military positions based on story branches, use these mutually exclusively with this command to keep character roles clear and distinct.
  • [add_trait](/wiki/effect/add_trait): After assigning the naval commander role, you can further add additional traits to implement step-by-step character development designs.
  • [remove_unit_leader_role](/wiki/effect/remove_unit_leader_role): If a character previously held other unit leader roles, use this command to clear them before calling this command to avoid role conflicts or display anomalies.
  • [has_advisor_role](/wiki/trigger/has_advisor_role): Commonly used as a prerequisite check to confirm whether the character is currently serving in an advisor role, preventing logic errors from stacking character identities.

Common Pitfalls

  1. Omitting the character field in COUNTRY scope: The character parameter can only be omitted when called within a CHARACTER scope; if you don't specify character = token under a country scope, the game cannot determine the target character, causing the effect to silently fail without error messages, making it extremely difficult to debug.
  2. Skill point totals exceeding implicit caps can be written but display abnormally: The sum of individual skill categories (attack/defense/maneuvering/coordination) should theoretically remain consistent with the skill field according to game logic. If the sum of individual skills diverges significantly from skill, the game will recalculate the display value according to its own formula, causing actual performance to differ from script definitions.