• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Bosparan

Second Lieutenant
92 Badges
Jun 4, 2012
155
83
  • Sword of the Stars
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Magicka
  • Majesty 2 Collection
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Sengoku
  • Cities in Motion
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Warlock 2: The Exiled
  • Warlock 2: Wrath of the Nagas
  • Europa Universalis IV: Mare Nostrum
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • For the Motherland
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Dungeonland
  • Crusader Kings II: Sons of Abraham
  • A Game of Dwarves
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall
  • BATTLETECH: Season pass
  • Stellaris: Apocalypse
  • Stellaris: Ancient Relics
  • Hearts of Iron 4: Arms Against Tyranny
  • Europa Universalis IV: Golden Century
  • Crusader Kings II: Holy Fury
  • BATTLETECH: Flashpoint
  • Europa Universalis IV: Dharma
  • Stellaris: Distant Stars
  • BATTLETECH - Digital Deluxe Edition
  • Europa Universalis IV: Rule Britannia
  • Age of Wonders: Planetfall Premium edition
  • Age of Wonders: Planetfall Season pass
  • Stellaris: Lithoids
  • BATTLETECH: Heavy Metal
  • Age of Wonders: Planetfall - Revelations
Hi Folks,

while working on a mod I searched for - and didn't find - a way to create a condition based on the number of buildings (for anything other than fortresses) in a given city.
At this time, I can check whether it has any building of a type, but not how many.

e.g.:
Code:
has_building = library_building

while what I'd want is this:
Code:
has_building = {
  type = library_building
  count < 2
}

Is there any other way to reach that result?
 
Hi Folks,

while working on a mod I searched for - and didn't find - a way to create a condition based on the number of buildings (for anything other than fortresses) in a given city.
At this time, I can check whether it has any building of a type, but not how many.

e.g.:
Code:
has_building = library_building

while what I'd want is this:
Code:
has_building = {
  type = library_building
  count < 2
}

Is there any other way to reach that result?
Code:
num_of_library_building - Compare number of buildings of type
Traits: <, <=, =, !=, >, >=
Supported Scopes: province
You can replace library with any building name, just make sure it's the exact name used in the files.