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

Scripted effect

create_artifact_badge_generic_effect

create_artifact_badge_generic_effect = { ACQUIRER = … }

game/common/scripted_effects/00_artifact_badge_scripted_effects.txt, line 117 (164 lines). Parameters: $ACQUIRER$.

create_artifact_badge_generic_effect is a scripted effect in Crusader Kings III, written at line 117 of its file. A call passes 1 parameter: ACQUIRER. The game's script calls it in 2 places, among them create_artifact_badge_effect (scripted effect) and generate_artifact_badge_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/00_artifact_badge_scripted_effects.txt.

The comment above it in the file

GENERIC BADGES ##
Generic

What it does

  • hidden_effect_new_object = { … }
  • scope:newly_created_artifact:
    • remove_artifact_modifier = artifact_placeholder_modifier
    • 1 of 4 things will happen:
      • 25%:
        • 1 of 4 things will happen:
          • 25%:
            • set_artifact_name = generic_badge_name_1
          • 25%:
            • set_artifact_name = generic_badge_name_2
          • 25%:
            • set_artifact_name = protection_badge_name_1
          • 25%:
            • set_artifact_name = protection_badge_name_2
        • set_artifact_description = generic_badge_protection_desc
        • add_artifact_modifier = artifact_travel_safety_1
        • 1 of 5 things will happen:
          • 24%:
            • add_artifact_modifier = artifact_prowess_mult_1_modifier
          • 5%:
            • add_artifact_modifier = artifact_prowess_mult_2_modifier
          • 24%:
            • add_artifact_modifier = artifact_negate_health_penalty_add_1_modifier
          • 24%:
            • add_artifact_modifier = artifact_scheme_resistance_add_1_modifier
          • 24%:
            • add_artifact_modifier = artifact_prowess_1_modifier
      • 25%:
        • 1 of 5 things will happen:
          • 20%:
            • set_artifact_name = generic_badge_name_1
          • 20%:
            • set_artifact_name = generic_badge_name_2
          • 20%:
            • set_artifact_name = prosperity_badge_name_1
          • 20%:
            • set_artifact_name = prosperity_badge_name_2
          • 20%:
            • set_artifact_name = prosperity_badge_name_3
        • set_artifact_description = generic_badge_prosperity_desc
        • add_artifact_modifier = artifact_build_gold_cost_2_modifier
        • 1 of 5 things will happen:
          • 24%:
            • add_artifact_modifier = artifact_stewardship_mult_1_modifier
          • 24%:
            • add_artifact_modifier = artifact_build_time_0_2_5_modifier
          • 5%:
            • add_artifact_modifier = artifact_build_time_0_5_modifier
          • 24%:
            • If

              • scope:badge_acquirer: Is landed

              Then

              • add_artifact_modifier = artifact_domain_tax_mult_2_modifier

              Otherwise

              • add_artifact_modifier = artifact_monthly_income_2_modifier
          • 24%:
            • add_artifact_modifier = artifact_stewardship_1_modifier
      • 25%:
        • 1 of 4 things will happen:
          • 25%:
            • set_artifact_name = generic_badge_name_3
          • 25%:
            • set_artifact_name = generic_badge_name_4
          • 25%:
            • set_artifact_name = virility_badge_name_1
          • 25%:
            • set_artifact_name = virility_badge_name_2
        • set_artifact_description = generic_badge_virility_desc
        • add_artifact_modifier = artifact_life_expectancy_1_modifier
        • 1 of 5 things will happen:
          • 24%:
            • add_artifact_modifier = artifact_diplomacy_mult_1_modifier
          • 24%:
            • add_artifact_modifier = artifact_fertility_gain_0_5_modifier
          • 24%:
            • add_artifact_modifier = artifact_health_gain_0_5_modifier
          • 24%:
            • add_artifact_modifier = artifact_negate_withering_mind_1_modifier
          • 5%:
            • add_artifact_modifier = artifact_life_expectancy_3_modifier
      • 25%:
        • 1 of 4 things will happen:
          • 25%:
            • set_artifact_name = generic_badge_name_3
          • 25%:
            • set_artifact_name = generic_badge_name_4
          • 25%:
            • set_artifact_name = wisdom_badge_name_1
          • 25%:
            • set_artifact_name = wisdom_badge_name_2
        • set_artifact_description = generic_badge_wisdom_desc
        • add_artifact_modifier = artifact_monthly_learning_lifestyle_xp_0_5_modifier
        • 1 of 5 things will happen:
          • 24%:
            • add_artifact_modifier = artifact_learning_mult_1_modifier
          • 24%:
            • add_artifact_modifier = artifact_learning_scheme_phase_duration_add_1_modifier
          • 24%:
            • add_artifact_modifier = artifact_monthly_lifestyle_xp_0_5_modifier
          • 5%:
            • add_artifact_modifier = artifact_monthly_lifestyle_xp_minor_modifier
          • 24%:
            • add_artifact_modifier = artifact_learning_1_modifier

