Artifact Modding - CK3RealmsinExile/RealmsInExile GitHub Wiki

Adding historic artifacts to Realms in Exile - a beginner’s guide

Introduction

A list of suggested artifacts for inclusion in Realms can be found here: LOTR List of Artifacts

One of the main limiting factors is the need for 3D models. If an artifact requires its own special model then we need that to be produced before including the artifact. However, many vanilla artifacts exist that can be repurposed and given new lore - from swords and crowns to reliquaries, boxes and even furniture.

There are six different files that you will need to amend to add an artifact. In each case you can use an existing artifact’s code as a template for your own.

Step 1 - Define the artifact: What is it? Who first had it? When was it made? Where was it made?

The first step you need to take is to decide how your artifact will be called in the files, and stick to it. For example the element crown_of_gondor in crown_of_gondor_name and create_artifact_crown_of_gondor_effect is the unique identifier for the artifact that you will use in the other files.

Define the artifact here: LotRRealmsInExileDev\common\scripted_effects\lotr_historical_artifacts_creation_effect.txt

For example:

create_artifact_crown_of_gondor_effect = {
	# Get the character the artifact is being made for.
	$OWNER$ = { save_scope_as = owner }
	# Not really used, but if we don't set the scopes we get errors in the feature selection
	set_artifact_rarity_illustrious = yes

	# Create the artifact
	create_artifact = {
		name = crown_of_gondor_name
		description = crown_of_gondor_description
		type = helmet
		visuals = crown_of_gondor
		wealth = scope:wealth
		quality = scope:quality
		template = crown_of_gondor_template # Template is where you set restrictions on usability!
		history = {
			type = created
			date = 5200.1.1
			recipient = character:lineofanarion21 # Atanatar II Alcarin
			location = province:b_osgiliath #Osgiliath
		}
		modifier = crown_of_gondor_modifier
		save_scope_as = newly_created_artifact
		decaying = no
	}

	scope:newly_created_artifact = {
		set_variable = { name = historical_unique_artifact value = yes }
		set_variable = crown_of_gondor
		save_scope_as = epic
	}
}
  1. Artifact type : The Realms artifact file is made of over 80 artifacts and is therefore the best place to look first for the appropriate type. A comprehensive list of artifact types is available in the Artifact Testing Tool (ATT), in the Royal Court UI while in debug mode.
  • any artifact that should be displayed on a pedestal is pedestal type. Court weapons and armour are pedestal type
  • trinket artifacts are miscellaneous
  • any artifact to be used in the head inventory slot is helmet, crowns for example
  1. You can choose the artifact’s level of fame here, for instance set_artifact_rarity_illustrious or set_artifact_rarity_famed
  2. Visuals : This determines which reference your artifact will use for icons and 3D asset
  • if you are content with vanilla visuals, you can simply use pre-made visuals, for which references can be found here https://github.com/MattTheLegoman/RealmsInExile/blob/master/LotRRealmsInExileDev/common/scripted_effects/01_exp1_historical_artifacts_creation_effect.txt , or in the ATT (see above)
  • If you want custom visuals for your artifact use visuals = myartifact (please do not literally write "myartifact" ;) )
  • If the created artifact is a shield or a banner and you want it to show a defined CoA, you need to add : visuals_source = (it does not replace visuals = but comes in addition) With the corresponding CoA, so for example visuals_source = title:e_numenor will fetch the CoA of Numenor, and visuals_source = dynasty:dynasty_elros will fetch the Elrosionath dynastic CoA
  1. Templates : this defines who can use and benefit from your artifact. If the artifact can be used by all, simply write template = general_unique_template
  2. Artifact history : this is purely flavour and isn't necessary for the artifact to work in-game
  • In debug mode, character and province names can be found by hovering over the relevant character or barony. The character code is usually something like lineisildur42 but for some characters from early in the mod’s development it may be a number e.g. 6000017. The characters and their dates of birth/death are also in the RealmsInExile/LotRRealmsInExileDev/history/characters files
  • Select an appropriate date for your artifact’s creation. Here’s a handy guide to dates: 7033 = T.A. 3000 (game start) 4033 = T.A. 1 592 = S.A. 1

Step 2 - Name and describe your artifact

First, give your artifact a name and description here (this is the ‘localization’ file): LotRRealmsInExileDev\localization\english\artifacts\lotr_artifacts_l_english.yml

For example:

 anduril_name:0 "Anduril"
 anduril_description:0 "Reforged and made anew from the shards of [narsil|E], the "[flameofthewest|E]" symbolizes the renewed strength of the Dúnedain."

The element ‘anduril’ in anduril_name and anduril_description is the unique identifier for the artifact that you will use in the other files.

