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_random_building_effect

destroy_random_building_effect = yes

game/common/scripted_effects/00_building_effects.txt, line 1495 (143 lines). No parameters.

destroy_random_building_effect is a scripted effect in Crusader Kings III, written at line 1495 of its file. It takes no parameters: destroy_random_building_effect = yes. The game's script calls it in 8 places, among them Flickering Flames (event ep3_story_cycle_harrying.1015), raiding.0040 (event) and The Fire Spreading (event bp3_survey.1040). Patch 1.20.1.2, from game/common/scripted_effects/00_building_effects.txt.

What it does

• 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 (120 lines of game script)
destroy_random_building_effect = {
	if = {
		limit = { has_variable = destroyed_building_variable }
		switch = {
			trigger = var:destroyed_building_variable
			0 = { # outposts : Cheap
				destroy_or_downgrade_building_effect = { BUILDING = outposts }
			}
			1 = { # logging_camps : Cheap
				destroy_or_downgrade_building_effect = { BUILDING = logging_camps }
			}
			2 = { # peat_quarries : Cheap
				destroy_or_downgrade_building_effect = { BUILDING = peat_quarries }
			}
			3 = { # hill_forts : Cheap
				destroy_or_downgrade_building_effect = { BUILDING = hill_forts }
			}
			4 = { # plantations : Cheap
				destroy_or_downgrade_building_effect = { BUILDING = plantations }
			}
			5 = { # quarries : Cheap
				destroy_or_downgrade_building_effect = { BUILDING = quarries }
			}
			6 = { # hunting_grounds : Cheap
				destroy_or_downgrade_building_effect = { BUILDING = hunting_grounds }
			}
			7 = { # military_camps : Cheap
				destroy_or_downgrade_building_effect = { BUILDING = military_camps }
			}
			8 = { # horse_pastures : Cheap
				destroy_or_downgrade_building_effect = { BUILDING = horse_pastures }
			}
			9 = { # hillside_grazing : Cheap
				destroy_or_downgrade_building_effect = { BUILDING = hillside_grazing }
			}
			10 = { # warrior_lodges : Cheap
				destroy_or_downgrade_building_effect = { BUILDING = warrior_lodges }
			}
			11 = { # pastures : Normal
				destroy_or_downgrade_building_effect = { BUILDING = pastures }
			}
			12 = { # ramparts : Normal
				destroy_or_downgrade_building_effect = { BUILDING = ramparts }
			}
			13 = { # curtain_walls : Normal
				destroy_or_downgrade_building_effect = { BUILDING = curtain_walls }
			}
			14 = { # watchtowers : Normal
				destroy_or_downgrade_building_effect = { BUILDING = watchtowers }
			}
			15 = { # cereal_fields : Normal
				destroy_or_downgrade_building_effect = { BUILDING = cereal_fields }
			}
			16 = { # barracks : Normal
				destroy_or_downgrade_building_effect = { BUILDING = barracks }
			}
			17 = { # camel_farms : Normal
				destroy_or_downgrade_building_effect = { BUILDING = camel_farms }
			}
			18 = { # hill_farms : Normal
				destroy_or_downgrade_building_effect = { BUILDING = hill_farms }
			}
			19 = { # elephant_pens : Normal
				destroy_or_downgrade_building_effect = { BUILDING = elephant_pens }
			}
			20 = { # common_tradeport : Normal
				destroy_or_downgrade_building_effect = { BUILDING = common_tradeport }
			}
			21 = { # hospices : Normal
				destroy_or_downgrade_building_effect = { BUILDING = hospices }
			}
			22 = { # qanats : Normal
				destroy_or_downgrade_building_effect = { BUILDING = qanats }
			}
			23 = { # murex_farm : Normal
				destroy_or_downgrade_building_effect = { BUILDING = murex_farm }
			}
			24 = { # wind_furnace : Normal
				destroy_or_downgrade_building_effect = { BUILDING = wind_furnace }
			}
			25 = { # stables : Normal
				destroy_or_downgrade_building_effect = { BUILDING = stables }
			}
			26 = { # smiths : Normal
				destroy_or_downgrade_building_effect = { BUILDING = smiths }
			}
			27 = { # orchards : Expensive
				destroy_or_downgrade_building_effect = { BUILDING = orchards }
			}
			28 = { # farm_estates : Expensive
				destroy_or_downgrade_building_effect = { BUILDING = farm_estates }
			}
			29 = { # regimental_grounds : Expensive
				destroy_or_downgrade_building_effect = { BUILDING = regimental_grounds }
			}
			30 = { # caravanserai : Expensive
				destroy_or_downgrade_building_effect = { BUILDING = caravanserai }
			}
			31 = { # watermills : Expensive
				destroy_or_downgrade_building_effect = { BUILDING = watermills }
			}
			32 = { # windmills : Expensive
				destroy_or_downgrade_building_effect = { BUILDING = windmills }
			}
			33 = { # workshops : Expensive
				destroy_or_downgrade_building_effect = { BUILDING = workshops }
			}
			# Holding Type Specific : Normal
			34 = { # monastic_schools : Normal
				destroy_or_downgrade_building_effect = { BUILDING = monastic_schools }
			}
			35 = { # guild_halls : Normal
				destroy_or_downgrade_building_effect = { BUILDING = guild_halls }
			}
			36 = { # scriptorium : Normal
				destroy_or_downgrade_building_effect = { BUILDING = scriptorium }
			}
			37 = { # megalith : Normal
				destroy_or_downgrade_building_effect = { BUILDING = megalith }
			}

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

The first 120 of its 143 lines; the rest is in game/common/scripted_effects/00_building_effects.txt from line 1495.

Where it is used

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

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?