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

get_book_variables_effect

get_book_variables_effect = yes

game/common/scripted_effects/01_ep1_court_artifact_creation_effects.txt, line 3127 (264 lines). No parameters.

get_book_variables_effect is a scripted effect in Crusader Kings III, in the The Royal Court files, written at line 3127 of its file. It takes no parameters: get_book_variables_effect = yes. The game's script calls it in 1 place, among them create_artifact_book_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/01_ep1_court_artifact_creation_effects.txt.

The comment above it in the file

Get variables needed for the book

What it does

  • scope:owner › If book artifact subject is childhood:

• 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)
get_book_variables_effect = {

	scope:owner = {
		# If we have a subject we save it as a variable on the owner so that we can access it when setting the subject-feature
		if = {
			limit = {
				NOT = { scope:subject_is_set = flag:no }
			}
			set_variable = {
				name = book_artifact_subject
				value = scope:subject_is_set
				days = 1
			}
		}
		else_if = {
			limit = {
				exists = scope:author
				exists = scope:author.var:book_subject
			}
			set_variable = {
				name = book_artifact_subject
				value = scope:author.var:book_subject
				days = 1
			}
		}

		#If we have a topic we save it as a variable on the owner so that we can access it when setting the topic-feature
		if = {
			limit = {
				NOT = { scope:topic_is_set = flag:no }
			}
			set_variable = {
				name = book_artifact_topic
				value = scope:topic_is_set
				days = 1
			}
		}
		else_if = {
			limit = {
				exists = scope:author
				exists = scope:author.var:book_topic
			}
			set_variable = {
				name = book_artifact_topic
				value = scope:author.var:book_topic
				days = 1
			}
		}
		# If subject or topic is "no" we do nothing and let the feature system handle it

		# To save the topic category if it has been set in events
		if = {
			limit = {
				exists = scope:author
				exists = scope:author.var:book_topic_category
			}
			set_variable = {
				name = book_topic_category
				value = scope:author.var:book_topic_category
				days = 1
			}
		}

	    # Save toy for childhood book loc (if it's a kid writing it will be the author who is a kid)
		if = {
			limit = {
				exists = var:book_artifact_subject
				var:book_artifact_subject = flag:childhood
			}
			if = {
				limit = {
					NOT = { exists = scope:author.var:child_toy_variable }
				}
				scope:author = { set_favorite_toy_effect = yes }
			}
		}
		if = { #Is the book about a mystical animal you hunted? Then we need to save the animal as a variable so we can use the custom loc key in the loc
			limit = {
				exists = var:book_artifact_subject
				var:book_artifact_subject = flag:mystical_animal
			}
			set_variable = {
				name = animal_type
				value = scope:owner.var:hunted_mystical_animal
				days = 1
			}
		}
		# Witch
		if = {
			limit = {
				exists = var:book_artifact_subject
				var:book_artifact_subject = flag:witch
				exists = scope:author.var:book_subject_witch_scope
			}
			set_variable = {
				name = book_subject_witch_scope
				value = scope:author.var:book_subject_witch_scope
				days = 1
			}
		}
		# Soulmate
		if = {
			limit = {
				exists = var:book_artifact_topic
				var:book_artifact_topic = flag:soulmate #Check for relationship variable
			}
			if = {
				limit = {
					exists = scope:author
					exists = scope:author.var:book_topic_relationship
				}
				set_variable = {
					name = book_topic_relationship
					value = scope:author.var:book_topic_relationship
					days = 1
				}
			}
			else_if = {
				limit = {
					exists = var:book_topic_relationship

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

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

Where it is used

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

Scripted effects (1)

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?