Hands-On Usage
has_built is commonly used in national focuses or mission chains to verify whether the player/AI has completed the required amount of building construction, such as "unlocking the next focus stage only after completing industrialization targets" or "military industry missions requiring construction of a specified number of arms factories". The following example demonstrates checking whether at least 3 arms factories have been built in the available block of a focus:
available = {
has_built = {
type = arms_factory
value = 3
}
}
Synergy
[building_count_trigger](/wiki/trigger/building_count_trigger): has_built counts newly constructed buildings since the goal was accepted, while building_count_trigger counts current total stock. Using both together allows simultaneous constraints on "existing foundation" and "new investment", preventing veteran players from circumventing construction requirements.
[has_completed_focus](/wiki/trigger/has_completed_focus): Commonly serves as a prerequisite condition placed alongside has_built in the available block, ensuring the player completes the related focus before triggering the construction check logic.
[activate_mission](/wiki/effect/activate_mission): Activates a mission with has_built as its completion condition in an effect block, forming a complete mission chain flow of "activate mission → track construction progress → trigger reward upon completion".
[has_active_mission](/wiki/trigger/has_active_mission): Used together in available or limit blocks to ensure has_built is only evaluated when the corresponding mission is in active status, preventing the condition from being unexpectedly satisfied outside the mission context.
Common Pitfalls
- Misunderstanding the counting origin:
has_built counts buildings constructed after accepting the goal, not the historical total. Buildings already completed before mission activation are not counted. Newcomers often mistakenly assume existing buildings directly satisfy the condition, causing missions to never complete.
- Incorrect
type specification: type must use the building key defined in the game (such as industrial_complex, arms_factory). Using display names or misspelling the key will not cause script errors but the condition will always be false, making it extremely difficult to debug.