If you want to create a tooltip link to the in game Encyclopedia then you can bracket a word as with [narsil|E] in the example above, but make sure the concept exists in the Encyclopedia (https://github.com/MattTheLegoman/RealmsInExile/blob/master/LotRRealmsInExileDev/localization/english/lotr_game_concepts_l_english.yml)

Step 3 - Link your artifact to a 2D icon and 3D model

If you decided to use a vanilla visuals, skip this step

Link your artifact to an icon and model (asset) here: LotRRealmsInExileDev\common\artifacts\visuals\lotr_historical.txt

Example:

anduril = { # Blade of Elessar, reforged from Narsil
    icon = "artefact_icons_unique_anduril.dds"
    asset = ep1_western_sword_01_a_entity
 }

Note that any text in the code after a # symbol is just a descriptive ‘comment’ that isn’t part of the code - it’s just there to give a description to help people see what the code is/does.

Vanilla artifact icons can be found here: Steam\steamapps\common\Crusader Kings III\game\gfx\interface\icons\artifact Note that there is no need to copy the vanilla icon into the Realms folder.

Realms-specific icons can be found here: LotRRealmsInExileDev\gfx\interface\icons\artifact

Vanilla 3D artifact models (assets) can be found here: Steam\steamapps\common\Crusader Kings III\game\gfx\models\artifacts\ asset references can be found in the files in LotRRealmsInExileDev/common/artifacts/visuals/ (including the non-LOTR ones), or in the ATT

Pedestal items need an additional line in the visual code, compared to inventory ones, which is used to determine the size of the pedestal, e.g. :

branch = { # Preserved Bough of Oiolairë
    icon = "artefact_icons_unique_artifact_holy_branch.dds"
    pedestal = "tall"
    asset = ep1_mena_box_small_basic_02_a_entity
}

There are four pedestal types : tall, tall_pillow, short and short_pillow

Please note that weapons displayed in court do not have the same asset as equippable weapons :

  • Anduril can be equipped and has asset = ep1_western_sword_01_a_portrait_entity
  • Sword of Iunast is only for display and has asset = ep1_indian_sword_01_a_entity. Note the absence of portrait in the asset name

Step 4 - Define the artifact’s modifiers - what does it do?

Define the artifact’s modifiers here: LotRRealmsInExileDev\common\modifiers\lotr_historical_artifact_modifiers.txt

For example:

anduril_modifier = {
    prowess = 6
    martial = 4
    monthly_prestige = 2
}

This bit is hopefully fairly self-explanatory!

Vanilla file 00_artifact_modifiers.txt has a good list of modifiers of scaling power. This is probably a good reference for power levels and balance, e.g: artifact_knight_effectiveness_1_modifier = { knight_effectiveness_mult = 0.02 } artifact_knight_effectiveness_2_modifier = { knight_effectiveness_mult = 0.03 } artifact_knight_effectiveness_3_modifier = { knight_effectiveness_mult = 0.04 } artifact_knight_effectiveness_4_modifier = { knight_effectiveness_mult = 0.05 } artifact_knight_effectiveness_5_modifier = { knight_effectiveness_mult = 0.06 } artifact_knight_effectiveness_6_modifier = { knight_effectiveness_mult = 0.07 } artifact_knight_effectiveness_7_modifier = { knight_effectiveness_mult = 0.08 } artifact_knight_effectiveness_8_modifier = { knight_effectiveness_mult = 0.09 } artifact_knight_effectiveness_9_modifier = { knight_effectiveness_mult = 0.10 } artifact_knight_effectiveness_10_modifier = { knight_effectiveness_mult = 0.12 } artifact_knight_effectiveness_11_modifier = { knight_effectiveness_mult = 0.14 } artifact_knight_effectiveness_12_modifier = { knight_effectiveness_mult = 0.16 }

Once again, previously made Realms artifact can guide you in applying modifiers

Step 5 - Add your artifact to the list of artifacts created at game start

This step is only for artifacts owned on game start. If the artifact is supposed to be found or made, this step can be skipped

Add your artifact to the start-up list here: LotRRealmsInExileDev\events\artifacts\lotr_historical_artifacts_events.txt

lotr_historical_artifacts.0001 = {
    type = empty
    hidden = yes

    immediate = {
        if = {
            #limit = {
            #    # has_dlc_feature = royal_court
            #}
            character:linesteward38 = { # Denethor receives the Rod of the Stewards
                create_artifact_steward_rod_effect = { OWNER = this }
            }
        }
        if = {
            #limit = {
            #    # has_dlc_feature = royal_court
            #}
            character:lineofdulgu44 = { # Arnakhor the receives Storm's Wrath
                create_artifact_storms_wrath_effect = { OWNER = this }
            }
        }
    }
}

You will need to add a new if = { section to this list for your artifact, including granting it to the character who holds the artifact at game start.

Step 6 - Create a template for your artifact - who can benefit from it?

If you decided to let anyone use your artifact by using template = general_unique_template, you can skip this step

Create a template for your artifact here: LotRRealmsInExileDev/common/artifacts/templates/lotr_historical_artifacts_templates.txt

This is where you determine who can benefit from the modifiers that you created in Step 4, and what benefits people gain from it if they do not meet your criteria.

In this example, the artifact is restricted to those who have an Eruhini faith or have Bellakari heritage. If they have neither of these things (for instance if it’s a prize of war) then they just get +1 court grandeur.

book_baitha_template = {
    can_equip = {
        always = yes
    }

    # can this character benefit from the full modifiers of the artifact?
    can_benefit = {
        OR = {
            has_religion = religion:eruhini [CHECK THIS - not sure that code is right]
            culture = { has_cultural_pillar = heritage_bellakari }
    }

    # if a given character does not pass the "can_benefit" trigger then this modifier will be applied instead.
    fallback = {
        court_grandeur_baseline_add = 1
    }

    unique = yes
}