GUIDE: Adding new units

"First of all you must unpak the Art0.fpk file using the PakBuild Utility to get the unit. Since new models can't be created you will have to use an existing one. Copy the whole ...arts/units/warrior folder from the unpaked .fpk file and paste it in your assets folder (either of your mod or the custom one) keeping the file structure."

I am new to modding and have only changed .xml files for this game so far. I would like to be able to make my own unit but i don't understand what the first step is telling me to do. Any help would be very appriciated. Thank you.

What is this Art0.fpk file? And where can i find it?
What is the PakBuild Utility? And where can i find it?
 
What is this Art0.fpk file? And where can i find it?

The .fpk files can be found in C:\Program Files\Firaxis Games\Civ4\Assets, there are 4 of them.
They are somehow...a kind of "zip file", where just everything is in.

What is the PakBuild Utility? And where can i find it?

PakBuild is the program which can extract the art files out of the .fpk files, and can be found here.
 
I'm wondering where I can find a general explanation of the different UNITAI_'s... eg UNITAI_COUNTER.

I know what theyre supposed to determine, but Id like to see a list of all the different possibilities as well as an explanation of each...
 
Hey, just wondering how I can make UU names work for me, for example I have this UU
Spoiler :
<UnitInfo>
<Class>UNITCLASS_SWORDSMAN</Class>
<Type>UNIT_SPARTAN_ROYAL_GUARD</Type>
<UniqueNames/>Royal Guard
<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>55</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>7</iCombat>
<iCombatLimit>100</iCombatLimit>
<iAirCombat>0</iAirCombat>
<iAirCombatLimit>0</iAirCombatLimit>
<iXPValueAttack>4</iXPValueAttack>
<iXPValueDefense>2</iXPValueDefense>
<iFirstStrikes>1</iFirstStrikes>
<iChanceFirstStrikes>2</iChanceFirstStrikes>
<iInterceptionProbability>0</iInterceptionProbability>
<iEvasionProbability>0</iEvasionProbability>
<iWithdrawalProb>5</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>0</iBombardRate>
<SpecialCargo>NONE</SpecialCargo>
<DomainCargo>NONE</DomainCargo>
<iCargo>0</iCargo>
<iConscription>1</iConscription>
<iCultureGarrison>5</iCultureGarrison>
<iExtraCost>0</iExtraCost>
<iAsset>2</iAsset>
<iPower>7</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_ROME_PRAETORIAN</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>

And in game it shows up as just Swordsman, am I doing something wrong? How can I make it say "Spartan Royal Guard"?
 
If you look again at your unit, you will see the description tag, where it says TXT_KEY_UNIT_SWORDSMAN.
-> you did not give your unit its own name ;).
These tags are located in the XML\Text folder. Just copy one of the existing files to your mod, rename it, and add an entry like the already existing ones with your new unit name to it.
 
Welcome to CFC :).

Pete :confused:?
Whatever:
Go to My Documents\My Games\Beyond The Sword, and open the Civilization4.ini (rightclick, open with notepad or wordpad).
Set these both values here:
PHP:
; Disable caching of file system (may slow initialization)
DisableFileCaching = 0

; Disable caching of xml and file system (may slow initialization)
DisableCaching = 0

to 1, save, close, and restart Civ.
 
hey i've gone through this and a few other tutorials on how to add units. i'm making some slow progress haha :) but when i load up my mod and pull out "terry" on the world builder it just shows him as a duplicate warrior on his little thumbnail pic and then when i put him on the map he's just three pink blobs. and he only has control buttons the first time i move him. after that they disappear. can anyone tell me what i'm doing wrong?
thanks
 
ya i've checked them but i have no idea what to change because i swear i've followed the tutorial right.

<UnitArtInfo>
<Type>ART_DEF_UNIT_TERRY</Type>
<Button>,Art/Interface/Buttons/Units/Terry.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,2,1</Button>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/TERRY/Warrior.nif</NIF>
<KFM>Art/Units/TERRY/Warrior.kfm</KFM>
<SHADERNIF>Art/Units/TERRY/Warrior_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>
Heres my CIV4ArtDefines_UNIT.xml clip about "terry" do you see any errors?
and if it means anything "terry" isn't a pink blob anymore, he's red now. but still the same blob.
 
hey thanks for helping out :) i finally figured out what was wrong, it was the kmf file wasn't in the terry folder. I'm SO happy to have finally figured it out. So now i'm gonna work on adding a new unit with new downloaded graphics. My main question right now is about the unit buttons. The game has the picture and stuff but when i look at it in the game the button is very weird. It seems that the picture is chopped up and placed in random spots....how do i fix that?
and also how do i install new units that come in a "rar" file?
 
Ok, this is a really obscure issue that I've solved I think but want to relate. I've been adding unit buttons to my mod for over a year and recently I noticed that several of them are now blurry where they used to be sharp. When I open the button in DXTBMP the button looks great but in game it's fuzzy and crappy looking. I opened the dds files and resaved them and that seems to have fixed things. It looks like some sort of corrupted graphics cache but I deleted all the cache files I could find. Just very odd.
 
hey thanks for helping out :) i finally figured out what was wrong, it was the kmf file wasn't in the terry folder. I'm SO happy to have finally figured it out. So now i'm gonna work on adding a new unit with new downloaded graphics. My main question right now is about the unit buttons. The game has the picture and stuff but when i look at it in the game the button is very weird. It seems that the picture is chopped up and placed in random spots....how do i fix that?
and also how do i install new units that come in a "rar" file?

.rar is a format like .zip. It's an archive and all the different files are packed in it.
You have to install winrar to open these archives.

---
At the "button"...i guess, you are talking about a downloaded unit, right?
Then you are probably not looking at the button, you are looking at the unit skin.
Most custom units in the database don't have a button, you have to create one yourself, but that's a work of 5 minutes or so ;).

Ok, this is a really obscure issue that I've solved I think but want to relate. I've been adding unit buttons to my mod for over a year and recently I noticed that several of them are now blurry where they used to be sharp. When I open the button in DXTBMP the button looks great but in game it's fuzzy and crappy looking. I opened the dds files and resaved them and that seems to have fixed things. It looks like some sort of corrupted graphics cache but I deleted all the cache files I could find. Just very odd.

Let me guess...graphics settings set to low, right?
Fix for the buttons is here.
 
hey alright that makes sense thanks :) but how would i go about making a new button for it? and also on the rar files....i have one and i got that rartool thing you mentioned. and i'm figuring things out :) and also could you tip me off on how to make unique units? and how to make unit flavors?
 
...uff...

okay, first, the simplest thing, the UU:
You want to give a civ a Terry UU? Copy Terry in UnitInfos.xml, and change ONLY the unit type. Don't change the unitClass, and don't add anything to UnitClassInfos.xml.
Then take a look at the CivilizationInfos.xml. You'll be able to see, how e.g. the jaguar warrior is made an UU in this file, so simple copy & paste it, and change the unit type and the unit class for it.

Flavors...do you mean to create a complete new one, or to add anything to the old ones?

For the button...does this here help as minimum description?
.dds are also just pictures, and creating a very simple button out of a screenshot is really not difficult and will take less then 5 minutes.
Download DXTBmp, and do, what Mechaerik has already said in the other thread:
Take a picture, resize it to 64*64, open it with DXTBmp, load as alpha channel a standard button background, save it as DDS DXT3, and you're finished.

Try it, and ask, when you have a problem.

I'll expand that on request (at the moment it's late here and i'm not motivated, will maybe somewhen write a short tutorial about it)
 
Back
Top Bottom