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_farm_building

upgrade_farm_building = yes

game/common/scripted_effects/01_building_upgrade_effects.txt, line 7 (123 lines). No parameters.

upgrade_farm_building is a scripted effect in Crusader Kings III, written at line 7 of its file. It takes no parameters: upgrade_farm_building = yes. No file of common/, events/ or history/ calls it. 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 farm type building
If such building does not exist, it is built. If building does not exist and there is no slot, it is built and a slot is added.

What it does

  • If

    Then

    • If

      • NOT = { has_building = farm_estates_01 }
      • free_building_slots = 0

      Then

      • add_province_modifier = extra_building_slot
      • add_building = farm_estates_01

      Else if

      • NOT = { has_building = farm_estates_01 }
      • Free building slots more than 0

      Then

      • add_building = farm_estates_01

      Else if

      • has_building = farm_estates_01

      Then

      • add_building = farm_estates_02

      Else if

      • has_building = farm_estates_02

      Then

      • add_building = farm_estates_03

      Else if

      • has_building = farm_estates_03

      Then

      • add_building = farm_estates_04

      Else if

      • has_building = farm_estates_04

      Then

      • add_building = farm_estates_05

      Else if

      • has_building = farm_estates_05

      Then

      • add_building = farm_estates_06

      Else if

      • has_building = farm_estates_06

      Then

      • add_building = farm_estates_07

      Else if

      • has_building = farm_estates_07

      Then

      • add_building = farm_estates_08

    Otherwise

    • If

      • NOT = { has_building = pastures_01 }
      • free_building_slots = 0

      Then

      • add_province_modifier = extra_building_slot
      • add_building = pastures_01

      Else if

      • NOT = { has_building = pastures_01 }
      • Free building slots at least 0

      Then

      • add_building = pastures_01

      Else if

      • has_building = pastures_01

      Then

      • add_building = pastures_02

      Else if

      • has_building = pastures_02

      Then

      • add_building = pastures_03

      Else if

      • has_building = pastures_03

      Then

      • add_building = pastures_04

      Else if

      • has_building = pastures_04

      Then

      • add_building = pastures_05

      Else if

      • has_building = pastures_05

      Then

      • add_building = pastures_06

      Else if

      • has_building = pastures_06

      Then

      • add_building = pastures_07

      Else if

      • has_building = pastures_07

      Then

      • add_building = pastures_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 (120 lines of game script)
upgrade_farm_building = {
	if = {
		limit = { 
			building_farm_estates_requirement_terrain = yes
		}
		if = {
			limit = {
				NOT = { has_building = farm_estates_01 }
				free_building_slots = 0
			}
			add_province_modifier = extra_building_slot
			add_building = farm_estates_01
		}
		else_if = {
			limit = {
				NOT = { has_building = farm_estates_01 }
				free_building_slots > 0
			}
			add_building = farm_estates_01
		}
		else_if = {
			limit = {
				has_building = farm_estates_01
			}
			add_building = farm_estates_02
		}
		else_if = {
			limit = {
				has_building = farm_estates_02
			}
			add_building = farm_estates_03
		}
		else_if = {
			limit = {
				has_building = farm_estates_03
			}
			add_building = farm_estates_04
		}
		else_if = {
			limit = {
				has_building = farm_estates_04
			}
			add_building = farm_estates_05
		}
		else_if = {
			limit = {
				has_building = farm_estates_05
			}
			add_building = farm_estates_06
		}
		else_if = {
			limit = {
				has_building = farm_estates_06
			}
			add_building = farm_estates_07
		}
		else_if = {
			limit = {
				has_building = farm_estates_07
			}
			add_building = farm_estates_08
		}
	}
	else = {
		if = {
			limit = {
				NOT = { has_building = pastures_01 }
				free_building_slots = 0
			}
			add_province_modifier = extra_building_slot
			add_building = pastures_01
		}
		else_if = {
			limit = {
				NOT = { has_building = pastures_01 }
				free_building_slots >= 0
			}
			add_building = pastures_01
		}
		else_if = {
			limit = {
				has_building = pastures_01
			}
			add_building = pastures_02
		}
		else_if = {
			limit = {
				has_building = pastures_02
			}
			add_building = pastures_03
		}
		else_if = {
			limit = {
				has_building = pastures_03
			}
			add_building = pastures_04
		}
		else_if = {
			limit = {
				has_building = pastures_04
			}
			add_building = pastures_05
		}
		else_if = {
			limit = {
				has_building = pastures_05
			}
			add_building = pastures_06
		}
		else_if = {
			limit = {
				has_building = pastures_06
			}
			add_building = pastures_07
		}
		else_if = {
			limit = {
				has_building = pastures_07
			}
			add_building = pastures_08

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

The first 120 of its 123 lines; the rest is in game/common/scripted_effects/01_building_upgrade_effects.txt from line 7.

Where it is used

No file of common/, events/ or history/ calls it.

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?