Scripted effect
destroy_random_building_effect
destroy_random_building_effect = yesgame/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
- If has “destroyed building variable” (a variable the game's script sets) › Depending on destroyed building variable:
- When destroyed building variable is 0:
destroy_or_downgrade_building_effect = { BUILDING = outposts }
- When destroyed building variable is 1:
destroy_or_downgrade_building_effect = { BUILDING = logging_camps }
- When destroyed building variable is 2:
destroy_or_downgrade_building_effect = { BUILDING = peat_quarries }
- When destroyed building variable is 3:
destroy_or_downgrade_building_effect = { BUILDING = hill_forts }
- When destroyed building variable is 4:
destroy_or_downgrade_building_effect = { BUILDING = plantations }
- When destroyed building variable is 5:
destroy_or_downgrade_building_effect = { BUILDING = quarries }
- When destroyed building variable is 6:
destroy_or_downgrade_building_effect = { BUILDING = hunting_grounds }
- When destroyed building variable is 7:
destroy_or_downgrade_building_effect = { BUILDING = military_camps }
- When destroyed building variable is 8:
destroy_or_downgrade_building_effect = { BUILDING = horse_pastures }
- When destroyed building variable is 9:
destroy_or_downgrade_building_effect = { BUILDING = hillside_grazing }
- When destroyed building variable is 10:
destroy_or_downgrade_building_effect = { BUILDING = warrior_lodges }
- When destroyed building variable is 11:
destroy_or_downgrade_building_effect = { BUILDING = pastures }
- When destroyed building variable is 12:
destroy_or_downgrade_building_effect = { BUILDING = ramparts }
- When destroyed building variable is 13:
destroy_or_downgrade_building_effect = { BUILDING = curtain_walls }
- When destroyed building variable is 14:
destroy_or_downgrade_building_effect = { BUILDING = watchtowers }
- When destroyed building variable is 15:
destroy_or_downgrade_building_effect = { BUILDING = cereal_fields }
- When destroyed building variable is 16:
destroy_or_downgrade_building_effect = { BUILDING = barracks }
- When destroyed building variable is 17:
destroy_or_downgrade_building_effect = { BUILDING = camel_farms }
- When destroyed building variable is 18:
destroy_or_downgrade_building_effect = { BUILDING = hill_farms }
- When destroyed building variable is 19:
destroy_or_downgrade_building_effect = { BUILDING = elephant_pens }
- When destroyed building variable is 20:
destroy_or_downgrade_building_effect = { BUILDING = common_tradeport }
- When destroyed building variable is 21:
destroy_or_downgrade_building_effect = { BUILDING = hospices }
- When destroyed building variable is 22:
destroy_or_downgrade_building_effect = { BUILDING = qanats }
- When destroyed building variable is 23:
destroy_or_downgrade_building_effect = { BUILDING = murex_farm }
- When destroyed building variable is 24:
destroy_or_downgrade_building_effect = { BUILDING = wind_furnace }
- When destroyed building variable is 25:
destroy_or_downgrade_building_effect = { BUILDING = stables }
- When destroyed building variable is 26:
destroy_or_downgrade_building_effect = { BUILDING = smiths }
- When destroyed building variable is 27:
destroy_or_downgrade_building_effect = { BUILDING = orchards }
- When destroyed building variable is 28:
destroy_or_downgrade_building_effect = { BUILDING = farm_estates }
- When destroyed building variable is 29:
destroy_or_downgrade_building_effect = { BUILDING = regimental_grounds }
- When destroyed building variable is 30:
destroy_or_downgrade_building_effect = { BUILDING = caravanserai }
- When destroyed building variable is 31:
destroy_or_downgrade_building_effect = { BUILDING = watermills }
- When destroyed building variable is 32:
destroy_or_downgrade_building_effect = { BUILDING = windmills }
- When destroyed building variable is 33:
destroy_or_downgrade_building_effect = { BUILDING = workshops }
- When destroyed building variable is 34:
destroy_or_downgrade_building_effect = { BUILDING = monastic_schools }
- When destroyed building variable is 35:
destroy_or_downgrade_building_effect = { BUILDING = guild_halls }
- When destroyed building variable is 36:
destroy_or_downgrade_building_effect = { BUILDING = scriptorium }
- When destroyed building variable is 37:
destroy_or_downgrade_building_effect = { BUILDING = megalith }
- When destroyed building variable is 42:
destroy_or_downgrade_building_effect = { BUILDING = waterworks }
- When destroyed building variable is 43:
destroy_or_downgrade_building_effect = { BUILDING = paddy_fields }
- When destroyed building variable is 38:
destroy_or_downgrade_tribal_building_effect = { BUILDING = market_villages }
- When destroyed building variable is 39:
destroy_or_downgrade_tribal_building_effect = { BUILDING = palisades }
- When destroyed building variable is 40:
destroy_or_downgrade_tribal_building_effect = { BUILDING = war_camps }
- When destroyed building variable is 41:
destroy_or_downgrade_tribal_building_effect = { BUILDING = longhouses }
- When destroyed building variable is 0:
• 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.
Events (4)
- Flickering Flames
ep3_story_cycle_harrying.1015 - raiding.0040
- The Fire Spreading
bp3_survey.1040 - Unmanageable Miscreants
tournament_events.1290
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.