Scripted effect
set_up_new_loan_effect
set_up_new_loan_effect = { AMOUNT = … INSTRUMENT = … LENDER = … }game/common/scripted_effects/00_scripted_effects.txt, line 25 (27 lines). Parameters: $AMOUNT$, $INSTRUMENT$, $LENDER$.
set_up_new_loan_effect is a scripted effect in Crusader Kings III, written at line 25 of its file. A call passes 3 parameters: AMOUNT, INSTRUMENT and LENDER. The game's script calls it in 6 places, among them Loan Gold (interaction), Make a Request (interaction) and …: Glittering Opportunity (event councillor_spouse_stewardship.2002). Patch 1.21.0, from game/common/scripted_effects/00_scripted_effects.txt.
The comment above it in the file
To loan money from someone (Remember: you can only have one loan at a time, but a loaner can have multiple debtors!) ROOT = the person taking the loan, character LENDER = the person giving the gold, character INSTRUMENT = type of loan, flag (disguised/free/open) AMOUNT = the gold being given, value
What it does
If
scope:lender_temp != scope:debtor_temp
Then
set_up_loan_story_effect = { … }loan_base_effect = { LENDER = scope:lender_temp DEBTOR = scope:debtor_temp AMOUNT = scope:amount_owed_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 (27 lines of game script)
set_up_new_loan_effect = {
save_temporary_scope_as = debtor_temp
$LENDER$ = { save_temporary_scope_as = lender_temp }
save_temporary_scope_value_as = { name = amount_owed_temp value = $AMOUNT$ }
if = {
limit = {
exists = scope:debtor_temp
exists = scope:lender_temp
scope:lender_temp != scope:debtor_temp
exists = scope:amount_owed_temp
}
# INSTRUMENT stays a direct argument: save_temporary_scope_value_as only preserves a flag from a flag: literal, and Loan Gold passes a saved flag scope.
set_up_loan_story_effect = {
LENDER = scope:lender_temp
AMOUNT = scope:amount_owed_temp
YEARS_SINCE = 0 # new loan, 0
INSTRUMENT = $INSTRUMENT$
ORIGINAL_DEBTOR = scope:debtor_temp # new loan, story_owner
ORIGINAL_LENDER = scope:lender_temp # new loan, same as LENDER
}
loan_base_effect = {
LENDER = scope:lender_temp
DEBTOR = scope:debtor_temp
AMOUNT = scope:amount_owed_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 set_up_new_loan_effect.
Character interactions (2)
Events (4)
- …: Glittering Opportunity
councillor_spouse_stewardship.2002 - gdp_purpose_events.0002
- holy_order.0200
- Monetary Ministrations
vassal.2201
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.