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 = authorclear_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)
- … in Despair
court.0107 - …: Center of the World
travel_events_cities.1030 - …: Fortified Monuments
travel_events_cities.1020 - …: Suq al-Warraqin
travel_events_cities.1010 - A Family Epic
commission_epic.9001 - A Laden Caravan
travel_events_oltner_2.1030
18 more
- A Lost Treasure
hold_court.6040 - A Wandering Merchant
ep3_camp_party.1040 - An Excellent Epic
commission_epic.9002 - Happy Birthday!
bp1_yearly.3005 - Heirloom Offering
emperor_imperial_examination.300 - Inspiration Realized
fund_inspiration.1031 - Inspiration Realized
fund_inspiration.1081 - Inspiration: An Alchemical Treasure
fund_inspiration.8013 - Learn Language: A Worn Manual
learn_language_ongoing.1030 - learning_scholarship.5007
- Leather-Bound Secrets
witch.4030 - New Acquisitions
stewardship_wealth.1061 - Study Rite: Old …
study_faith_ongoing.1030 - Tending the Flock
pam_decision_events.0032 - tgp_movement_events.0110
- Where All the World Gazes
bp2_yearly.6070 - Yes and No
bp2_adult_education.1060 - debug.342
Scripted effects inside an event file (3)
- create_coronation_artifact_effect
- create_cultural_artifact_effect
- tgp_movement_events_0140_create_artifact_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.