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

Scripted effect · The Royal Court files

create_artifact_book_effect

create_artifact_book_effect = { CREATOR = … OWNER = … SET_SUBJECT = … SET_TOPIC = … }

game/common/scripted_effects/01_ep1_court_artifact_creation_effects.txt, line 3866 (2566 lines). Parameters: $CREATOR$, $OWNER$, $SET_SUBJECT$, $SET_TOPIC$.

create_artifact_book_effect is a scripted effect in Crusader Kings III, in the The Royal Court files, written at line 3866 of its file. A call passes 4 parameters: CREATOR, OWNER, SET_SUBJECT and SET_TOPIC. The game's script calls it in 29 places, among them … in Despair (event court.0107), …: Center of the World (event travel_events_cities.1030) and …: Fortified Monuments (event travel_events_cities.1020). Patch 1.20.1.2, from game/common/scripted_effects/01_ep1_court_artifact_creation_effects.txt.

What it does

  • If

    • scope:author = scope:dummy_gender

    Then

    • clear_saved_scope = author
    • clear_saved_scope = dummy_gender
  • hidden_effect_new_object = { … }
  • If

    a check the game hides

    Then

    • clear_saved_scope = should_be_trinket

• 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_book_effect = {
	$OWNER$ = { save_scope_as = owner } #Will always exist!
	$CREATOR$ = { #Doesn't always exist
		save_scope_as = author
	}
	save_temporary_scope_value_as = {
		name = subject_is_set
		value = $SET_SUBJECT$
	}
	save_temporary_scope_value_as = {
		name = topic_is_set
		value = $SET_TOPIC$
	}
	if = {
		limit = {
			exists = scope:dummy_gender
			scope:author = scope:dummy_gender
		}
		clear_saved_scope = author
		clear_saved_scope = dummy_gender
	}
	else = { #If we have an author we save them as a variable on the owner so that we can access them later on when setting the subject etc.
		scope:owner = {
			set_variable = {
				name = book_artifact_author
				value = scope:author
				days = 1
			}
		}
	}
	hidden_effect_new_object = {
		# Get artifact quality and wealth
		get_artifact_quality_effect = yes
		get_artifact_wealth_effect = yes

		# To save the subject, topic, and other variables we'll need if it has been set in events or in the effect
		get_book_variables_effect = yes

		scope:owner = {
			if = { #Should this be a court artifact?
				limit = {
					has_royal_court = yes
					has_dlc_feature = court_artifacts
					NOT = { exists = scope:should_be_trinket }
				}
				create_artifact_book_base_effect = { TYPE = book }
			}
			else = { #This is a personal artifact
				create_artifact_book_base_effect = { TYPE = journal }
				scope:newly_created_artifact = {
					set_artifact_feature_group = book_subject
					set_artifact_feature_group = book_cover_material
				}
			}
		}

		scope:newly_created_artifact = {
			set_artifact_feature_group = book_topic
			set_artifact_feature_group = book_title
			set_artifact_feature_group = book_decoration
			set_artifact_feature_group = decoration_pattern
			get_artifact_feature_references_effect = yes
			# Get quality of written content
			if = {
				limit = {
					NOT = { exists = scope:author }
				}
				get_book_content_quality_effect = { SKILL_BASE = scope:owner }
			}
			else = {
				get_book_content_quality_effect = { SKILL_BASE = scope:author }
			}
			# We save these values as variables on the owner so that we can access them deep in scopes in the desc-loc later on
			scope:owner = {
				set_variable = {
					name = quality
					value = scope:quality
				}
				set_variable = {
					name = wealth
					value = scope:wealth
				}
				set_variable = {
					name = book_content_quality
					value = scope:book_content_quality
				}
			}
			# Generate the updated - final description for the book
			set_artifact_description = artifact_book_description
			# Generate the updated title - final title for the book
			set_artifact_name = artifact_book_title
			# Is the subject a lifestyle?
			if = {
				limit = {
					has_artifact_feature = book_topic_stewardship_old_ledger
				}
				#add_artifact_modifier = artifact_monthly_stewardship_lifestyle_xp_1_modifier
				remove_artifact_modifier = artifact_placeholder_modifier
				flag_as_trash_artifact = yes
			}
			else_if = { 
				limit = { has_artifact_feature = book_subject_martial }
				if = {
					limit = {
						rarity = illustrious
					}
					add_artifact_modifier = artifact_monthly_martial_lifestyle_xp_4_modifier
				}
				else_if = {
					limit = {
						rarity = famed
					}
					add_artifact_modifier = artifact_monthly_martial_lifestyle_xp_3_modifier
				}
				else_if = {
					limit = {
						rarity = masterwork
					}
					add_artifact_modifier = artifact_monthly_martial_lifestyle_xp_2_modifier
				}

As written in game/common/scripted_effects/01_ep1_court_artifact_creation_effects.txt.

The first 120 of its 2566 lines; the rest is in game/common/scripted_effects/01_ep1_court_artifact_creation_effects.txt from line 3866.

Where it is used

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

Character interactions (1)

  • Bestow Artifact

Events (24)

18 more

Scripted effects inside an event file (3)

  • create_coronation_artifact_effect
  • create_cultural_artifact_effect
  • tgp_movement_events_0140_create_artifact_effect

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