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

bailiff_collect_loan_payment_effect

bailiff_collect_loan_payment_effect = { LOAN = … }

game/common/scripted_effects/gdp_merchant_scripted_effects.txt, line 480 (55 lines). Parameters: $LOAN$.

bailiff_collect_loan_payment_effect is a scripted effect in Crusader Kings III, in the Silk and Silver files, written at line 480 of its file. A call passes 1 parameter: LOAN. The game's script calls it in 1 place, among them Collect Loans (court task). Its body carries 1 text of the game's own for the player. Patch 1.21.0, from game/common/scripted_effects/gdp_merchant_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 (55 lines of game script)
bailiff_collect_loan_payment_effect = {
	$LOAN$ = { save_scope_as = loan }
	scope:loan.story_owner = { save_scope_as = debtor }
	save_scope_value_as = {
		name = collected_gold
		value = {
			value = 0
			scope:liege ?= {
				add = bailiff_collect_loans_payment_value
			}
			max = scope:loan.var:amount_owed
			max = scope:debtor.gold
		}
	}
	if = {
		limit = { scope:loan.var:amount_owed <= scope:collected_gold }
		scope:loan = { repay_and_end_loan_story_effect = yes }
	}
	else = {
		scope:liege = {
			send_interface_toast = {
				type = event_royal_court_good_with_text
				title = bailiff_collect_loans_title
				desc = bailiff_collect_loans_notification_desc
				left_icon = root
				right_icon = scope:debtor
				scope:debtor = {
					pay_short_term_gold = {
						target = scope:liege
						gold = scope:collected_gold
					}
				}
				gdp_merchant_creditor_loan_acumen_effect = { GOLD = scope:collected_gold }
				hidden_effect = {
					scope:loan = {
						change_variable = {
							name = amount_owed
							add = {
								value = scope:collected_gold
								multiply = -1
							}
						}
						save_scope_value_as = {
							name = outstanding
							value = var:amount_owed
						}
					}
				}
				scope:loan = {
					custom_tooltip = bailiff_collect_loans_remaining_tt
				}
			}
		}
	}
}

As written in game/common/scripted_effects/gdp_merchant_scripted_effects.txt.

Where it is used

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

Court position tasks (1)

  • Collect Loans

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