Scripted effect
personality_check_if_chars_have_opposing_traits_effect
personality_check_if_chars_have_opposing_traits_effect = { CHAR1 = … CHAR2 = … FLAG_POSTFIX = … FLAG_PREFIX = … FLAG_SUCCESS = … STRICT = … TRAIT1 = … TRAIT2 = … }game/common/scripted_effects/00_personality_trait_effects.txt, line 28 (52 lines). Parameters: $CHAR1$, $CHAR2$, $FLAG_POSTFIX$, $FLAG_PREFIX$, $FLAG_SUCCESS$, $STRICT$, $TRAIT1$, $TRAIT2$.
personality_check_if_chars_have_opposing_traits_effect is a scripted effect in Crusader Kings III, written at line 28 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_opposing_bad_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 (52 lines of game script)
personality_check_if_chars_have_opposing_traits_effect = {
$CHAR1$ = {
if = {
limit = {
number_of_opposing_traits = {
target = $CHAR2$
value >= 1
}
}
if = {
#If CHAR1 and CHAR2 have these opposite traits, CHAR1 gets the appropriate flags added to them.
limit = {
has_trait = $TRAIT1$
$CHAR2$ = {
has_trait = $TRAIT2$
}
}
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 opposing traits at all.
limit = {
#If we are strictly looking for only opposite traits, do not do this step.
$STRICT$ = no
#Otherwise, simply find a trait that CHAR1 has which CHAR2 does not, then add the appropriate flag to CHAR1.
has_trait = $TRAIT1$
$CHAR2$ = {
NOT = { has_trait = $TRAIT1$ }
}
}
save_scope_value_as = {
name = $FLAG_PREFIX$
value = flag:$FLAG_POSTFIX$
}
save_scope_value_as = {
name = flag:$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_opposing_traits_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.