• 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.

speeder

Second Lieutenant
2 Badges
Jun 8, 2013
112
20
  • Crusader Kings II
  • Crusader Kings II: The Old Gods
I have the following problem:

I want some characters to only build heavy infantry
others only pikemen

and so on.

So how I steer them toward the troop composition I want? Preferably without relying on special unit.
 
what do you mean by build units?
Construct buildings that provide these units or train retinues of these units?
Also pikemen and heavy infantry come from the same building (barracks) so the first option is impossible.
Technically you could in common/retinuesubunits make the requirement of training the retinue be whatever you want (preventing ai from getting the retinues you don't want them to get) but how you get it to actually recruit the ones you want it to.
 
ok, that was a poor example.

suppose I have a culture that is horse-centric.
another that is light-infantry centric.

ignoring cultural buildings, how I make the AI of the horse culture build more stables, and the AI of the infantry culture build more training fields? assuming both have access to same buildings in similar provinces.
 
you can use province modifiers as trigger to allow or disqualify the building chains if you want them to be inter-exclusive.
not_if_x_exists command in the building files also work.
using "has_building" in building potential/trigger don't work (it is only evaluated at launch or when loading a save game AFAIK.
 
you can use province modifiers as trigger to allow or disqualify the building chains if you want them to be inter-exclusive.
not_if_x_exists command in the building files also work.
using "has_building" in building potential/trigger don't work (it is only evaluated at launch or when loading a save game AFAIK.
really? i have a private mod i'm running, and has_building works -- sort off.
Let's say there are 5 buildings, and i wanted all of them to be available at first, but once one of them was chosen, the others would disappear. So in potential, i specified that it could not contain either of the other 4 buildings.
Code:
potential = {
    FROMFROM = {
        NOR = {
            has_building = ca_mil_A_1
            has_building = ca_mil_HC_1
            has_building = ca_mil_HI_1
            has_building = ca_mil_P_1
        }
    }
}

It seems to work perfectly fine in the county capital. The only thing is that the other baronies in the county can only construct the same building as the capital (the only one that's not blocked by the constructed building's potential). Mind you, i don't think i've tried building in a non-capital county first. So yeah, it's still very buggy, but ifi just wanted to put this out there. Then again, i also run a dozen of other mods, but since mine overwrites the common/buildings file, then it shouldn't be a problem.
 
You could emulate this with two almost identical buildings, differing only by the a cultural requirement and the ai_creation_factor.
"Regular" Barracks would have the requirement of NOT {culture = X} and a low ai_creation_factor, while "Preferred" Barracks would have a requirement of culture = X and a high ai_creation_factor.
It gets a bit finicky with all those "upgrades_from", "not_if_x_exists", and "replaces", but I think this could work.