Scripted effect
loan_open_interest_effect
loan_open_interest_effect = { AMOUNT = … DEBTOR = … LENDER = … }game/common/scripted_effects/00_scripted_effects.txt, line 259 (73 lines). Parameters: $AMOUNT$, $DEBTOR$, $LENDER$.
loan_open_interest_effect is a scripted effect in Crusader Kings III, written at line 259 of its file. A call passes 3 parameters: AMOUNT, DEBTOR and LENDER. The game's script calls it in 1 place, among them set_up_loan_story_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_scripted_effects.txt.
What it does
- They will owe … … in return (Open Interest)
$DEBTOR$ = { … }
• 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 (73 lines of game script)
loan_open_interest_effect = {
save_temporary_scope_value_as = {
name = loan_owed_temp
value = {
value = $AMOUNT$
multiply = {
value = 1
add = gdp_loan_open_interest_rate_value
}
}
}
scope:new_loan ?= {
set_variable = { name = instrument value = flag:open }
set_variable = { name = original_interest value = gdp_loan_open_interest_premium_value }
# Effects
change_variable = {
name = amount_owed
add = var:original_interest
}
}
# Interest explanation
custom_description = {
text = gdp_loan_owed_open_interest_tt
subject = $DEBTOR$
object = $LENDER$
value = scope:loan_owed_temp
}
$DEBTOR$ = {
if = {
limit = {
is_ai = yes
gdp_usury_borrower_condemns_loan_trigger = { LENDER = $LENDER$ }
}
add_opinion = {
target = $LENDER$
modifier = gdp_usurious_loan_opinion
}
}
if = {
limit = {
NOT = { has_character_flag = gdp_debt_repudiator }
gdp_usury_rite_voids_debts_trigger = yes
culture = {
NOT = { has_cultural_parameter = binding_oaths_harsh_break_penalties }
}
}
custom_tooltip = loan_money_interaction_voidable_warning_tt
}
if = {
limit = { has_character_flag = gdp_debt_repudiator }
custom_tooltip = loan_money_interaction_repudiator_warning_desc
}
$LENDER$ = {
gdp_usury_lend_at_interest_effect = { BORROWER = $DEBTOR$ }
gdp_update_usury_reputation_effect = yes
}
}
# Messages
$DEBTOR$ = {
if = {
limit = { # hide messages for inherited loans
NOT = { var:inheriting_loan ?= scope:new_loan.var:original_debtor }
}
loan_interest_open_message_effect = {
LENDER = $LENDER$
DEBTOR = $DEBTOR$
AMOUNT = $AMOUNT$
OWED = scope:loan_owed_temp
}
}
else = { remove_variable = inheriting_loan }
}
}As written in game/common/scripted_effects/00_scripted_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls loan_open_interest_effect.
Scripted effects (1)
Source: game/common/scripted_effects/00_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.21.0.