Wiki

effect · change_division_template

Definition

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

Description

change_division_template = "My Template Name"

实战 · 配合 · 坑

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

实战用法

change_division_template 常用于剧本事件或决议中,将某国的师级模板名称切换为新模板,例如在科技完成后自动将旧式步兵师升级为摩托化师模板。它也常见于 mod 中为 AI 国家在特定历史节点触发模板更换,以模拟编制改革。

country_event = {
    id = my_mod.1
    title = "陆军编制改革"
    option = {
        name = "推行新编制"
        change_division_template = "精锐步兵师"
    }
}

配合关系

由于本 effect 所在 scope 白名单中暂无其他可交叉引用的命令,无法列出合规的配合条目。实际开发中此命令通常需要配合外层 scope 限定与条件判断来安全使用,建议在官方 wiki 核实当前版本支持的配套命令后再组合。

常见坑

  1. 模板名称大小写与空格必须完全一致:游戏匹配模板时区分大小写和空格,若填写的字符串与实际模板名称哪怕一个字符不同,效果会静默失败且不报错,很难察觉。
  2. 作用对象不明确:该命令影响的是当前 scope 下的师,若 scope 没有正确锁定到目标单位,可能意外更改了非预期的部队模板,建议在测试时开控制台逐条核验效果。

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

change_division_template is commonly used in scripted events or decisions to switch a nation's division template name to a new one. For example, it can automatically upgrade outdated infantry divisions to motorized division templates after tech completion. It's also frequently seen in mods to trigger template changes for AI nations at specific historical points, simulating organizational reforms.

country_event = {
    id = my_mod.1
    title = "Army Reorganization Reform"
    option = {
        name = "Implement New Organization"
        change_division_template = "Elite Infantry Division"
    }
}

Synergy

Since this effect's scope whitelist currently contains no other cross-referenceable commands, no compatible entries can be listed. In actual development, this command typically requires safe usage by combining it with outer scope constraints and conditional checks. It is recommended to verify supported companion commands in the current game version on the official wiki before combining them.

Common Pitfalls

  1. Template name case and spacing must match exactly: The game performs case-sensitive and space-sensitive matching when identifying templates. If the provided string differs from the actual template name by even a single character, the effect will silently fail without error messages, making it difficult to detect.

  2. Unclear target scope: This command affects divisions within the current scope. If the scope is not correctly locked to the target unit, it may unexpectedly change unintended division templates. It is recommended to verify the effect line by line in the console during testing.