[Modding] Consolidate building allow-conditions

  • 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
151
83
  • A Game of Dwarves
  • 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
  • Sword of the Stars
  • 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
  • Cities in Motion
  • 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
  • Europa Universalis IV: Conquest of Paradise
  • Dungeonland
  • Crusader Kings II: Sons of Abraham
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Conclave
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron 4: Arms Against Tyranny
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis IV
  • Warlock: Master of the Arcane
Hello,

I do quite a bit of modding, but since this is a feature request / suggestion, I suppose putting it here would be appropriate.

The Issue
One of the things that has bothered me for quite some time now is this:
Since the introduction of habitats and machine empires, the conditions on what building you are allowed to place have become quite complex, hard to read and probably also take a fair bit of calculation time.

Here's an example block:
Code:
potential = {
    planet = {
        NOT = { is_planet_class = pc_habitat } 
    }
} 

allow = {
    if = {
        limit = {
            owner = {
                NOT = { has_authority = auth_machine_intelligence }
            }
        }
        custom_tooltip = {
            text = "requires_building_capital_2"
            planet = {
                OR = {
                    has_building = "building_capital_2"
                    has_building = "building_capital_3"
                }
            }
        }
    }
    if = {
        limit = {
            owner = { has_authority = auth_machine_intelligence }
        }
        custom_tooltip = {
            text = "requires_building_machine_capital_2"
            planet = {
                OR = {
                    has_building = "building_machine_capital_2"
                    has_building = "building_machine_capital_3"
                }
            }
        }
    }
}
Almost every single building in the entire game has this condition block, the only difference being the actual capital level.

The Proposal
Add two properties to a colony:
  • colony_type : Indicates what building set should be available (Currently: PlanetBiologic, PlanetMachine and Habitat)
  • capital_level : Indicates the planetary capital level (irrespective of whether it's a machine empire or one of these flabby fleshies' ones)
This would allow reducing this entire vast code block above to this:
Code:
potential = {
    colony_type = { PlanetBiologic PlanetMachine }
} 

allow = {
    capital_level = 2
}
I'm sure that would be faster to process.
It would certainly make building modding easier to write and easier to read.

Any thoughts? Opinions?
Cheers,
Bosparan
 
Last edited:
Upvote 0