• 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)
create_artifact_badge_generic_effect = {
	$ACQUIRER$ = { save_scope_as = badge_acquirer }
	if = {
		limit = { NOT = { exists = scope:badge_location } }
		if = {
			limit = { exists = scope:faith }
			scope:faith = {
				random_holy_site_barony = {
					limit = { barony_title_is_unique_badge_christian_holy_site_trigger = no }
					alternative_limit = { always = yes }
					title_province = { save_scope_as = badge_location }
				}
			}
		}
		else = {
			scope:badge_acquirer.faith = {
				random_holy_site_barony = {
					limit = { barony_title_is_unique_badge_christian_holy_site_trigger = no }
					alternative_limit = { always = yes }
					title_province = { save_scope_as = badge_location }
				}
			}
		}
	}
	save_scope_value_as = {
		name = badge_quality
		value = pam_pilgrim_badge_quality_value
	}
	hidden_effect_new_object = {
		scope:badge_acquirer = {
			create_artifact = {
				name = maria_conch_name
				description = placeholder
				type = badge
				template = pilgrim_badge_template
				visuals = badge
				rarity = famed
				modifier = artifact_placeholder_modifier
				wealth = scope:badge_quality
				quality = scope:badge_quality
				save_scope_as = newly_created_artifact
				generate_history = no
			}
		}
	}
	scope:newly_created_artifact ?= {
		set_variable = {
			name = is_pilgrim_badge
			value = flag:yes
		}
		set_variable = {
			name = pilgrim_badge_location
			value = scope:badge_location
		}
		if = {
			limit = { exists = var:pilgrim_badge_location }
			#To prevent 'unused except in loc' errors :catto:
		}
		remove_artifact_modifier = artifact_placeholder_modifier
		random_list = {
			#Protection
			10 = {
				random_list = {
					10 = { set_artifact_name = generic_badge_name_1 }
					10 = { set_artifact_name = generic_badge_name_2 }
					10 = { set_artifact_name = protection_badge_name_1 }
					10 = { set_artifact_name = protection_badge_name_2 }
				}
				set_artifact_description = generic_badge_protection_desc
				add_artifact_modifier = artifact_travel_safety_1
				random_list = {
					10 = { add_artifact_modifier = artifact_prowess_mult_1_modifier }
					2 = { add_artifact_modifier = artifact_prowess_mult_2_modifier }
					10 = { add_artifact_modifier = artifact_negate_health_penalty_add_1_modifier }
					10 = { add_artifact_modifier = artifact_scheme_resistance_add_1_modifier }
					10 = { add_artifact_modifier = artifact_prowess_1_modifier }
				}
				set_variable = protection_badge
				if = {
					limit = { exists = var:protection_badge }
					#To prevent 'unused except in loc' errors :catto:
				}
			}
			#Prosperity
			10 = {
				random_list = {
					10 = { set_artifact_name = generic_badge_name_1 }
					10 = { set_artifact_name = generic_badge_name_2 }
					10 = { set_artifact_name = prosperity_badge_name_1 }
					10 = { set_artifact_name = prosperity_badge_name_2 }
					10 = { set_artifact_name = prosperity_badge_name_3 }
				}
				set_artifact_description = generic_badge_prosperity_desc
				add_artifact_modifier = artifact_build_gold_cost_2_modifier
				random_list = {
					10 = { add_artifact_modifier = artifact_stewardship_mult_1_modifier }
					10 = { add_artifact_modifier = artifact_build_time_0_2_5_modifier }
					2 = { add_artifact_modifier = artifact_build_time_0_5_modifier }
					10 = { 
						if = {
							limit = { 
								scope:badge_acquirer = { is_landed = yes }
							}
							add_artifact_modifier = artifact_domain_tax_mult_2_modifier
						}
						else = { add_artifact_modifier = artifact_monthly_income_2_modifier }
					}
					10 = { add_artifact_modifier = artifact_stewardship_1_modifier }
				}
				set_variable = prosperity_badge
				if = {
					limit = { exists = var:prosperity_badge }
					#To prevent 'unused except in loc' errors :catto:
				}
			}
			#Virility
			10 = {
				random_list = {
					10 = { set_artifact_name = generic_badge_name_3 }
					10 = { set_artifact_name = generic_badge_name_4 }

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

The first 120 of its 164 lines; the rest is in game/common/scripted_effects/00_artifact_badge_scripted_effects.txt from line 117.

Where it is used

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

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