effect · add_extra_state_shared_building_slots
Definition
- Supported scope:
STATE - Supported target:
none
Description
add extra shared building slot to state
add_extra_state_shared_building_slotsSTATEnoneadd extra shared building slot to state
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
add_extra_state_shared_building_slots 常用于奖励玩家占领特定州或完成国策/决议时,为目标州额外增加共享建筑槽位,从而允许在该州建造更多基础设施或工厂。例如在一个"开发殖民地"类决议中,每次执行决议就为目标州解锁额外槽位:
# 在决议的 complete_effect 中,目标 scope 为 STATE
complete_effect = {
526 = { # 目标州的 state_id
add_extra_state_shared_building_slots = 1
add_building_construction = {
type = industrial_complex
level = 1
instant_build = yes
}
}
}
[add_building_construction](/wiki/effect/add_building_construction):增加槽位后立即安排建筑施工,确保新槽位被有效利用,避免玩家拿到空槽但没有后续引导。[free_building_slots](/wiki/trigger/free_building_slots):在执行前用此触发器检查当前剩余槽位数量,可以设计"仅在槽位不足时才额外补充"的条件逻辑,防止过度堆叠。[set_state_category](/wiki/effect/set_state_category):与州等级调整配合使用,当整体升级州类型时同步追加额外槽位,使两种扩槽手段形成叠加效果。[has_state_flag](/wiki/trigger/has_state_flag):配合 state flag 记录该州已经被加成的次数,避免同一个事件链重复触发导致槽位无上限膨胀。STATE scope 下执行,若直接写在国家 scope(如 country_event 的 option 顶层)而未先用 526 = { } 或 capital_scope = { } 切入州 scope,脚本会静默失效且不报错,极难排查。[add_state_modifier](/wiki/effect/add_state_modifier) 搭配修正器属性来实现间接控制。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.
add_extra_state_shared_building_slots is commonly used to reward players with additional shared building slots in a target state when they occupy a specific state or complete a focus/decision, thereby allowing more infrastructure or factories to be constructed. For example, in a "develop colony" type decision, each execution grants the target state additional unlocked slots:
# In the decision's complete_effect, the target scope is STATE
complete_effect = {
526 = { # target state's state_id
add_extra_state_shared_building_slots = 1
add_building_construction = {
type = industrial_complex
level = 1
instant_build = yes
}
}
}
[add_building_construction](/wiki/effect/add_building_construction): Schedule building construction immediately after adding slots to ensure new slots are utilized effectively, preventing players from receiving empty slots without follow-up guidance.[free_building_slots](/wiki/trigger/free_building_slots): Use this trigger before execution to check the current remaining slot count; you can design conditional logic such as "only supplement additional slots when slots are insufficient," preventing excessive accumulation.[set_state_category](/wiki/effect/set_state_category): Use in combination with state tier adjustments; when upgrading the overall state type, synchronously append extra slots so that both slot expansion methods create a stacking effect.[has_state_flag](/wiki/trigger/has_state_flag): Use with state flags to record how many times a state has already received the bonus, preventing the same event chain from triggering repeatedly and causing slots to inflate without limit.STATE scope; if written directly in country scope (such as at the top level of option in a country_event) without first switching to state scope via 526 = { } or capital_scope = { }, the script will silently fail without error reporting, making it extremely difficult to debug.[add_state_modifier](/wiki/effect/add_state_modifier) instead with modifier properties to achieve indirect control.