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_leave_house_bloc_effect

tgp_leave_house_bloc_effect = { OPINION = … TRUCE = … }

game/common/scripted_effects/10_dlc_tgp_house_bloc_scripted_effects.txt, line 203 (125 lines). Parameters: $OPINION$, $TRUCE$.

tgp_leave_house_bloc_effect is a scripted effect in Crusader Kings III, in the All Under Heaven files, written at line 203 of its file. A call passes 2 parameters: OPINION and TRUCE. The game's script calls it in 16 places, among them Invite House to Bloc (interaction), Join House Bloc (interaction) and Leave House Bloc (interaction). Its body carries 4 texts of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/10_dlc_tgp_house_bloc_scripted_effects.txt.

The comment above it in the file

Leave block taking all rulers of the same house with you
root: house - leaving the bloc

What it does

  • house_confederation ?= { … }
  • If

    • scope:leaver.house_head.house.house_confederation ?= scope:bloc

    Then

    • If

      • scope:bloc: Confederation member house (at most 2):

      Then

      • House … will leave the …
      • The … will disband

      Else if

      • scope:leader != scope:leaver

      Then

      • House … will leave the … and may not rejoin for 5 years
    • If

      • scope:leader = scope:leaver

      Then

      Otherwise

      • If

        • $OPINION$ = flag:yes

        Then

        • scope:leader:
          • Their house head:
            • If

              • has_opinion_modifier = { target = scope:leaver.house_head modifier = joined_house_bloc_opinion }

              Then

              • remove_opinion = { target = scope:leaver.house_head modifier = joined_house_bloc_opinion }
            • Opinion: Left House Bloc (-15)
          • change_house_relation_effect = { … }
      • If

        • $TRUCE$ = flag:yes

        Then

        • scope:leaver.house_head: All … House members gain a one-way Truce with all other Bloc members for 5 years

• 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)
tgp_leave_house_bloc_effect = {
	save_scope_as = leaver
	house_confederation ?= {
		save_scope_as = bloc
		leading_house ?= { save_scope_as = leader }
	}
	if = {
		limit = {
			exists = scope:bloc
			scope:leaver.house_head.house.house_confederation ?= scope:bloc
		}
		if = { # DISBAND
			limit = {
				scope:bloc = {
					any_confederation_member_house = { count <= 2 }
				}
			}
			# TOOLTIPS
			custom_description = {
				text = leave_house_bloc_effect
				subject = scope:leaver.house_head
				object = scope:bloc.leading_house.house_head
			}
			custom_description = {
				text = disband_house_bloc_effect
				subject = scope:bloc.leading_house.house_head
			}
		}
		else_if = { # COOLDOWN
			limit = { scope:leader != scope:leaver }
			custom_description = {
				text = leave_house_bloc_cooldown_effect
				subject = scope:leaver.house_head
				object = scope:bloc.leading_house.house_head
				add_to_variable_list = {
					name = left_bloc_cooldown
					target = scope:bloc
					years = tgp_leave_house_bloc_cooldown_years_value
				}
			}
		}
		if = {
			limit = { scope:leader = scope:leaver }
			# NEW LEADER TOOLTIP
			scope:bloc = {
				show_as_tooltip = { tgp_find_new_house_bloc_leader_effect = yes }
			}
		}
		else = {
			# OPINION
			if = {
				limit = { $OPINION$ = flag:yes }
				scope:leader ?= {
					house_head ?= {
						if = {
							limit = {
								has_opinion_modifier = {
									target = scope:leaver.house_head
									modifier = joined_house_bloc_opinion
								}
							}
							remove_opinion = {
								target = scope:leaver.house_head
								modifier = joined_house_bloc_opinion
							}
						}
						add_opinion = {
							target = scope:leaver.house_head
							modifier = left_house_bloc_opinion
							opinion = -15
						}
					}
					change_house_relation_effect = {
						HOUSE = scope:leaver
						VALUE = house_relation_damage_medium_value
						REASON = left_bloc
						CHAR = scope:leaver.house_head
						TARGET_CHAR = scope:leader.house_head
						TITLE = scope:dummy_gender
					}
				}
			}
			# TRUCE
			if = {
				limit = { $TRUCE$ = flag:yes }
				scope:leaver.house_head = {
					custom_tooltip = {
						text = tgp_leave_house_bloc_truce_tt
						scope:bloc = {
							every_confederation_member_house = {
								every_house_member = {
									limit = {
										top_liege = scope:leaver.house_head.top_liege
										is_landed = yes
									}
									if = {
										limit = { house != scope:leaver }
										add_to_list = truce_targets
									}
									else = { add_to_list = truce_getters }
								}
							}
							every_in_list = {
								list = truce_targets
								save_temporary_scope_as = truce_target_temp
								every_in_list = {
									list = truce_getters
									add_truce_one_way = {
										character = scope:truce_target_temp
										years = tgp_leave_house_bloc_truce_years_value
										name = TRUCE_LEFT_BLOC
									}
								}
							}
						}
					}
				}
			}
		}
		# REMOVE MEMBER HOUSE

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

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

Where it is used

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

Activities (1)

Events (3)

Scripted effects inside an event file (1)

  • tgp_yoshinaka_new_house_bloc_effect

On actions (the game's own hooks) (2)

  • on_title_destroyed
  • on_vassal_gained

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?