In your canBuildSettings file, you have several lines like this
where you reassign build conditions to the Bulgarian Units. Croatia is like that, too, but I changed it in my investigations.
Also, you have a numbering problem between your rules and your object.lua. They're out by 1 at some point.
CroatianTank is 167 in your rules, and 168 in the object file. The error begins at RomanianTank. This looks like it will fix it:
I'll look into this a bit more, since there still seems to be some issues.
Code:
--unitTypeBuild[object.uBulgarianInfantry.id]={location=spanishCities}
--unitTypeBuild[object.uBulgarianTank.id]={location=spanishCities,allImprovements={object.iFactory}}
--unitTypeBuild[object.uBulgarianArtillery.id]={location=spanishCities,allImprovements={object.iFactory}}
--unitTypeBuild[object.uBulgarianFighter.id]={location=spanishCities,allImprovements={object.iFactory}}
--unitTypeBuild[object.uBulgarianBomber.id]={location=spanishCities,allImprovements={object.iFactory}}
--
--unitTypeBuild[object.uBulgarianInfantry.id]={location=turkishCities}
--unitTypeBuild[object.uBulgarianTank.id]={location=turkishCities,allImprovements={object.iFactory}}
--unitTypeBuild[object.uBulgarianArtillery.id]={location=turkishCities,allImprovements={object.iFactory}}
--unitTypeBuild[object.uBulgarianFighter.id]={location=turkishCities,allImprovements={object.iFactory}}
--unitTypeBuild[object.uBulgarianBomber.id]={location=turkishCities,allImprovements={object.iFactory}}
Also, you have a numbering problem between your rules and your object.lua. They're out by 1 at some point.
CroatianTank is 167 in your rules, and 168 in the object file. The error begins at RomanianTank. This looks like it will fix it:
Code:
object.uRomanianTank =civ.getUnitType(140)
object.uRomanianArtillery =civ.getUnitType(141)
object.uRomanianFighter =civ.getUnitType(142)
object.uRomanianBomber =civ.getUnitType(143)
object.uHungarianTank =civ.getUnitType(144)
object.uHungarianArtillery =civ.getUnitType(145)
object.uHungarianFighter =civ.getUnitType(146)
object.uHungarianBomber =civ.getUnitType(147)
object.uFinnishTank =civ.getUnitType(148)
object.uFinnishArtillery =civ.getUnitType(149)
object.uFinnishFighter =civ.getUnitType(150)
object.uFinnishBomber =civ.getUnitType(151)
object.uBulgarianTank =civ.getUnitType(152)
object.uBulgarianArtillery =civ.getUnitType(153)
object.uBulgarianFighter =civ.getUnitType(154)
object.uBulgarianBomber =civ.getUnitType(155)
object.uSpanishInfantry =civ.getUnitType(156)
object.uSpanishTank =civ.getUnitType(157)
object.uSpanishArtillery =civ.getUnitType(158)
object.uSpanishFighter =civ.getUnitType(159)
object.uSpanishBomber =civ.getUnitType(160)
object.uTurkishInfantry =civ.getUnitType(161)
object.uTurkishTank =civ.getUnitType(162)
object.uTurkishArtillery =civ.getUnitType(163)
object.uTurkishFighter =civ.getUnitType(164)
object.uTurkishBomber =civ.getUnitType(165)
object.uCroatianInfantry =civ.getUnitType(166)
object.uCroatianTank =civ.getUnitType(167)
object.uCroatianArtillery =civ.getUnitType(168)
object.uCroatianFighter =civ.getUnitType(169)
object.uCroatianBomber =civ.getUnitType(170)
object.uIraqiInfantry =civ.getUnitType(171)
object.uBritishDefenses =civ.getUnitType(172)
object.uAmericanDefenses =civ.getUnitType(173)
object.uSunderland =civ.getUnitType(174)
object.uTito =civ.getUnitType(175)
object.uYugoslavPartisanI =civ.getUnitType(176)
object.uYugoslavPartisanII =civ.getUnitType(177)
object.uYugoslavTank =civ.getUnitType(178)
object.uYugoslavFighter =civ.getUnitType(179)
object.uPolishFighter =civ.getUnitType(180)
object.uNewUnit182 =civ.getUnitType(181)
object.uNewUnit183 =civ.getUnitType(182)
object.uNewUnit184 =civ.getUnitType(183)
object.uNewUnit185 =civ.getUnitType(184)
object.uNewUnit186 =civ.getUnitType(185)
object.uNewUnit187 =civ.getUnitType(186)
object.uNewUnit188 =civ.getUnitType(187)
I'll look into this a bit more, since there still seems to be some issues.