Scripted effect
add_hook_if_possible_effect
add_hook_if_possible_effect = { TARGET = … TYPE = … YEARS = … }game/common/scripted_effects/00_hook_effects.txt, line 12 (15 lines). Parameters: $TARGET$, $TYPE$, $YEARS$.
add_hook_if_possible_effect is a scripted effect in Crusader Kings III, written at line 12 of its file. A call passes 3 parameters: TARGET, TYPE and YEARS. The game's script calls it in 2 places, among them A Castle Worthy of Iberia (event fp2_struggle.2007) and Pilgrim Roads: Impoverished Student (event iberia_north_africa.2012). Patch 1.20.1.2, from game/common/scripted_effects/00_hook_effects.txt.
What it does
If
can_add_hook = { target = $TARGET$ type = $TYPE$ }
Then
add_hook = { target = $TARGET$ type = $TYPE$ years = $YEARS$ }
• 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 (15 lines of game script)
add_hook_if_possible_effect = {
if = {
limit = {
can_add_hook = {
target = $TARGET$
type = $TYPE$
}
}
add_hook = {
target = $TARGET$
type = $TYPE$
years = $YEARS$
}
}
}As written in game/common/scripted_effects/00_hook_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls add_hook_if_possible_effect.
Events (2)
- A Castle Worthy of Iberia
fp2_struggle.2007 - Pilgrim Roads: Impoverished Student
iberia_north_africa.2012
Source: game/common/scripted_effects/00_hook_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.