Wiki

effect · modify_building_resources

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Modifies resource output of specific building for this country only
Example: modify_building_resources = {
	building = radar_station
	resource = oil
	amount = 2
}

实战 · 配合 · 坑

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

实战用法

modify_building_resources 常用于国策、决议或事件中,为特定国家的某类建筑赋予额外资源产出加成,例如科技路线点亮后让雷达站额外产出石油,或通过特殊国策让炼油厂增产稀有资源。该效果只作用于触发国,不会影响其他国家同类建筑,适合做差异化的国家特色加成。

# 示例:完成某国策后,本国所有合成精炼厂额外产出 1 单位钢铁
focus = {
    id = MY_FOCUS_RESOURCE_BOOST
    ...
    completion_reward = {
        modify_building_resources = {
            building = synthetic_refinery
            resource = steel
            amount = 1
        }
    }
}

配合关系

  • [add_resource](/wiki/effect/add_resource):前者永久改变建筑单位产出倍率,后者直接增减州的资源储量,两者组合可同时实现"建筑长期增产 + 即时补充库存"的双重效果。
  • [has_built](/wiki/trigger/has_built):在 if / limit 中先检测该国是否建有目标建筑,再触发 modify_building_resources,避免对没有对应建筑的国家施加无意义的修改。
  • [add_dynamic_modifier](/wiki/effect/add_dynamic_modifier):动态修正器可以附加可撤销的属性加成,与 modify_building_resources 的永久性加成互补,适合做限时活动或战时政策。
  • [add_ideas](/wiki/effect/add_ideas):国策思潮(idea)中若已含有建筑资源乘数,可与 modify_building_resources 叠加,在 reward 中同时调用两者以构建完整的经济加成包。

常见坑

  1. building 字段必须填内部 ID 而非本地化名称:例如应写 synthetic_refinery 而非 "合成精炼厂",填错会导致效果静默失效,日志中也不一定报错,极难排查。
  2. 该效果无法撤销modify_building_resources 没有对应的移除命令,一旦执行便永久生效;若需要可撤销的版本,应改用 add_dynamic_modifier 配合含有建筑资源修正的动态修正器,而不是直接调用本命令。

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

modify_building_resources is commonly used in national focuses, decisions, or events to grant additional resource output bonuses to specific building types for a particular nation. For example, unlocking a tech path can make radar stations produce extra oil, or a special focus can increase rare resource output from refineries. This effect only applies to the triggering nation and does not affect other nations' buildings of the same type, making it ideal for creating nation-specific economic bonuses.

# Example: After completing a focus, all synthetic refineries in your nation produce an additional 1 unit of steel
focus = {
    id = MY_FOCUS_RESOURCE_BOOST
    ...
    completion_reward = {
        modify_building_resources = {
            building = synthetic_refinery
            resource = steel
            amount = 1
        }
    }
}

Synergy

  • [add_resource](/wiki/effect/add_resource): The former permanently modifies building output multipliers, while the latter directly adds or removes state resources. Combined, they achieve both "long-term building production increase + immediate inventory replenishment" effects.
  • [has_built](/wiki/trigger/has_built): Use this in if / limit blocks to first verify that a nation has constructed the target building before triggering modify_building_resources, avoiding meaningless modifications to nations lacking the relevant building.
  • [add_dynamic_modifier](/wiki/effect/add_dynamic_modifier): Dynamic modifiers attach revocable attribute bonuses that complement the permanent nature of modify_building_resources, ideal for time-limited events or wartime policies.
  • [add_ideas](/wiki/effect/add_ideas): If a national idea already contains building resource multipliers, it can stack with modify_building_resources. Call both in rewards simultaneously to construct a comprehensive economic bonus package.

Common Pitfalls

  1. The building field must use the internal ID, not the localized name: For example, write synthetic_refinery rather than "合成精炼厂". Using the wrong identifier causes silent failure with no guaranteed error in logs, making it extremely difficult to debug.
  2. This effect cannot be reverted: modify_building_resources has no corresponding removal command—once executed, it takes permanent effect. If you need a revocable version, use add_dynamic_modifier with a dynamic modifier containing building resource adjustments instead of calling this command directly.