Wiki

effect · add_region_efficiency

Definition

  • Supported scope:STRATEGIC_REGION
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

add efficiency factor to strategic region for from country

实战 · 配合 · 坑

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

实战用法

add_region_efficiency 常用于战略区域动态经济系统 mod 中,比如为某国占领或控制特定战略区域后给予生产效率加成,模拟资源开发或基础设施建设效果。通常在事件或决策的执行块中,以战略区域为 scope 触发,并通过 FROM 指向受益国家。

# 在战略区域事件中执行
strategic_region_event = {
    id = my_mod.1
    hidden = yes
    immediate = {
        add_region_efficiency = {
            target = FROM  # FROM 为触发该事件的国家
        }
    }
}

配合关系

  • [hidden_trigger](/wiki/trigger/hidden_trigger):在执行 add_region_efficiency 前,用 hidden_trigger 隐式检查目标国家是否满足条件(如是否实际控制该区域内的省份),避免效率加成被不符合预期的国家获得。
  • [meta_trigger](/wiki/trigger/meta_trigger):在需要动态构建触发条件(例如根据变量判断目标国 tag)时,用 meta_trigger 包裹逻辑,配合 add_region_efficiency 实现更灵活的多国适配场景。

常见坑

  1. scope 层级错误add_region_efficiency 必须在 STRATEGIC_REGION scope 下调用,新手常在国家 scope 或省份 scope 中直接写该命令,导致脚本静默失败或报错,需用 strategic_region = { ... } 块先切换到正确 scope。
  2. target 指向混淆target 决定哪个国家获得效率加成,若 FROM 在当前事件链中并非预期国家(例如多层事件嵌套后 FROM 已发生变化),应先用临时变量或 ROOT/PREV 明确指向正确的受益方。

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_region_efficiency is commonly used in strategic region dynamic economy system mods, such as granting production efficiency bonuses to a nation after occupying or controlling a specific strategic region, simulating the effects of resource development or infrastructure construction. It is typically triggered within event or decision execution blocks, with a strategic region as the scope, and uses FROM to point to the beneficiary nation.

# Execute within a strategic region event
strategic_region_event = {
    id = my_mod.1
    hidden = yes
    immediate = {
        add_region_efficiency = {
            target = FROM  # FROM is the nation that triggered this event
        }
    }
}

Synergy

  • [hidden_trigger](/wiki/trigger/hidden_trigger): Before executing add_region_efficiency, use hidden_trigger to implicitly verify that the target nation meets conditions (such as whether it actually controls provinces within the region), preventing efficiency bonuses from being granted to unintended nations.
  • [meta_trigger](/wiki/trigger/meta_trigger): When dynamic trigger construction is needed (for example, determining the target nation tag based on variables), wrap the logic with meta_trigger and combine with add_region_efficiency to achieve more flexible multi-nation adaptation scenarios.

Common Pitfalls

  1. Scope hierarchy errors: add_region_efficiency must be called under STRATEGIC_REGION scope. Beginners often write this command directly in nation scope or province scope, causing silent script failures or errors. Use the strategic_region = { ... } block to switch to the correct scope first.
  2. Target reference confusion: The target determines which nation receives the efficiency bonus. If FROM in the current event chain is not the intended nation (for example, after nested events FROM has changed), use temporary variables or ROOT/PREV to explicitly specify the correct beneficiary.