Scripted effect
choose_and_assign_appropriate_councillor_position_effect
choose_and_assign_appropriate_councillor_position_effect = { FALLBACK_1 = … FALLBACK_2 = … FALLBACK_3 = … FALLBACK_4 = … PREFERRED_POSITION = … }game/common/scripted_effects/00_councillor_effects.txt, line 887 (82 lines). Parameters: $FALLBACK_1$, $FALLBACK_2$, $FALLBACK_3$, $FALLBACK_4$, $PREFERRED_POSITION$.
choose_and_assign_appropriate_councillor_position_effect is a scripted effect in Crusader Kings III, written at line 887 of its file. A call passes 5 parameters: FALLBACK_1, FALLBACK_2, FALLBACK_3, FALLBACK_4 and PREFERRED_POSITION. The game's script calls it in 1 place, among them assign_appropriate_councillor_position_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/00_councillor_effects.txt.
What it does
scope:court_owner:If
One of these
NOT = { exists = cp:councillor_$PREFERRED_POSITION$ }or
cp:councillor_$PREFERRED_POSITION$:can_be_fired_from_council_trigger = { COURT_OWNER = scope:court_owner }
Then
assign_councillor_type = { type = councillor_$PREFERRED_POSITION$ target = scope:new_councillor remove_existing_councillor = yes }
Else if
One of these
NOT = { exists = cp:councillor_$FALLBACK_1$ }or
cp:councillor_$FALLBACK_1$:can_be_fired_from_council_trigger = { COURT_OWNER = scope:court_owner }
Then
assign_councillor_type = { type = councillor_$FALLBACK_1$ target = scope:new_councillor remove_existing_councillor = yes }
Else if
One of these
NOT = { exists = cp:councillor_$FALLBACK_2$ }or
cp:councillor_$FALLBACK_2$:can_be_fired_from_council_trigger = { COURT_OWNER = scope:court_owner }
Then
assign_councillor_type = { type = councillor_$FALLBACK_2$ target = scope:new_councillor remove_existing_councillor = yes }
Else if
One of these
NOT = { exists = cp:councillor_$FALLBACK_3$ }or
cp:councillor_$FALLBACK_3$:can_be_fired_from_council_trigger = { COURT_OWNER = scope:court_owner }
Then
assign_councillor_type = { type = councillor_$FALLBACK_3$ target = scope:new_councillor remove_existing_councillor = yes }
Else if
One of these
NOT = { exists = cp:councillor_$FALLBACK_4$ }or
cp:councillor_$FALLBACK_4$:can_be_fired_from_council_trigger = { COURT_OWNER = scope:court_owner }
Then
assign_councillor_type = { type = councillor_$FALLBACK_4$ target = scope:new_councillor remove_existing_councillor = yes }
• 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 (82 lines of game script)
choose_and_assign_appropriate_councillor_position_effect = {
scope:court_owner = {
if = {
limit = {
OR = {
NOT = { exists = cp:councillor_$PREFERRED_POSITION$ }
cp:councillor_$PREFERRED_POSITION$ ?= {
can_be_fired_from_council_trigger = { COURT_OWNER = scope:court_owner }
}
}
}
assign_councillor_type = {
type = councillor_$PREFERRED_POSITION$
target = scope:new_councillor
remove_existing_councillor = yes
}
}
else_if = {
limit = {
OR = {
NOT = { exists = cp:councillor_$FALLBACK_1$ }
cp:councillor_$FALLBACK_1$ ?= {
can_be_fired_from_council_trigger = { COURT_OWNER = scope:court_owner }
}
}
}
assign_councillor_type = {
type = councillor_$FALLBACK_1$
target = scope:new_councillor
remove_existing_councillor = yes
}
}
else_if = {
limit = {
OR = {
NOT = { exists = cp:councillor_$FALLBACK_2$ }
cp:councillor_$FALLBACK_2$ ?= {
can_be_fired_from_council_trigger = { COURT_OWNER = scope:court_owner }
}
}
}
assign_councillor_type = {
type = councillor_$FALLBACK_2$
target = scope:new_councillor
remove_existing_councillor = yes
}
}
else_if = {
limit = {
OR = {
NOT = { exists = cp:councillor_$FALLBACK_3$ }
cp:councillor_$FALLBACK_3$ ?= {
can_be_fired_from_council_trigger = { COURT_OWNER = scope:court_owner }
}
}
}
assign_councillor_type = {
type = councillor_$FALLBACK_3$
target = scope:new_councillor
remove_existing_councillor = yes
}
}
else_if = {
limit = {
OR = {
NOT = { exists = cp:councillor_$FALLBACK_4$ }
cp:councillor_$FALLBACK_4$ ?= {
can_be_fired_from_council_trigger = { COURT_OWNER = scope:court_owner }
}
}
}
assign_councillor_type = {
type = councillor_$FALLBACK_4$
target = scope:new_councillor
remove_existing_councillor = yes
}
}
else = {
# shouldn't happen, if before using the assign_appropriate_councillor_position_effect you check that any councilor can be fired
}
}
}As written in game/common/scripted_effects/00_councillor_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls choose_and_assign_appropriate_councillor_position_effect.
Scripted effects (1)
Source: game/common/scripted_effects/00_councillor_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.