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

tgp_save_bloc_leaving_reason_effect

tgp_save_bloc_leaving_reason_effect = { INVITING_HOUSE = … LEAVING_HOUSE = … }

game/common/scripted_effects/10_dlc_tgp_house_bloc_scripted_effects.txt, line 1313 (124 lines). Parameters: $INVITING_HOUSE$, $LEAVING_HOUSE$.

tgp_save_bloc_leaving_reason_effect is a scripted effect in Crusader Kings III, in the All Under Heaven files, written at line 1313 of its file. A call passes 2 parameters: INVITING_HOUSE and LEAVING_HOUSE. The game's script calls it in 3 places, among them Invite House to Bloc (interaction), Join House Bloc (interaction) and Leave House Bloc (interaction). Patch 1.20.1.2, from game/common/scripted_effects/10_dlc_tgp_house_bloc_scripted_effects.txt.

What it does

Every line of it is script with no tooltip text: the script is below.

The script as written (120 lines of game script)
tgp_save_bloc_leaving_reason_effect = {
	$LEAVING_HOUSE$ = { save_temporary_scope_as = leaver_temp }
	$INVITING_HOUSE$ = { save_temporary_scope_as = inviter_temp }
	scope:leaver_temp = {
		if = {
			limit = { NOT = { has_variable = bloc_leaving_reason } }
			if = {
				limit = {
					house_head ?= { is_ai = no }
				}
				set_variable = {
					name = bloc_leaving_reason
					value = flag:reason_player
					days = 4
				}
			}
			else_if = {
				limit = { exists = house_confederation.leading_house.house_head }
				house_confederation.leading_house.house_head = { save_scope_as = prev_bloc_leader }
				if = { # PRESTIGE LEVEL
					limit = { 
						OR = {
							house_head.prestige_level > scope:prev_bloc_leader.prestige_level
							scope:inviter_temp.house_head.prestige_level > scope:prev_bloc_leader.prestige_level
						}
					}
					set_variable = {
						name = bloc_leaving_reason
						value = flag:reason_prestige
						days = 4
					}
				}
				else_if = { # INFLUENCE LEVEL
					limit = {
						OR = {
							house_head.influence_level > scope:prev_bloc_leader.influence_level
							scope:inviter_temp.house_head.influence_level > scope:prev_bloc_leader.influence_level
						}
					}
					set_variable = {
						name = bloc_leaving_reason
						value = flag:reason_influence
						days = 4
					}
				}
				else_if = { # MILITARY POWER
					limit = {
						OR = {
							house_head.military_power > scope:prev_bloc_leader.military_power
							scope:inviter_temp.house_head.military_power > scope:prev_bloc_leader.military_power
						}
					}
					set_variable = {
						name = bloc_leaving_reason
						value = flag:reason_military_strength
						days = 4
					}
				}
				else_if = { # INVITER OPINION
					limit = {
						this != scope:inviter_temp
						house_head = {
							opinion = {
								target = scope:inviter_temp.house_head
								value >= 40
							}
						}
					}
					set_variable = {
						name = bloc_leaving_reason
						value = flag:reason_inviter_bloc_opinion
						days = 4
					}
				}
				else_if = { # PREV LEADER OPINION
					limit = {
						house_head = {
							opinion = {
								target = scope:prev_bloc_leader
								value < 0
							}
						}
					}
					set_variable = {
						name = bloc_leaving_reason
						value = flag:reason_current_bloc_opinion
						days = 4
					}
				}
				else_if = { # DYNASTY
					limit = {
						this != scope:inviter_temp
						house_head.dynasty = scope:inviter_temp.house_head.dynasty
					}
					set_variable = {
						name = bloc_leaving_reason
						value = flag:reason_dynasty
						days = 4
					}
				}
				else_if = { # ASPIRATIONS
					limit = {
						NOT = { has_same_house_aspiration_as = scope:prev_bloc_leader.house }
					}
					set_variable = {
						name = bloc_leaving_reason
						value = flag:reason_aspirations
						days = 4
					}
				}
				else_if = { # COHESION
					limit = {
						house_confederation ?= { cohesion <= 25 }
					}
					set_variable = {
						name = bloc_leaving_reason
						value = flag:reason_cohesion
						days = 4
					}
				}

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

The first 120 of its 124 lines; the rest is in game/common/scripted_effects/10_dlc_tgp_house_bloc_scripted_effects.txt from line 1313.

Where it is used

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

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