Scripted effect
activity_on_war_declared_events_effect
activity_on_war_declared_events_effect = yesgame/common/scripted_effects/00_activity_effects.txt, line 4249 (49 lines). No parameters.
activity_on_war_declared_events_effect is a scripted effect in Crusader Kings III, written at line 4249 of its file. It takes no parameters: activity_on_war_declared_events_effect = yes. The game's script calls it in 2 places, among them on_join_war_as_secondary (on action) and on_war_started (on action). Patch 1.20.1.2, from game/common/scripted_effects/00_activity_effects.txt.
The comment above it in the file
Called in the war_on_actions.txt file Used to send out the correct events if a character becomes involved in a war while attending an activity
What it does
- Event religious_decision.0200
If
- Their activity:
is_activity_complete = no
Then
- Else, if no war enemy: Event activity_system.0310
- Else, if any war enemy:
current_travel_plan ?= { … }
- Their activity:
• 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 (49 lines of game script)
activity_on_war_declared_events_effect = {
trigger_event = religious_decision.0200 # Stop mediation in its tracks
if = {
limit = {
this.involved_activity ?= {
is_activity_complete = no
}
}
this.involved_activity ?= {
save_scope_as = target_activity
activity_type = { save_scope_as = target_activity_type }
activity_host = { save_scope_as = target_activity_host }
}
if = { # Send one event if you're the host
limit = {
exists = this.involved_activity
this = this.involved_activity.activity_host
}
# This event fires follow-up events for the guests depending on the character's choice
trigger_event = activity_system.0300
}
else_if = { # Send another if you're just a guest
limit = {
exists = this.involved_activity
NOT = {
any_war_enemy = { this = scope:target_activity_host }
}
}
trigger_event = activity_system.0310
}
else_if = { # Just go home if you're at war with host
limit = {
exists = this.involved_activity
any_war_enemy = { this = scope:target_activity_host }
}
send_interface_toast = {
type = event_toast_effect_bad
left_icon = scope:target_activity_host
title = at_war_difficulty #"At war"
current_travel_plan ?= {
if = {
limit = { can_cancel = yes }
cancel_travel_plan = yes
}
}
}
}
}
}As written in game/common/scripted_effects/00_activity_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls activity_on_war_declared_events_effect.
On actions (the game's own hooks) (2)
- on_join_war_as_secondary
- on_war_started
Source: game/common/scripted_effects/00_activity_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.