XML/Art/CIV4ArtDefines_Unit.xml
Create a new UnitArtInfo block, based on the default type of its unit, unless this is the unique version of the unit, in that case use its version instead (to check which unit is a unique unit, look them up in CIV4CivilizationInfos.xml).
Change the Type, NIF, KFM and SHADERNIF blocks within the copy.
Code:
<UnitArtInfo>
-> <Type>ART_DEF_UNIT_SWORDSMAN_GERMAN</Type>
<Button>,Art/Interface/Buttons/Units/Swordsman.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,4,5</Button>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
-> <NIF>Art/Units/Swordsman_German/LightSwordsman.nif</NIF>
-> <KFM>Art/Units/Swordsman_German/LightSwordsman.kfm</KFM>
-> <SHADERNIF>Art/Units/Swordsman_German/LightSwordsman_FX.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>1.0</fShadowScale>
</ShadowDef>
<fBattleDistance>0.35</fBattleDistance>
<fRangedDeathTime>0.31</fRangedDeathTime>
<bActAsRanged>0</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
</UnitArtInfo>
XML/Units/CIV4UnitInfos.xml
If you add a new type of unit and not just a different graphical representation, you need to create a new UnitInfo block, based on the default type of its unit class (or the unique unit type if it is the unique unit of the civilization you add it to).
Change the EarlyArtDefineTag blocks - and the Type block if it is NOT the unique unit.
If you only want to change the graphics of a unit but not its stats, this file does not need to be changed at all.
Code:
<UnitInfo>
<Class>UNITCLASS_SWORDSMAN</Class>
-> <Type>UNIT_SWORDSMAN_GERMAN</Type>
<UniqueNames/>
<Special>NONE</Special>
<Capture>NONE</Capture>
<Combat>UNITCOMBAT_MELEE</Combat>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
<Invisible>NONE</Invisible>
<SeeInvisible>NONE</SeeInvisible>
<Description>TXT_KEY_UNIT_SWORDSMAN</Description>
<Civilopedia>TXT_KEY_UNIT_SWORDSMAN_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_SWORDSMAN_STRATEGY</Strategy>
<Advisor>ADVISOR_MILITARY</Advisor>
<bAnimal>0</bAnimal>
<bFood>0</bFood>
<bNoBadGoodies>0</bNoBadGoodies>
<bOnlyDefensive>0</bOnlyDefensive>
<bNoCapture>0</bNoCapture>
<bQuickCombat>0</bQuickCombat>
<bRivalTerritory>0</bRivalTerritory>
<bMilitaryHappiness>1</bMilitaryHappiness>
<bMilitarySupport>1</bMilitarySupport>
<bMilitaryProduction>1</bMilitaryProduction>
<bPillage>1</bPillage>
<bSpy>0</bSpy>
<bSabotage>0</bSabotage>
<bDestroy>0</bDestroy>
<bStealPlans>0</bStealPlans>
<bInvestigate>0</bInvestigate>
<bCounterSpy>0</bCounterSpy>
<bFound>0</bFound>
<bGoldenAge>0</bGoldenAge>
<bInvisible>0</bInvisible>
<bFirstStrikeImmune>0</bFirstStrikeImmune>
<bNoDefensiveBonus>0</bNoDefensiveBonus>
<bIgnoreBuildingDefense>0</bIgnoreBuildingDefense>
<bCanMoveImpassable>0</bCanMoveImpassable>
<bCanMoveAllTerrain>0</bCanMoveAllTerrain>
<bFlatMovementCost>0</bFlatMovementCost>
<bIgnoreTerrainCost>0</bIgnoreTerrainCost>
<bNukeImmune>0</bNukeImmune>
<bPrereqBonuses>0</bPrereqBonuses>
<bPrereqReligion>0</bPrereqReligion>
<bMechanized>0</bMechanized>
<bSuicide>0</bSuicide>
<bHiddenNationality>0</bHiddenNationality>
<bAlwaysHostile>0</bAlwaysHostile>
<UnitClassUpgrades>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_MACEMAN</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
</UnitClassUpgrades>
<UnitClassTargets/>
<UnitCombatTargets/>
<UnitClassDefenders/>
<UnitCombatDefenders/>
<FlankingStrikes/>
<UnitAIs>
<UnitAI>
<UnitAIType>UNITAI_ATTACK</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>
<UnitAIType>UNITAI_ATTACK_CITY</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>
<UnitAIType>UNITAI_RESERVE</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>
<UnitAIType>UNITAI_CITY_DEFENSE</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
</UnitAIs>
<NotUnitAIs/>
<Builds/>
<ReligionSpreads/>
<CorporationSpreads/>
<GreatPeoples/>
<Buildings/>
<ForceBuildings/>
<HolyCity>NONE</HolyCity>
<ReligionType>NONE</ReligionType>
<StateReligion>NONE</StateReligion>
<PrereqReligion>NONE</PrereqReligion>
<PrereqCorporation>NONE</PrereqCorporation>
<PrereqBuilding>NONE</PrereqBuilding>
<PrereqTech>TECH_IRON_WORKING</PrereqTech>
<TechTypes/>
<BonusType>BONUS_IRON</BonusType>
<PrereqBonuses/>
<ProductionTraits/>
<Flavors/>
<iAIWeight>0</iAIWeight>
<iCost>40</iCost>
<iHurryCostModifier>0</iHurryCostModifier>
<iAdvancedStartCost>100</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<iMinAreaSize>-1</iMinAreaSize>
<iMoves>1</iMoves>
<bNoRevealMap>0</bNoRevealMap>
<iAirRange>0</iAirRange>
<iAirUnitCap>0</iAirUnitCap>
<iDropRange>0</iDropRange>
<iNukeRange>-1</iNukeRange>
<iWorkRate>0</iWorkRate>
<iBaseDiscover>0</iBaseDiscover>
<iDiscoverMultiplier>0</iDiscoverMultiplier>
<iBaseHurry>0</iBaseHurry>
<iHurryMultiplier>0</iHurryMultiplier>
<iBaseTrade>0</iBaseTrade>
<iTradeMultiplier>0</iTradeMultiplier>
<iGreatWorkCulture>0</iGreatWorkCulture>
<iEspionagePoints>0</iEspionagePoints>
<TerrainImpassables/>
<FeatureImpassables/>
<TerrainPassableTechs/>
<FeaturePassableTechs/>
<iCombat>6</iCombat>
<iCombatLimit>100</iCombatLimit>
<iAirCombat>0</iAirCombat>
<iAirCombatLimit>0</iAirCombatLimit>
<iXPValueAttack>4</iXPValueAttack>
<iXPValueDefense>2</iXPValueDefense>
<iFirstStrikes>0</iFirstStrikes>
<iChanceFirstStrikes>0</iChanceFirstStrikes>
<iInterceptionProbability>0</iInterceptionProbability>
<iEvasionProbability>0</iEvasionProbability>
<iWithdrawalProb>0</iWithdrawalProb>
<iCollateralDamage>0</iCollateralDamage>
<iCollateralDamageLimit>0</iCollateralDamageLimit>
<iCollateralDamageMaxUnits>0</iCollateralDamageMaxUnits>
<iCityAttack>10</iCityAttack>
<iCityDefense>0</iCityDefense>
<iAnimalCombat>0</iAnimalCombat>
<iHillsAttack>0</iHillsAttack>
<iHillsDefense>0</iHillsDefense>
<TerrainNatives/>
<FeatureNatives/>
<TerrainAttacks/>
<TerrainDefenses/>
<FeatureAttacks/>
<FeatureDefenses/>
<UnitClassAttackMods/>
<UnitClassDefenseMods/>
<UnitCombatMods/>
<UnitCombatCollateralImmunes/>
<DomainMods/>
<BonusProductionModifiers/>
<iBombRate>0</iBombRate>
<iBombardRate>0</iBombardRate>
<SpecialCargo>NONE</SpecialCargo>
<DomainCargo>NONE</DomainCargo>
<iCargo>0</iCargo>
<iConscription>0</iConscription>
<iCultureGarrison>5</iCultureGarrison>
<iExtraCost>0</iExtraCost>
<iAsset>2</iAsset>
<iPower>3</iPower>
<UnitMeshGroups>
<iGroupSize>3</iGroupSize>
<fMaxSpeed>1.75</fMaxSpeed>
<fPadTime>1</fPadTime>
<iMeleeWaveSize>3</iMeleeWaveSize>
<iRangedWaveSize>0</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>3</iRequired>
-> <EarlyArtDefineTag>ART_DEF_UNIT_SWORDSMAN_GERMAN</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<FormationType>FORMATION_TYPE_DEFAULT</FormationType>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<FreePromotions/>
<LeaderPromotion>NONE</LeaderPromotion>
<iLeaderExperience>0</iLeaderExperience>
</UnitInfo>
XML/Civilizations/CIV4UnitArtStyleTypeInfos.xml
Create a new UnitArtStyleTypeInfo block, based on the block which is used by the civilization you want to add the units to. You can look up the type in CIV4CivilizationInfos.xml (see below, as you will have to change it, after having created your new style type).
For each unit you set up a UnitArtInfo (in CIV4ArtDefines_Unit.xml), you need to either change the existing StyleUnit block (if there is one) or add a new one (always for new units).
Leave all unit styles for which you did not create new art unchanged (i.e. do not remove them).
Make sure the unit you add is not a unique unit for the civ you want to add it to, the info is stored in CIV4CivilizationInfos.xml. If it is, use the name of the unique unit instead of the generic one.
Code:
<StyleUnit>
-> ? <UnitType>UNIT_SWORDSMAN</UnitType>
<UnitMeshGroup>
-> <EarlyArtDefineTag>ART_DEF_UNIT_SWORDSMAN_GERMAN</EarlyArtDefineTag>
-> <LateArtDefineTag>ART_DEF_UNIT_SWORDSMAN_GERMAN</LateArtDefineTag>
-> <MiddleArtDefineTag>ART_DEF_UNIT_SWORDSMAN_GERMAN</MiddleArtDefineTag>
</UnitMeshGroup>
</StyleUnit>
XML/Civilizations/CIV4CivilizationInfos.xml
In the appropriate civilization (CIVILIZATION_*), enter the appropriate new art style.
Code:
<CivilizationInfo>
<Type>CIVILIZATION_GERMANY</Type>
<Description>TXT_KEY_CIV_GERMANY_DESC</Description>
<ShortDescription>TXT_KEY_CIV_GERMANY_SHORT_DESC</ShortDescription>
<Adjective>TXT_KEY_CIV_GERMANY_ADJECTIVE</Adjective>
<Civilopedia>TXT_KEY_CIV_GERMANY_PEDIA</Civilopedia>
<DefaultPlayerColor>PLAYERCOLOR_GRAY</DefaultPlayerColor>
<ArtDefineTag>ART_DEF_CIVILIZATION_GERMANY</ArtDefineTag>
<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
-> <UnitArtStyleType>UNIT_ARTSTYLE_GERMAN</UnitArtStyleType>
<bPlayable>1</bPlayable>
<bAIPlayable>1</bAIPlayable>
<Cities>
.
.
.
XML/GlobalTypes.xml
Finally, the new art style should be added to GlobalTypes.xml Append your type in this block :
Code:
<ArtStyleTypes>
<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
<ArtStyleType>ARTSTYLE_ASIAN</ArtStyleType>
<ArtStyleType>ARTSTYLE_SOUTH_AMERICA</ArtStyleType>
<ArtStyleType>ARTSTYLE_MIDDLE_EAST</ArtStyleType>
<ArtStyleType>ARTSTYLE_GRECO_ROMAN</ArtStyleType>
<ArtStyleType>ARTSTYLE_BARBARIAN</ArtStyleType>
</ArtStyleTypes>
I never actually did this part and it works nicely without doing so, maybe this is no longer needed thanks to modular loading, no idea.
If you actually want to use modular xml, some of the info here is outdated, all the changes are still valid, but you create new xml files for each civilization / art style / etc. instead of editing (a copy of) the standard xml file which includes all of them.