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

manage_new_trade_opportunity_contract_effect

manage_new_trade_opportunity_contract_effect = yes

game/common/scripted_effects/gdp_merchant_trade_opportunity_scripted_effects.txt, line 300 (66 lines). No parameters.

manage_new_trade_opportunity_contract_effect is a scripted effect in Crusader Kings III, in the Silk and Silver files, written at line 300 of its file. It takes no parameters: manage_new_trade_opportunity_contract_effect = yes. The game's script calls it in 16 places, among them gdp_build_category_connections (on action), gdp_challenge_competitor (on action) and gdp_disrupt_charter (on action). Patch 1.21.0, from game/common/scripted_effects/gdp_merchant_trade_opportunity_scripted_effects.txt.

What it does

  • If

    a check the game hides

    Then

    • localization_values = { trade_opportunity = scope:trade_opportunity market = scope:market }
  • If played by the AI:
    • If

      a check the game hides

      Then

      • 1 of 2 things will happen:
        • 50% (base chance; changed in play):
          • accept_task_contract = scope:trade_opportunity
        • 50% (base chance; changed in play):
          • accept_task_contract = scope:other_trade_opportunity

      Otherwise

      • accept_task_contract = scope:trade_opportunity
  • scope:trade_opportunity.task_contract_taker:

• 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 (66 lines of game script)
manage_new_trade_opportunity_contract_effect = {
	scope:trade_opportunity = {
		set_variable = {
			name = task_contract_route
			value = scope:route
		}
		set_variable = {
			name = task_contract_market
			value = scope:market
		}
	}
	scope:other_trade_opportunity ?= {
		set_variable = {
			name = task_contract_route
			value = scope:route
		}
		set_variable = {
			name = task_contract_market
			value = scope:market
		}
	}
	if = {
		limit = { exists = scope:destination }
		if = {
			limit = {
				NOT = { has_character_flag = trade_opportunity_frequency_cooldown }
			}
			add_character_flag = { flag = trade_opportunity_frequency_cooldown years = 6 }
		}
		send_interface_message = {
			type = msg_trade_opportunity_appear
			right_icon = scope:destination.duchy
			localization_values = {
				trade_opportunity = scope:trade_opportunity
				market = scope:market
			}
		}
	}
	if = {
		limit = {
			is_ai = yes
			exists = scope:trade_opportunity
		}
		if = {
			limit = { exists = scope:other_trade_opportunity }
			random_list = {
				10 = {
					modifier = { add = ai_greed } # exploit
					accept_task_contract = scope:trade_opportunity
				}
				10 = {
					modifier = { add = ai_compassion } # alleviate
					accept_task_contract = scope:other_trade_opportunity
				}
			}
		}
		else = { accept_task_contract = scope:trade_opportunity }
	}
	scope:trade_opportunity.task_contract_taker = {
		if = {
			limit = { exists = var:market_agent_opportunity }
			trigger_event = gdp_merchant.3031
		}
	}
	play_sound_effect = "event:/DLC/EP3/SFX/Stingers/Byzantine_Flavor/ep3_mx_sting_byzantineflavor_become_governor" # TODO_CD_GDP
}

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

Where it is used

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

On actions (the game's own hooks) (13)

  • gdp_build_category_connections
  • gdp_challenge_competitor
  • gdp_disrupt_charter
  • gdp_entrepot_buy
  • gdp_exploit_upheaval
  • gdp_market_investment
7 more
  • gdp_negotiate_tolls
  • gdp_promote_goods
  • gdp_sabotage_competition
  • gdp_seek_debtors
  • gdp_silk_road_network
  • gdp_smuggle_goods
  • gdp_support_guilds

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