Scripted effect
personality_check_if_chars_have_shared_trait_effect
personality_check_if_chars_have_shared_trait_effect = { CHAR1 = … CHAR2 = … FLAG_POSTFIX = … FLAG_PREFIX = … FLAG_SUCCESS = … STRICT = … TRAIT1 = … TRAIT2 = … }game/common/scripted_effects/00_personality_trait_effects.txt, line 784 (51 lines). Parameters: $CHAR1$, $CHAR2$, $FLAG_POSTFIX$, $FLAG_PREFIX$, $FLAG_SUCCESS$, $STRICT$, $TRAIT1$, $TRAIT2$.
personality_check_if_chars_have_shared_trait_effect is a scripted effect in Crusader Kings III, written at line 784 of its file. A call passes 8 parameters: CHAR1, CHAR2, FLAG_POSTFIX, FLAG_PREFIX, FLAG_SUCCESS, STRICT, TRAIT1 and TRAIT2. The game's script calls it in 1 place, among them personality_check_shared_good_ruler_traits_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/00_personality_trait_effects.txt.
What it does
Every line of it is script with no tooltip text: the script is below.
The script as written (51 lines of game script)
personality_check_if_chars_have_shared_trait_effect = {
$CHAR1$ = {
if = {
limit = {
number_of_personality_traits_in_common = {
target = $CHAR2$
value >= 1
}
}
if = {
#If CHAR1 and both have this trait, set the appropriate flag.
limit = {
has_trait = $TRAIT1$
$CHAR2$ = {
has_trait = $TRAIT1$ }
}
save_scope_value_as = {
name = $FLAG_PREFIX$
value = flag:$FLAG_POSTFIX$
}
save_scope_value_as = {
name = $FLAG_SUCCESS$
value = yes
}
}
}
else = {
if = {
#Fallback option if the two characters have no shared traits at all.
limit = {
#If we are strictly looking for only shared traits, do not do this step.
$STRICT$ = no
#Otherwise, simply find a trait that CHAR1 has which CHAR2 does not have the opposite trait for, then add the appropriate flag to CHAR1.
has_trait = $TRAIT1$
$CHAR2$ = {
NOT = { has_trait = $TRAIT2$ }
}
}
save_scope_value_as = {
name = $FLAG_PREFIX$
value = flag:$FLAG_POSTFIX$
}
save_scope_value_as = {
name = $FLAG_SUCCESS$
value = yes
}
}
}
}
}As written in game/common/scripted_effects/00_personality_trait_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls personality_check_if_chars_have_shared_trait_effect.
Scripted effects (1)
Source: game/common/scripted_effects/00_personality_trait_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.