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

Scripted effect · All Under Heaven files

spawn_flood_in_county_effect

spawn_flood_in_county_effect = { COUNTY = … }

game/common/scripted_effects/10_dlc_tgp_natural_disaster_scripted_effects.txt, line 184 (72 lines). Parameters: $COUNTY$.

spawn_flood_in_county_effect is a scripted effect in Crusader Kings III, in the All Under Heaven files, written at line 184 of its file. A call passes 1 parameter: COUNTY. The game's script calls it in 2 places, among them spawn_flood_in_region_effect (scripted effect) and Spawn Natural Disaster (interaction). Patch 1.20.1.2, from game/common/scripted_effects/10_dlc_tgp_natural_disaster_scripted_effects.txt.

What it does

  • start_situation = { type = natural_disaster_flood save_scope_as = situation }
  • scope:situation:
    • set_situation_center_province = scope:flood_county.title_province
    • One random situation sub region:
      • add_geographical_region = scope:river_region
    • log_natural_disaster = started

• 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 (72 lines of game script)
spawn_flood_in_county_effect = {
	$COUNTY$ = { save_scope_as = flood_county }

	if = {
		limit = { NOT = { exists = scope:river_region } }
		random_in_global_list = {
			variable = flood_region_list
			limit = {
				save_temporary_scope_as = region_temp
				NOT = {
					any_in_global_list = {
						variable = ongoing_floods
						scope:region_temp = this
					}
				}
				scope:flood_county.title_province = { geographical_region =  scope:region_temp }
			}
			save_scope_as = river_region
		}
	}

	start_situation = {
		type = natural_disaster_flood
		save_scope_as = situation
	}

	# Track globally for exclusivity and distribution
	scope:situation ?= {
		set_situation_center_province = scope:flood_county.title_province
		add_to_global_variable_list = {
			name = ongoing_floods
			target = this
		}

		# Save region for exclusivity checks and Situation naming
		set_variable = {
			name = river_region
			value = scope:river_region
		}
		
		set_variable = {
			name = fatalities
			value = 0
		}

		save_scope_value_as = {
			name = min_severity
			value = scope:flood_county.title_province.natural_disaster_flood_min_severity
		}
		save_scope_value_as = {
			name = max_severity
			value = scope:flood_county.title_province.natural_disaster_flood_max_severity
		}

		set_variable = {
			name = severity
			value = {
				add = {
					fixed_range = {
						min = 1
						max = 3
					}
					min = scope:min_severity
					max = scope:max_severity
				}
			}
		}

		random_situation_sub_region = { add_geographical_region = scope:river_region }
		log_natural_disaster = "started"
	}
}

As written in game/common/scripted_effects/10_dlc_tgp_natural_disaster_scripted_effects.txt.

Where it is used

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

Character interactions (1)

  • Spawn Natural Disaster

Scripted effects (1)

Source: game/common/scripted_effects/10_dlc_tgp_natural_disaster_scripted_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?