CK3 DatabaseCrusader Kings III · 1.20.1.2 “Crozier” · unofficial
Silk & Silverout Tue, Nov 17What's free, what needs the DLC, price →

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)

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.

Spotted a mistake on this page?