Wiki

effect · raid_reduce_project_progress_ratio

Definition

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

Description

Reduce progress to the special project in state. Root scope is raid instance scope.
The input value is a ratio of the total needed progress to complete the special project, i.e. a decimal number between 0 and 1.
ex:
# Root scope is raid
state = {
  raid_reduce_project_progress_ratio = 0.1 # Reduces the project progress by 10%
}

实战 · 配合 · 坑

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

实战用法

此 effect 主要用于制作突袭/破坏类事件或决策,让玩家或 AI 能够通过特定行动打断敌方的特殊项目(如核武器、火箭研究等)进度。典型场景是在突袭事件链中,根据突袭成果的好坏对目标州的特殊项目造成不同比例的破坏,配合随机数或条件分支实现多档次的破坏效果。

# 突袭成功事件选项:重创敌方特殊项目
country_event = {
    id = my_raid.5
    # Root scope = raid instance
    option = {
        name = my_raid.5.a
        # 对目标州造成 30% 的项目进度损失
        state = {
            raid_reduce_project_progress_ratio = 0.3
        }
    }
    option = {
        name = my_raid.5.b
        # 小规模破坏,仅损失 10%
        state = {
            raid_reduce_project_progress_ratio = 0.1
        }
    }
}

配合关系

  • [has_state_flag](/wiki/trigger/has_state_flag):在执行破坏前先检查目标州是否挂有特定标记(如"正在进行特殊项目"),避免对无关州触发效果。
  • [set_state_flag](/wiki/effect/set_state_flag):破坏项目进度后立即给该州打上"已被突袭"标记,可用于冷却判断或后续事件触发条件。
  • [add_resistance](/wiki/effect/add_resistance):突袭行动往往伴随当地抵抗运动的激增,可同步增加目标州抵抗值以反映事件的政治影响。
  • [state_event](/wiki/effect/state_event):破坏完成后向目标州所属国家发送后续事件,通知其项目受损并触发应对选项链。

常见坑

  1. Scope 误用:此 effect 必须在 STATE scope 下调用,而 Root 是突袭实例 scope;新手常直接在国家 scope 或事件顶层写该命令,导致脚本报错或无效,需显式用 state = { ... } 块包裹才能正确切换到 STATE scope。
  2. 数值范围理解偏差:输入值是占项目总所需进度的比例(0~1),而非当前剩余进度的百分比;填入 1.0 代表清空全部进度,而不是"减少当前剩余的 100%",若目标项目已完成大半,用较小的值可能效果不如预期,需结合项目总量来规划数值。

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

This effect is primarily used to create sabotage or disruption events or decisions, allowing players or AI to interrupt enemy special projects (such as nuclear weapons, rocket research, etc.) through specific actions. A typical scenario is in a sabotage event chain, where the extent of project progress damage to the target state varies based on the quality of the sabotage outcome, combined with random rolls or conditional branches to implement multi-tier destruction effects.

# Successful sabotage event option: heavily damage enemy special projects
country_event = {
    id = my_raid.5
    # Root scope = raid instance
    option = {
        name = my_raid.5.a
        # Inflict 30% project progress loss on target state
        state = {
            raid_reduce_project_progress_ratio = 0.3
        }
    }
    option = {
        name = my_raid.5.b
        # Small-scale damage, only 10% loss
        state = {
            raid_reduce_project_progress_ratio = 0.1
        }
    }
}

Synergy

  • [has_state_flag](/wiki/trigger/has_state_flag): Check whether the target state has a specific flag (such as "special project in progress") before executing the sabotage, preventing the effect from triggering on unrelated states.
  • [set_state_flag](/wiki/effect/set_state_flag): Immediately apply a "sabotaged" flag to the state after reducing project progress, useful for cooldown logic or triggering conditions in subsequent events.
  • [add_resistance](/wiki/effect/add_resistance): Sabotage operations are often accompanied by a surge in local resistance activity; you can simultaneously increase the target state's resistance value to reflect the political impact of the event.
  • [state_event](/wiki/effect/state_event): After sabotage is complete, send a follow-up event to the country controlling the target state, notifying them of project damage and triggering response option chains.

Common Pitfalls

  1. Scope misuse: This effect must be called within STATE scope, while Root is the sabotage instance scope; beginners often write the command directly in country scope or at the event's top level, causing script errors or ineffectiveness. You must explicitly wrap it in a state = { ... } block to correctly switch to STATE scope.
  2. Misunderstanding value ranges: The input value represents a ratio of the project's total required progress (0~1), not a percentage of the current remaining progress; entering 1.0 clears all progress entirely, not "reduce the current remaining by 100%". If the target project is already largely complete, using a smaller value may not produce the expected effect, so you need to plan your values in conjunction with the total project amount.