How to duplicate BTS units and make them unique?

AstuteClass

Chieftain
Joined
Jul 17, 2009
Messages
20
I basically want to make more powerful versions of all vessels in vanilla game and BtS expansion, and make them unique units to a particular civ, while keeping the regular ones for all other civs as normal.

I have some small experience editing the XML files because I wanted to make the research take longer.

A small guide would be great thanks!
 
Copy and paste the unit entry in CIV4UnitInfos.xml. For example the Frigate below.
Spoiler :
Code:
		<UnitInfo>
			<Class>UNITCLASS_FRIGATE</Class>
			<Type>UNIT_[COLOR="Red"]FRENCH[/COLOR]_FRIGATE</Type>
			<UniqueNames/>
			<Special>NONE</Special>
			<Capture>NONE</Capture>
			<Combat>UNITCOMBAT_NAVAL</Combat>
			<Domain>DOMAIN_SEA</Domain>
			<DefaultUnitAI>UNITAI_RESERVE_SEA</DefaultUnitAI>
			<Invisible>NONE</Invisible>
			<SeeInvisible>NONE</SeeInvisible>
			<Description>TXT_KEY_UNIT_[COLOR="red"]FRENCH[/COLOR]_FRIGATE</Description>
			<Civilopedia>TXT_KEY_UNIT_[COLOR="red"]FRENCH[/COLOR]_FRIGATE_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_UNIT_[COLOR="red"]FRENCH[/COLOR]_FRIGATE_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>0</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>1</bIgnoreBuildingDefense>
			<bCanMoveImpassable>0</bCanMoveImpassable>
			<bCanMoveAllTerrain>0</bCanMoveAllTerrain>
			<bFlatMovementCost>0</bFlatMovementCost>
			<bIgnoreTerrainCost>0</bIgnoreTerrainCost>
			<bNukeImmune>0</bNukeImmune>
			<bPrereqBonuses>0</bPrereqBonuses>
			<bPrereqReligion>0</bPrereqReligion>
			<bMechanized>1</bMechanized>
			<bRenderBelowWater>1</bRenderBelowWater>
			<bSuicide>0</bSuicide>
			<bHiddenNationality>0</bHiddenNationality>
			<bAlwaysHostile>0</bAlwaysHostile>
			<UnitClassUpgrades>
				<UnitClassUpgrade>
					<UnitClassUpgradeType>UNITCLASS_DESTROYER</UnitClassUpgradeType>
					<bUnitClassUpgrade>1</bUnitClassUpgrade>
				</UnitClassUpgrade>
			</UnitClassUpgrades>
			<UnitClassTargets/>
			<UnitCombatTargets/>
			<UnitClassDefenders/>
			<UnitCombatDefenders/>
			<FlankingStrikes/>
			<UnitAIs>
				<UnitAI>
					<UnitAIType>UNITAI_ATTACK_SEA</UnitAIType>
					<bUnitAI>1</bUnitAI>
				</UnitAI>
				<UnitAI>
					<UnitAIType>UNITAI_RESERVE_SEA</UnitAIType>
					<bUnitAI>1</bUnitAI>
				</UnitAI>
				<UnitAI>
					<UnitAIType>UNITAI_ESCORT_SEA</UnitAIType>
					<bUnitAI>1</bUnitAI>
				</UnitAI>
				<UnitAI>
					<UnitAIType>UNITAI_EXPLORE_SEA</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_CHEMISTRY</PrereqTech>
			<TechTypes>
				<PrereqTech>TECH_ASTRONOMY</PrereqTech>
				<PrereqTech>NONE</PrereqTech>
				<PrereqTech>NONE</PrereqTech>
			</TechTypes>
			<BonusType>BONUS_IRON</BonusType>
			<PrereqBonuses/>
			<ProductionTraits/>
			<Flavors/>
			<iAIWeight>0</iAIWeight>
			<iCost>90</iCost>
			<iHurryCostModifier>0</iHurryCostModifier>
			<iAdvancedStartCost>100</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
			<iMinAreaSize>20</iMinAreaSize>
			<iMoves>4</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/>
			[COLOR="red"]<iCombat>8</iCombat>[/COLOR]
			<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>0</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>8</iBombardRate>
			<SpecialCargo>NONE</SpecialCargo>
			<DomainCargo>DOMAIN_LAND</DomainCargo>
			<iCargo>0</iCargo>
			<iConscription>0</iConscription>
			<iCultureGarrison>0</iCultureGarrison>
			<iExtraCost>0</iExtraCost>
			<iAsset>3</iAsset>
			<iPower>8</iPower>
			<UnitMeshGroups>
				<iGroupSize>1</iGroupSize>
				<fMaxSpeed>2.25</fMaxSpeed>
				<fPadTime>1</fPadTime>
				<iMeleeWaveSize>1</iMeleeWaveSize>
				<iRangedWaveSize>1</iRangedWaveSize>
				<UnitMeshGroup>
					<iRequired>1</iRequired>
					<EarlyArtDefineTag>ART_DEF_UNIT_[COLOR="red"]FRENCH[/COLOR]_FRIGATE</EarlyArtDefineTag>
				</UnitMeshGroup>
			</UnitMeshGroups>
			<FormationType>FORMATION_TYPE_MACHINE</FormationType>
			<HotKey/>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
			<FreePromotions/>
			<LeaderPromotion>NONE</LeaderPromotion>
			<iLeaderExperience>0</iLeaderExperience>
		</UnitInfo>
