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

Scripted effect · Silk and Silver files

gg_involvement_cb_effect

gg_involvement_cb_effect = { WAR_OUTCOME = … }

game/common/scripted_effects/00_gdp_guelph_ghibelline_scripted_effects.txt, line 1648 (84 lines). Parameters: $WAR_OUTCOME$.

gg_involvement_cb_effect is a scripted effect in Crusader Kings III, in the Silk and Silver files, written at line 1648 of its file. A call passes 1 parameter: WAR_OUTCOME. The game's script calls it in 3 places, among them gg_involvement_cb_defeat_effect (scripted effect), gg_involvement_cb_victory_effect (scripted effect) and gg_involvement_cb_white_peace_effect (scripted effect). Its body carries 3 texts of the game's own for the player. Patch 1.21.0, from game/common/scripted_effects/00_gdp_guelph_ghibelline_scripted_effects.txt.

What it does

• 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 (84 lines of game script)
gg_involvement_cb_effect = {
	$WAR_OUTCOME$ = { save_scope_as = gg_outcome }
	if = {
		limit = { exists = scope:war }
		scope:war ?= {
			#Calculate the involvement for the leader
			random_war_participant = {
				limit = { this = scope:attacker }
				save_scope_value_as = {
					name = winner_war_contribution_value
					value = {
						value = "scope:war.war_contribution(scope:attacker)"
						divide = 1000
						round = yes
					}
				}
				save_scope_value_as = {
					name = actual_involvement_gain
					value = {
						add = {
							value = gg_involvement_base_addition_value
							multiply = scope:winner_war_contribution_value
							if = {
								limit = { gg_phase_gives_half_involvement_trigger = yes }
								multiply = 0.5
							}
							if = {
								limit = { gg_phase_gives_double_involvement_trigger = yes }
								multiply = 2
							}
							round = yes
							if = {
								limit = { scope:gg_outcome = flag:victory }
								max = gg_involvement_cb_success_value
							}
							else_if = {
								limit = { scope:gg_outcome = flag:white_peace }
								max = gg_involvement_cb_participant_value
							}
							else = {
								max = gg_involvement_cb_failure_value
							}
						}
					}
				}
				if = {
					limit = { has_variable = gg_involvement }
					custom_tooltip = {
						text = gg_involvement_cb_success_actual_tt
						gg_add_involvement_effect = { AMOUNT = scope:actual_involvement_gain }
					}
				}
			}
			#Involvement for Guelph participant attackers
			if = {
				limit = {
					scope:attacker = { is_guelph_trigger = yes }
					scope:defender = { is_ghibelline_trigger = yes }
				}
				gg_involvement_cb_participant_effect = { 
					ATTACKER = guelph 
					DEFENDER = ghibelline 
					WAR_OUTCOME = scope:gg_outcome
				}
			}
			#Involvement for Ghibelline participant attackers
			if = {
				limit = {
					scope:attacker = { is_ghibelline_trigger = yes }
					scope:defender = { is_guelph_trigger = yes }
				}
				gg_involvement_cb_participant_effect = { 
					ATTACKER = ghibelline 
					DEFENDER = guelph 
					WAR_OUTCOME = scope:gg_outcome
				}
			}
		}
	}
	else = {
		custom_tooltip = gg_involvement_cb_success_tt
		custom_tooltip = gg_involvement_cb_participant_tt
	}
}

As written in game/common/scripted_effects/00_gdp_guelph_ghibelline_scripted_effects.txt.

Where it is used

Every place in common/, events/ and history/ that calls gg_involvement_cb_effect.

Source: game/common/scripted_effects/00_gdp_guelph_ghibelline_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.21.0.

Spotted a mistake on this page, or have an idea for the site?