Hands-On Usage
any_province_building_level is most commonly used in defensive fortification checks — for example, detecting whether any province in a state has a bunker below a certain level in order to unlock a reinforcement decision. It also works well for fort or naval base level checks, enabling conditional branching alongside occupation or resistance mechanics.
# Decision available block: only allow the reinforcement decision if any coastal province
# in this state has a coastal_bunker below level 3
available = {
any_province_building_level = {
province = {
limit_to_coastal = yes
}
building = coastal_bunker
level < 3
}
is_controlled_by = ROOT
}
Synergy
- set_building_level: Once the trigger detects that a province's building level is insufficient, use this effect to raise it directly to the desired level — forming a clean "detect → build up" loop.
- add_building_construction: Pair with the trigger so that when the low-level condition is met, construction is queued rather than instantly set, which fits more naturally into the game's economic flow.
- non_damaged_building_level: Another province-level building trigger; can be used alongside
any_province_building_level to distinguish between a building's nominal level and its undamaged effective level.
- free_building_slots: Before deciding to add new construction, use this trigger first to confirm the state still has open building slots, preventing invalid build orders from being queued.
Common Pitfalls
- Wrong scope causes script errors:
any_province_building_level is only valid inside a STATE scope. Writing it inside a limit or trigger block at COUNTRY scope will cause a silent failure or an error. You must first switch into STATE scope via something like capital_scope or every_state.
id and all_provinces are mutually exclusive but sometimes written together: Inside the province sub-block, id = xxx and all_provinces = yes cannot coexist. Using both at the same time results in undefined behavior. Beginners often assume this means "narrow down first, then scan all" — but in practice you must choose one or the other.