There is a hard limit of 32 unit TYPES that a building can recruit in one settlement. Violating this will causing the game to crash if you try to view the settlement details WHILE THE BUILDING IS UNDER PROGRESS.
- Once the building completes, you regain the ability to view the settlement details
- Negative recruitment per unit type counts towards this limit! That was what was causing the CTD mentioned above
Here's an example of building data that violates the 32 unit type per settlement limit
Code:
;;; MILITARY EXEMPTIONS FOR PROFRESSIONAL HELLENES
recruit_pool "hellenistic infantry hoplitai" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry hemithorakitai" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry thureophoroi" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry machairophoroi" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry euzonoi" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry deuteroi phalangitai" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry phalangitai" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry thorakitai" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry hyperaspistai" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry peltastai logades" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry promachoi" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry hoplitai spartiatai" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry hoplitai lakonikoi" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic missile cretan archers" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry cretan" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic cavalry hippakontistai" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic cavalry thureopherontes hippeis" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic cavalry hippeis" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic cavalry lonchophoroi hippeis" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic cavalry xystophoroi" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic cavalry aspidiotai hippeis" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic cavalry lydian lancers" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic cavalry baktrioi hippeis" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic cavalry baktrioi hippotoxotai" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry bosporan logades" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic infantry thureopherontes toxotai" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic cavalry thureopherontes hippotoxotai" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic cavalry tarantinoi" 0 -1 -10 0 requires factions { f_pergamon, }
recruit_pool "hellenistic cavalry thessalikoi" 0 -1 -10 0 requires factions { f_pergamon, }
;; Karians, Thracians, and Galatians are not exempt. Get :wub:ed.
;;; MERCENARY IMPORTS
;;; ATHENS
recruit_pool "steppe infantry scythian archers" 1 0.09 3 0 requires factions { f_pergamon, } and hidden_resource hr_a and hidden_resource hr_g and hidden_resource hr_h and hidden_resource hr_j
recruit_pool "thracian cavalry prodromoi" 1 0.03 1 0 requires factions { f_pergamon, } and hidden_resource hr_a and hidden_resource hr_g and hidden_resource hr_h and hidden_resource hr_j
recruit_pool "thracian infantry peltastai" 1 0.06 2 0 requires factions { f_pergamon, } and hidden_resource hr_a and hidden_resource hr_g and hidden_resource hr_h and hidden_resource hr_j
recruit_pool "iberian infantry caetratii" 1 0.03 1 0 requires factions { f_pergamon, } and hidden_resource hr_a and hidden_resource hr_g and hidden_resource hr_h and hidden_resource hr_j
recruit_pool "iberian infantry caetratii spearmen" 1 0.06 2 0 requires factions { f_pergamon, } and hidden_resource hr_a and hidden_resource hr_g and hidden_resource hr_h and hidden_resource hr_j
recruit_pool "iberian infantry scutarii swordsman" 1 0.03 1 0 requires factions { f_pergamon, } and hidden_resource hr_a and hidden_resource hr_g and hidden_resource hr_h and hidden_resource hr_j and event_counter ecThureosReform 1
recruit_pool "iberian infantry scutarii spearman" 1 0.03 1 0 requires factions { f_pergamon, } and hidden_resource hr_a and hidden_resource hr_g and hidden_resource hr_h and hidden_resource hr_j and event_counter ecThureosReform 1
This offers 29 unit types of negative recruitment across all settlements (by itself this is valid), and 5 units of positive recruitment in Athens only (since ecThureosReform was 0 in my campaign ATM). That makes 34 in total for one settlement in this building, and the game crashes if the Settlement Details is viewed while this building is in progress.
Now, this only applies for a single building. Multiple buildings can together offer much more than 32 unit types, which makes sense since in vanilla M2TW, where (I'm guessing?) every unit can be recruited everywhere give the right infrastructure, each settlement can technically support every unit type. However, within a single building, only less than 32 unit types are probably offered.
Someone with proper access should update https://wiki.twcenter.net/index.php?..._buildings.txt to include a 32 unit TYPE per settlement limit.
Basically, there's nothing wrong with negative recruitment that causes CTDs. It's the hard limit of a settlement that causes this issue. Unfortunately, this means you can't have, for example, a "Garrison Duty" building that offers negative recruitment for every single heavy infantry unit in the game (probably exceeds 32). You could however spread the negative recruitment across different upgrade paths, one for each "culture".