Change the Unit Type but leave the Unit Class as Frigate
Code:
<Class>UNITCLASS_FRIGATE</Class>
<Type>UNIT_[COLOR="Red"]FRENCH[/COLOR]_FRIGATE</Type>
To modify the strength adjust the <iCombat> tag.
Alter the text entries
Code:
<Description>TXT_KEY_UNIT_[COLOR="red"]FRENCH[/COLOR]_FRIGATE</Description>
<Civilopedia>TXT_KEY_UNIT_[COLOR="red"]FRENCH[/COLOR]_FRIGATE_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_[COLOR="red"]FRENCH[/COLOR]_FRIGATE_STRATEGY</Strategy>
and add them to CIV4GameText_Objects_BTS.xml for description, CIV4GameText_Civilopedia_BTS.xml for Civilopedia, CIV4GameTextChanged_BTS.xml for strategy. Alternatively I believe you can write in the entries in lower case and they will appear as such in game, I don't because I like to keep my XML clean.e.g.
<Description>French Frigate</Description>

If you wish to change the art for the unit. Change the <EarlyArtDefineTag>
<EarlyArtDefineTag>ART_DEF_UNIT_FRENCH_FRIGATE</EarlyArtDefineTag>

In CIV4CivilizationInfos.xml add the UU to the required Civ
Code:
<Units>
	<Unit>
	        <UnitClassType>UNITCLASS_MUSKETMAN</UnitClassType>
		<UnitType>UNIT_FRENCH_MUSKETEER</UnitType>
	</Unit>
[COLOR="Red"]        <Unit>
	        <UnitClassType>UNITCLASS_FRIGATE</UnitClassType>
		<UnitType>UNIT_FRENCH_FRIGATE</UnitType>
	</Unit>[/COLOR]
</Units>
In CIV4ArtDefines_Unit.xml copy and paste the Frigate entry. Change the Type tag, Alter the
NIF/KFM/SHADERNIF tags to point to the necessary files for the new art.
Spoiler :
Code:
		<UnitArtInfo>
			<Type>ART_DEF_UNIT_[COLOR="Red"]FRENCH[/COLOR]_FRIGATE</Type>
			<Button>,Art/Interface/Buttons/Units/Frigate.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,2,9</Button>
			<fScale>0.24</fScale>
			<fInterfaceScale>0.5</fInterfaceScale>
			<bActAsLand>0</bActAsLand>
			<bActAsAir>0</bActAsAir>
