Wiki

effect · add_divisional_commander_xp

Definition

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

Description

add divisional commander xp to unit: add_divisional_commander_xp = 10

实战 · 配合 · 坑

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

实战用法

add_divisional_commander_xp 常用于自定义事件或决议系统中,让玩家或 AI 的师级指挥官通过特定行动(如完成训练任务、赢得战役)获得额外经验值,从而加速其成长为高级指挥官。也可用于新手引导 mod 中,在游戏开局时给予玩家一定的指挥官经验奖励以降低难度门槛。

# 在某个决议完成时,为师级指挥官奖励经验
country_event = {
    id = my_mod.1
    option = {
        name = my_mod.1.a
        add_divisional_commander_xp = 25
    }
}

配合关系

由于当前白名单中暂无同 scope 下列出的其他 effect 或 trigger 命令,无法提供符合规范的交叉引用条目。建议在实际使用时结合国家级事件触发逻辑与该 effect 搭配,以确保其在正确的执行块中被调用。

常见坑

  1. 误用 scope:该 effect 的支持 scope 为空列表,意味着它在具体执行环境中有严格限制,新手常将其写在不适当的 scope(如 country 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

add_divisional_commander_xp is commonly used in custom event or decision systems to grant divisional commanders additional experience points through specific actions (such as completing training missions or winning campaigns), thereby accelerating their progression to higher ranks. It can also be utilized in beginner tutorial mods to provide players with commander experience rewards at game start, lowering the difficulty threshold.

# Award experience to divisional commander upon decision completion
country_event = {
    id = my_mod.1
    option = {
        name = my_mod.1.a
        add_divisional_commander_xp = 25
    }
}

Synergy

As there are currently no other effects or triggers listed under the same scope in the whitelist, no cross-reference entries conforming to specifications can be provided. It is recommended to combine this effect with country-level event trigger logic during actual implementation to ensure it is invoked within the correct execution block.

Common Pitfalls

  1. Incorrect scope usage: This effect's supported scope list is empty, meaning it has strict limitations in concrete execution environments. Beginners often place it in inappropriate scopes (such as the top level of country scope), causing the command to silently fail. You must verify that the script execution context correctly corresponds to the divisional commander unit.
  2. Overflow from excessive values: Directly assigning extremely large experience values (such as thousands) may cause experience calculation anomalies or unexpected rank jumps, resulting in unintended game states. It is recommended to increment values gradually and observe actual effects in test mode rather than providing excessively high values at once.