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

change_capital_holding_to_citadel_effect

change_capital_holding_to_citadel_effect = yes

game/common/scripted_effects/tgp_mandala_scripted_effects.txt, line 1259 (64 lines). No parameters.

change_capital_holding_to_citadel_effect is a scripted effect in Crusader Kings III, in the All Under Heaven files, written at line 1259 of its file. It takes no parameters: change_capital_holding_to_citadel_effect = yes. The game's script calls it in 1 place, among them change_to_mandala_government_and_citadel_effect (scripted effect). Its body carries 1 text of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/tgp_mandala_scripted_effects.txt.

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 (64 lines of game script)
change_capital_holding_to_citadel_effect = {
	custom_tooltip = realm_capital_will_change_to_citadel
	save_scope_as = current_holder
	hidden_effect_new_object = {
		capital_province = {
			if = {
				limit = { has_holding_type = temple_citadel_holding }
				scope:current_holder = {
					if = {
						limit = {
							NOT = { government_has_flag = government_is_mandala }
						}
						change_to_mandala_government_effect = yes
					}
				}
			}
			else = {
				set_variable = {
					name = generic_to_mandala_building_level
					value = combined_building_level
					days = 1
				}
				if = {
					limit = { holding_is_tribal = yes }
					holding_pre_feudalize_effect = yes
				}
				set_holding_type = temple_citadel_holding
				#Did any buildings invalidate? Calculate!
				set_variable = {
					name = new_generic_to_mandala_building_level
					value = combined_building_level
					days = 1
				}
				if = {
					limit = { var:new_generic_to_mandala_building_level < var:generic_to_mandala_building_level }
					change_variable = {
						name = generic_to_mandala_building_level
						subtract = var:new_generic_to_mandala_building_level
					}
				}
				#We need to set the holding type BEFORE we can change to the government, lest it invalidates
				scope:current_holder = {
					if = {
						limit = {
							NOT = { government_has_flag = government_is_mandala }
						}
						change_to_mandala_government_effect = yes
					}
				}
				#We need to set the government type BEFORE we generate buildings, otherwise basically none are valid
				while = {
					limit = { var:generic_to_mandala_building_level > 0 }
					generate_building = yes
					change_variable = {
						name = generic_to_mandala_building_level
						subtract = 1
					}
				}
				remove_variable = generic_to_mandala_building_level
				remove_variable = new_generic_to_mandala_building_level
			}
		}
	}
}

As written in game/common/scripted_effects/tgp_mandala_scripted_effects.txt.

Where it is used

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

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