[COLOR="red"]			<NIF>Art/Units/Frigate/Frigate.nif</NIF>
			<KFM>Art/Units/Frigate/Frigate.kfm</KFM>
			<SHADERNIF>Art/Units/Frigate/Frigate_FX.nif</SHADERNIF>[/COLOR]
			<ShadowDef>
				<ShadowNIF>Art/Units/01_UnitShadows/FrigateShadow.nif</ShadowNIF>
				<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
				<fShadowScale>1.0</fShadowScale>
			</ShadowDef>
			<iDamageStates>4</iDamageStates>
			<TrailDefinition>
				<Texture>Art/Shared/water_ship_wake.dds</Texture>
				<fWidth>1</fWidth>
				<fLength>180.0</fLength>
				<fTaper>1</fTaper>
				<fFadeStartTime>.2</fFadeStartTime>
				<fFadeFalloff>0.35</fFadeFalloff>
			</TrailDefinition>
			<fBattleDistance>0.35</fBattleDistance>
			<fRangedDeathTime>0.31</fRangedDeathTime>
			<bSmoothMove>1</bSmoothMove>
			<fAngleInterpRate>720.0</fAngleInterpRate>
			<fBankRate>.3</fBankRate>
			<fExchangeAngle>25.0</fExchangeAngle>
			<bActAsRanged>0</bActAsRanged>
			<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
			<AudioRunSounds>
				<AudioRunTypeLoop>LOOPSTEP_OCEAN2</AudioRunTypeLoop>
				<AudioRunTypeEnd>ENDSTEP_OCEAN2</AudioRunTypeEnd>
			</AudioRunSounds>
			<SelectionSound>AS3D_UN_OCEAN_END1</SelectionSound>
			<ActionSound>AS3D_UN_OCEAN_END1</ActionSound>
		</UnitArtInfo>
 
Thanks for the great help! I will have a go at that after work tonight.

However, do the art related entries need to be messed with? I'm honestly fine with them looking identical to the non-unique counterparts.

Finally, all these modified XML documents go into:

C:\Users\my name\Documents\My Games\Beyond the Sword\CustomAssets\xml

Right?

Thanks again!
 
However, do the art related entries need to be messed with? I'm honestly fine with them looking identical to the non-unique counterparts.
No it is not necessary for them to work as UU's, if you don't mind them looking identical, in which case you should not change the <EarlyArtDefineTag>.
Finally, all these modified XML documents go into:

C:\Users\my name\Documents\My Games\Beyond the Sword\CustomAssets\xml

Right?
Yes:copy and paste
CIV4UnitInfos.xml in the units folder
CIV4CivilizationInfos.xml in the Civilizations folder
The text files (if used) in the text folder.

N.B.
C:\Users\my name\Documents\My Games\Beyond the Sword\CustomAssets\xml is used when you wish alter the vanilla BTS game.
If you wish to keep BTS as is, then you would need to create a separate mod.
In which case you would create a "My Mod Name" folder in C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\ and then create the folders My Mod Name\Assets\XML
 
Well, I believe it might be better to create a mod and adjust there rather than adjust in the custom assets.

Anyway for the text files, there is no need to be so troublesome.
Simply create a new one and write all the new tags there.
 
So to simply duplicate current units, make them unique to a particular civ and make them more powerful, I only need edit these:

CIV4UnitInfos.xml
CIV4CivilizationInfos.xml

?

Thanks again, guys!
 
So to simply duplicate current units, make them unique to a particular civ and make them more powerful, I only need edit these:

CIV4UnitInfos.xml
CIV4CivilizationInfos.xml

?

Thanks again, guys!
Your welcome,
Yes.
<Class>UNITCLASS_FRIGATE</Class>Sets the Unit class, there can be only one unit class in the game, Rifleman, Musketman and so on.

<Type>UNIT_FRENCH_FRIGATE</Type>Sets the Unit type, there can be multiple types in a class, English Redcoat, French Musketeer and so on.

