Wiki

effect · set_war_support

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Sets the war support to the country in scope. Example: set_war_support = 80

实战 · 配合 · 坑

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

实战用法

set_war_support 常用于国家焦点、事件或决议中,将战争支持度强制设定到某一固定值,适合剧情节点需要精确控制民心的场景(如历史事件触发后将某国士气归零或拉满)。与 add_war_support 的增减逻辑不同,它直接覆盖当前值,适合"重置"而非"调整"的需求。

# 某事件导致国家陷入厌战情绪,直接将战争支持强制压低
country_event = {
    id = my_mod.5
    option = {
        name = my_mod.5.a
        set_war_support = 10   # 强制设为 10%,而非在当前值基础上加减
    }
}

配合关系

  • [add_war_support](/wiki/effect/add_war_support):两者互补——set_war_support 用于硬性锚定初始值,之后再用 add_war_support 做动态微调,避免叠加误差。
  • [add_stability](/wiki/effect/add_stability):战争支持度与稳定度通常在同一事件中联动调整,共同反映国内政治气候的剧变。
  • [has_war_support](/wiki/trigger/has_war_support)(注意:此处使用白名单内对应的战争支持触发器)——实际应搭配 [has_bombing_war_support](/wiki/trigger/has_bombing_war_support)[has_casualties_war_support](/wiki/trigger/has_casualties_war_support) 作为前置条件判断,确认当前士气阈值后再决定是否需要执行强制覆盖。
  • [add_ideas](/wiki/effect/add_ideas):常在同一 option 中一起使用,用某个 idea 来叙事解释为什么战争支持骤变,保持游戏呈现的逻辑自洽。

常见坑

  1. add_war_support 混用逻辑错误:新手经常在已有较高战争支持度时使用 set_war_support = 50 期望"加到 50",实际上该命令是直接覆盖,若当前值已高于目标值则会导致支持度反而下降,应先用 [has_war_support](/wiki/trigger/has_war_support) 类触发器检查再决定用哪个命令。
  2. 数值范围未做限定:传入的数值超出游戏允许范围(通常为 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

set_war_support is commonly used in national focuses, events, or decisions to force war support to a fixed value, making it ideal for narrative moments requiring precise control over morale (such as resetting a nation's morale to zero or maxing it out after a historical event trigger). Unlike add_war_support, which applies relative adjustments, this command directly overwrites the current value, suited for "reset" scenarios rather than "fine-tuning" needs.

# An event causes the nation to fall into war weariness; directly force war support down
country_event = {
    id = my_mod.5
    option = {
        name = my_mod.5.a
        set_war_support = 10   # Force to 10%, not an addition to the current value
    }
}

Synergy

  • [add_war_support](/wiki/effect/add_war_support): The two are complementary—set_war_support anchors the initial value firmly, then add_war_support applies dynamic fine-tuning afterward, avoiding cumulative errors.
  • [add_stability](/wiki/effect/add_stability): War support and stability are typically adjusted in tandem within the same event, jointly reflecting shifts in the domestic political climate.
  • [has_war_support](/wiki/trigger/has_war_support) (note: use the corresponding war support trigger from the whitelist)—should actually be paired with [has_bombing_war_support](/wiki/trigger/has_bombing_war_support) or [has_casualties_war_support](/wiki/trigger/has_casualties_war_support) as precondition checks to confirm the current morale threshold before deciding whether forced overwrite execution is necessary.
  • [add_ideas](/wiki/effect/add_ideas): Often used together in the same option to narratively explain why war support fluctuates sharply, maintaining logical consistency in the game's presentation.

Common Pitfalls

  1. Logic errors from mixing with add_war_support: Beginners often use set_war_support = 50 when war support is already high, expecting it to "add up to 50"—but this command directly overwrites the value. If the current value is already above the target, support will actually decrease. Always check with [has_war_support](/wiki/trigger/has_war_support)-type triggers first to decide which command to use.
  2. Unvalidated numeric ranges: Passing values outside the game's allowed range (typically 0–100) may cause the engine to truncate silently or produce unexpected behavior. It's recommended to enforce valid ranges in your script logic itself rather than relying on engine-side boundary protection.