effect · set_building_level
Definition
- Supported scope:
STATE - Supported target:
none
Description
Sets specific level of a building construction for amount of levels in specified state or province
set_building_levelSTATEnoneSets specific level of a building construction for amount of levels in specified state or province
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
set_building_level 常用于 mod 中的事件或决策,直接将某州的建筑等级设定为固定值,适合初始化地图、触发特殊事件后重建基础设施、或通过决策一次性拉满特定建筑。例如,在一个"工业援助"决策中,将目标州的民用工厂直接设置到指定等级:
# 在 STATE scope 内执行
set_building_level = {
building = industrial_complex
level = 5
instant_build = yes
}
[non_damaged_building_level](/wiki/trigger/non_damaged_building_level):在执行 set_building_level 前先检测当前建筑的未受损等级,避免重复设置或逻辑矛盾。[damage_building](/wiki/effect/damage_building):可先用 damage_building 将建筑破坏至特定状态,再用 set_building_level 重建,模拟"先摧毁后重建"的剧情演出。[add_extra_state_shared_building_slots](/wiki/effect/add_extra_state_shared_building_slots):建筑等级提升后可能超出可用槽位上限,配合此命令提前扩充共享建筑槽以确保数值合法。[free_building_slots](/wiki/trigger/free_building_slots):在设置建筑前校验剩余空闲槽位是否充足,防止因槽位不足导致效果静默失败。set_building_level 直接设定等级,但若目标等级超过该州当前的可用建筑槽位,效果可能被截断或静默失败,务必先确认槽位充足或配合 add_extra_state_shared_building_slots 预留空间。add_building_construction 混淆:set_building_level 是立即到位的硬设置,不经过施工队排队流程;若不加 instant_build = yes 字段(部分版本/建筑类型需要),可能出现意料之外的行为,需注意与 add_building_construction(走正常建造队列)的本质区别。