CivilizationInfos links them as a replacement for a specific civ.

Well, I believe it might be better to create a mod and adjust there rather than adjust in the custom assets.
I would agree platyping as I like to keep BTS in its original state as a reference point when modding. But its up to the O/P, if that is not required and you wish to change BTS you must use Custom asserts, because you must never alter the actual game files.
 
That's great. I can't wait to try this when I get home from work in an hour. Thanks so much for your help again!

One thing, does the unique unit HAVE to be named the nationality like in your example? Can I name it "ROYAL_NAVY_FRIGATE" for example, or does it have to be "ENGLISH_FRIGATE", "ENGLISH_BATTLESHIP", etc?
 
You can name it however you want, the names are just references, which you define yourself.
It is however a good idea to keep to some kind of naming convention - for example by actually putting the nationality in the tag you make it easier for other moders, who might want to merge your mod into a bigger package and so on.
 
One thing, does the unique unit HAVE to be named the nationality like in your example? Can I name it "ROYAL_NAVY_FRIGATE" for example, or does it have to be "ENGLISH_FRIGATE", "ENGLISH_BATTLESHIP", etc?
anything, BIG_STEEL_MONSTER if you want, whatever as long as its not the same as the base unit.
Ah Refar posted just before me but that as well,
its also good to get into the habit of commenting your changes as well.
like <!-- UU Frigates Start -->, as a mod grows its hard to keep track and harder still to go back and comment everything.
Just a personal thing, its not strictly necessary.
 
Thanks again for the help, guys. It's not worked for me though =(

I edited the CIV4UnitInfos and CIV4CivilizationInfos, and in each I simply put:

<Class>UNITCLASS_MISSILE_CRUISER</Class>
<Type>UNIT_ROYAL_NAVY_MISSILE_CRUISER</Type>

and

<Units>
<Unit>
<UnitClassType>UNITCLASS_RIFLEMAN</UnitClassType>
<UnitType>UNIT_ENGLISH_REDCOAT</UnitType>
</Unit>
<Unit>
<Class>UNITCLASS_MISSILE_CRUISER</Class>
<Type>UNIT_ROYAL_NAVY_MISSILE_CRUISER</Type>
</Unit>
</Units>

And these errors came up in this order:

wlSDm.png


NRn4Z.png


YyheH.png


Also, regarding going the "mod" route, I'm afraid I don't know what this means. I really am a n00b. Is there a topic here with a tutorial explaining everything? I really need to learn! lol

EDIT:

Never mind. I realised my silly error. The tags are slightly different in the CIV4CivilizationInfos for units, than they are in the CIV4UnitInfos. I missed the "UnitClassType" and simply had "Class".

Though the game I loaded up kept crashing, but it's because I realised I was England and had some Missile Cruisers, when that nation isn't supposed to have them any more, so I made a new game and pulled the CTRL+W cheat and placed a missile cruiser.

All working fine and dandy! Now to edit EVERY vessel!

Thanks for all your help though, guys! Really appreciate it.
 
Also, regarding going the "mod" route, I'm afraid I don't know what this means. I really am a n00b. Is there a topic here with a tutorial explaining everything? I really need to learn! lol
Watch these tutorials, they'll get you started on this.


Never mind. I realised my silly error. The tags are slightly different in the CIV4CivilizationInfos for units, than they are in the CIV4UnitInfos. I missed the "UnitClassType" and simply had "Class".
One we all make time and again, you only need read the first error, it tells you where it is and what is causing it, then start task manager and close the game correct it and start it up again.
Though the game I loaded up kept crashing, but it's because I realised I was England and had some Missile Cruisers, when that nation isn't supposed to have them any more, so I made a new game and pulled the CTRL+W cheat and placed a missile cruiser.
yes this happens when you add something new, worldbuilder is the simplest way to test stuff. Good work.:goodjob:
 
Back
Top Bottom