Scripted effect
add_bastard_trait_based_on_faith_effect
add_bastard_trait_based_on_faith_effect = yesgame/common/scripted_effects/00_bastard_effects.txt, line 41 (84 lines). No parameters.
add_bastard_trait_based_on_faith_effect is a scripted effect in Crusader Kings III, written at line 41 of its file. It takes no parameters: add_bastard_trait_based_on_faith_effect = yes. The game's script calls it in 3 places, among them My … (event birth.2011), My … (event birth.2012) and on_birth_child (on action). Patch 1.20.1.2, from game/common/scripted_effects/00_bastard_effects.txt.
The comment above it in the file
Sets the correct bastard trait
What it does
If
- Their rite: The rite has There is no such thing as a Bastard. All children are equally Legitimate
Then
add_trait_force_tooltip = wild_oat
Otherwise
add_trait_force_tooltip = bastardscope:real_father:- If no child:
create_character_memory = { … }
- Otherwise:
If a check the game hides passes: the same again (1 line)
create_character_memory = { … }
Otherwise
create_character_memory = { … }
- If no child:
• 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 (84 lines of game script)
add_bastard_trait_based_on_faith_effect = {
if = {
limit = {
rite = {
rite_has_parameter = bastards_none
}
}
add_trait_force_tooltip = wild_oat
}
else = {
add_trait_force_tooltip = bastard
scope:father ?= {
random_memory = {
limit = {
OR = {
has_memory_type = first_born
has_memory_type = twins_born
has_memory_type = child_born
}
any_memory_participant = { scope:child ?= this }
}
set_variable = bastard
}
}
scope:mother ?= {
random_memory = {
limit = {
OR = {
has_memory_type = first_born
has_memory_type = twins_born
has_memory_type = child_born
}
any_memory_participant = { scope:child ?= this }
}
set_variable = bastard
}
}
scope:real_father = {
scope:child = {
if = {
limit = { has_trait = twin }
random_sibling = {
limit = { is_twin_of = scope:child }
save_scope_as = child_2
}
}
}
if = {
limit = {
NOR = {
any_child = {
even_if_dead = yes
this != scope:child
}
exists = scope:child_2
}
}
create_character_memory = {
type = first_born
participants = { child = scope:child }
}
}
else = {
if = {
limit = { exists = scope:child_2 }
create_character_memory = {
type = twins_born
participants = {
child = scope:child
child_2 = scope:child_2
}
}
}
else = {
create_character_memory = {
type = child_born
participants = { child = scope:child }
}
}
}
scope:new_memory = { set_variable = bastard }
}
}
}As written in game/common/scripted_effects/00_bastard_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls add_bastard_trait_based_on_faith_effect.
Source: game/common/scripted_effects/00_bastard_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.