Scripted effect
increase_existing_loan_effect
increase_existing_loan_effect = { INSTRUMENT = … LENDER = … }game/common/scripted_effects/00_scripted_effects.txt, line 336 (108 lines). Parameters: $INSTRUMENT$, $LENDER$.
increase_existing_loan_effect is a scripted effect in Crusader Kings III, written at line 336 of its file. A call passes 2 parameters: INSTRUMENT and LENDER. The game's script calls it in 2 places, among them Loan Gold (interaction) and Make a Request (interaction). 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.
The comment above it in the file
ROOT - who owes LENDER - who was owed INSTRUMENT - type of loan (flag)
What it does
- One random owned story:
- Where:
story_type = story_cycle_loan- Lender is scope:lender temp
- Instrument is $INSTRUMENT$
If
$INSTRUMENT$ = flag:open
Then
- They will owe … … in return (Open Interest)
scope:lender_temp:gdp_usury_lend_at_interest_effect = { BORROWER = scope:debtor_temp }gdp_update_usury_reputation_effect = yes
loan_interest_open_message_effect = { … }
Else if
$INSTRUMENT$ = flag:disguised
Then
- They will owe … … in return
scope:lender_temp:add_disguised_usury_secret_effect = { DEBTOR = scope:debtor_temp }
loan_interest_disguised_message_effect = { … }
Otherwise
- They will owe … … in return (Interest Free)
loan_interest_free_message_effect = { … }
- Where:
loan_base_effect = { LENDER = scope:lender_temp DEBTOR = scope:debtor_temp AMOUNT = scope:loan_principal_temp }
• 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 (108 lines of game script)
increase_existing_loan_effect = {
save_temporary_scope_as = debtor_temp
$LENDER$ = { save_temporary_scope_as = lender_temp }
# Save total sum loaned so we can see what's left
save_temporary_scope_value_as = {
name = loan_principal_temp
value = scope:debtor_temp.gdp_loan_principal_value
}
random_owned_story = {
limit = {
story_type = story_cycle_loan
var:lender = scope:lender_temp
var:instrument = $INSTRUMENT$
}
if = {
limit = { $INSTRUMENT$ = flag:open }
save_temporary_scope_value_as = {
name = loan_owed_temp
value = {
value = scope:loan_principal_temp
multiply = {
value = 1
add = gdp_loan_open_interest_rate_value
}
}
}
# Interest explanation
custom_description = {
text = gdp_loan_owed_open_interest_tt
subject = scope:debtor_temp
object = scope:lender_temp
value = scope:loan_owed_temp
}
change_variable = {
name = amount_owed
add = scope:loan_owed_temp
}
scope:lender_temp = {
gdp_usury_lend_at_interest_effect = { BORROWER = scope:debtor_temp }
gdp_update_usury_reputation_effect = yes
}
# Messages
loan_interest_open_message_effect = {
LENDER = scope:lender_temp
DEBTOR = scope:debtor_temp
AMOUNT = scope:loan_principal_temp
OWED = scope:loan_owed_temp
}
}
else_if = {
limit = { $INSTRUMENT$ = flag:disguised }
save_temporary_scope_value_as = {
name = loan_owed_temp
value = {
value = scope:loan_principal_temp
multiply = {
value = 1
add = gdp_loan_disguised_interest_rate_value
}
}
}
custom_description = {
text = gdp_loan_owed_disguised_interest_tt
subject = scope:debtor_temp
object = scope:lender_temp
value = scope:loan_owed_temp
}
change_variable = {
name = amount_owed
add = scope:loan_owed_temp
}
scope:lender_temp = {
add_disguised_usury_secret_effect = { DEBTOR = scope:debtor_temp }
}
# Messages
loan_interest_disguised_message_effect = {
LENDER = scope:lender_temp
DEBTOR = scope:debtor_temp
AMOUNT = scope:loan_principal_temp
OWED = scope:loan_owed_temp
}
}
else = {
custom_description = {
text = gdp_loan_owed_interest_free_tt
subject = scope:debtor_temp
object = scope:lender_temp
value = scope:loan_principal_temp
}
change_variable = {
name = amount_owed
add = scope:loan_principal_temp
}
# Messages
loan_interest_free_message_effect = {
LENDER = scope:lender_temp
DEBTOR = scope:debtor_temp
AMOUNT = scope:loan_principal_temp
OWED = scope:loan_principal_temp
}
}
}
loan_base_effect = {
LENDER = scope:lender_temp
DEBTOR = scope:debtor_temp
AMOUNT = scope:loan_principal_temp
}
}As written in game/common/scripted_effects/00_scripted_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls increase_existing_loan_effect.
Character interactions (2)
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.