Wiki

effect · set_compliance

Definition

  • Supported scope:STATE
  • Supported target:any

Description

set compliance of a state. Example: set_compliance = 30

实战 · 配合 · 坑

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

实战用法

set_compliance 常用于剧本事件或决议中强制将某占领州的服从度重置到特定值,例如在"镇压起义"事件后将服从度拉回到一个稳定阈值,或在 mod 初始化时为特定历史场景预设合理的服从度起点。与逐步增减的 add_compliance 不同,它是直接覆盖赋值,适合需要精确控制数值的场合。

# 某决议执行后,将目标州服从度强制设为 50
effect_tooltip = {
    set_compliance = 50
}
hidden_effect = {
    123 = {           # STATE scope,如法国某州
        set_compliance = 50
    }
}

配合关系

  • [compliance](/wiki/trigger/compliance) — 在执行 set_compliance 前用来检查当前服从度是否满足条件,避免无意义的重复赋值或触发逻辑冲突。
  • [add_compliance](/wiki/effect/add_compliance) — 两者互补:set_compliance 做绝对赋值,add_compliance 做相对调整,常在同一事件的不同 option 里分别使用。
  • [set_resistance](/wiki/effect/set_resistance) — 服从度与抵抗度通常需要同步调整,镇压或解放场景里往往同时调用两者以保持数值逻辑一致。
  • [set_occupation_law](/wiki/effect/set_occupation_law) — 占领法律直接影响服从度上限与增速,修改占领法律时配合 set_compliance 可立即体现政策变化效果。

常见坑

  1. Scope 写错位置set_compliance 必须在 STATE scope 下调用,直接写在国家 scope(如 GER = { set_compliance = 50 })会静默失败且不报错,新手常因此找不到效果不生效的原因。
  2. 覆盖而非累加:新手容易混淆它与 add_compliance——set_compliance直接替换当前值,如果本意是奖励玩家"增加若干服从度"却误用了 set_compliance,会导致低服从度州反而被意外拉高或高服从度州被强行压低。

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

set_compliance is commonly used in scripted events or decisions to forcibly reset the compliance of an occupied state to a specific value. For example, after a "suppress uprising" event, you might pull compliance back to a stable threshold, or during mod initialization, preset reasonable compliance starting points for specific historical scenarios. Unlike the incremental add_compliance, it performs a direct value assignment, making it suitable for situations requiring precise numerical control.

# After executing a decision, forcibly set target state compliance to 50
effect_tooltip = {
    set_compliance = 50
}
hidden_effect = {
    123 = {           # STATE scope, e.g., a French state
        set_compliance = 50
    }
}

Synergy

  • [compliance](/wiki/trigger/compliance) — Use before executing set_compliance to check whether current compliance meets conditions, avoiding meaningless repeated assignments or logic conflicts.
  • [add_compliance](/wiki/effect/add_compliance) — The two are complementary: set_compliance performs absolute assignment, add_compliance performs relative adjustment. They are often used separately in different options of the same event.
  • [set_resistance](/wiki/effect/set_resistance) — Compliance and resistance typically need synchronized adjustments. In suppression or liberation scenarios, both are usually called together to maintain logical consistency in values.
  • [set_occupation_law](/wiki/effect/set_occupation_law) — Occupation law directly affects compliance cap and growth rate. When modifying occupation law, pairing it with set_compliance can immediately reflect the effect of policy changes.

Common Pitfalls

  1. Incorrect scope placement: set_compliance must be called under a STATE scope. Writing it directly in a country scope (e.g., GER = { set_compliance = 50 }) will silently fail without error messages, which is why novices often cannot find the reason the effect doesn't work.
  2. Assignment instead of accumulation: Novices often confuse this with add_complianceset_compliance will directly replace the current value. If the intention was to reward the player with "additional compliance" but set_compliance was mistakenly used instead, it can result in low-compliance states being unexpectedly raised or high-compliance states being forcibly lowered.