MINOR and BARBARIAN not allowed to build a Special Unit

Asterix Rage

Warlord
Joined
Jun 6, 2010
Messages
1,585
According many threads I read, this prevent Minor and Barbarian to build A "specific unit" :

Code:
<Civilization_UnitClassOverrides>
        <Row>
            <CivilizationType>CIVILIZATION_MINOR</CivilizationType>
            <UnitClassType>UNITCLASS_SPECIFIC_UNIT</UnitClassType>
            <UnitType/>
        </Row>
        <Row>
            <CivilizationType>CIVILIZATION_BARBARIAN</CivilizationType>
            <UnitClassType>UNITCLASS_SPECIFIC_UNIT</UnitClassType>
            <UnitType/>
        </Row>
    </Civilization_UnitClassOverrides>

I'm doing a mod where I introduce a new Unit for AI and Human players only. Not Minor and Barbarian. It works but Barbarians spread them despite the fact that I wrote this :


Code:
<GameData>
    <UnitClasses>
        <Row>
            <Type>UNITCLASS_CHAIRIO_BORGUIGNON</Type>
            <Description>TXT_KEY_UNIT_CHAIRIO_BORGUIGNON</Description>
            <DefaultUnit>UNIT_CHAIRIO_BORGUIGNON</DefaultUnit>
        </Row>
    </UnitClasses>

    <Units>
        <Row>
            <Class>UNITCLASS_CHAIRIO_BORGUIGNON</Class>
            <Type>UNIT_CHAIRIO_BORGUIGNON</Type>
            <CombatClass>UNITCOMBAT_SIEGE</CombatClass>
            <Domain>DOMAIN_LAND</Domain>
            <Combat>15</Combat>
            <Range>2</Range>
...
...
...
        </Row>
    </Units>
 
<!--   MINOR and BARBARIAN NOT ALLOWED TO BUILD CHAIRIO_BORGUIGNON -->

    <Civilization_UnitClassOverrides>
        <Row>
            <CivilizationType>CIVILIZATION_MINOR</CivilizationType>
            <UnitClassType>UNITCLASS_CHAIRIO_BORGUIGNON</UnitClassType>
            <UnitType/>
        </Row>
        <Row>
            <CivilizationType>CIVILIZATION_BARBARIAN</CivilizationType>
            <UnitClassType>UNITCLASS_CHAIRIO_BORGUIGNON</UnitClassType>
            <UnitType/>
        </Row>
    </Civilization_UnitClassOverrides>
</GameData>

Where am I wrong ?

Maybe i should write :

Code:
          <UnitType>UNIT_CANNON</UnitType>

(The chairiô Borguignon I made is supposed to be a "elite" version of the Cannon)
 
Last edited:
Try <UnitType></UnitType> instead of <UnitType/>

