CK3 DatabaseCrusader Kings III · 1.20.1.2 “Crozier” · unofficial
Silk & Silverout Tue, Nov 17What's free, what needs the DLC, price →

Scripted effect

destroy_or_downgrade_building_effect

destroy_or_downgrade_building_effect = { BUILDING = … }

game/common/scripted_effects/00_building_effects.txt, line 1050 (38 lines). Parameters: $BUILDING$.

destroy_or_downgrade_building_effect is a scripted effect in Crusader Kings III, written at line 1050 of its file. A call passes 1 parameter: BUILDING. The game's script calls it in 4 places, among them A Common Cause (event coronation_events.6011), Stone upon Stone (event pam_theocratic_ruler_events.0008) and laamp_base_contract_schemes_3661_duel_success_effect (local effect). Patch 1.20.1.2, from game/common/scripted_effects/00_building_effects.txt.

The comment above it in the file

For stuff that has exactly _eight_ levels of upgrades.

What it does

  • If

    • has_building = $BUILDING$_08

    Then

    • remove_building = $BUILDING$_08

    Else if

    • has_building = $BUILDING$_07

    Then

    • remove_building = $BUILDING$_07

    Else if

    • has_building = $BUILDING$_06

    Then

    • remove_building = $BUILDING$_06

    Else if

    • has_building = $BUILDING$_05

    Then

    • remove_building = $BUILDING$_05

    Else if

    • has_building = $BUILDING$_04

    Then

    • remove_building = $BUILDING$_04

    Else if

    • has_building = $BUILDING$_03

    Then

    • remove_building = $BUILDING$_03

    Else if

    • has_building = $BUILDING$_02

    Then

    • remove_building = $BUILDING$_02

    Otherwise

    • remove_building = $BUILDING$_01

• the game's own tooltip text · ◦ our reading of the script line · code the script where neither exists

“They” is whatever it runs on (the scope it is called in). The scripted triggers and effects it calls link to their own pages; $PARAMETERS$ stay as written: each call fills them in.

The script as written (38 lines of game script)
destroy_or_downgrade_building_effect = {
	if = {
		limit = { has_building = $BUILDING$_08 }
		remove_building = $BUILDING$_08
		hidden_effect = { add_building = $BUILDING$_07 }
	}
	else_if = {
		limit = { has_building = $BUILDING$_07 }
		remove_building = $BUILDING$_07
		hidden_effect = { add_building = $BUILDING$_06 }
	}
	else_if = {
		limit = { has_building = $BUILDING$_06 }
		remove_building = $BUILDING$_06
		hidden_effect = { add_building = $BUILDING$_05 }
	}
	else_if = {
		limit = { has_building = $BUILDING$_05 }
		remove_building = $BUILDING$_05
		hidden_effect = { add_building = $BUILDING$_04 }
	}
	else_if = {
		limit = { has_building = $BUILDING$_04 }
		remove_building = $BUILDING$_04
		hidden_effect = { add_building = $BUILDING$_03 }
	}
	else_if = {
		limit = { has_building = $BUILDING$_03 }
		remove_building = $BUILDING$_03
		hidden_effect = { add_building = $BUILDING$_02 }
	}
	else_if = {
		limit = { has_building = $BUILDING$_02 }
		remove_building = $BUILDING$_02
		hidden_effect = { add_building = $BUILDING$_01 }
	}
	else = { remove_building = $BUILDING$_01 }
}

As written in game/common/scripted_effects/00_building_effects.txt.

Where it is used

Every place in common/, events/ and history/ that calls destroy_or_downgrade_building_effect.

Events (2)

Scripted effects inside an event file (1)

  • laamp_base_contract_schemes_3661_duel_success_effect

Scripted effects (1)

Source: game/common/scripted_effects/00_building_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.

Spotted a mistake on this page?