Scripted trigger
guest_allowed_to_arrive_trigger
guest_allowed_to_arrive_trigger = { HOST = … }game/common/scripted_triggers/00_courtier_guest_management_triggers.txt, line 294 (38 lines). Parameters: $HOST$.
guest_allowed_to_arrive_trigger is a scripted trigger in Crusader Kings III, written at line 294 of its file. A call passes 1 parameter: HOST. The game's script calls it in 3 places, among them learning_medicine_2001_pool_herbalist_trigger (local trigger), select_pool_to_move_to_effect (scripted effect) and guest_management (courtier guest management). Patch 1.20.1.2, from game/common/scripted_triggers/00_courtier_guest_management_triggers.txt.
What it checks
If
a check the game hides
Then
- Last visited ruler is not $HOST$
If
a check the game hides
Then
NOT = { host = $HOST$ }
- Has none of the traits: Consumption, Typhus, Bubonic Plague, Smallpox, Measles, Bloody Flux, Holy Fire
NOT = { has_relation_rival = $HOST$ }- Their faith:
faith_hostility_level = { target = $HOST$.faith value < faith_evil_level }
$HOST$.faith = { … }- Does not have “merchant var” (a variable the game's script sets)
• 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 (38 lines of game script)
guest_allowed_to_arrive_trigger = {
trigger_if = {
limit = { exists = var:last_visited_ruler }
NOT = { var:last_visited_ruler = $HOST$ }
}
trigger_if = { # Make sure that they're not trying to go back to where they are right now
limit = { exists = host }
NOT = { host = $HOST$ }
}
NOT = { has_trait_with_flag = epidemic_disease }
NOT = { has_relation_rival = $HOST$ }
#Compatible faiths
faith = {
save_temporary_scope_as = potential_guest_faith
faith_hostility_level = {
target = $HOST$.faith
value < faith_evil_level
}
}
$HOST$.faith = {
faith_hostility_level = {
target = scope:potential_guest_faith
value < faith_evil_level
}
}
#Isn't too good for host
NAND = {
OR = {
any_claim = { tier >= tier_empire }
any_close_family_member = { highest_held_title_tier >= tier_empire }
}
$HOST$ = { highest_held_title_tier <= tier_county }
}
# Prevent paiza merchants from arriving as guests
NOT = { has_variable = merchant_var }
} #Note: this trigger used to contain opinion triggers but then some awful rulers could never get guests because everyone hates themAs written in game/common/scripted_triggers/00_courtier_guest_management_triggers.txt.
Where it is used
Every place in common/, events/ and history/ that calls guest_allowed_to_arrive_trigger.
Scripted triggers inside an event file (1)
- learning_medicine_2001_pool_herbalist_trigger
Scripted effects (1)
Courtier guest management (1)
- guest_management
Source: game/common/scripted_triggers/00_courtier_guest_management_triggers.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.