CK3 DatabaseCrusader Kings III · 1.20.1.2 “Crozier” · unofficial
Silk & Silverout Tue, Nov 17What's free, what needs the DLC, price →

Scripted effect

upgrade_tradeport

upgrade_tradeport = yes

game/common/scripted_effects/01_building_upgrade_effects.txt, line 133 (77 lines). No parameters.

upgrade_tradeport is a scripted effect in Crusader Kings III, written at line 133 of its file. It takes no parameters: upgrade_tradeport = yes. The game's script calls it in 1 place, among them Foreign Merchants (event court_yearly.7030). Patch 1.20.1.2, from game/common/scripted_effects/01_building_upgrade_effects.txt.

The comment above it in the file

Upgrades a single tradeport building
If such a building does not exist and can be built, it is built. If no slot exists, a slot is added and it is built.

What it does

  • If

    • NOT = { has_building = common_tradeport_01 }
    • NOT = { has_building = common_tradeport_02 }
    • NOT = { has_building = common_tradeport_03 }
    • NOT = { has_building = common_tradeport_04 }
    • NOT = { has_building = common_tradeport_05 }
    • NOT = { has_building = common_tradeport_06 }
    • NOT = { has_building = common_tradeport_07 }
    • NOT = { has_building = common_tradeport_08 }
    • free_building_slots = 0

    Then

    • add_province_modifier = extra_building_slot
    • add_building = common_tradeport_01

    Else if

    • NOT = { has_building = common_tradeport_01 }
    • NOT = { has_building = common_tradeport_02 }
    • NOT = { has_building = common_tradeport_03 }
    • NOT = { has_building = common_tradeport_04 }
    • NOT = { has_building = common_tradeport_05 }
    • NOT = { has_building = common_tradeport_06 }
    • NOT = { has_building = common_tradeport_07 }
    • NOT = { has_building = common_tradeport_08 }
    • Free building slots more than 1

    Then

    • add_building = common_tradeport_01

    Else if

    • has_building = common_tradeport_01

    Then

    • add_building = common_tradeport_02

    Else if

    • has_building = common_tradeport_02

    Then

    • add_building = common_tradeport_03

    Else if

    • has_building = common_tradeport_03

    Then

    • add_building = common_tradeport_04

    Else if

    • has_building = common_tradeport_04

    Then

    • add_building = common_tradeport_05

    Else if

    • has_building = common_tradeport_05

    Then

    • add_building = common_tradeport_06

    Else if

    • has_building = common_tradeport_06

    Then

    • add_building = common_tradeport_07

    Else if

    • has_building = common_tradeport_07

    Then

    • add_building = common_tradeport_08

• 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 (77 lines of game script)
upgrade_tradeport = {
	if = {
		limit = {
			NOR = {
				has_building = common_tradeport_01
				has_building = common_tradeport_02
				has_building = common_tradeport_03
				has_building = common_tradeport_04
				has_building = common_tradeport_05
				has_building = common_tradeport_06
				has_building = common_tradeport_07
				has_building = common_tradeport_08
			}
			free_building_slots = 0
		}
		add_province_modifier = extra_building_slot
		add_building = common_tradeport_01
	}
	else_if = {
		limit = {
			NOR = {
				has_building = common_tradeport_01
				has_building = common_tradeport_02
				has_building = common_tradeport_03
				has_building = common_tradeport_04
				has_building = common_tradeport_05
				has_building = common_tradeport_06
				has_building = common_tradeport_07
				has_building = common_tradeport_08
			}
			free_building_slots > 1
		}
		add_building = common_tradeport_01
	}
	else_if = {
		limit = {
			has_building = common_tradeport_01
		}
		add_building = common_tradeport_02
	}
	else_if = {
		limit = {
			has_building = common_tradeport_02
		}
		add_building = common_tradeport_03
	}
	else_if = {
		limit = {
			has_building = common_tradeport_03
		}
		add_building = common_tradeport_04
	}
	else_if = {
		limit = {
			has_building = common_tradeport_04
		}
		add_building = common_tradeport_05
	}
	else_if = {
		limit = {
			has_building = common_tradeport_05
		}
		add_building = common_tradeport_06
	}
	else_if = {
		limit = {
			has_building = common_tradeport_06
		}
		add_building = common_tradeport_07
	}
	else_if = {
		limit = {
			has_building = common_tradeport_07
		}
		add_building = common_tradeport_08
	}
}

As written in game/common/scripted_effects/01_building_upgrade_effects.txt.

Where it is used

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

Events (1)

Source: game/common/scripted_effects/01_building_upgrade_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.

Spotted a mistake on this page?