Wiki

trigger · state_strategic_value

Definition

  • Supported scope:STATE
  • Supported target:none

Description

Checks for state strategic value

实战 · 配合 · 坑

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

实战用法

state_strategic_value 常用于动态决策或事件的触发条件,例如限制某项占领政策、建筑建设或特殊决策仅对战略价值达标的州生效。在占领系统 mod 或战争目标 mod 中,可以用它筛选出高价值州作为优先争夺目标。

# 示例:仅当州战略价值足够高时,才允许激活某个针对性决策
available = {
    state_strategic_value > 0.5
}

配合关系

  • [has_state_category](/wiki/trigger/has_state_category):州类别(如城市、农业区等)直接影响战略价值计算,两者常联用以双重筛选目标州。
  • [state_and_terrain_strategic_value](/wiki/trigger/state_and_terrain_strategic_value):同为战略价值相关 trigger,可并列使用以区分"纯州价值"与"含地形加成的综合价值",形成更精确的条件组合。
  • [is_controlled_by](/wiki/trigger/is_controlled_by):实际场景中通常还需要确认控制权归属,配合使用可精确定位"敌占高价值州"等判断。
  • [set_state_category](/wiki/effect/set_state_category):在 effect 侧修改州类别后可能影响后续战略价值判断,常见于测试或动态改变州定位的 mod 逻辑中。

常见坑

  1. 误用 scope:此 trigger 只能在 STATE scope 下调用,若在 COUNTRY 或 CHARACTER scope 的条件块中直接写入而不先切换 scope(如通过 any_state 等迭代),会导致脚本报错或静默失败,新手常因此以为条件"永远不触发"。
  2. 阈值理解偏差:战略价值是浮点数而非整数,直接与整数比较(如写成 = 1)可能因精度问题无法命中预期州,建议使用 >< 进行范围判断而非严格等号。

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

state_strategic_value is commonly used in dynamic decision logic and event triggers, such as restricting occupation policies, building construction, or special decisions to apply only to states meeting strategic value thresholds. In occupation system mods or war goal mods, it can be used to filter high-value states as priority targets for conquest.

# Example: Allow activation of a targeted decision only when state strategic value is sufficiently high
available = {
    state_strategic_value > 0.5
}

Synergy

  • [has_state_category](/wiki/trigger/has_state_category): State category (such as city, agricultural region, etc.) directly affects strategic value calculation; the two are often used together for dual filtering of target states.
  • [state_and_terrain_strategic_value](/wiki/trigger/state_and_terrain_strategic_value): Also a strategic value-related trigger; can be used in parallel to distinguish between "pure state value" and "comprehensive value with terrain bonuses," forming more precise condition combinations.
  • [is_controlled_by](/wiki/trigger/is_controlled_by): In practical scenarios, control ownership typically also needs to be confirmed; combined use allows precise identification of scenarios like "enemy-controlled high-value states."
  • [set_state_category](/wiki/effect/set_state_category): Modifying state category on the effect side may influence subsequent strategic value judgment; commonly seen in test scenarios or mod logic that dynamically changes state positioning.

Common Pitfalls

  1. Incorrect scope usage: This trigger can only be called under STATE scope. If used directly in condition blocks within COUNTRY or CHARACTER scope without first switching scope (such as through any_state iteration), it will cause script errors or silent failures. Newcomers often mistakenly believe the condition "never triggers" as a result.
  2. Threshold understanding discrepancy: Strategic value is a floating-point number rather than an integer; direct comparison with integers (such as writing = 1) may fail to match intended states due to precision issues. It is recommended to use > or < for range judgment rather than strict equality.