Wiki

effect · promote_officer_to_general

Definition

  • Supported scope:(none)
  • Supported target:none

Description

Promote the officer of the division to a general.
Example:
promote_officer_to_general = yes # yes/no is ignored

实战 · 配合 · 坑

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

实战用法

promote_officer_to_general 常用于事件或决策链中,将某个师的指挥官自动晋升为将领,适合制作"名将崛起"或战役奖励类 mod 场景。例如在一场重大胜利事件触发后,让玩家的精锐师团长直接升格为将领:

country_event = {
    id = my_mod.1
    # ...
    option = {
        name = my_mod.1.a
        # 当前 scope 为该师的 division scope
        promote_officer_to_general = yes
    }
}

配合关系

由于当前 scope 白名单中暂无同层级的 effect / trigger 命令,无法列出有效的交叉引用。建议在调用此 effect 前,在外层逻辑中确认目标师确实存在且拥有军官,以避免静默失败。

常见坑

  1. Scope 对象错误:此 effect 必须在正确的 division scope 下执行,若直接写在国家 scope 或角色 scope 里,晋升不会生效且不会报错,是最难排查的静默问题。
  2. 师没有军官时调用:如果目标师当前没有指派任何军官(指挥官槽位为空),执行该命令不会有任何效果,新手容易误以为是脚本语法写错,实际上需要先确保师已配备指挥官。

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

promote_officer_to_general is commonly used in events or decision chains to automatically promote a division's commander to general rank, making it ideal for "rise of legendary generals" or campaign reward mod scenarios. For example, after a major victory event triggers, you can promote your elite division commander directly to general:

country_event = {
    id = my_mod.1
    # ...
    option = {
        name = my_mod.1.a
        # Current scope is the division scope
        promote_officer_to_general = yes
    }
}

Synergy

Since the current scope whitelist contains no equivalent-level effect or trigger commands, no useful cross-references can be listed. It is recommended to verify in the outer logic before calling this effect that the target division exists and has an assigned officer, to avoid silent failures.

Common Pitfalls

  1. Incorrect scope object: This effect must be executed within the correct division scope. If written directly in a country scope or character scope, the promotion will not take effect and no error will be reported—this is the hardest silent issue to debug.
  2. Calling when division has no officer: If the target division currently has no assigned officer (commander slot is empty), executing this command will have no effect. New modders often mistake this for a script syntax error, when in reality you need to ensure the division has an officer assigned beforehand.