#Events for error suppression. Please make sure we don't need these.

namespace = error_suppression

#Show relation event
error_suppression.0001 = {
	hidden = yes
	orphan = yes

	trigger = {
		is_married = yes
	}

	option = {
		name = OK_BUTTON

		add_character_modifier = {
			modifier = matilda_of_canossa_modifier
		}
		add_character_modifier = {
			modifier = ep3_master_todor_modifier
		}
		add_character_modifier = {
			modifier = police_chief_of_baghdad_modifier
		}
		add_character_modifier = {
			modifier = guiscard_modifier
		}


		# "Variable 'has_scripted_appearance' is used but is never set"
		# It's used in history, but we read the history after we check for these unused variable errors.
		add_character_flag = easteregg
		add_character_flag = has_scripted_appearance
		add_character_flag = has_scripted_weight
		add_character_flag = has_scripted_clothes
		add_character_flag = no_headgear
		add_character_flag = no_drunkard_visual
		add_character_flag = lady_in_shadows

		if = { limit = {
			# "Variable 'has_scripted_appearance' is set but is never used"
			# In no-graphics we never read the portrait script that uses these flags, so then the above fix causes issues.
			has_character_flag = easteregg
			has_character_flag = has_scripted_appearance
			has_character_flag = has_scripted_weight
			has_character_flag = has_scripted_clothes
			has_character_flag = no_headgear
			has_character_flag = no_drunkard_visual
			has_character_flag = lady_in_shadows
			is_target_in_variable_list = {
				name = artifact_rewards
				target = root
			}
			is_target_in_variable_list = {
				name = trait_rewards
				target = root
			}
			exists = var:reichskrone
			exists = var:pope_hat
			has_variable = show_historical_gui
			has_variable = nerge_activity

			title:e_japan = {
				has_variable = administrative_ui_special_title
			}
			title:e_goryeo = {
				has_variable = administrative_ui_special_title
			}
			scope:poem_tune = flag:riverside_city
			scope:poem_tune = flag:spring_in_the_han_palace
			scope:poem_tune = flag:winds_between_pine_trees
			scope:poem_tune = flag:memories_of_the_past_at_red_cliff
			scope:poem_tune = flag:my_wrath_bristles_through_my_helmet
			scope:poem_tune = flag:thinking_of_the_past_at_beigu_pavilion
			scope:poem_tune = flag:dream_song
			scope:poem_tune = flag:as_in_a_dream
			scope:poem_tune = flag:immortal_by_the_river
			scope:poem_tune = flag:longing_for_qin_e
			scope:poem_tune = flag:new_chrysanthemum_flowers
			scope:poem_tune = flag:poluomen_son
			scope:poem_tune = flag:pouring_out_deep_emotions
			scope:poem_tune = flag:rain_hits_a_bell
			scope:poem_tune = flag:spring_in_the_tower_of_jade
			scope:poem_tune = flag:drunk_in_the_fairyland
			scope:poem_tune = flag:anxiety_of_a_beauty
			scope:poem_tune = flag:writing_of_my_sorrow
			scope:poem_tune = flag:sad_remembrance
			scope:poem_tune = flag:on_the_advent_of_spring
			scope:poem_tune = flag:silk_washing_stream
			scope:poem_tune = flag:at_an_inn_in_xinshi
			scope:poem_tune = flag:on_red_lotus_petals
			scope:poem_tune = flag:pusa_man
			scope:poem_tune = flag:a_quiet_night
			scope:poem_tune = flag:huanxi_sand
			scope:poem_tune = flag:overlapping_golden_light_of_small_hills
			scope:poem_tune = flag:the_road_is_difficult
			scope:poem_tune = flag:phoenix_hairpin
			scope:poem_tune = flag:boating_on_tai_lake
			scope:poem_tune = flag:prelude_to_the_water_song
			scope:poem_tune = flag:rambling_young_man
			scope:poem_tune = flag:king_of_lanling
			scope:poem_tune = flag:washing_creek_sands
			scope:poem_tune = flag:magnolia_blossoms
			scope:poem_tune = flag:petals_falling_in_the_river
			scope:poem_tune = flag:my_way_passed_ancient_tombs
			scope:poem_tune = flag:dreaming_of_the_south_side_of_the_river
			scope:poem_tune = flag:beautiful_barbarian
			scope:poem_tune = flag:missing_the_emperors_hometown
			scope:poem_tune = flag:daoist_priestess
			scope:poem_tune = flag:a_bushel_of_pearls
			scope:poem_tune = flag:bodhisattva_barbarian
			scope:poem_tune = flag:clear_and_even_music
			scope:poem_tune = flag:lost_battle
			scope:poem_tune = flag:beauty_yu
			scope:poem_tune = flag:crows_cry_at_night
			scope:poem_tune = flag:phoenix_perched_on_the_parasol_tree
			scope:poem_tune = flag:imperial_avenue_procession
			scope:poem_tune = flag:rain_hits_a_bell
			scope:poem_tune = flag:divination_song
			scope:poem_tune = flag:attached_to_her_skirt
			scope:poem_tune = flag:partridge_sky
			scope:poem_tune = flag:mountain_hawthorn
			scope:poem_tune = flag:the_song_of_tangduo
			scope:poetry_theme = flag:love
			scope:poetry_theme = flag:nature
			scope:poetry_theme = flag:longing
			scope:poetry_theme = flag:separation
			scope:poetry_theme = flag:sadness_and_pain
			scope:poetry_theme = flag:philosophy
			scope:poetry_theme = flag:mythological_events
			scope:poetry_theme = flag:daily_chores
			scope:poetry_theme = flag:historical_events
		} }
	}
}
# EP1 achievement variable erroring from not being used outside of ep1_achievements.txt
error_suppression.0002 = {
	hidden = yes
	orphan = yes

	trigger = {
		any_character_artifact = {
			exists = var:last_person_to_steal
		}
	}

	option = {
		name = OK_BUTTON
	}
}
# Memory events to make sure they appear in the right order chronologically
error_suppression.0003 = {
	hidden = yes

	immediate = {
		create_character_memory = {
			type = imprisoned_other

			participants = {
				imprisoned = scope:prisoner_memory
			}
		}
	}

	option = {
		name = OK_BUTTON
	}
}

#Suppression of legend properties
error_suppression.0004 = {
	hidden = yes
	orphan = yes

	trigger = {
		var:dummy ?= flag:kumari_kandam
		var:dummy ?= flag:prester_john_kingdom
		var:dummy ?= flag:china
		var:dummy ?= flag:bald_mountain
		var:dummy ?= flag:olympus
		var:dummy ?= flag:beyul
		var:dummy ?= flag:hindustan
		var:dummy ?= flag:irum
		var:dummy ?= flag:atlantis
		var:dummy ?= flag:himavanta
		var:dummy ?= flag:mahishmati
		var:dummy ?= flag:albion
	}

	option = {
		name = OK_BUTTON
		set_variable = {
			name = dummy
			value = 1
		}
	}
}
