Wiki

effect · remove_building

Definition

  • Supported scope:STATE, COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

Removes a building in a targeted state or province.
Example:

remove_building = {
	type = air_base
	level = 1 # how many levels to remove
	state = 32 # or a variable like var:target_state
}

The building can also be specified through tags.
Example:
remove_building = {
	tags = facility # can be a single tag or a { }-wrapped list of tags
	level = 1 # how many levels to remove
	province = 500 # or a variable like var:target_province
}

You can manually specify either a state or province as per the examples above. Both values and variables are supported.
The effect can also be called without specifying province or state if used within a state scope:

remove_building = {
	type = air_base
	level = 1 # how many levels to remove
}

In this case, the building type must be a state building.

Note that this effect will NOT recursively find province buildings from a state when no province has been specified.

Hands-On Notes

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.

Hands-On Usage

remove_building is commonly used in scripted events or national focuses to demolish infrastructure in a specific country or state, such as dismantling industrial facilities as punitive post-war measures or destroying airports through espionage operations. Within STATE scope, you can omit the state/province field and directly specify state-level buildings, making it ideal for batch processing of occupied territories:

# National focus effect: remove one level of air base from target state (within STATE scope)
every_controlled_state = {
    limit = {
        is_on_same_continent_as = ROOT
    }
    remove_building = {
        type = air_base
        level = 1
    }
}

Synergy

  • [free_building_slots](/wiki/trigger/free_building_slots): Check remaining building slots before removal to ensure removal logic synchronizes with slot management and prevents unexpected negative slot counts.
  • [add_building_construction](/wiki/effect/add_building_construction): Frequently paired with removal—demolish old buildings then reconstruct new ones to achieve a "replacement" effect, such as upgrading basic factories to military factories in scripted scenarios.
  • [damage_building](/wiki/effect/damage_building): Both can reduce building levels, but damage_building emphasizes damage from combat or bombing, while remove_building focuses on active script-driven removal. Understanding this distinction helps you choose the command that better matches your narrative intent.
  • [has_built](/wiki/trigger/has_built): Confirm the building actually exists before executing removal to prevent script errors or unexpected log warnings from attempting to demolish non-existent structures.

Common Pitfalls

  1. Province-level buildings must specify province: Beginners working in STATE scope write type = air_base but forget to specify province for province-level buildings (such as airports). The official documentation clearly states that without specifying province, the command will not recursively search for province-level buildings, resulting in a silent failure that is extremely difficult to debug.
  2. COUNTRY scope must explicitly specify state or province: When called within country scope, omitting the state = ... or province = ... field leaves the game unable to determine the target location, causing the effect to fail silently. You must explicitly provide numeric values or variables (such as var:target_state).