effect · set_garrison_strength
Definition
- Supported scope:
STATE - Supported target:
any
Description
set initial garrison strength. Example: set_garrison_strength = 0.5
set_garrison_strengthSTATEanyset initial garrison strength. Example: set_garrison_strength = 0.5
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
set_garrison_strength 常用于 mod 中重置或初始化占领区的驻军强度,例如在玩家刚占领一个州时将其设为较低值以模拟兵力不足的状态,或在剧本事件中强制将某地区的驻军恢复至满编。典型场景包括:反抗军事件链触发后削减驻军、以及在特定国策完成后提升关键州的初始驻军强度。
# 某国策完成后,将目标州驻军强度设为满编
some_state = {
set_garrison_strength = 1.0
}
# 反抗事件触发后,削减占领州的驻军
event_target:contested_state = {
set_garrison_strength = 0.3
}
[has_active_resistance](/wiki/trigger/has_active_resistance):在执行驻军强度修改前,先判断该州是否存在活跃抵抗运动,避免对稳定地区做多余操作。[set_resistance](/wiki/effect/set_resistance):两者常成对使用——同时设定抵抗值与驻军强度,构建一个完整的占领初始状态。[add_compliance](/wiki/effect/add_compliance):驻军强度调整后,配合顺从度修改可同步校准占领区的整体稳定性数值,使状态更符合剧本预期。[set_occupation_law](/wiki/effect/set_occupation_law):占领法律与驻军强度共同决定镇压效率,切换占领法时一并重置驻军强度可避免数值错位。500),导致驻军被设为异常的超高强度或直接被引擎截断,应始终使用小数形式。STATE scope 下执行,若直接写在 COUNTRY scope 的 immediate 块中而未先切换到具体州,脚本将静默失效且不报错,排查时极易遗漏。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.
set_garrison_strength is commonly used in mods to reset or initialize the garrison strength of occupied states—for example, setting a low value when a player first occupies a state to simulate insufficient forces, or forcibly restoring a region's garrison to full strength during scripted events. Typical scenarios include reducing garrison after resistance event chains trigger, and increasing initial garrison strength in key states after specific national focuses complete.
# After a national focus completes, set the target state's garrison to full strength
some_state = {
set_garrison_strength = 1.0
}
# After a resistance event triggers, reduce garrison in the contested state
event_target:contested_state = {
set_garrison_strength = 0.3
}
[has_active_resistance](/wiki/trigger/has_active_resistance): Before modifying garrison strength, check whether the state has active resistance to avoid unnecessary operations on stable regions.[set_resistance](/wiki/effect/set_resistance): These two are often used in pairs—simultaneously setting resistance value and garrison strength to establish a complete initial occupied state.[add_compliance](/wiki/effect/add_compliance): After adjusting garrison strength, pairing it with compliance modifications allows synchronized calibration of the occupied region's overall stability metrics, ensuring the state matches scenario expectations.[set_occupation_law](/wiki/effect/set_occupation_law): Occupation law and garrison strength jointly determine suppression efficiency; resetting garrison strength when switching occupation laws prevents value misalignment.500), causing garrison to be set to abnormally high strength or be truncated by the engine. Always use decimal form.STATE scope. If written directly in a COUNTRY scope's immediate block without first switching to a specific state, the script fails silently without error, making it easy to overlook during troubleshooting.