1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Getting the AI to use a new unit?

Discussion in 'Mod Creation Help' started by Angryr, Oct 10, 2019.

Tags:
  1. Angryr

    Angryr Chieftain

    Joined:
    Jul 12, 2014
    Messages:
    39
    Gender:
    Male
    Location:
    Indiana, USA
    Are there any guides or information for getting the AI to build and use a new unit?
    Having trouble using the search feature to find anything on this.

    I've tried tinkering around with the UnitAiInfos and OpTeamRequirements tables, but it seems to have had no effect.

    More specifically, my long-term goal is to get it to practically require my new support unit to be apart of every group of units it sends out.
     
  2. Lonecat Nekophrodite

    Lonecat Nekophrodite Prince

    Joined:
    Jan 10, 2019
    Messages:
    393
    Gender:
    Male
    I'm working on a big mod rightnow. If you look at UNITS.xml . Route to the file is "(Drive installed)\Games\Civilization6\steamapps\common\Sid Meier's Civilization IV\Base\Assets\Gameplay\Data"
    upload_2019-10-11_12-28-32.png
    Did you see highlighted area? That is. right click and hit 'open with' and pick text editing programs to view the file (Notepad++ is recommended, but use normal Notepad if not available)

    upload_2019-10-11_12-32-28.png
    This is what's inside the file. Find the syntax that has <UnitAiTypes> and <UnitAiInfos>. The entire section should look like this
    Spoiler :
    Code:
        <UnitAiTypes>
           <Row AiType="UNITAI_SETTLE" TypeValue="0"/>
           <Row AiType="UNITAI_BUILD" TypeValue="1"/>
           <Row AiType="UNITAI_EXPLORE" TypeValue="2"/>
           <Row AiType="UNITAI_COMBAT" TypeValue="3"/>
           <Row AiType="UNITAI_DEFENDER" TypeValue="4"/>
           <Row AiType="UNITAI_LEADER" TypeValue="5"/>
           <Row AiType="UNITTYPE_CAVALRY"/>
           <Row AiType="UNITTYPE_CIVILIAN"/>
           <Row AiType="UNITTYPE_CIVILIAN_LEADER"/>
           <Row AiType="UNITTYPE_LAND_COMBAT"/>
           <Row AiType="UNITTYPE_MELEE"/>
           <Row AiType="UNITTYPE_NAVAL"/>
           <Row AiType="UNITTYPE_RANGED"/>
           <Row AiType="UNITTYPE_SIEGE"/>
           <Row AiType="UNITTYPE_SIEGE_ALL"/>
           <Row AiType="UNITTYPE_SIEGE_SUPPORT" Priority="true"/>
           <Row AiType="UNITTYPE_TRADE"/>
           <Row AiType="UNITTYPE_AIR"/>
           <Row AiType="UNITTYPE_AIR_SIEGE"/>
           <Row AiType="UNITTYPE_NUCLEAR"/>
           <Row AiType="UNITTYPE_NUCLEAR_ESCORT"/>
       </UnitAiTypes>
       <UnitAiInfos>
           <!-- Civilian-->
           <Row UnitType="UNIT_SETTLER" AiType="UNITAI_SETTLE"/>
           <Row UnitType="UNIT_SETTLER" AiType="UNITTYPE_CIVILIAN"/>
           <Row UnitType="UNIT_BUILDER" AiType="UNITAI_BUILD"/>
           <Row UnitType="UNIT_BUILDER" AiType="UNITTYPE_CIVILIAN"/>
           <Row UnitType="UNIT_TRADER" AiType="UNITTYPE_CIVILIAN"/>
           <Row UnitType="UNIT_TRADER" AiType="UNITTYPE_TRADE"/>
           <Row UnitType="UNIT_SPY" AiType="UNITTYPE_CIVILIAN"/>
           <!-- Great People-->
           <Row UnitType="UNIT_GREAT_GENERAL" AiType="UNITTYPE_CIVILIAN_LEADER"/>
           <Row UnitType="UNIT_GREAT_GENERAL" AiType="UNITAI_LEADER"/>
           <Row UnitType="UNIT_GREAT_ADMIRAL" AiType="UNITTYPE_CIVILIAN_LEADER"/>
           <Row UnitType="UNIT_GREAT_ADMIRAL" AiType="UNITAI_LEADER"/>
           <Row UnitType="UNIT_GREAT_ADMIRAL" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_GREAT_ENGINEER" AiType="UNITTYPE_CIVILIAN"/>
           <Row UnitType="UNIT_GREAT_MERCHANT" AiType="UNITTYPE_CIVILIAN"/>
           <Row UnitType="UNIT_GREAT_PROPHET" AiType="UNITTYPE_CIVILIAN"/>
           <Row UnitType="UNIT_GREAT_SCIENTIST" AiType="UNITTYPE_CIVILIAN"/>
           <Row UnitType="UNIT_GREAT_SCIENTIST" AiType="UNITAI_LEADER"/>
           <Row UnitType="UNIT_GREAT_WRITER" AiType="UNITTYPE_CIVILIAN"/>
           <Row UnitType="UNIT_GREAT_ARTIST" AiType="UNITTYPE_CIVILIAN"/>
           <Row UnitType="UNIT_GREAT_MUSICIAN" AiType="UNITTYPE_CIVILIAN"/>
           <!-- Recon-->
           <Row UnitType="UNIT_SCOUT" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_SCOUT" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_RANGER" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_RANGER" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_RANGER" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_NATURALIST" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_NATURALIST" AiType="UNITTYPE_CIVILIAN"/>
           <!-- Melee-->
           <Row UnitType="UNIT_WARRIOR" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_WARRIOR" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_WARRIOR" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_WARRIOR" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_WARRIOR_MONK" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_WARRIOR_MONK" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_WARRIOR_MONK" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_WARRIOR_MONK" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_SPEARMAN" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_SPEARMAN" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_SPEARMAN" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_SPEARMAN" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_SWORDSMAN" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_SWORDSMAN" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_SWORDSMAN" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_SWORDSMAN" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_PIKEMAN" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_PIKEMAN" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_PIKEMAN" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_PIKEMAN" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_MUSKETMAN" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_MUSKETMAN" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_MUSKETMAN" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_MUSKETMAN" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_INFANTRY" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_INFANTRY" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_INFANTRY" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_INFANTRY" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_AT_CREW" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_AT_CREW" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_AT_CREW" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_AT_CREW" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_MECHANIZED_INFANTRY" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_MECHANIZED_INFANTRY" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_MECHANIZED_INFANTRY" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_MECHANIZED_INFANTRY" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_MODERN_AT" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_MODERN_AT" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_MODERN_AT" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_MODERN_AT" AiType="UNITTYPE_LAND_COMBAT"/>
           <!-- Ranged-->
           <Row UnitType="UNIT_SLINGER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_SLINGER" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_SLINGER" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_ARCHER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_ARCHER" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_ARCHER" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_CROSSBOWMAN" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_CROSSBOWMAN" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_CROSSBOWMAN" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_FIELD_CANNON" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_FIELD_CANNON" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_FIELD_CANNON" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_MACHINE_GUN" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_MACHINE_GUN" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_MACHINE_GUN" AiType="UNITAI_COMBAT"/>
           <!-- Light Cavalry-->
           <Row UnitType="UNIT_HORSEMAN" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_HORSEMAN" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_HORSEMAN" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_HORSEMAN" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_HORSEMAN" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_CAVALRY" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_CAVALRY" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_CAVALRY" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_CAVALRY" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_CAVALRY" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_HELICOPTER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_HELICOPTER" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_HELICOPTER" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_HELICOPTER" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_HELICOPTER" AiType="UNITTYPE_LAND_COMBAT"/>
           <!-- Siege-->
           <Row UnitType="UNIT_CATAPULT" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_CATAPULT" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_CATAPULT" AiType="UNITTYPE_SIEGE"/>
           <Row UnitType="UNIT_CATAPULT" AiType="UNITTYPE_SIEGE_ALL"/>
           <Row UnitType="UNIT_CATAPULT" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_BOMBARD" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_BOMBARD" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_BOMBARD" AiType="UNITTYPE_SIEGE"/>
           <Row UnitType="UNIT_BOMBARD" AiType="UNITTYPE_SIEGE_ALL"/>
           <Row UnitType="UNIT_BOMBARD" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_ARTILLERY" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_ARTILLERY" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_ARTILLERY" AiType="UNITTYPE_SIEGE"/>
           <Row UnitType="UNIT_ARTILLERY" AiType="UNITTYPE_SIEGE_ALL"/>
           <Row UnitType="UNIT_ARTILLERY" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_ROCKET_ARTILLERY" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_ROCKET_ARTILLERY" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_ROCKET_ARTILLERY" AiType="UNITTYPE_SIEGE"/>
           <Row UnitType="UNIT_ROCKET_ARTILLERY" AiType="UNITTYPE_SIEGE_ALL"/>
           <Row UnitType="UNIT_ROCKET_ARTILLERY" AiType="UNITTYPE_LAND_COMBAT"/>
           <!-- Heavy Cavalry-->
           <Row UnitType="UNIT_HEAVY_CHARIOT" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_HEAVY_CHARIOT" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_HEAVY_CHARIOT" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_HEAVY_CHARIOT" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_KNIGHT" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_KNIGHT" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_KNIGHT" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_KNIGHT" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_TANK" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_TANK" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_TANK" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_TANK" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_MODERN_ARMOR" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_MODERN_ARMOR" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_MODERN_ARMOR" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_MODERN_ARMOR" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_MODERN_ARMOR" AiType="UNITTYPE_LAND_COMBAT"/>
           <!-- Support -->
           <Row UnitType="UNIT_BATTERING_RAM" AiType="UNITTYPE_SIEGE_SUPPORT"/>
           <Row UnitType="UNIT_BATTERING_RAM" AiType="UNITTYPE_SIEGE_ALL"/>
           <Row UnitType="UNIT_SIEGE_TOWER" AiType="UNITTYPE_SIEGE_SUPPORT"/>
           <Row UnitType="UNIT_SIEGE_TOWER" AiType="UNITTYPE_SIEGE_ALL"/>
           <Row UnitType="UNIT_MILITARY_ENGINEER" AiType="UNITTYPE_SIEGE_SUPPORT"/>
           <Row UnitType="UNIT_MILITARY_ENGINEER" AiType="UNITAI_BUILD"/>
           <Row UnitType="UNIT_MILITARY_ENGINEER" AiType="UNITTYPE_CIVILIAN"/>
           <Row UnitType="UNIT_MEDIC" AiType="UNITTYPE_SIEGE_SUPPORT"/>
           <Row UnitType="UNIT_OBSERVATION_BALLOON" AiType="UNITTYPE_SIEGE_SUPPORT"/>
           <Row UnitType="UNIT_ANTIAIR_GUN" AiType="UNITTYPE_SIEGE_SUPPORT"/>
           <Row UnitType="UNIT_ANTIAIR_GUN" AiType="UNITTYPE_SIEGE_ALL"/>
           <Row UnitType="UNIT_MOBILE_SAM" AiType="UNITTYPE_SIEGE_SUPPORT"/>
           <Row UnitType="UNIT_MOBILE_SAM" AiType="UNITTYPE_SIEGE_ALL"/>
           <!-- Naval Units-->
           <Row UnitType="UNIT_GALLEY" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_GALLEY" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_GALLEY" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_GALLEY" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_QUADRIREME" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_QUADRIREME" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_QUADRIREME" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_CARAVEL" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_CARAVEL" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_CARAVEL" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_CARAVEL" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_FRIGATE" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_FRIGATE" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_FRIGATE" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_PRIVATEER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_PRIVATEER" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_PRIVATEER" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_IRONCLAD" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_IRONCLAD" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_IRONCLAD" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_IRONCLAD" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_BATTLESHIP" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_BATTLESHIP" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_BATTLESHIP" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_SUBMARINE" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_SUBMARINE" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_SUBMARINE" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_AIRCRAFT_CARRIER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_AIRCRAFT_CARRIER" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_DESTROYER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_DESTROYER" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_DESTROYER" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_DESTROYER" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_NUCLEAR_SUBMARINE" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_NUCLEAR_SUBMARINE" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_NUCLEAR_SUBMARINE" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_NUCLEAR_SUBMARINE" AiType="UNITTYPE_NUCLEAR"/>
           <Row UnitType="UNIT_MISSILE_CRUISER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_MISSILE_CRUISER" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_MISSILE_CRUISER" AiType="UNITTYPE_NAVAL"/>
           <!-- Air Units -->
           <Row UnitType="UNIT_BIPLANE" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_BIPLANE" AiType="UNITTYPE_AIR"/>
           <Row UnitType="UNIT_FIGHTER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_FIGHTER" AiType="UNITTYPE_AIR"/>
           <Row UnitType="UNIT_BOMBER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_BOMBER" AiType="UNITTYPE_NUCLEAR"/>
           <Row UnitType="UNIT_BOMBER" AiType="UNITTYPE_AIR_SIEGE"/>
           <Row UnitType="UNIT_JET_FIGHTER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_JET_FIGHTER" AiType="UNITTYPE_AIR"/>
           <Row UnitType="UNIT_JET_BOMBER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_JET_BOMBER" AiType="UNITTYPE_NUCLEAR"/>
           <Row UnitType="UNIT_JET_BOMBER" AiType="UNITTYPE_AIR_SIEGE"/>
           <!-- Unique Units-->
           <Row UnitType="UNIT_BARBARIAN_HORSEMAN" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_BARBARIAN_HORSEMAN" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_BARBARIAN_HORSEMAN" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_BARBARIAN_HORSEMAN" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_BARBARIAN_HORSE_ARCHER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_BARBARIAN_HORSE_ARCHER" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_BARBARIAN_HORSE_ARCHER" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_BARBARIAN_HORSE_ARCHER" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_BARBARIAN_HORSE_ARCHER" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_EGYPTIAN_CHARIOT_ARCHER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_EGYPTIAN_CHARIOT_ARCHER" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_EGYPTIAN_CHARIOT_ARCHER" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_EGYPTIAN_CHARIOT_ARCHER" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_GREEK_HOPLITE" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_GREEK_HOPLITE" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_GREEK_HOPLITE" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_GREEK_HOPLITE" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_SCYTHIAN_HORSE_ARCHER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_SCYTHIAN_HORSE_ARCHER" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_SCYTHIAN_HORSE_ARCHER" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_SCYTHIAN_HORSE_ARCHER" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_SCYTHIAN_HORSE_ARCHER" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_SUMERIAN_WAR_CART" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_SUMERIAN_WAR_CART" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_SUMERIAN_WAR_CART" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_SUMERIAN_WAR_CART" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_ENGLISH_REDCOAT" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_ENGLISH_REDCOAT" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_ENGLISH_REDCOAT" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_ENGLISH_REDCOAT" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_SPANISH_CONQUISTADOR" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_SPANISH_CONQUISTADOR" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_SPANISH_CONQUISTADOR" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_SPANISH_CONQUISTADOR" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_AMERICAN_ROUGH_RIDER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_AMERICAN_ROUGH_RIDER" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_AMERICAN_ROUGH_RIDER" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_AMERICAN_ROUGH_RIDER" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_AMERICAN_ROUGH_RIDER" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_AMERICAN_P51" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_AMERICAN_P51" AiType="UNITTYPE_AIR"/>
           <Row UnitType="UNIT_ROMAN_LEGION" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_ROMAN_LEGION" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_ROMAN_LEGION" AiType="UNITAI_BUILD"/>
           <Row UnitType="UNIT_ROMAN_LEGION" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_ROMAN_LEGION" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_JAPANESE_SAMURAI" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_JAPANESE_SAMURAI" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_JAPANESE_SAMURAI" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_JAPANESE_SAMURAI" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_NORWEGIAN_BERSERKER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_NORWEGIAN_BERSERKER" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_NORWEGIAN_BERSERKER" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_NORWEGIAN_BERSERKER" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_BARBARIAN_RAIDER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_BARBARIAN_RAIDER" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_BARBARIAN_RAIDER" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_BARBARIAN_RAIDER" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_NORWEGIAN_LONGSHIP" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_NORWEGIAN_LONGSHIP" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_NORWEGIAN_LONGSHIP" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_NORWEGIAN_LONGSHIP" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_RUSSIAN_COSSACK" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_RUSSIAN_COSSACK" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_RUSSIAN_COSSACK" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_RUSSIAN_COSSACK" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_RUSSIAN_COSSACK" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_INDIAN_VARU" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_INDIAN_VARU" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_INDIAN_VARU" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_KONGO_SHIELD_BEARER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_KONGO_SHIELD_BEARER" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_KONGO_SHIELD_BEARER" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_KONGO_SHIELD_BEARER" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_ARABIAN_MAMLUK" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_ARABIAN_MAMLUK" AiType="UNITTYPE_CAVALRY"/>
           <Row UnitType="UNIT_ARABIAN_MAMLUK" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_ARABIAN_MAMLUK" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_ENGLISH_SEADOG" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_ENGLISH_SEADOG" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_ENGLISH_SEADOG" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_FRENCH_GARDE_IMPERIALE" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_FRENCH_GARDE_IMPERIALE" AiType="UNITAI_EXPLORE"/>
           <Row UnitType="UNIT_FRENCH_GARDE_IMPERIALE" AiType="UNITTYPE_MELEE"/>
           <Row UnitType="UNIT_FRENCH_GARDE_IMPERIALE" AiType="UNITTYPE_LAND_COMBAT"/>
           <Row UnitType="UNIT_GERMAN_UBOAT" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_GERMAN_UBOAT" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_GERMAN_UBOAT" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_BRAZILIAN_MINAS_GERAES" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_BRAZILIAN_MINAS_GERAES" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_BRAZILIAN_MINAS_GERAES" AiType="UNITTYPE_NAVAL"/>
           <Row UnitType="UNIT_CHINESE_CROUCHING_TIGER" AiType="UNITAI_COMBAT"/>
           <Row UnitType="UNIT_CHINESE_CROUCHING_TIGER" AiType="UNITTYPE_RANGED"/>
           <Row UnitType="UNIT_CHINESE_CROUCHING_TIGER" AiType="UNITTYPE_LAND_COMBAT"/>
       </UnitAiInfos>
    

    This is where to tell AI to use your custom unit. but if you made independent unit mod similar to what I did before (and a big mod is to bring them all together) This is not neccessary. My experience is that 'be patient'. but first look at your unit profile and how you define gameplay characteristics and assign classes (PromotionClass tag is where unit class is generally assigned. This is where normal melee and anti-cavalry units are defined), then prerequisites ((PrereqTech or PrereqCivic, and StrategicResource), then mandatory obsolete (conditions that this unit will no longer be able to made from that point on; MandatoryObsoleteTech or MandatoryObsoleteCivic ), and so fourth.) Once these codings are revised, edited, and properly checked (Hit the 'clean solution' and 'build solution' respectively first to finalize the mod project or these will not take effect). Playtest it and.. be patient, it takes time for an AI to use custom units. well it needs about 10-30 turns to see them recruited the first of such.
    oh! EDIT ONLY associated files of your project. NOT the core game ones!!!!!!!

    EDIT If you feel like you must add these codes to have AI use such units in the way you intended them to do. First you must be aware what class the unit is. then copy codes mentioned here and adapt with your unit gameplay XML file.
     

Share This Page