[I know they SHOULD be equivalent, but Firaxis' XML to SQL parser may not be treating them as such.]

There could also be some other bug that isn't apparent in your snippet. Have you enabled logging and checked database.log?
 
Thx for the answer.
I made the change. I'll see the result with further tests.

Have you enabled logging and checked database.log

I did. Database.log is clean but xlm.log say :

[6588.515] Missing Entry for UNIT_CHAIRIO_BORGUIGNON
[6588.515] **** VALIDATION FAILED *****
[6588.515] Validation Took 4.695525 seconds
[6590.293] **** Validating Prefetch Process *****
[6590.293] **** Validation Success ***

I have no idea what I missed

The full xml :
Code:
<GameData>
<!--------------------------------------------  
<   DEF
<-------------------------------------------->  

    <UnitClasses>
        <Row>
            <Type>UNITCLASS_CHAIRIO_BORGUIGNON</Type>
            <Description>TXT_KEY_UNIT_CHAIRIO_BORGUIGNON</Description>
            <DefaultUnit>UNIT_CHAIRIO_BORGUIGNON</DefaultUnit>
            <MaxPlayerInstances>2</MaxPlayerInstances>
        </Row>
    </UnitClasses>

    <Units>
        <Row>
            <Class>UNITCLASS_CHAIRIO_BORGUIGNON</Class>
            <Type>UNIT_CHAIRIO_BORGUIGNON</Type>
            <Combat>15</Combat>
            <Range>2</Range>
            <RangedCombat>33</RangedCombat>
            <Cost>525</Cost>
            <RequiresFaithPurchaseEnabled>false</RequiresFaithPurchaseEnabled>
            <HurryCostModifier>200</HurryCostModifier>
            <Moves>2</Moves>
            <CombatClass>UNITCOMBAT_SIEGE</CombatClass>
            <Domain>DOMAIN_LAND</Domain>
           
            <PrereqTech>TECH_ASTRONOMY</PrereqTech>
            <ObsoleteTech>TECH_EE_FLINTLOCK</ObsoleteTech>
       
            <Description>TXT_KEY_UNIT_CHAIRIO_BORGUIGNON</Description>
            <Civilopedia>TXT_KEY_CIVILOPEDIA_UNITS_CHAIRIO_BORGUIGNON_TEXT</Civilopedia>
            <Strategy>TXT_KEY_UNIT_STRATEGY_CHAIRIO_BORGUIGNON</Strategy>
            <Help>TXT_KEY_UNIT_HELP_CHAIRIO_BORGUIGNON</Help>

            <MilitaryProduction>true</MilitaryProduction>      
            <MilitarySupport>true</MilitarySupport>
            <Pillage>true</Pillage>
            <IgnoreBuildingDefense>true</IgnoreBuildingDefense>
            <XPValueAttack>3</XPValueAttack>
            <XPValueDefense>3</XPValueDefense>
            <GoodyHutUpgradeUnitClass>UNITCLASS_EE_FIELD_GUN</GoodyHutUpgradeUnitClass>
            <AdvancedStartCost>30</AdvancedStartCost>

            <UnitArtInfo>ART_DEF_UNIT_CHAIRIO_BORGUIGNON</UnitArtInfo>
            <UnitFlagAtlas>CIV_FLAG_ATLAS_CHAIRIO_BORGUIGNON</UnitFlagAtlas>
            <UnitFlagIconOffset>0</UnitFlagIconOffset>
            <IconAtlas>CIV_COLOR_ATLAS_CHAIRIO_BORGUIGNON</IconAtlas>
            <PortraitIndex>0</PortraitIndex>
        </Row>
    </Units>
   
    <Unit_BuildingClassRequireds>
        <Row>
            <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
            <BuildingClassType>BUILDINGCLASS_CASTLE</BuildingClassType>
        </Row>
    </Unit_BuildingClassRequireds>
   
  <Unit_ClassUpgrades>
        <Row>
            <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
            <UnitClassType>UNITCLASS_EE_FIELD_GUN</UnitClassType>
        </Row>
    </Unit_ClassUpgrades>
   
<!--------------------------------------------  
<   newPROMO
<-------------------------------------------->  

    <UnitPromotions>
        <Row>
            <Type>PROMOTION_SIEGE_ELITE</Type>
            <Description>TXT_KEY_PROMOTION_SIEGE_ELITE</Description>
            <Help>TXT_KEY_HELP_PROMOTION_SIEGE_ELITE</Help>
            <Sound>AS2D_IF_LEVELUP</Sound>
            <OrderPriority>1</OrderPriority>
            <LostWithUpgrade>false</LostWithUpgrade>
            <CannotBeChosen>true</CannotBeChosen>
           
            <CanMoveAfterAttacking>true</CanMoveAfterAttacking>
            <RangedAttackModifier>20</RangedAttackModifier>
            <MovesChange>1</MovesChange>
           
            <IconAtlas>ELITE_MERCENARY_PROMOTION_ATLAS</IconAtlas>
            <PortraitIndex>4</PortraitIndex>
            <PediaType>PEDIA_SIEGE</PediaType>
            <PediaEntry>TXT_KEY_PEDIA_PROMOTION_SIEGE_ELITE</PediaEntry>
        </Row>
    </UnitPromotions>

<!--------------------------------------------  
<   freePROMO
<-------------------------------------------->  

    <Unit_FreePromotions>
    <Row>
      <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
      <PromotionType>PROMOTION_SIEGE_ELITE</PromotionType>
     </Row>
     <Row>
       <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
       <PromotionType>PROMOTION_NO_DEFENSIVE_BONUSES</PromotionType>
      </Row>
      <Row>
        <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
        <PromotionType>PROMOTION_SIGHT_PENALTY</PromotionType>
      </Row>
      <Row>
        <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
        <PromotionType>PROMOTION_CITY_SIEGE</PromotionType>
        </Row>
      <Row>
        <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
        <PromotionType>PROMOTION_MUST_SET_UP</PromotionType>
      </Row>
      <Row>
         <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
         <PromotionType>PROMOTION_ONLY_DEFENSIVE</PromotionType>
      </Row>
      <Row>
         <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
         <PromotionType>PROMOTION_SIEGE_INACCURACY</PromotionType>
      </Row>
      <Row>
         <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
         <PromotionType>PROMOTION_COVER_1</PromotionType>
       </Row>
       <Row>
         <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
         <PromotionType>PROMOTION_NAVAL_MISFIRE</PromotionType>
       </Row>
       <Row>
         <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
         <PromotionType>PROMOTION_MORALE</PromotionType>
        </Row>
    </Unit_FreePromotions>
   
<!--------------------------------------------  
<   UnitClassOverrides
<-------------------------------------------->
   
    <Civilization_UnitClassOverrides>
        <Row>
            <CivilizationType>CIVILIZATION_MINOR</CivilizationType>
            <UnitClassType>UNITCLASS_CHAIRIO_BORGUIGNON</UnitClassType>
            <UnitType></UnitType>
        </Row>
        <Row>
            <CivilizationType>CIVILIZATION_BARBARIAN</CivilizationType>
            <UnitClassType>UNITCLASS_CHAIRIO_BORGUIGNON</UnitClassType>
            <UnitType></UnitType>
        </Row>
    </Civilization_UnitClassOverrides>
   
<!--------------------------------------------  
<   AITypes - Flavors
<-------------------------------------------->  
   
  <Unit_AITypes>
        <Row>
            <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
            <UnitAIType>UNITAI_RANGED</UnitAIType>
        </Row>
        <Row>
            <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
            <UnitAIType>UNITAI_CITY_BOMBARD</UnitAIType>
        </Row>
    </Unit_AITypes>

    <Unit_Flavors>
        <Row>
            <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
            <FlavorType>FLAVOR_OFFENSE</FlavorType>
            <Flavor>6</Flavor>
        </Row>
        <Row>
            <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
            <FlavorType>FLAVOR_DEFENSE</FlavorType>
            <Flavor>3</Flavor>
        </Row>
        <Row>
            <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
            <FlavorType>FLAVOR_RANGED</FlavorType>
            <Flavor>15</Flavor>
        </Row>
    </Unit_Flavors>
   
<!--------------------------------------------  
<   TEXT
<-------------------------------------------->  
   
    <Unit_UniqueNames>
        <Row>
            <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
            <UniqueName>TXT_KEY_UNCB0</UniqueName>
        </Row>
        <Row>
            <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
            <UniqueName>TXT_KEY_UNCB1</UniqueName>
        </Row>
        <Row>
            <UnitType>UNIT_CHAIRIO_BORGUIGNON</UnitType>
            <UniqueName>TXT_KEY_UNCB2</UniqueName>
        </Row>
    </Unit_UniqueNames>
   
    <Language_en_US>
    <Row Tag="TXT_KEY_UNCB0">
            <Text>Vincenot</Text>
        </Row>
    <Row Tag="TXT_KEY_UNCB1">
            <Text>Binchois</Text>
        </Row>
        <Row Tag="TXT_KEY_UNCB2">
            <Text>Rejannou</Text>
        </Row>


        <Row Tag="TXT_KEY_PROMOTION_SIEGE_ELITE">
            <Text>Siege Elite</Text>
        </Row>
        <Row Tag="TXT_KEY_PEDIA_PROMOTION_SIEGE_ELITE">
            <Text>Siege Elite</Text>
        </Row>
        <Row Tag="TXT_KEY_HELP_PROMOTION_SIEGE_ELITE">
            <Text>20% Ranged Attack, Can move after Attack, +1 movement</Text>
        </Row>
       
        <Row Tag="TXT_KEY_UNIT_CHAIRIO_BORGUIGNON">
            <Text>Chairiô Borguignon</Text>
        </Row>
        <Row Tag="TXT_KEY_UNIT_HELP_CHAIRIO_BORGUIGNON">
            <Text>This Elite Siege Mercenary Unit is slightly stronger than the Cannon and can move quicker. Castle required. 2 maximum. No Iron needed.</Text>
        </Row>
        <Row Tag="TXT_KEY_UNIT_STRATEGY_CHAIRIO_BORGUIGNON">
            <Text>A maximum of 2 Chairiô Borguignon Units can join your troops before the discovery of the Flintlock technology.................[NEWLINE]</Text>
        </Row>
        <Row Tag="TXT_KEY_CIVILOPEDIA_UNITS_CHAIRIO_BORGUIGNON_TEXT">
            <Text>The Chairiô Borguignon (from an old French/burgundian dialect meaning "Burgundian carriage") was one of the innovative weapons developed at the late 15th Century under the reigh of Charles the Bold............................[NEWLINE]</Text>
        </Row>
    </Language_en_US>
</GameData>

Atlas, Flag and ArtDef are in .sql

---------------
Two more questions if you mind :undecide:

I can't find informations about :

- The meaning of <OrderPriority>1</OrderPriority> under <UnitPromotions>
I tried 2, 10, 50. Nothing changed

- The goal of <Reload...> in .modinfo
Because I create a new UNITCLASS_CHAIRIO_BORGUIGNON, I've chosen to write :
Code:
    <ReloadAudioSystem>0</ReloadAudioSystem>
    <ReloadLandmarkSystem>0</ReloadLandmarkSystem>
    <ReloadStrategicViewSystem>0</ReloadStrategicViewSystem>
    <ReloadUnitSystem>1</ReloadUnitSystem>
Usefull? Wrong or what?

Thx for your time
 
Last edited:
-- is not valid within an XML comment, so <!----(etc) is invalid so MAY be causing the entire XML file to silently fail.

Try removing all of those multi-line comments, or replace them with something like <!-- ******* text ****** -->
and see what happens
 
Try removing all of those multi-line comments, or replace them with something like <!-- ******* text ****** -->
and see what happens

Done
Code:
    </Unit_Flavors>
  
<!-- *** TEXT *** -->
  
    <Unit_UniqueNames>

Still [3217.364] Missing Entry for UNIT_CHAIRIO_BORGUIGNON in xml.log
Even without any line comments

I also get [3170.283] Missing Entry for UNIT_BARBARIAN_HORSEMAN
I'm not responsible for this one. My mod is load with/dependent of VP and VP-EE

Thx

Edit :
It looks a very common error. More Unique Components for VP (v 29) get :
[5089.907] Missing Entry for UNIT_AMERICA_MONITOR
[5089.907] Missing Entry for UNIT_ARABIA_HASHEMITE_RAIDER
[5089.907] Missing Entry for UNIT_ASSYRIA_IRON_CHARIOT
[5089.907] Missing Entry for UNIT_AUSTRIA_LANDWEHR
[5089.907] Missing Entry for UNIT_AZTEC_EAGLE
[5089.907] Missing Entry for UNIT_CHINA_XIAFAN_GUANJUN
[5089.907] Missing Entry for UNIT_EGYPT_KHOPESH
[5089.907] Missing Entry for UNIT_GERMANY_SLAGANZ
[5089.907] Missing Entry for UNIT_MOROCCO_CORSAIR
[5089.907] Missing Entry for UNIT_PORTUGUESE_CACADORES
[5089.907] **** VALIDATION FAILED *****

and JFD's The Kingdom of Prussia for Vox Populi (v 4) get its Missing Entry for UNIT_JFD_LANDWEHR

I'm not alone and so not very concern about it.

Any clue about :
- The meaning of <OrderPriority>1</OrderPriority> under <UnitPromotions>
and
- The goal of <Reload...> in .modinfo ?
 
Last edited:
The "Reload" checkboxes are required in order to get the game to use new ArtDefs, Sound Definitions, and StrategicView Icons. So long as one enabled mod has the needed check-box checked in Modbuddy (or the code-line in the modinfo file) then all mod's will be covered for all their added Unit, Landmark, etc., definitions. But you cannot rely on some other mod also having the data set-up fo the "Reload" commands in its modinfo file. You need to ensure your mod has the needed set-up. You will need as a minimum
Code:
<ReloadUnitSystem>1</ReloadUnitSystem>
in your modinfo file, and if you have a custom strategic view icon for the unit, you will also need
Code:
<ReloadStrategicViewSystem>1</ReloadStrategicViewSystem>

I can't remember exactly what OrderPriority does in UnitPromotions but I *think* it's to control the order of how the promotions are displayed in Unit Panel but if your promotion is set to "CannotBeChosen" you really shouldn't need the OrderPriority.

If you are using Vox Populi then Vox Populi might be "jiggering" things around enough that this might be the reason the barbs are still able to use the unit. I have no knowledge whatsoever about Vox Populi.

Ths missing entry errors in xml.log are because you have no entry in table <UnitGameplay2DScripts> for the unit. As like this for a "swordsman-like" unit:
Code:
	<UnitGameplay2DScripts>
		<Row>
			<UnitType>UNIT_CRUSADER_LEGION</UnitType>
			<SelectionSound>AS2D_SELECT_SWORDSMAN</SelectionSound>
			<FirstSelectionSound>AS2D_BIRTH_SWORDSMAN</FirstSelectionSound>
		</Row>
	</UnitGameplay2DScripts>
 
Last edited:
Back
Top Bottom