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

generate_trinket_effect

generate_trinket_effect = { GRAB_ALL_TRINKETS = … HISTORY_TYPE = … TRINKET_GIVER = … TRINKET_RECEIVER = … }

game/common/scripted_effects/00_ep1_artifact_creation_effects.txt, line 12325 (1169 lines). Parameters: $GRAB_ALL_TRINKETS$, $HISTORY_TYPE$, $TRINKET_GIVER$, $TRINKET_RECEIVER$.

generate_trinket_effect is a scripted effect in Crusader Kings III, in the The Royal Court files, written at line 12325 of its file. A call passes 4 parameters: GRAB_ALL_TRINKETS, HISTORY_TYPE, TRINKET_GIVER and TRINKET_RECEIVER. The game's script calls it in 15 places, among them … Gave a Gift to the Host, … (activity pulse), tournament_host_gifted (activity pulse) and 'Haunted' Manor: Something Borrowed (event travel_events.2021). Patch 1.20.1.2, from game/common/scripted_effects/00_ep1_artifact_creation_effects.txt.

The comment above it in the file

HOW TO generate_trinket_effect ####
Use this template to make the generate_trinket_effect work
generate_trinket_effect = {
	TRINKET_RECEIVER = scope:your_receiving_character
	TRINKET_GIVER = scope:your_giving_character
GRAB_ALL_TRINKETS = yes/no
HISTORY_TYPE = given_unknown/given/discovered_for/stolen_unknown/stolen/created_unknown/created/inherited_unknown/inherited/reforged/conquest/taken_in_siege
TRINKET_RECEIVER/TRINKET_GIVER - if you don't have a giver and/or receiver, set the same character as both
GRAB_ALL_TRINKETS - if you are not discerned with what trinkets you generate, put this as a "yes". Otherwise put it as a "no" and set your own flags.
If you _are_ discerning and you want to choose which trinkets you want to be able to generate:
> Set an add_character_flag = { flag = used_in_stewardship_general.2001 } on your TRINKET_RECEIVER-character
> Refer to this flag in the trigger of the trinket below
> Remember to remove_character_flag = used_in_stewardship_general.2001 in your after = { ... }
HISTORY_TYPE - pick one that fits the interaction in which you get the trinket

What it does

  • 1 of 18 things will happen:
  • If

    a check the game hides

    Then

    • scope:new_trinket:
      • If

        • scope:artifact_history = flag:given_unknown

        Then

        • add_artifact_history = { type = given actor = scope:trinket_receiver recipient = scope:trinket_receiver }

        Else if

        • scope:artifact_history = flag:given

        Then

        • add_artifact_history = { type = given actor = scope:trinket_giver recipient = scope:trinket_receiver }

        Else if

        • scope:artifact_history = flag:discovered

        Then

        • add_artifact_history = { … }

        Else if

        • scope:artifact_history = flag:stolen_unknown

        Then

        • add_artifact_history = { type = stolen actor = scope:trinket_receiver recipient = scope:trinket_receiver }

        Else if

        • scope:artifact_history = flag:stolen

        Then

        • add_artifact_history = { type = stolen actor = scope:trinket_giver recipient = scope:trinket_receiver }

        Else if

        • scope:artifact_history = flag:created_unknown

        Then

        • add_artifact_history = { type = created recipient = scope:trinket_receiver location = scope:trinket_receiver.location }

        Else if

        • scope:artifact_history = flag:created

        Then

        • add_artifact_history = { … }

        Else if

        • scope:artifact_history = flag:inherited_unknown

        Then

        • add_artifact_history = { type = inherited actor = scope:trinket_receiver recipient = scope:trinket_receiver }

        Else if

        • scope:artifact_history = flag:inherited

        Then

        • add_artifact_history = { type = inherited actor = scope:trinket_giver recipient = scope:trinket_receiver }

        Else if

        • scope:artifact_history = flag:reforged

        Then

        • add_artifact_history = { type = reforged recipient = scope:trinket_receiver location = scope:trinket_receiver.location }

        Else if

        • scope:artifact_history = flag:conquest

        Then

        • add_artifact_history = { type = conquest actor = scope:trinket_giver recipient = scope:trinket_receiver }

        Else if

        • scope:artifact_history = flag:taken_in_siege

        Then

        • add_artifact_history = { … }

• 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)
generate_trinket_effect = {
	$TRINKET_RECEIVER$ = { save_scope_as = trinket_receiver }
	$TRINKET_GIVER$ = { save_scope_as = trinket_giver }
	scope:trinket_receiver = {
		set_variable = {
			name = grab_all_trinkets
			value = flag:$GRAB_ALL_TRINKETS$
		}
	}
	random_list = {
		#BAD
		##Bad 01
		###Gilded Rat's Tail
		80 = {
			#TRIGGERS
			trigger = {
				scope:trinket_receiver = {
					OR = {
						##If we are flagged to grab all trinkets
						var:grab_all_trinkets ?= flag:yes
						##stewardship_general.2001
						###Let's not get trash if we outwitted the merchant
						AND = {
							has_character_flag = used_in_stewardship_general.2001
							NOT = { has_character_flag = free_outcome_stewardship_general.2001 }
						}
						##^^Add more/other trigger flags above^^##
					}
				}
			}
			#MODIFIERS
			##stewardship_general.2001
			###We didn't choose the CHEAP option
			modifier = {
				scope:trinket_receiver = {
					OR = {
						has_character_flag = expensive_option_stewardship_general.2001
						has_character_flag = helpful_option_stewardship_general.2001
					}
				}
				add = -25
			}
			###We have extremely high stewardship skill
			modifier = {
				scope:trinket_receiver = { has_character_flag = has_extremely_high_stewardship_skill_stewardship_general.2001 }
				add = -25
			}
			##^^Add more/other modifier flags above^^##
			#DO NOT edit this part##
			create_artifact = {
				name = gilded_rats_tail
				description = gilded_rats_tail.desc
				type = miscellaneous
				visuals = ring
				modifier = artifact_monthly_prestige_penalty_modifier
				modifier = artifact_child_opinion_1_modifier
				save_scope_as = new_trinket
				wealth = 5
				quality = 5
				max_durability = 10
				generate_history = no
			}
			scope:new_trinket = {
				flag_as_trash_artifact = yes
				#The AI probably shouldn't want this bad trinket
				flag_as_unwanted_artifact = yes
			}
		}
		##Bad 02
		###Quail's Eggshell 'Gem'
		80 = {
			#TRIGGERS
			trigger = {
				scope:trinket_receiver = {
					OR = {
						##If we are flagged to grab all trinkets
						var:grab_all_trinkets ?= flag:yes
						##stewardship_general.2001
						###Let's not get trash if we outwitted the merchant
						AND = {
							has_character_flag = used_in_stewardship_general.2001
							NOT = { has_character_flag = free_outcome_stewardship_general.2001 }
						}
						has_character_flag = used_in_mpo_events_ariana_0070
						##^^Add more/other trigger flags above^^##
					}
				}
			}
			#MODIFIERS
			##stewardship_general.2001
			###We didn't choose the CHEAP option
			modifier = {
				scope:trinket_receiver = {
					OR = {
						has_character_flag = expensive_option_stewardship_general.2001
						has_character_flag = helpful_option_stewardship_general.2001
					}
				}
				add = -25
			}
			###We have extremely high stewardship skill
			modifier = {
				scope:trinket_receiver = { has_character_flag = has_extremely_high_stewardship_skill_stewardship_general.2001 }
				add = -25
			}
			##^^Add more/other modifier flags above^^##
			#DO NOT edit this part##
			create_artifact = {
				name = quail_eggshell_gem
				description = quail_eggshell_gem.desc
				type = miscellaneous
				visuals = diamond
				modifier = artifact_monthly_prestige_penalty_modifier
				modifier = artifact_fertility_gain_1_modifier
				save_scope_as = new_trinket
				wealth = 5
				quality = 5
				max_durability = 10
				generate_history = no
			}

As written in game/common/scripted_effects/00_ep1_artifact_creation_effects.txt.

The first 120 of its 1169 lines; the rest is in game/common/scripted_effects/00_ep1_artifact_creation_effects.txt from line 12325.

Where it is used

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

Activity pulse actions (2)

  • … Gave a Gift to the Host, …
  • tournament_host_gifted

Events (13)

7 more

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.

Spotted a mistake on this page?