Scripted effect · The Royal Court files
create_artifact_weapon_effect
create_artifact_weapon_effect = { CREATOR = … OWNER = … SET_WEAPON_TYPE = … }game/common/scripted_effects/00_ep1_artifact_creation_effects.txt, line 9585 (616 lines). Parameters: $CREATOR$, $OWNER$, $SET_WEAPON_TYPE$.
create_artifact_weapon_effect is a scripted effect in Crusader Kings III, in the The Royal Court files, written at line 9585 of its file. A call passes 3 parameters: CREATOR, OWNER and SET_WEAPON_TYPE. The game's script calls it in 30 places, among them …: the Weaponsmith (event ep3_laamp_decision_event.1061), A Laden Caravan (event travel_events_oltner_2.1030) and A Small Grave (event bp3_roaming.0250). Patch 1.20.1.2, from game/common/scripted_effects/00_ep1_artifact_creation_effects.txt.
What it does
If
scope:smith = scope:dummy_gender
Then
clear_saved_scope = smithclear_saved_scope = dummy_gender
save_adventurer_location_effect = yeshidden_effect_new_object = { … }
• 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_weapon_effect = {
# Get the character the artifact is being made for.
# If scope:adventurer exists this will result in the history entry reading that the weapon was discovered instead of made.
$OWNER$ = { save_scope_as = owner }
$CREATOR$ = { save_scope_as = smith }
save_temporary_scope_value_as = {
name = weapon_type_is_set
value = $SET_WEAPON_TYPE$
}
if = { #Any existing dummy character gets turned into the smith
limit = {
exists = scope:dummy_gender
scope:smith = scope:dummy_gender
}
clear_saved_scope = smith
clear_saved_scope = dummy_gender
}
save_adventurer_location_effect = yes
hidden_effect_new_object = {
if = {
limit = {
scope:weapon_type_is_set = flag:no
}
if = {
limit = {
exists = scope:smith
}
set_weapon_artifact_type_effect = {
BASE_SCOPE = scope:smith
NO_TYPE = no
}
scope:smith = {
var:artifact_weapon_type = { save_scope_as = weapon_type }
remove_variable = artifact_weapon_type
}
}
else = {
set_weapon_artifact_type_effect = {
BASE_SCOPE = scope:owner
NO_TYPE = no
}
scope:owner = {
var:artifact_weapon_type = { save_scope_as = weapon_type }
remove_variable = artifact_weapon_type
}
}
}
else = {
scope:weapon_type_is_set = { save_scope_as = weapon_type }
}
# Get artifact quality and wealth.
get_artifact_quality_effect = yes
get_artifact_wealth_effect = yes
# Get the type of weapon to forge. Defaults to sword if an invalid type is provided.
if = {
limit = { scope:weapon_type = flag:artifact_weapon_type_axe }
if = {
limit = { exists = scope:adventurer }
create_artifact = {
name = artifact_axe_name
description = placeholder # Will be re-generated once decorations are added in the post-creation effects.
visuals = axe
type = axe
modifier = artifact_prowess_1_modifier
wealth = scope:wealth
quality = scope:quality
save_scope_as = newly_created_artifact
history = {
location = scope:location
actor = scope:adventurer
recipient = root
type = discovered
}
}
}
else_if = {
limit = { exists = scope:smith }
create_artifact = {
name = artifact_axe_name
creator = scope:smith
description = placeholder # Will be re-generated once decorations are added in the post-creation effects.
visuals = axe
type = axe
modifier = artifact_prowess_1_modifier
wealth = scope:wealth
quality = scope:quality
save_scope_as = newly_created_artifact
}
}
else_if = {
limit = {
scope:host ?= $OWNER$
scope:activity ?= { has_activity_type = activity_tournament }
}
tournament_contest_weapon_prize_effect = { VISUALS = axe TYPE = axe }
}
else = {
create_artifact = {
name = artifact_axe_name
description = placeholder # Will be re-generated once decorations are added in the post-creation effects.
visuals = axe
type = axe
modifier = artifact_prowess_1_modifier
wealth = scope:wealth
quality = scope:quality
save_scope_as = newly_created_artifact
history = { type = created_before_history }
}
}
scope:newly_created_artifact = {
get_axe_decoration_effect = yes
get_artifact_feature_references_effect = yes
set_artifact_description = artifact_axe_description
}
}
else_if = {
limit = { scope:weapon_type = flag:artifact_weapon_type_hammer }
if = {As written in game/common/scripted_effects/00_ep1_artifact_creation_effects.txt.
The first 120 of its 616 lines; the rest is in game/common/scripted_effects/00_ep1_artifact_creation_effects.txt from line 9585.
Where it is used
Every place in common/, events/ and history/ that calls create_artifact_weapon_effect.
Character interactions (1)
- Bestow Artifact
Events (20)
- …: the Weaponsmith
ep3_laamp_decision_event.1061 - A Laden Caravan
travel_events_oltner_2.1030 - A Small Grave
bp3_roaming.0250 - A Wandering Merchant
ep3_camp_party.1040 - Eparch: For Services Rendered
ep3_eparch_event.0020 - Happy Birthday!
bp1_yearly.3005
14 more
- Inspiration Realized
fund_inspiration.1011 - Passing Like Fire
migration_events.1050 - Ruin Rambling
ep3_laamps.5040 - The Smith's Clangor
travel_events_oltner_2.1110 - Underequipped
court.8010 - Weaponsmith: Chip Off The Old Sword
ep2_locale_events.4500 - Weaponsmith: Offensive Gifts
ep2_locale_events.4511 - … Artifact
debug.0301 - … Artifact
debug.302 - … Artifact
debug.303 - … Artifact
debug.304 - … Artifact
debug.305 - … Artifact
debug.306 - DEBUG TEST TITLE
debug_story_test_event.0001
Scripted effects inside an event file (5)
- create_coronation_artifact_effect
- create_cultural_artifact_effect
- ep1_flavor_2040_artifact_effect
- tgp_movement_events_0140_create_artifact_effect
- tribute_mission_1000_set_artifact_reward_effect
History files (the start of the game) (2)
- easteregg_chad_uhl (characters)
- easteregg_henry_of_skalitz (characters)
Source: game/common/scripted_effects/00_ep1_artifact_creation_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.