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

Scripted effect

imprison_remove_ward_guardian_effect

imprison_remove_ward_guardian_effect = { IMPRISONER = … PRISONER = … }

game/common/scripted_effects/00_prison_effects.txt, line 2730 (67 lines). Parameters: $IMPRISONER$, $PRISONER$.

imprison_remove_ward_guardian_effect is a scripted effect in Crusader Kings III, written at line 2730 of its file. A call passes 2 parameters: IMPRISONER and PRISONER. The game's script calls it in 5 places, among them hard_imprison_character_effect (scripted effect), imprison_character_effect (scripted effect) and imprison_character_effect_ignore_reason (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/00_prison_effects.txt.

What it does

  • scope:imprisoner:
    • If

      • Any courtier:
        • has_relation_guardian = scope:imprisonment_target
        • has_relation_ward = scope:imprisonment_target

      Then

• 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 (67 lines of game script)
imprison_remove_ward_guardian_effect = {
	#Remove them as guardian/ward for any courtiers and give feedback about this
	$PRISONER$ = { save_temporary_scope_as = imprisonment_target }
	$IMPRISONER$ = { save_temporary_scope_as = imprisoner }

	scope:imprisoner ?= {
		#Check for relations
		if = {
			limit = {
				exists = scope:imprisonment_target
				any_courtier = {
					has_relation_guardian = scope:imprisonment_target
					has_relation_ward = scope:imprisonment_target
				}
			}
			#Save all those with a ward/guardian relation to the person being imprisoned
			every_courtier = {
				limit = {
					has_relation_guardian = scope:imprisonment_target
					has_relation_ward = scope:imprisonment_target
				}
				add_to_list = ward_or_guardian_list
			}
			# Send messages to people that need to know that the ward/guardian relationship is over	
			every_in_list = {
				list = ward_or_guardian_list
				save_scope_as = their_ward_or_guardian #saved for appropriate portrait in message
				
				send_interface_message = {
					type = event_childhood_neutral
					title = remove_guardian_interaction_notification
					left_icon = scope:imprisonment_target
					right_icon = scope:their_ward_or_guardian

					scope:imprisonment_target = {
						send_interface_message = {
							type = event_childhood_neutral
							title = remove_guardian_interaction_notification
							left_icon = scope:imprisonment_target
							right_icon = scope:their_ward_or_guardian
							#Remove appropriate relationship
							scope:their_ward_or_guardian = {
								if = {
									limit = { has_relation_guardian = scope:imprisonment_target }
									remove_guardian_effect = {
										GUARDIAN = scope:imprisonment_target
										WARD = scope:their_ward_or_guardian
										RETURN_WARD = yes
										HIDE_OPINION = no
									}
								}
								else = {
									remove_guardian_effect = {
										GUARDIAN = scope:their_ward_or_guardian
										WARD = scope:imprisonment_target
										RETURN_WARD = yes
										HIDE_OPINION = no
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

As written in game/common/scripted_effects/00_prison_effects.txt.

Where it is used

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

Source: game/common/scripted_effects/00_prison_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?