Scripted effect · Silk and Silver files
gdp_create_starting_merchants_near_player_effect
gdp_create_starting_merchants_near_player_effect = yesgame/common/scripted_effects/gdp_merchant_scripted_effects.txt, line 3317 (90 lines). No parameters.
gdp_create_starting_merchants_near_player_effect is a scripted effect in Crusader Kings III, in the Silk and Silver files, written at line 3317 of its file. It takes no parameters: gdp_create_starting_merchants_near_player_effect = yes. The game's script calls it in 1 place, among them on_game_start_after_lobby (on action). Patch 1.21.0, from game/common/scripted_effects/gdp_merchant_scripted_effects.txt.
The comment above it in the file
Gives the player three nearby merchant companies Capital province is the starting location for landless playables We run this in player scope to save performance
What it does
- Their capital province’s county:
- Their province:
create_character = { … }
- One random neighboring county:
- Where:
NOT = { scope:starting_county ?= this }
- Their province:
create_character = { … }
- Where:
- Their province:
- If landed › One random character to title neighboring and across water county:
- Where:
NOT = { scope:starting_county ?= this }NOT = { scope:merchant_second_starting_county ?= this }
- Their province:
create_character = { … }
- Where:
- Otherwise › Their capital province’s county’s holder › One random character to title neighboring and across water county:
- Where:
NOT = { scope:starting_county ?= this }NOT = { scope:merchant_second_starting_county ?= this }
title_capital_county.title_province = { … }
- Where:
- Every in list:
- Their house:
set_house_name = generated_merchant_house_name
create_merchant_title_effect = { REASON = flag:historical FLAVOR_CHAR = dummy_female }remove_from_list = new_merchants
- Their house:
clear_saved_scope = starting_countyclear_saved_scope = merchant_second_starting_county
• 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 (90 lines of game script)
gdp_create_starting_merchants_near_player_effect = {
capital_province.county = {
save_scope_as = starting_county
title_province = {
create_character = {
template = generated_merchant_template
location = this
after_creation = {
add_to_list = new_merchants
}
}
}
random_neighboring_county = {
limit = {
NOT = { scope:starting_county ?= this }
}
save_scope_as = merchant_second_starting_county
title_province = {
create_character = {
template = generated_merchant_template
location = this
after_creation = {
add_to_list = new_merchants
}
}
}
}
}
if = {
limit = { is_landed = yes }
random_character_to_title_neighboring_and_across_water_county = {
limit = {
NOR = {
scope:starting_county ?= this
scope:merchant_second_starting_county ?= this
}
}
title_province = {
create_character = {
template = generated_merchant_template
location = this
after_creation = {
add_to_list = new_merchants
#add_character_flag = this_is_me_3
}
}
}
}
}
else = { #random_character_to_title_neighboring_and_across_water_county fails for landless playables, so we use the starting county's holder
capital_province.county.holder = {
random_character_to_title_neighboring_and_across_water_county = {
limit = {
NOR = {
scope:starting_county ?= this
scope:merchant_second_starting_county ?= this
}
}
title_capital_county.title_province = {
create_character = {
template = generated_merchant_template
location = this
after_creation = {
add_to_list = new_merchants
#add_character_flag = this_is_me_3
}
}
}
}
}
}
every_in_list = {
list = new_merchants
save_temporary_scope_as = merchant_scope
house = { set_house_name = generated_merchant_house_name }
save_temporary_scope_value_as = {
name = gdp_starting_merchant
value = yes
}
create_merchant_title_effect = {
REASON = flag:historical
FLAVOR_CHAR = dummy_female
}
remove_from_list = new_merchants
}
clear_saved_scope = starting_county
clear_saved_scope = merchant_second_starting_county
}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 gdp_create_starting_merchants_near_player_effect.
On actions (the game's own hooks) (1)
- on_game_start_after_lobby
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.