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

Scripted effect · Legacy of Persia files

fp3_end_persian_struggle_effect

fp3_end_persian_struggle_effect = { ENDING = … EVENT = … FLAG = … }

game/common/scripted_effects/05_dlc_fp3_scripted_effects.txt, line 6 (46 lines). Parameters: $ENDING$, $EVENT$, $FLAG$.

fp3_end_persian_struggle_effect is a scripted effect in Crusader Kings III, in the Legacy of Persia files, written at line 6 of its file. A call passes 3 parameters: ENDING, EVENT and FLAG. The game's script calls it in 6 places, among them Iranian Intermezzo (struggle), … Ascension (event fp3_struggle.0095) and … Foundation: A New Persia (event fp3_struggle.0091). Patch 1.20.1.2, from game/common/scripted_effects/05_dlc_fp3_scripted_effects.txt.

The comment above it in the file

Struggle Ending #####

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 (46 lines of game script)
fp3_end_persian_struggle_effect = {
	if = {
		limit = {
			exists = title:e_arabia.holder
			title:e_arabia.holder = { has_character_modifier = fp3_struggle_caliph_super_suspicious_modifier }
		}
		title:e_arabia.holder = { remove_character_modifier = fp3_struggle_caliph_super_suspicious_modifier }
	}

	every_in_global_list = { # We de-flag chars (surprisingly performance friendly, from all possible options)
		variable = fp3_intro_flag_character_list
		if = {
			limit = { has_character_flag = fp3_struggle_intro_event_flag } # Since only alive chars have flags, we don't need to check for anything else
			remove_character_flag = fp3_struggle_intro_event_flag
		}
	}

	# Global variable tracking.
	## For usage in councillor tasks.
	set_global_variable = {
		name = fp3_struggle_ending
		value = $FLAG$
	}
	## For debug purposes.
	if = {
		limit = { gather_debug_variables_for_persian_struggle_trigger = yes }
		increment_global_variable_effect = {
			VAL = current_year
			VAR = sp_end_date
		}
	}

	every_player = {
		limit = { fp3_does_this_player_care_about_the_persian_struggle = yes } # Needs to be checked before the struggle ends due to race condition issues
		add_to_list = player_to_notify # Making a list so stuff is tiggered after the struggle ends, to make extra sure I don't break anything.
	}

	every_in_list = { # Then we *actually* notify palyers, making sure the struggle has already ended
		list = player_to_notify
		limit = {
			this != root
		}
		trigger_event = $EVENT$
	}
	struggle:persian_struggle ?= { end_struggle = $ENDING$ }
}

As written in game/common/scripted_effects/05_dlc_fp3_scripted_effects.txt.

Where it is used

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

Struggles (1)

  • Iranian Intermezzo

Events (5)

Source: game/common/scripted_effects/05_dlc_fp3_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?