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

Scripted effect · The Fate of Iberia files

fp2_contract_assistance_war_pay_effect

fp2_contract_assistance_war_pay_effect = yes

game/common/scripted_effects/03_dlc_fp2_scripted_effects.txt, line 1277 (87 lines). No parameters.

fp2_contract_assistance_war_pay_effect is a scripted effect in Crusader Kings III, in the The Fate of Iberia files, written at line 1277 of its file. It takes no parameters: fp2_contract_assistance_war_pay_effect = yes. The game's script calls it in 3 places, among them on_war_white_peace (on action), on_war_won_attacker (on action) and on_war_won_defender (on action). Its body carries 4 texts of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/03_dlc_fp2_scripted_effects.txt.

What it does

  • If

    • Any war participant:
      • Has “owed contract assistance war” (a variable the game's script sets)
      • Owed contract assistance war is scope:war

    Then

    • Every war participant:
      • Where:
        • Has “owed contract assistance war” (a variable the game's script sets)
        • Owed contract assistance war is scope:war
      • If

        • scope:war:
          • war_contribution = { target = scope:contract_assistance_helper value >= scope:contract_assistance_helper.var:owed_contract_assistance_contribution }

        Then

        • scope:contract_assistance_hirer:
          • You paid … for Military Assistance, as … War Contribution was at least …
          • pay_short_term_gold = { target = scope:contract_assistance_helper gold = scope:contract_assistance_helper.var:owed_contract_assistance_gold }
        • scope:contract_assistance_helper:
          • You were paid by … for Military Assistance, as your War Contribution was at least …
          • scope:contract_assistance_hirer:
            • pay_short_term_gold = { target = scope:contract_assistance_helper gold = scope:contract_assistance_helper.var:owed_contract_assistance_gold }

        Otherwise

• 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 (87 lines of game script)
fp2_contract_assistance_war_pay_effect = {
	if = {
		limit = {
			any_war_participant = {
				has_variable = owed_contract_assistance_war
				var:owed_contract_assistance_war = scope:war
			}
		}
		every_war_participant = {
			limit = {
				has_variable = owed_contract_assistance_war
				var:owed_contract_assistance_war = scope:war
			}
			remove_variable = owed_contract_assistance_war
			save_scope_as = contract_assistance_helper
			if = {
				limit = { is_attacker_in_war = scope:war }
				scope:war.primary_attacker = { save_scope_as = contract_assistance_hirer }
			}
			else = {
				scope:war.primary_defender = { save_scope_as = contract_assistance_hirer }
			}
			if = {
				limit = {
					scope:war = {
						war_contribution = {
							target = scope:contract_assistance_helper
							value >= scope:contract_assistance_helper.var:owed_contract_assistance_contribution
						}
					}
				}
				scope:contract_assistance_hirer = {
					send_interface_message = {
						type = event_gold_neutral
						title = contract_assistance_war_msg_title
						left_icon = scope:contract_assistance_helper
						custom_tooltip = contract_assistance_war_msg_hirer_paid_desc
						pay_short_term_gold = {
							target = scope:contract_assistance_helper
							gold = scope:contract_assistance_helper.var:owed_contract_assistance_gold
						}
					}
				}
				scope:contract_assistance_helper = {
					send_interface_message = {
						type = event_gold_good
						title = contract_assistance_war_msg_title
						left_icon = scope:contract_assistance_hirer
						custom_tooltip = contract_assistance_war_msg_helper_paid_desc
						show_as_tooltip = {
							scope:contract_assistance_hirer = {
								pay_short_term_gold = {
									target = scope:contract_assistance_helper
									gold = scope:contract_assistance_helper.var:owed_contract_assistance_gold
								}
							}
						}
					}
				}
			}
			else = {
				scope:contract_assistance_hirer = {
					send_interface_message = {
						type = event_gold_neutral
						title = contract_assistance_war_msg_title
						left_icon = scope:contract_assistance_helper
						custom_tooltip = contract_assistance_war_msg_hirer_kept_desc
					}
				}
				scope:contract_assistance_helper = {
					add_character_flag = {
						flag = fp2_contract_assistance_failure
						years = 10
					}
					send_interface_message = {
						type = event_gold_bad
						title = contract_assistance_war_msg_title
						left_icon = scope:contract_assistance_hirer
						custom_tooltip = contract_assistance_war_msg_helper_kept_desc
					}
				}
			}
			remove_variable = owed_contract_assistance_contribution
			remove_variable = owed_contract_assistance_gold
		}
	}
}

As written in game/common/scripted_effects/03_dlc_fp2_scripted_effects.txt.

Where it is used

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

On actions (the game's own hooks) (3)

  • on_war_white_peace
  • on_war_won_attacker
  • on_war_won_defender

Source: game/common/scripted_effects/03_dlc_fp2_scripted_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?