Hands-On Usage
can_construct_building is commonly used within the available block of decisions or focuses to pre-validate whether the target state and country meet the construction requirements before triggering building-related rewards, preventing invalid construction after script execution. For example, in an "Industrialization Plan" decision, players are only allowed to click if the state truly permits factory construction:
available = {
GER = {
65 = {
can_construct_building = industrial_complex
}
}
}
Synergy
[free_building_slots](/wiki/trigger/free_building_slots): Works in conjunction with can_construct_building to further confirm that the target state has sufficient remaining building slots, providing dual insurance against construction failure.
[add_building_construction](/wiki/effect/add_building_construction): Typically serves as the effect execution body after can_construct_building conditions are met, responsible for actually queuing the construction task.
[is_owned_and_controlled_by](/wiki/trigger/is_owned_and_controlled_by): Construction operations often require the state to be both owned and controlled by the target country; pairing with this trigger ensures complete prerequisites.
[has_state_category](/wiki/trigger/has_state_category): Different state categories determine the upper limit of available building slots; combined use filters for high-tier states with construction potential.
Common Pitfalls
- Incorrect Scope Nesting: This trigger must be called within STATE scope, with an outer layer switching to the corresponding country scope (as ROOT). Beginners often write
can_construct_building directly under country scope, causing game errors or conditions that never fire. Always follow official examples by switching to the country scope first, then nesting the state scope.
- Confusing Trigger and Effect:
can_construct_building only performs validation; it does not actually start construction. Some players mistakenly believe that once conditions are met, buildings automatically queue, but in reality you must additionally call add_building_construction within the effect block to produce construction behavior.