Wiki

effect · set_equipment_version_number

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Changes current version number for a given equipment type to N.
The next equipment variant created from that type will have version number N+1.

#### Example

set_equipment_version_number = { type = small_plane_airframe_1 version = 4 }

实战 · 配合 · 坑

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

实战用法

当 mod 需要重置某国的装备版本进度时(例如在剧本事件中模拟"技术倒退"或强制对齐多国版本号),可使用此 effect。典型场景是在焦点或事件中将某种机体框架的版本归零,使后续研发的改型从指定编号重新开始计数。

country_event = {
    id = my_mod.1
    # ...
    option = {
        name = my_mod.1.a
        # 将该国小型飞机机体版本重置为 2,下一个变种将为 V3
        set_equipment_version_number = {
            type = small_plane_airframe_1
            version = 2
        }
    }
}

配合关系

  • [create_equipment_variant](/wiki/effect/create_equipment_variant) — 版本号归位后立即创建新变种,可确保新变种的版本编号符合预期的叙事逻辑。
  • [add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile) — 在调整版本号的同时补充对应装备库存,模拟"重新装备"的完整流程。
  • [has_design_based_on](/wiki/trigger/has_design_based_on) — 在执行前先检查该国是否拥有基于目标装备类型的设计方案,避免对没有相关科技的国家执行此效果导致逻辑错误。

常见坑

  1. type 填写的是装备类型名(如 small_plane_airframe_1),而不是变种名称——新手常误填自定义变种的名字,导致脚本静默失败,版本号实际未改变。
  2. version 设置的是"当前已完成的版本号"而非"下一个版本号"——若希望下一个变种编号为 N,应填 version = N - 1,否则实际生成的变种版本会比预期多 1。

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

When a mod needs to reset a country's equipment version progress (for example, to simulate "technology regression" in a scenario event or force version alignment across multiple nations), this effect can be used. A typical scenario is resetting the version of a certain airframe type to zero in a focus or event, causing subsequent development variants to restart counting from a specified number.

country_event = {
    id = my_mod.1
    # ...
    option = {
        name = my_mod.1.a
        # Reset this country's small plane airframe version to 2, next variant will be V3
        set_equipment_version_number = {
            type = small_plane_airframe_1
            version = 2
        }
    }
}

Synergy

  • [create_equipment_variant](/wiki/effect/create_equipment_variant) — Create a new variant immediately after resetting the version number to ensure the new variant's version ID matches the intended narrative logic.
  • [add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile) — Replenish equipment stockpiles while adjusting version numbers to simulate a complete "re-equipment" process.
  • [has_design_based_on](/wiki/trigger/has_design_based_on) — Check beforehand whether the country possesses a design based on the target equipment type to avoid executing this effect on nations without the relevant technology, which could cause logic errors.

Common Pitfalls

  1. type should be filled with the equipment type name (such as small_plane_airframe_1), not the variant name — Beginners often mistakenly fill in custom variant names, causing the script to fail silently with the version number remaining unchanged.
  2. version sets the "currently completed version number" rather than the "next version number" — If you want the next variant numbered N, you should set version = N - 1. Otherwise, the variant actually generated will be one version higher than expected.