View Full Version : GUIDE: Adding new units


Pages : [1] 2

sovarn
Nov 10, 2005, 03:54 PM
How to add your own custom units

Beware that at the moment no one can create an actual new model but only new units with their own unique skins and/or stats. This can be added in very easily. This guide also doesn't cover changing unit stats, for that go to : http://civ4wiki.com/wiki/index.php/CIV4UnitInfos for a list of tags and what they mean.

In our example we will be creating a new unit using the Warrior model with a new skin. This unit will be called Terry. Use common sense where applicable and tell me if something is wrong/missing or you just plain can't understand it.

To prepare, go to your customs assets folder or create a new mod. All files in the following guide will use the assets folder as the root. So if i say create a new folder, this folder will be created in the assets folder.

PART 1 - Getting ready

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.

Rename the folder to Terry but keep all the files inside intact i.e. do not touch them otherwise your game will crash and do funny stuff with you RAM. Get the new skin if you have one and replace it over the warrior_128.dds. The new skin has to take this name (in this example).

Next copy over your .../assets/xml/units/CIV4UnitClassInfos.xml and CIV4UnitInfos.xml to your assets folder using the same file structure.
Copy the .../assets/xml/text/CIV4GameText_Strategy.xml, CIV4GameTextInfos_Objects.xml and CIV4GameText_Civililopedia_Units.xml to your new assets folder - again keeping the file structure.
Copy the .../assets/xml/art/CIV4ArtDefines_Unit.xml over.

Now you should be ready.

sovarn
Nov 10, 2005, 03:55 PM
PART 2 - Writing in your new unit

Now you are ready to mod .xml. You can use notepad or some other program which highlights stuff for you. I use Dreamweaver.

a) Open CIV4UnitInfos.xml
It's a very big file but copy one whole class section. i.e. between and including :

<UnitInfo>

....

</UnitInfo>

Then paste it after a </UnitInfo>. You have now esentially created a duplicate of a unit.

So now we need to edit it. I will only tell you the essential elements to change, the rest you can fiddle round with and you can figure out what the do by checking out the other units.

Below is a list of things to change.

<Class>UNITCLASS_WARRIOR</Class>
<Type>UNIT_WARRIOR</Type>
...
<Description>TXT_KEY_UNIT_WARRIOR</Description>
<Civilopedia>TXT_KEY_UNIT_WARRIOR_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_WARRIOR_STRATEGY</Strategy>

to

<Class>UNITCLASS_TERRY</Class>
<Type>UNIT_TERRY</Type>
...
<Description>TXT_KEY_UNIT_TERRY</Description>
<Civilopedia>TXT_KEY_UNIT_TERRY_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_TERRY_STRATEGY</Strategy>

Notice all i do is change all WARRIOR references to TERRY. If you want you can just type in the words you want bewtween the <Description><Civilopedia><Strategy> but then it won't translate. This will save you from editting the text files though.

Near the bottom of the UnitInfo class you will see this:

<UnitMeshGroups>
<iGroupSize>3</iGroupSize>
<fMaxSpeed>1.75</fMaxSpeed>
<iMeleeWaveSize>3</iMeleeWaveSize>
<iRangedWaveSize>0</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>8</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_WARRIOR</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<Button>,Art/Interface/Buttons/Units/Warrior.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,2,1</Button>

Again change the WARRIOR ref to TERRY so it should look like this.

<UnitMeshGroups>
<iGroupSize>3</iGroupSize>
<fMaxSpeed>1.75</fMaxSpeed>
<iMeleeWaveSize>3</iMeleeWaveSize>
<iRangedWaveSize>0</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>8</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_TERRY</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<Button>Art/Interface/Buttons/Units/Terry.dds</Button>


Notice that I removed the atlas picture in the mod. It will still work fine without it and is just easier to edit one file.
There is so much more that you can do, but i am just covering the basics.

b) Open Civ4UnitClassInfos.xml

Again copy a whole UnitClassInfo and paste it in at the end but before the

</UnitClassInfos></Civ4UnitClassInfos>. It should look like this

<UnitClassInfo>
<Type>UNITCLASS_TERRY</Type>
<Description>TXT_KEY_UNIT_TERRY</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<DefaultUnit>UNIT_TERRY</DefaultUnit>
</UnitClassInfo>

c) Edit all the TEXT files.

This is pretty straight forward. Again copy the class and paste a new one, remembering to rename the KEYs corrrectly.

d) Open the CIV4ArtDefines_Units.xml

Like before create a new <UnitArtInfo> and edit it. It should look like this:


<UnitArtInfo>
<Type>ART_DEF_UNIT_TERRY</Type>
<fScale>0.61</fScale>
<fInterfaceScale>1.3</fInterfaceScale>
<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/LionShadow.nif</ShadowNIF>
<ShadowAttachNode>LionBip Spine1</ShadowAttachNode>
<fShadowScale>1.0</fShadowScale>
</ShadowDef>
<fBattleDistance>0.35</fBattleDistance>
<fRangedDeathTime>0.28</fRangedDeathTime>
<bActAsRanged>0</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
</UnitArtInfo>


Notce that all we do is change the folder reference to TERRY but keep the warrior file names. This is why you must not rename files as the .dds skin is not referenced here but in the .nif file. Everything has to be the same and original name so all the .kf s will work properly.

TADA: now your unit will be avaliable to play with its new graphics/stats. But we still have something missing. The buttons!!

sovarn
Nov 10, 2005, 03:55 PM
PART 3 - Referencing and Graphics

Okay now for the more time consuming bit - graphics. (Hopefully someone created that skin for you otherwise this will be easy for those with a nimble digital paintbrush).

For normal units all you have to do is create one button image for your unit. An image will automatically be created to select the unit when it is in a stack.

Create a new .dds image called terry.dds and put it in .../Art/Interface/Buttons/Units/Terry.dds. Note that the Art folder is in the Assets folder. It is different to XML/Arts folder. In other words when you look in your custom assets folder you will see an Art and XML folder.

Somehow either export or edit the .dds file. It should be 64x64 pixels at 200 pixels/inch. They best way is to copy and rename an existing .dds and just edit that picture so you get to keep the blue frame.

PART 4 - Play the game

Now you can play your own unique unit you just put in. Have fun.

NOTE: creating a new Great person or specialist is similar but will require extra changes. It is a bit more complex with more files to edit and a couple of extra buttons.
I may write another guide if people want this.

Now you can add you own units in. Go ahead, you know you want to. You may now commence commenting on how useful this was (or not as the case may be :p ) Any ommissions or mistakes please point it out.

Thanks

Ralendil
Nov 10, 2005, 08:12 PM
I just add one thing, cause it is true there's so much to say about this... I have even succeeded to limit the nuclear weapons to the civilizations that would build a national wonder "manhattan project". So ... so much we could say ;)....


Well the precision :p...

We must precise the fact you can find several units with the same class.


<UnitClassInfo>
<Type>UNITCLASS_TERRY</Type>
<Description>TXT_KEY_UNIT_TERRY</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<DefaultUnit>UNIT_TERRY</DefaultUnit>
</UnitClassInfo>

When you are here you see this: <DefaultUnit>UNIT_TERRY</DefaultUnit>
This tell the game what is the default unit for this class.

In the file \Assets\xml\civilizations\CIV4CivilizationInfos.xm l you can give some units to some civilizations. These units will replace the default unit. You can add several units to a civilization.

Exemple I have done ;)

<Units>
<Unit>
<UnitClassType>UNITCLASS_MUSKETMAN</UnitClassType>
<UnitType>UNIT_FRENCH_MUSKETEER</UnitType>
</Unit>
<Unit>
<UnitClassType>UNITCLASS_INFANTRY</UnitClassType>
<UnitType>UNIT_INFANTRY_WW1</UnitType>
</Unit>
<Unit>
<UnitClassType>UNITCLASS_RIFLEMAN</UnitClassType>
<UnitType>UNIT_MINUTEMAN</UnitType>
</Unit>
</Units>

This command the game to use 3 special units for the france. The 3 units are from the classes of UNITCLASS_MUSKETMAN ; UNITCLASS_INFANTRY and UNIT_INFANTRY_WW1.
So basically you can add here some specific units for a civilization without limit (except the hardcoded limits).

erdrik
Nov 22, 2005, 01:53 PM
I just spent 2 days reworking every unit to match what I wanted for my mod. I even added 4 new units. I plan on doing more but for now this is good enough to start testing balance issues, ect.
I started up the game went to Advanced>Load Mod> My Mod
It restarted, loading my mod ( after quite a few errors were fixed lol ), but the Multiplayer menu option is greyed out, and when I go single player, the only option available is load game.
Am I missing some thing? Why can't I start a new game under my mod?

I only have 3 mod files:
Erdrik.ini
-- Mods/Erdrik/
CIV4GameTextInfos_Objects.xml
-- Mods/Erdrik/Assests/XML/Text/
CIV4UnitInfos.xml
-- Mods/Erdrik/Assests/XML/Units/

I do have a regular text file in -- Mods/Erdrik/Pertainent Info.txt
That I am using to type up mod ideas...

Is there something I am missing?

The Great Apple
Nov 22, 2005, 04:46 PM
This guide doesn't seem to mention changing any stats of the unit (only graphics). If anybody is interested in changing stats, I'd check out http://civ4wiki.com/wiki/index.php/CIV4UnitInfos . Pretty much all the unit tags are documented there.

erdrik
Nov 22, 2005, 08:19 PM
Yea I got that page bookmarked. :) very helpful.

Tho I couldn't find anything there to help with my problem. :sad:

...

WaxonWaxov
Nov 25, 2005, 05:17 PM
OK guys, this thread is one of the best for modding I've found yet.

Question: How do you mod the promotions allowed for a custom unit?

I'm making the "Highlander" to be the UU for the Scots (to replace the Swordsman) and the Guerilla promotions are not available to it.

thanks

The Great Apple
Nov 26, 2005, 06:45 AM
Question: How do you mod the promotions allowed for a custom unit?

Okies. The unit file links to the promotions file through the <Combat> tag in the units file. If you look in the promtions file, you will see a <UnitCombats> tag, containing all the <Combat> types that can use the promotion.

Now unfortunetly you probably want your Highlander to be a melee combat unit (for purposes of combat bonuses against certain types), and melee units can't have the Guerilla promotion as standard.

There are several things you could do, however, I think that this one is the best method:

1) Mod in a new promotion called Guerilla_H or something. Make it available to melee units, and have the same stats as the Guerilla promotion.

2) Mod in a second promotion. Make this new promotion a prerequisite of Guerilla_H. Make sure no units can get this new promotion.

3) Give your Highlander unit the second promotion as a free promotion (bottom tag on unitinfos).

WaxonWaxov
Nov 26, 2005, 09:32 AM
hmm.. thanks.

I fixed the problem another way.... the Highlander starts with Guerilla I and II.

;)

Mumin
Nov 26, 2005, 12:12 PM
<Button>,Art/Interface/Buttons/Units/Terry.dds</Button>

I have to remove the first "," for this to work:

<Button>Art/Interface/Buttons/Units/Terry.dds</Button>

Still, this leaves me with a "!" instead of the picture that shows current production in a city. I have tried to solve this by pasting my custom button in a custom_atlas file, so that it looks just like the original code. The game can pick the graphics correctly from both files but it didn't help. :(

Do anyone else have this problem?

WaxonWaxov
Nov 26, 2005, 03:57 PM
Do anyone else have this problem?

yes. Me to.

SwordOfJustice
Nov 27, 2005, 03:02 AM
I keep getting an error message when trying to add a new unitclass.

"Tag: UNITCLASS_SKIRMISH2 in Info class was incorrect Current XML file is: Units\CIV4UnitInfos.xml"

I thought I followed this guide exactly. I have tried a different name, clearing the cache, checking other mods to compare how they do it, searching for relevant text strings inside the Civ 4 folders and inside my mod to make sure there are no other hidden references to unitclass... and I still can't figure out why I get this error!

Here is a cut and paste of my entry in CIV4UnitClassInfos.xml :

<UnitClassInfo>
<Type>UNITCLASS_SKIRMISH2</Type>
<Description>TXT_KEY_UNIT_SKIRMISH2</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<DefaultUnit>UNIT_SKIRMISH2</DefaultUnit>
</UnitClassInfo>

Believe me, I've checked the entry in CIV4UnitInfos.xml too. No mispellings, etc.

Can anyone help? Any ideas?


Cheers,
Peter :(

SwordOfJustice
Nov 27, 2005, 03:13 AM
I found the answer. I wasn't clearing the cache properly! I thought it was in My Documents but no, it's in Application Data\My Games. ahem :blush:

- Pete

sovarn
Nov 27, 2005, 05:13 AM
hiya guys, glad to see someone using my guide.

Is there anything wrong with the guide? because i did check it before i posted it.
what are you havign problems with.

WaxonWaxov
Nov 27, 2005, 09:34 AM
See the issue with an exclamation point showing up as described in post #11 in this thread. (just a couple up)

Otherwise this is a great guide. You might want to amend it a little for "if you want this to be a Unique Unit..."

D_K
Nov 27, 2005, 09:52 AM
Hi all!

I have the same problem: A "!" instead of the picture that shows current production in a city. By the way, your Tutorial is very good. It helps a lot.

Greetings

D_K

P.S. English is not my first language, so be patient with my text, please...:)

Draskar
Nov 28, 2005, 02:25 AM
Sorry, if i want to chang only the name of a unit?
In the first link guide, i don't understad how to do this.

The text tags are

<Class>UNITCLASS_WARRIOR</Class>
<Type>UNIT_WARRIOR</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_WARRIOR</Description>
<Civilopedia>TXT_KEY_UNIT_WARRIOR_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_WARRIOR_STRATEGY</Strategy>
<Advisor>ADVISOR_MILITARY</Advisor>


I have the italian version, i can't find the association with the object names

BaneBlade
Nov 28, 2005, 03:57 AM
This file CIV4GameTextInfos_Objects.xml in folder .../xml/text
Example:

<TEXT>
<Tag>TXT_KEY_UNIT_MODERN_ARMOR</Tag>
<English>Modern Armor</English>
<French>
<Text>Blindé moderne</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</French>
<German>
<Text>Kampfpanzer</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</German>
<Italian>
<Text>Unità corazzata:Unità corazzate</Text>
<Gender>Female</Gender>
<Plural>0:1</Plural>
</Italian>
<Spanish>
<Text>Blindado moderno:Blindados modernos</Text>
<Gender>Male</Gender>
<Plural>0:1</Plural>
</Spanish>
</TEXT>

Draskar
Nov 30, 2005, 02:47 AM
Thanks! I did it!

Pwyll
Dec 04, 2005, 12:09 PM
Thanks for the writeup. It was very useful. Using it I was mostly successful in adding a new unit, though I haven't yet modified the button.

I am unable to get a unit I am adding to be a unique unit. In fact, it seems any player civilization starts with one of the new units. I've added the unit to my new civilization in CIV4CivilizationInfos.xml in the unit tag, but not under free units, and it still shows up no matter which civilization I choose. Any ideas?

Pwyll
Dec 04, 2005, 05:46 PM
I was able to figure out the unique unit issue. When a unit class is created, it is available to all civilizations. If the unit you want to be a unique unit is the default unit type for this class, it won't work. The other civs will be able to implement the unit class, whose default unit is your "unique" unit.

To remedy this, a unique unit should be a member of an existing class type. The game then replaces the default unit type of that class with your new unit when playing the new Civ.

Rando
Dec 07, 2005, 05:00 PM
Are there any tips or tricks from experienced modders regarding how best to *delete* units from CIV IV? I am working on a medieval/fantasy mod. I have been able to add new units successfully, but when I try to replace or delete existing modern units I get all sorts of xml errors. I was thinking of just trying to add in some sort of prereq that would never happen so that they will never appear in game instead of deleting them - but am wondering if there are different/better suggestions. I just want to keep my fantasy/medieval kingdoms from building air craft carriers. :p Thanks for any suggestions! Great tutorial on adding units!

sovarn
Dec 07, 2005, 05:51 PM
The prob with your idea is that the units will still be there in the Pedia which could be confusing for players.
The best way would just to reference out all the instances of the units i reckon. but that is a lot of files.

Gnostic78
Dec 09, 2005, 12:32 PM
Hey, I really appreciate this tutorial.. but did it go smoothly? Nooo...

I replaced the Greeks with Byzantines, and I wanted to make a cataphract unique unit for them. I wasn't getting too involved.... modify a horse archer, and just use knight graphics until I could get better at graphic enhancement.

Ok, my Byzantines now have the cataphract as a unique unit, but it shows up twice on the build menu in any city, and when I finally build one, all I get is a glowing red ball. :confused:

How do I make a unique unit and have it use another units graphics? In Civ3, that was pretty easy to do. Now I'm just frustrated. :mad:

Thanks for the tutorial, just need some advice....

Gnostic78
Dec 09, 2005, 12:37 PM
<UnitInfo>
<Class>UNITCLASS_HORSE_ARCHER</Class>
<Type>UNIT_CATAPHRACT</Type>
<UniqueNames/>
<Special>NONE</Special>
<Capture>NONE</Capture>
<Combat>UNITCOMBAT_MOUNTED</Combat>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
<Invisible>NONE</Invisible>
<SeeInvisible>NONE</SeeInvisible>
<Description>TXT_KEY_UNIT_CATAPHRACT</Description>
<Civilopedia>TXT_KEY_UNIT_CATAPHRACT_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_CATAPHRACT_STRATEGY</Strategy>
<Advisor>ADVISOR_MILITARY</Advisor>
<bAnimal>0</bAnimal>
<bFood>0</bFood>
<bNoBadGoodies>0</bNoBadGoodies>
<bOnlyDefensive>0</bOnlyDefensive>
<bNoCapture>0</bNoCapture>
<bRivalTerritory>0</bRivalTerritory>
<bMilitaryHappiness>1</bMilitaryHappiness>
<bMilitarySupport>1</bMilitarySupport>
<bMilitaryProduction>1</bMilitaryProduction>
<bPillage>1</bPillage>
<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>1</bFirstStrikeImmune>
<bNoDefensiveBonus>1</bNoDefensiveBonus>
<bIgnoreBuildingDefense>0</bIgnoreBuildingDefense>
<bCanMoveImpassable>0</bCanMoveImpassable>
<bFlatMovementCost>0</bFlatMovementCost>
<bIgnoreTerrainCost>0</bIgnoreTerrainCost>
<bNukeImmune>0</bNukeImmune>
<bPrereqBonuses>0</bPrereqBonuses>
<bPrereqReligion>0</bPrereqReligion>
<bMechanized>0</bMechanized>
<UnitClassUpgrades>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_CAVALRY</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
</UnitClassUpgrades>
<UnitAIs>
<UnitAI>
<UnitAIType>UNITAI_ATTACK</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>
<UnitAIType>UNITAI_PILLAGE</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
</UnitAIs>
<NotUnitAIs/>
<Builds/>
<ReligionSpreads/>
<GreatPeoples/>
<Buildings/>
<ForceBuildings/>
<HolyCity>NONE</HolyCity>
<ReligionType>NONE</ReligionType>
<StateReligion>NONE</StateReligion>
<PrereqReligion>NONE</PrereqReligion>
<PrereqBuilding>NONE</PrereqBuilding>
<PrereqTech>TECH_IRON_WORKING</PrereqTech>
<TechTypes>
<PrereqTech>TECH_HORSEBACK_RIDING</PrereqTech>
<PrereqTech>NONE</PrereqTech>
<PrereqTech>NONE</PrereqTech>
</TechTypes>
<BonusType>BONUS_HORSE</BonusType>
<PrereqBonuses>
<BonusType>BONUS_IRON</BonusType>
<BonusType>NONE</BonusType>
<BonusType>NONE</BonusType>
<BonusType>NONE</BonusType>
</PrereqBonuses>
<ProductionTraits/>
<Flavors/>
<iAIWeight>0</iAIWeight>
<iCost>70</iCost>
<iHurryCostModifier>0</iHurryCostModifier>
<iMinAreaSize>-1</iMinAreaSize>
<iMoves>2</iMoves>
<iAirRange>0</iAirRange>
<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>
<TerrainImpassables/>
<FeatureImpassables/>
<iCombat>8</iCombat>
<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>
<iHillsDefense>0</iHillsDefense>
<TerrainNatives/>
<FeatureNatives/>
<TerrainDefenses/>
<FeatureDefenses/>
<UnitClassAttackMods/>
<UnitClassDefenseMods/>
<UnitCombatMods/>
<DomainMods/>
<BonusProductionModifiers/>
<iBombRate>0</iBombRate>
<iBombardRate>0</iBombardRate>
<SpecialCargo>NONE</SpecialCargo>
<DomainCargo>NONE</DomainCargo>
<iCargo>0</iCargo>
<iConscription>0</iConscription>
<iCultureGarrison>6</iCultureGarrison>
<iExtraCost>0</iExtraCost>
<iAsset>3</iAsset>
<iPower>6</iPower>
<UnitMeshGroups>
<iGroupSize>3</iGroupSize>
<fMaxSpeed>1.75</fMaxSpeed>
<iMeleeWaveSize>3</iMeleeWaveSize>
<iRangedWaveSize>3</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>3</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_CATAPHRACT</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<Button>,Art/Interface/Buttons/Units/Knight.dds</Button>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<FreePromotions>
<FreePromotion>
<PromotionType>PROMOTION_SHOCK</PromotionType>
<bFreePromotion>1</bFreePromotion>
</FreePromotion>
</FreePromotions>
</UnitInfo>

Mumin
Dec 09, 2005, 03:25 PM
Gnostic: First, there actually is a Cataphract (Greek Companion) model in the game. I think it is in the Greek World mod folder if I remember correctly.

Then you need to define the texts for "Description", "Civilopedia" and "Strategy". Just writing a text string instead of TXT_KEY_UNIT_BLABLA works fine (unless you want multiple language supporrt). I.e.:

<Description>Cataphract</Description>
<Civilopedia>Some yadda yadda</Civilopedia>
<Strategy/> (Omits it completely.)

You also need to define ART_DEF_UNIT_CATAPHRACT or use ART_DEF_UNIT_KNIGHT instead.

Finally remove the "," before Art/Interface/Buttons/Units/Knight.dds or copy the entire button definition from the Knight. (This is actually an error in the tutorial.)

Hope it helps!

sovarn
Dec 09, 2005, 04:58 PM
oh yeah was meant to fix that error, now it is fixed.

I think the problem is with your unit files rather than the xml (except for that comma but all that would do is mess up the icon).

make sure you dont change any of the names in the unit folder (i.e. nif and kf files.) post what you put in the art defines if you want because im sure that is your problem.

also you may want to change the button image.

Gnostic78
Dec 09, 2005, 08:30 PM
<UnitArtInfo>
<Type>ART_DEF_UNIT_BYZANTINE_CATAPHRACT</Type>
<fScale>0.42</fScale>
<fInterfaceScale>0.9</fInterfaceScale>
<NIF>Art/Units/Unique/Greek/Cataphract/Cataphract.nif</NIF>
<KFM>Art/Units/Unique/Greek/Cataphract/Cataphract.kfm</KFM>
<SHADERNIF>Art/Units/Unique/Greek/Cataphract/Cataphract_FX.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/HorseShadow.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_UNIQUE_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
</UnitArtInfo>

Gnostic78
Dec 09, 2005, 08:34 PM
Mumin: Thanks, I'll check that out... Alexander's companion cav would probably suffice. Being a Total War fan has really sparked my desire for Civ modding

Sovarn: There's my art defines excerpt. I left the extensions for knight, previously, but changed them to cataphract, while renaming every last file in the knight art folders that I unpacked and copied, rather laboriously I might add. :sad:

I will follow your collective suggestions, so hopefully it'll work. :) Thanks!!

Gnostic78
Dec 09, 2005, 08:52 PM
OMG, I was shoving fast food in my mouth while following your suggestions, and IT WORKED. It was the comma... had to be... because your suggestions reverted my XMLs and art files back to where they were when I originally posted my problem.

I could totally hug you guys.... but I won't. :goodjob: Now... to practice some digi-art so I can make the graphics fit the unit... and finish my cheeseburger....

Peace, y'all

sovarn
Dec 10, 2005, 05:27 AM
glad to know your problem in fixed.

Seven05
Dec 11, 2005, 12:07 AM
Are there any tips or tricks from experienced modders regarding how best to *delete* units from CIV IV? I am working on a medieval/fantasy mod. I have been able to add new units successfully, but when I try to replace or delete existing modern units I get all sorts of xml errors. I was thinking of just trying to add in some sort of prereq that would never happen so that they will never appear in game instead of deleting them - but am wondering if there are different/better suggestions. I just want to keep my fantasy/medieval kingdoms from building air craft carriers. :p Thanks for any suggestions! Great tutorial on adding units!

Set the unit's <iCost> value to -1 and nobody can build it, it's not the proper or complete solution but it's a lot easier the removing them from every file.

Rando
Dec 16, 2005, 09:34 AM
Thanks for the suggestion on unit value! I will try that. I had been trying to fix it by using a technology prereq, but that was also causing problems. The negative unit value might work better. Thanks again for the suggestion. :goodjob:

Portus
Dec 21, 2005, 12:14 PM
ONE SIMPLE QUESTION
I have disable the upgrade ability for some units in my costom assets( MG, Inf,Tank, Fighter and Bomber). So in single player, i play with that changes.
Now in MP games what could happend. Am i able to play with no problems and if im the host.
Anyone here could comment. Tanks

MorphineBoy
Dec 22, 2005, 08:07 PM
Okay....I'm creating a new Wehrmacht unit to replace the infantry for the Germans. How do I make it one of Germany's unique units?

sarbat
Dec 24, 2005, 04:00 AM
Hi all ˇ
I have a problem adding units I only could have added one, when I add more the previous one does not appear to construct it.

Some solution??

bleedingromeo97
Jan 13, 2006, 06:30 PM
I feel so stupid and feel i should know this, I am new at modding and am trying to follow the guide on units and relating it to the Black Knight skin which looks really cool and am just trying to figure out in the instructions (I know this is bad english punctuation, this should not be one complete sentence) where do I stick the unzipped version of that file or the contents of it, in another words, what is already done in the file, what do you have to do, and where do you stick it all. I know I am probably not getting something I should be getting, but I would appreciate instructions from someone who put in the black knight skin step by step. Thanks to anyone who can help in advance. Ceaser kicks butt.

JBG
Jan 17, 2006, 05:56 PM
I've created a UU for my new civilization (which I'll post once I've fixed this). It is essentially another version of the mali skirmisher, and does not need any new graphics other than the button. It displays fine in all the menus (apart from the civilopedia where I can't get its entry to display anything other than the button for some reason) and there are no error messages in the game.

But whenever I try and build one in-game, Civ 4 bombs to the desktop (there are no error messages prior to this). Why should this be?

hash
Jan 20, 2006, 11:05 AM
im having a small issue with this, but otherwise i've added 6 new custom units to my game thanx to this guide =D

whenever i build one of my custom units, instead of the defualt portriat showing next to the city, i get a black circle with a white ! in it. probably the same issue, whenever i have a custom unit selected, but hes off-screen, instead of the the pointy tab showing his portrait, i get a pink circle. obviously im missing either a piece of art or a link to a piece of art, any clues?

i made a custom civ at the same time, so its definately possible that i overlooked something in my gusto.

thanx for the write up!

Shqype
Jan 20, 2006, 03:27 PM
Okay....I'm creating a new Wehrmacht unit to replace the infantry for the Germans. How do I make it one of Germany's unique units?
You must edit the Civ4CivilizationInfos.xml to do this. Scroll down below the cities to where it has the information about the Panzer UU ... as you can see it is under the "tank" subcategory.

Copy this code and paste it under the panzer code .... next change it so that it is a Wehrmacht under the "Infantry" subcategory ... (This will give Germany 2 UUs).

If you still aren't sure, I can provide the actual code for you, but just follow the style of the Panzer setting and you should be fine.

whenever i build one of my custom units, instead of the defualt portriat showing next to the city, i get a black circle with a white ! in it.
This is the problem that I am having as well ... although I added my unit icon to the unit Atlas, and everything else works, including civilopedia pictures and whatnot. Does anyone know the solution to this?

hash
Jan 20, 2006, 06:18 PM
This is the problem that I am having as well ... although I added my unit icon to the unit Atlas, and everything else works, including civilopedia pictures and whatnot. Does anyone know the solution to this?

i do not have the images added to the atlas, (i was going to try that next), but my civlopedia pictures work as well. either the civlopedia calls to the button itself, or its smart enuff to defualt to it if no atlas image is there.

do you get the big pink blob when not centered on a custom unit? if not, then i'll go thru the trouble of adding them to the atlas, as the pink blob bugs me alot more than the ! pic (even tho thats pretty annoying too).

Shqype
Jan 20, 2006, 11:58 PM
I don't get any pink blob or any other problems, except the ! when my city is building the unique unit.

If the button itself is fine, then what is the purpose for the Atlas itself in the first place?

Neomega
Jan 21, 2006, 07:25 AM
I am also getting the magenta box. :( tried many many things, like converting from a jpg, from tga, from png, coloring over in Direct X texture tool... no luck. I noticed all of them are 4.12 Kb, but mine are anywhere from 5.48Kb to 12Kb

The Cricket
Jan 21, 2006, 11:58 PM
I need help. I have installed civ4 twice, and watched it install art0.fpk, but when i look for it, it isn't there. I have used a search program, enabled hidden files, and looked with unpak. I just can't find it. I know it is supposed to be in assets, and there a four asset#.fpk files there but no art0.fpk. Can anyone shed some light on this conundrum. Thx

hash
Jan 23, 2006, 04:15 PM
i had this same issue when i first tried to make some custom units. the secret is, your NOT looking for art0.fpk =D

the files your looking for ar in your main civ4\Assets directory. your looking for the files Assets0.fpk, Assets1.fpk, Assets2.fpk and Assets0.fpk. open the pak program by firaxis, and click pak>unpack and unpack each of those four files in a directory. (dont try to "open" the fpks, as you cant, which was where i got stuck for the longest time, again PAK>unpack).

now you have a directory just jam packed with all the textures/toys used in civ4. happy modding =D

The Cricket
Jan 23, 2006, 05:30 PM
thx, that helps a lot

Neomega
Jan 23, 2006, 08:10 PM
I am also getting the magenta box. :( tried many many things, like converting from a jpg, from tga, from png, coloring over in Direct X texture tool... no luck. I noticed all of them are 4.12 Kb, but mine are anywhere from 5.48Kb to 12Kb

answered by Deja for me.

http://forums.civfanatics.com/showpost.php?p=3612999&postcount=7

Master Lexx
Jan 24, 2006, 05:34 AM
I am pretty sure the big atlas is just abigger file that can be compressed better in graphics ram. Yes, if there is an atlas file and a single pic given, civ4 takes the one out of the big atlas. Just make sure you have alpha channel painted correctly if you convert your psd to dds again. Also remember that you may not change the atlas width height size if you convert ist back to dds. Always use a dds converted to psd/tga, never make a tga or so from scratch and convert it to dds later.

Neomega
Jan 24, 2006, 07:26 AM
I am pretty sure the big atlas is just abigger file that can be compressed better in graphics ram.

Yes. the atlas must be for the civilopedia or something, when multiple icons are displayed. A GPU prefers 1 128X128 texture over 4 64x64 textures.

With the sdk, I'd assume a 1024x1024 texture may be possible.

JSmith99
Jan 26, 2006, 11:31 PM
I've created a UU for my new civilization (which I'll post once I've fixed this). It is essentially another version of the mali skirmisher, and does not need any new graphics other than the button. It displays fine in all the menus (apart from the civilopedia where I can't get its entry to display anything other than the button for some reason) and there are no error messages in the game.

But whenever I try and build one in-game, Civ 4 bombs to the desktop (there are no error messages prior to this). Why should this be?

I do not have this specific problem (or perhaps I do, but I have another that prevents me from verifying this), but similar results. I have followed the guide, and when I begin a new game and tell a settler to build a new city, the game drops to desktop, without any error messages. Using the cheat mode, I was able to CTRL + SHIFT my custom unit in, and it could fight and receive promotion without problems. The unit I attempted to create was not a unique unit, simply to put in the Mark V Tank. I utilized the Modern Armor text as my blueprint to alter.

It may simply be that I am a stupid newb who is making the same error repeatedly, I don't know.

mismatch
Feb 04, 2006, 09:55 AM
great tutorial, Ive only got two problems so far:
1) My unit has no action buttons (goto, slee, etc...) and I cant imagine why.
2) In the civilopedia only the picture show up.

Does anyone know what may be the problem?
The Civ4GameText_Civilopedia_Units seems to be aye ok, Ive been through it several times. And the missing action icons I dont even know where to start in a try to fix that.

cheers.

Errand
Feb 04, 2006, 04:52 PM
I do not have this specific problem (or perhaps I do, but I have another that prevents me from verifying this), but similar results. I have followed the guide, and when I begin a new game and tell a settler to build a new city, the game drops to desktop, without any error messages. Using the cheat mode, I was able to CTRL + SHIFT my custom unit in, and it could fight and receive promotion without problems. The unit I attempted to create was not a unique unit, simply to put in the Mark V Tank. I utilized the Modern Armor text as my blueprint to alter.

It may simply be that I am a stupid newb who is making the same error repeatedly, I don't know.


You're not alone: I've got exactly the same problem, hope someone can help cause it's driving me nuts.... :twitch:

Shqype
Feb 04, 2006, 09:13 PM
A sacrificial offering goes to whoever can figure out my problem:

I've created multiple units (not unique units, by the way), but whenever starting a new game every civ begins with a Settler and my new unit (same one every time) INSTEAD of the warrior it should start with.

Does anyone know what the cause of this is? It reminds me of some technology issues when new techs were created, which allowed Plastics and Computers to be researched in the beginning of the game along with the other beginning technologies... that time it had to do with the position of the techs both in the XML file and their XY coords ... I wonder what causes this issue?

Head Serf
Feb 10, 2006, 03:18 PM
I am really confused. I want to add a T-34 tank to my mod, however I can't find this PakBuild Utilitity thing. I've run searches and everything. Do I need to download or buy it? If someone could help me, I'd appreciate it! :)

Head Serf
Feb 11, 2006, 05:37 AM
Nevermind, I figured it out myself. :)

mismatch
Feb 11, 2006, 09:38 AM
So, Im having this weird problem.
Instead of my new unit I get a huge purpleish blob, which usually means something is wong with either missing graphics files invalid path to the .nif.
Ive checked and double checked the names of my artsdefines tag, my path and filename to the files, but nothing wrong there as far as I can see.
I tested whether I had any missing graphics files by replacing (temporarily) a original units files with mine, and then they worked just fine.
So either the pikeman requires some files outside the art/unit/pikeman filder, or Ive screwed up in the xml.
But I havent.
my earlyartdefinestag:
<EarlyArtDefineTag>ART_DEF_UNIT_MERCENARY</EarlyArtDefineTag>
compared to the tag in the artsdef file:
<UnitArtInfo>
<Type>ART_DEF_UNIT_MERCENARY</Type>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<NIF>Art/Units/mercenary/Pikeman.nif</NIF>
<KFM>Art/Units/mercenary/Pikeman.kfm</KFM>
<SHADERNIF>Art/mercenary/Pikeman_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>

And as i said, my path IS correct:
Art/units/mercenary
Im at a total loss here.

Neomega
Feb 11, 2006, 12:56 PM
Hi,

check post 48 in this thread.

bye

mismatch
Feb 12, 2006, 03:01 AM
yeah, but it aint my button thats big and purple, its the model.
cheers n e weh.

edit: finally found the problem, I was just being a sloppy ****, not focusing. as usual.
edit2: yay cencorship, mebbe you should change your name to china fanatics, you bloody violators of free speech.

Houman
Feb 13, 2006, 10:28 AM
Was there any work done on the real Persian Immortal so far?

http://www.riseofpersia.com/screenshots/persia_prev/arstibara.jpg
*picture from Rise of Persia Mod - Rome:Total War

I could probably take the spearman and give it Archery ability as well + Change to attack first.

I m thinking about making one, however how could I make the skin? I am not an artist. ANy tips for me where I should start with skins?

Thanks
Houman

RED DIAMOND
Feb 13, 2006, 01:05 PM
Nice artwork.:goodjob:

sovarn
Feb 13, 2006, 04:31 PM
why not try taking it directly from the game if possible?
not sure how the models are kept but maybe you can just convert the art file.

Houman
Feb 14, 2006, 02:35 AM
First; to make it clear, I haven't created the picture. :) It is a copy from the mod "Rise of Persia", that is based on the game "Rome: Totalwar". I know the people who are working on this mod. Very nice guys. They are working hard to release this mod very soon.

However it is not made for CIV engine, the units are there true 3D. I could try to use the skin to put it on the CIV4 spearmen. But I have no idea how to convert the "art" file. Could you give any more details?

I am totaly new to the modding and skinning. :( But i have passion for learning it.

Many thanks,
Houman

Houman
Feb 24, 2006, 03:50 AM
hmm.. thanks.

I fixed the problem another way.... the Highlander starts with Guerilla I and II.

;)

@WaxonWaxov

I have the same problem, how do I enable firststrike I and II for a customized melee unit please?

Thanks
Houman

mrnett1974
Feb 24, 2006, 10:34 AM
... I have even succeeded to limit the nuclear weapons to the civilizations that would build a national wonder "manhattan project". So ... so much we could say ;)...

:goodjob:

Can u post your files you changed, please?! :cool:
I always wanted the same, that is, that the manhattan is a national wonder
and that only the civilization that construct it can build nukes.

THX!

Robo Magic Man
Feb 25, 2006, 12:15 PM
Okay....I'm creating a new Wehrmacht unit to replace the infantry for the Germans. How do I make it one of Germany's unique units?
It's actually very easy to make a unit unique for a civ. In the Civ4CivilizationInfos.xml file, find the part that has the info for Germany. Under the list of German cities, you'll find somehtng that looks like this:

<Units>
<Unit>
<UnitClassType>UNITCLASS_TANK</UnitClassType>
<UnitType>UNIT_GERMAN_PANZER</UnitType>
</Unit>
</Units>

You just need to add the tag for your new Wehrmacht unit. To do this change the above coding to this:

<Units>
<Unit> <UnitClassType>UNITCLASS_TANK</UnitClassType>
<UnitType>UNIT_GERMAN_PANZER</UnitType>
</Unit>
<Unit> <UnitClassType>UNITCLASS_INFANTRY</UnitClassType>
<UnitType>UNIT_(Unit Name from Civ4UnitInfos)</UnitType>
</Unit>
</Units>

Robo Magic Man
Feb 25, 2006, 12:20 PM
Also, is there a way to make a unit a World Unit, as opposed to a National Unit, so that there can only be one? I need this for a Chuck Norris unit, and I've finished everything for the mod except making sure that there can't be 30 Chuck Norrises of different nationalities running all over the world (Madness!:eek:) Please help.

charlesolmsted
Feb 28, 2006, 05:48 PM
Did anyone figure out how to get rid of that ! (exclamation point) when trying to build a custom unit? That seems to be the last obstacle between me having my new US Marine unit (instead of the Navy Seal).

yepzer
Mar 01, 2006, 02:20 AM
See this thread: How to Create City Bar Icons for your New Units

CrazyAce
Mar 07, 2006, 08:50 PM
Okay this is driving me nuts, I followed SOVARN’s tutorial (replacing Terry with GUERILLA) I am trying to create a guerilla UU for Arabia. This is my code in the CIV4CivilizationInfos.XML file:

<Units>
<Unit>
<UnitClassType>UNITCLASS_KNIGHT</UnitClassType>
<UnitType>UNIT_ARABIA_CAMELARCHER</UnitType>
</Unit>
<Unit>
<UnitClassType>UNITCLASS_MARINE</UnitClassType>
<UnitType>UNIT_GUERILLA</UnitType>
</Unit>
</Units>

Yet still every Civ can build this GUERILLA unit...

What am I doing wrong here..?

Hennahito
Mar 10, 2006, 05:47 AM
...1) My unit has no action buttons (goto, slee, etc...) and I cant imagine why.


mismatch, did you solve this problem (or can anyone else help out here)? I'm having the same difficulties. I searched the forums but to no avail...

I click on a worker, I get worker action buttons; I then click on my new unit and I get... worker action buttons! Thanks in advance for any attempt to help me out.

Pegasos
Mar 12, 2006, 09:09 AM
My art.fpk folder doesn´t iclude anything that I could unpack! Actually, my Customassets folder´s size is 0 bites!! So, I want to ask, where is those vital files I can unpack? :confused:

Hennahito
Mar 13, 2006, 09:55 AM
Pegasos: check out post #46.

Marc-Antoine
Mar 23, 2006, 02:53 AM
I want to add a new specific unit to a country that already have one (and still have the first). In pratice, i'm aiming modding a WWII mod, with 2 kinds of specific tank for german & russian player.

How should i do it ?
1) create a new specific UNITCLASS_INFO (for instance HEAVY_TANK) but with no DefaultUnit
2) modify the civilization info in this way :
<Unit>
<UnitClassType>UNITCLASS_TANK</UnitClassType>
<UnitType>UNIT_GERMAN_TIGER</UnitType>
</Unit>
<Unit>
<UnitClassType>UNITCLASS_TANK</UnitClassType>
<UnitType>UNIT_GERMAN_PANZER</UnitType>
</Unit>
3) Create a new specific UNITCLASS_INFO (for instance HEAVY_TANK) with on of this unit and add the civilisation_info to all other this :
<Unit>
<UnitClassType>UNITCLASS_HEAVY_TANK</UnitClassType>
<UnitType>NONE</UnitType>
</Unit>

In practice, i hope the first or second option can function. Does anyone have such a problem ? (and solve it of course).

PS : Excuse my English, i've never been versed in the language art.

adamamri
Mar 26, 2006, 08:35 AM
Hello, I find this unit superb but when I add it I do not have bombs in animation bombardment. Is this situation it normal?

Raider62
Mar 26, 2006, 01:03 PM
Hi sorry for asking this but I am unclear how adding new units works. I have downloaded the zip files from many of you (thanks). Is it really more complicated than inserting those files into the right places? I see all this text editing and stuff and am confused? I thought I could just unzip, put files in Assets folder or something and it would work. Can someone give me a push in the right direction for adding these pre-made units into Civ? Thanks

Xarlak
Mar 27, 2006, 11:05 AM
Ok, I've downloaded a skin (the polar bear skin), and I've got all of the xml files edited, so the polar bear is actually showing up in the game. The only problem is that I can't seem to find a way to get it to use the skin. The only file included in the zip is the polarbear.dds and the bear.dds file. I looked at ArtDefines... but the only reference there is to the .nif files, and I can't even find the original bear.nif file to copy into the polar bear folder. Am I missing something? Is there a way to do this without copying the bear.nif file? Where *is* the bear.nif file, since it doesn't even seem to be in the art/units/ folder?

Any help would be most appreciated. For now, I'm stuck with brown polar bears.

Beeralbion
Mar 30, 2006, 10:26 AM
Hi sorry for asking this but I am unclear how adding new units works. I have downloaded the zip files from many of you (thanks). Is it really more complicated than inserting those files into the right places? I see all this text editing and stuff and am confused? I thought I could just unzip, put files in Assets folder or something and it would work. Can someone give me a push in the right direction for adding these pre-made units into Civ? Thanks

Im having exactly the same problem. I have downloaded nautils A6M Zero Fighter and have used the guide here but it does not work for me. I still get the original fighter showing in its place. OBVIOUSLY I am going wrong somewhere along the line but where I just don't know! :sad:

Can somebody write a clear tutorial on how to get a unit to work with an example file like any of nautils planes/helos!?!?!?!! hehe pwleeeeease!!!

BFD8656
Apr 02, 2006, 04:46 PM
I Can't seem to find the Art0.fpk file. I did everything else you said in your tutorial but my units are not working in the game. I am thinking that the ART0.fpk might be what I am missing.

BFD8656
Apr 02, 2006, 06:22 PM
i had this same issue when i first tried to make some custom units. the secret is, your NOT looking for art0.fpk =D

the files your looking for ar in your main civ4\Assets directory. your looking for the files Assets0.fpk, Assets1.fpk, Assets2.fpk and Assets0.fpk. open the pak program by firaxis, and click pak>unpack and unpack each of those four files in a directory. (dont try to "open" the fpks, as you cant, which was where i got stuck for the longest time, again PAK>unpack).

now you have a directory just jam packed with all the textures/toys used in civ4. happy modding =D

Where is the pak program?

Agent 009
Apr 02, 2006, 11:27 PM
The name of the program is pakbuild. I don't have a link, but I think it might be located in the utilities section on this site.

Now this is my little problem:

I have made quite a number of new units and they all work fine in game. However, the older units are NOT getting replaced by the newer ones. I have made Bronze, Iron, and Steel versions of some of the medieval units and all of them except the knight are being replaced by the newer ones that get unlocked by later techs. All of my other new units are staying, so by the time I get to the future era my city build screen has 20 units or so in it. I have 3 different knights, 3 different armor tanks, 2 jets, 2 stealths, 2 mechs, and 3 marines/NAVY SEAL, all showing up in the city build screen.

I know this has nothing to do with the upgrades as those all work and check out so I am at a loss as to what else could be causing it. :S

Keep in mind that none of these are uniques units and can be built by any civ. The problem is that the older ones don't ever get replaced by the newer more advanced units when they get unlocked by a tech.

Any help will be much appreciated. :)

dcdragon
Apr 05, 2006, 10:50 AM
Now this is my little problem:

I have made quite a number of new units and they all work fine in game. However, the older units are NOT getting replaced by the newer ones.
You have to go to your old units in CIV4UnitInfos.xml and put in the unit that it upgrades to.


<bMechanized>0</bMechanized>

<UnitClassUpgrades>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_#^*^#</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
</UnitClassUpgrades>

<UnitAIs>

and that should replace the old units, also I think you have to put the new unit below the old one to properly replace it.

dcdragon
Apr 05, 2006, 11:00 AM
I'm having a problem with the civIV +7 plugin for max 30 day trial, I put the file in the max file and get an error and none of the civ 4 stuff works, so i put it in the max plugins folder and it tryies to export my file to niff but i get about 12 can't open file - CivIV/ errors, the final one saying Don't know how to save in that file type and all of the tools are missing.
Any help will be much appreciated.

Agent 009
Apr 06, 2006, 05:28 AM
You have to go to your old units in CIV4UnitInfos.xml and put in the unit that it upgrades to.


and that should replace the old units, also I think you have to put the new unit below the old one to properly replace it.


hmm... you know that thought crossed my mind. The upgrades thing was in order as I said in my first post that's why I was confused as to what else could be causing the problem. It seemed to me logically that that would be what makes old units not buildable.

I'll try rearranging the placement of the units in the file and see how that works. Thanks for the help. :D

Kaizer Kai
Apr 12, 2006, 04:46 PM
when i go to art0.fpk there isnt anything in the folder what am i supposed to do?

senwiz
Apr 13, 2006, 06:50 AM
when i go to art0.fpk there isnt anything in the folder what am i supposed to do?

I had the same issue. I had to uninstall then reinstall to version 1.0, grab the file, then upgrade to 1.52 again.

Agent 009
Apr 13, 2006, 09:47 AM
Actually there is no Art0.fpk

There is Assets0.fpk, Assets1.fpk, Asset2.fpk, and Assets3.fpk. Use pakbuild and select the unpack option and unpack them all. Don't try to open the file(s) because you can't.

That's where I got stuck for a while and only figured it out by accident as I was trying to explain to my brother how annoyed I was that I couldn't get it to work. :p

Kaizer Kai
Apr 13, 2006, 03:58 PM
But when i go to unpack, then to the file i am only able to open it so how do i unpak it?

senwiz
Apr 14, 2006, 09:52 AM
Actually there is no Art0.fpk

There is Assets0.fpk, Assets1.fpk, Asset2.fpk, and Assets3.fpk. Use pakbuild and select the unpack option and unpack them all. Don't try to open the file(s) because you can't.

That's where I got stuck for a while and only figured it out by accident as I was trying to explain to my brother how annoyed I was that I couldn't get it to work. :p

I tried that awhile ago, and couldn't do it. Once I reinstalled a 1.0 version, I found the art0 file. The assests file ahs never worked for me, but if someone figures out how to make it work...Let me know. :)

When I go into the pakbuild app, and locate the assets files, I get a error saying that it cannot open the file.

Agent 009
Apr 14, 2006, 06:17 PM
I tried that awhile ago, and couldn't do it. Once I reinstalled a 1.0 version, I found the art0 file. The assests file ahs never worked for me, but if someone figures out how to make it work...Let me know. :)

When I go into the pakbuild app, and locate the assets files, I get a error saying that it cannot open the file.


Yeah that's what I am saying... you aren't supposed to open it.

Goto the Pak menu in Pakbuild, and click unpack...

Then find all the assets files with the fpk extention. Those are the files that need to be unpacked. However, if you try to open them you will get that error. ;)

senwiz
Apr 16, 2006, 11:01 AM
I know you can't open it. What would you open it with? LMAO

That stated, I received an error when trying to unpak the assets files. It won't use them no matter what I do, at this point.

Portus
Apr 22, 2006, 09:29 AM
Hi sovarn
ADD unit its ok, however im not knowing how to REPLACE NEW units in the same class, annimations ...and so on, only the new art( some only have a DDS and a NIF):confused: . Can you please extend your tutorial for that case, i presume its eazy and more fast but im not catching it. :mad:
In civ3 was so eazy.

Kaizer Kai
May 03, 2006, 03:42 PM
I tried reinstalling it, but im not getting anything could someone send me a copy of their installed data?i think that would work

taltho
May 03, 2006, 05:52 PM
Hi all

I have a question, the packbuild utility where can I get it?

I'v searched this thred some to try and find the anser. I did'nt see any thing from where I looked.

I really learned allot here thanks for the tutorial. I already have added units to the game but only by taking art folders from other mods I downloaded.
I never could finde the art files in the game, well I know now thanks to this tutorial.

Agent 009
May 07, 2006, 02:58 PM
I know you can't open it. What would you open it with? LMAO

That stated, I received an error when trying to unpak the assets files. It won't use them no matter what I do, at this point.

That's odd... it worked fine over here. :confused:

Hi all

I have a question, the packbuild utility where can I get it?

I'v searched this thred some to try and find the anser. I did'nt see any thing from where I looked.

I really learned allot here thanks for the tutorial. I already have added units to the game but only by taking art folders from other mods I downloaded.
I never could finde the art files in the game, well I know now thanks to this tutorial.

Go to the Utilities Subforum. I believe it is located there. ;)

jamie006
May 09, 2006, 12:37 PM
hi iv got a problem (sigh not another one......) iv created a unit, put them in the game but then when i click on them there is nothing where the promotions defend ect should be....... Its prob some thing amaturish but i cant seem to fix it any one got any ideas????
2 other people have asked the question but no one seems to awnser it.....

[EDIT] fixed this prob it was an error in the xml art defines unit file. i new it was something newbish:p

jstarbuck5
May 09, 2006, 03:03 PM
This is a REALLY basic question: Where is the Art0.fpx file located? The instructions for unpacking the fpx say to place the unpacker in the main CIV4 directory and unpack the file in my Assets/Art folder. No such file in there. A search of my hard drive and the CIV CD also came up blank. The only .fpk files found were Assets.fpk.

Thanks,

Starbuck

whatsallthisnow
May 10, 2006, 10:17 AM
Hello,

I just recently added Snafusmith's Akula Submarine to my Civ IV game. Everything worked fine BUT once I got in the game, I discovered that I could place the unit using the world builder tool, BUT I couldn't build the unit. In the city tab, if I clicked to build one the game would crash to the desktop. I've read this whole thread and there are others who have the same problem, however they were not addressed. I hope someone knows whats going on to cause this.

Thanks

jstarbuck5
May 10, 2006, 02:10 PM
OK, I got the assets unpacked and followed the tutorial here.

1- button worked fine, showed up where it's supposed to.

2- I can build the unit in a game, but the section that has promotions to be assigned and orders to give is blank.

3. The unit itself is not visible, only a red octagon.

4. The unit moves and fights, but won't show up or take promotions.

Any useful ideas?

Thanks,

Starbuck

7rew
May 29, 2006, 11:57 AM
I am trying to add 2 units:

Humvee - fast infantry (great person) land troop mover - stats as gunship - cannot attack - animation downloaded from here.

SBS Commando - stats as navy SEAL (attack 12 + defensive bonuses) is a great person type unit - (can go in sub/humvee) - animation standard navy SEAL.

I get 3 red spheres that orbit slowly instead of the animation. How do I fix this - also how do I set a build limit on the SBS guys?

Also my peadia artical for SBS doesn't work (does for humvee).

Officer Reene
May 30, 2006, 07:59 AM
here's the thread with the pakbuild utility program


http://forums.civfanatics.com/showthread.php?t=136023


;)


NOTE: when you unpack all those files, its best NOT to put it in CIV4 folder!

make a new folder

The reason you dont need to unpack it there... everytime you start up CIV4 it unpacks the files automatically.... you only need to unpack it to:

1) use as a reference - putting new/edited files in the correct directory path
2) edit a "vanilla" file (ex. Changes colors to a dds file) and placing the new file in the correct folder
3) use some of the "vanilla" files in a new Unique Unit (Ex. you want to use the swordsman model in a new Unique unit of the Scots Highlander)
4) use as a reference - checking vanilla versions of files to edit or change
5) Probably some other stuff I missed! :mischief:
(Forgive me I am alittle drunk and tired now)

etc
use these files to edit/copy/replace vanilla files either in Custom Assets or your own mod

(when you add/edit files... follow the directory/folder path to properly place the files in the correct folder)


probably some other stuff too...

I'll get back to ya when I am sober... :D

Officer Reene
May 30, 2006, 03:02 PM
OK, I got the assets unpacked and followed the tutorial here.

1- button worked fine, showed up where it's supposed to.

2- I can build the unit in a game, but the section that has promotions to be assigned and orders to give is blank.

3. The unit itself is not visible, only a red octagon.

4. The unit moves and fights, but won't show up or take promotions.

Any useful ideas?

Thanks,

Starbuck


ok Im sober.... but I cant give a long explanation... (got some stuff to do IRL)

but here are some quick answers..

2. the promotions info is in the CIV4UnitInfos.xml (What Unit are you basing it off of? You should follow the template of the unit you are basing it off of) I think the "orders to give" are here too... (also check your CIV4ArtDefines_Unit.xml) not sure and maybe later I can answer it better (Im short on time)

3. you didnt refer to the correct files in the CIV4ArtDefines_Unit.xml

4. CIV4UnitInfos.xml again (see#2)

hope that helps

but I am short on time... I'll try to get back to you later...

unless you solved the problem by then.... :D

Officer Reene
May 30, 2006, 03:16 PM
...I get 3 red spheres that orbit slowly instead of the animation. How do I fix this - also how do I set a build limit on the SBS guys?


3 red spheres means you didnt reference the right files in the CIV4ArtDefines_Unit.xml

to set build limit I would suggest following the spy template in CIV4UnitInfos.xml
(since you can only make 3... there's probably a way to limit or increase this number - I just dont got the time to explain right now :mischief:

Also my peadia artical for SBS doesn't work (does for humvee).

you gotta add the txt about it (and use the right tag lines too) to CIV4GameText_Civilopedia_units.xml file


Well I hope that helps... :crazyeye:

I 'll get back to you all later... and try to help you all out more


TIP: When making a new unit follow a template of a "vanilla" version unit

remember to try keep this line the same as a vanilla Unit:

ex.

<Class>UNITCLASS_MECHANIZED_INFANTRY</Class>

or UNITCLASS_WARRIOR

or UNITCLASS_RIFLEMAN

etc

just keep the unit class as a vanilla verison (you can customize it...but it means more modding files!)


Well I gotta go... I'll try to explain it better later! ;)

generalshake
Jun 19, 2006, 07:41 AM
I'm new to the modding part of Civ so please excuse the newbish question(s) that are to follow.

What I'm trying to do is take a unit in a person's mod that I love and add in a duplicate of it. The unit upgrades later in the game and I don't mind it losing it's advantage, but what I'm trying to do is have it upgrade to the 'new' unit I want to make. I want to use the same skin as the original but just bring up the stats.

I copied the original units data and changed it to reflect the new unit class it would be and name, but the problem is the file refuses to load. I get an XML Load Error that pops up and says : "Failed Loading XML file XML\Civilizations/CIV4CivilizatinsInfo.xml. [.\FXml.cpp:133] Error parsing XML File-

Reason: Invalid at the top level of the document."

I'm at a loss to explain it. I'm sure it's an extreme newb mistake I'm doing here and overlooking something but would love some help figuring it out. I use the same stratagy, description, and civilopedia tags as the orginal unit. The same with the art tag. The only thing I do is change the thing to not upgrade, the unit class to what the orginal unit upgrades to, and the title tag.

Thanks for any help.

Officer Reene
Jun 19, 2006, 08:11 AM
I'm new to the modding part of Civ so please excuse the newbish question(s) that are to follow.

What I'm trying to do is take a unit in a person's mod that I love and add in a duplicate of it. The unit upgrades later in the game and I don't mind it losing it's advantage, but what I'm trying to do is have it upgrade to the 'new' unit I want to make. I want to use the same skin as the original but just bring up the stats.

I copied the original units data and changed it to reflect the new unit class it would be and name, but the problem is the file refuses to load. I get an XML Load Error that pops up and says : "Failed Loading XML file XML\Civilizations/CIV4CivilizatinsInfo.xml. [.\FXml.cpp:133] Error parsing XML File-

Reason: Invalid at the top level of the document."

I'm at a loss to explain it. I'm sure it's an extreme newb mistake I'm doing here and overlooking something but would love some help figuring it out. I use the same stratagy, description, and civilopedia tags as the orginal unit. The same with the art tag. The only thing I do is change the thing to not upgrade, the unit class to what the orginal unit upgrades to, and the title tag.

Thanks for any help.


it's a little hard to give you that answer without all the details in front of me...
however it sounds like a "mis"tagged data...

can you copy and paste the part of the XML file with your new unit stats?

or post the XML file here so I can examine it?
(and tell me what is the name of your new unit so I know what I am looking for ;) )



however:

... I get an XML Load Error that pops up and says : "Failed Loading XML file XML\Civilizations/CIV4CivilizatinsInfo.xml. [.\FXml.cpp:133] Error parsing XML File-

Reason: Invalid at the top level of the document."



it is tough to say.... but if the CIV4CivilizationsInfo.XML file causes the problem... then it may be a Unique Unit for a Civilization which:

A) you didnt add to the new civilization

B) the unit you copied referenced a civilization that doesnt exist in your mod (the unit you copied belonged to a unique civilization that you didnt add)

C) the unit is assigned/defined for the wrong civ

D) other problems I am not sure of at this time... :crazyeye:


of course alot of errors are inter-related where if one XML file is wrong... it make another XML file wrong... and so on... but the only error is in the original file.... where you correct that so the other xml error files work fine... :mischief:


bottom line.... I need more info :D

Ill stand by for your reply :)

generalshake
Jun 19, 2006, 08:40 AM
Thanks for the quick reply, didn't expect anyone else to be up as early as me lol. I'll upload the files I modded into a zip It's from the excellent 'The Ancient Mediterranean' mod.

I'm basically trying to get the legionnaire to upgrade to the heavy infantry but to keep the skin of the legionnaire. The stats haven't been fully nerfed down to the Heavy Infantry as I've been banging my head trying to figure out what I'm doing wrong. Just bugs me to lose my legionnaire skin when they upgrade. :cool: I've named the upgraded form LegionaryII

I'm sure it's an silly mistake I'm making, as I'm no where near as good as the modders who made the mod LoL. I've tried a bunch (and the mess that is the mod files I'm sure shows it) of things to get it to work, but to no avail.

I've gotta bounce off to do the family thing, but will definitly check back. I appreciate any help you can offer, as the good Lord knows I need it LoL.

Officer Reene
Jun 19, 2006, 05:33 PM
...Thanks for the quick reply, didn't expect anyone else to be up as early as me lol...

Actually I was heading to bed (im a night person :mischief: ) but I always check the threads before I go to bed....
(Thats why my replies are so late since I go to sleep then reply back over 6 hours later :p )


...I'm basically trying to get the legionnaire to upgrade to the heavy infantry but to keep the skin of the legionnaire. The stats haven't been fully nerfed down to the Heavy Infantry as I've been banging my head trying to figure out what I'm doing wrong.

ok preliminary results:

(like you I have to do stuff IRL - but not as noble as you with your family - mine is just errands :blush: )

first I noticed in

CIV4Unitinfos.XML file
you define your new UU as:

<Class>UNITCLASS_ARMORED_INFANTRY</Class>
<Type>UNIT_ROME_LEGIONARYII</Type>

however in your

CIV4UnitClassInfos.XML file
you define your UU as:

<Type>UNITCLASS_ARMORED_INFANTRY</Type>
<Description>TXT_KEY_UNIT_SWORDSMAN</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<DefaultUnit>UNIT_ARMORED_INFANTRY</DefaultUnit>


the types have to be the same to work!

(the easiest is changing UNIT_ARMORED_INFANTRY to UNIT_ROME_LEGIONARYII in the CIV4UnitClassInfos.XML file)

NOTE there is different ways to define UU

for example I made a unit but used the default swordsman unit as a reference
since it was the similar! :) you could have done that to with your UNIT_ARMORED_INFANTRY and use the old UNITCLASS_SWORDSMAN like the original UNIT_ROME_LEGIONARY

this looks complicated but it is not... it just saves having to edit the CIV4UnitClassInfos.XML file when you dont really have to... (I can go into detail later if you wish)

as for the TXT for the unit ... you could easily make a new entry (in another file) to give it's description

basically the CIV4UnitClassInfos.XML file just defines whether it is a limited # unit like the spy or not...

brief explanation:

<iMaxGlobalInstances>-1</iMaxGlobalInstances> - defines how many times the unit can appear in all civilizations
<iMaxTeamInstances>-1</iMaxTeamInstances> - defines how many times the unit can appear on teammates civilizations
<iMaxPlayerInstances>-1</iMaxPlayerInstances> - defines how many times the unit can appear in one civilization

-1 = unlimited
0 = none
any positive Number (1/2/3...etc) = # of units

for example:

<iMaxPlayerInstances>3</iMaxPlayerInstances>

means 3 units can appear in one entire civilization (check the spy stats)

this is particularly important in limiting building/wonders...

in this file

CIV4UBuildingClassInfos.XML

where:

<iMaxGlobalInstances>-1</iMaxGlobalInstances> - think World Wonders Define
<iMaxPlayerInstances>-1</iMaxPlayerInstances> - think National Wonders

of course
if both those tags are -1 that just means it's a regular building

ok enough of the modding tutorial... dont want to drive you crazy :crazyeye:

Like I said.... this is a preliminary report...

there may be other errors but I am not done checking (RL stuff to do)

try those changes and see what happens ;)

Please note any errors and post them here... (PLEASE be specific about the errors that pop up!)


NOTE: I am still suspicious about the civilization.xml error but like I said before the errors may be related.... and you fix the main problem... the other problems may go away :mischief:

Just bugs me to lose my legionnaire skin when they upgrade. :cool: I've named the upgraded form LegionaryII

there is another way to "save" your legionary skins (but that a little more advanced... but not very hard to do once you do it a couple of times)


... I appreciate any help you can offer, as the good Lord knows I need it LoL.


any time I can help... I will...

I hope this helps...:)

keep me updated! :goodjob:

generalshake
Jun 19, 2006, 09:39 PM
there is another way to "save" your legionary skins (but that a little more advanced... but not very hard to do once you do it a couple of times)



That's prob what I'm going to have to do. I can't make the armored infantry class default unit the LegionaryII as the other races use the regular. I'm just looking to add another UU in on this mod as the LegionaryII instead of the armored infantry. The Goths in this mod have a UU that is of the armored infantry and that's kinda what I'm going after as well, though instead of it being a 'true' UU like the goths with better stats, I'll just mirror the normal Armored Infantry stat wise.

I tried creating a seperate unit class just for the legionaryII and it gave me the same Civ4unitclassinfo error and a few others. I've uploaded the changed files of the mod and here's the errors they are giving me.

1. The same error as the first one with the Error parsing XML File. Reason: End Tag 'UnitClassInfo' does not match the start tag 'UnitClassInfos'. Line: 121, 5 Source: </UnitClassInfo>

2. Tag: UNITCLASS_PROPHET in Info class was incorrect. (This one is funny as I didn't even touch that part of it.)

3. Tag: UNITCLASS_ARTIST in Info class was incorrect. Same for the _SCIENTIST, _MERCHANT, ENGINEER, and so on. Basically seems to be doing it to a whole list of 'em.

Lastly, the strangest thing of all is when I go back and take out any of the modding I done, it does a similiar error, though they change. The only way I clear it is to completly replace it with an untouched copy of the files I was modding. (I just copy and paste the whole folder though in that case). I've uploaded the orginal files as well. I'm wondering if it could be that I'm using notepad and it's changing something that the original modders put in?

Thanks for the help, and words of encouragement. All in all I still love this mod the original creators made and can live w/o my anal need to have legionaries till the end hehe.

Officer Reene
Jun 19, 2006, 10:39 PM
...1. The same error as the first one with the Error parsing XML File. Reason: End Tag 'UnitClassInfo' does not match the start tag 'UnitClassInfos'. Line: 121, 5 Source: </UnitClassInfo>...

well I found one problem:

<UnitClassInfo>
<Type>UNITCLASS_ARMORED_INFANTRY</Type>
<Description>TXT_KEY_UNIT_SWORDSMAN</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<DefaultUnit>UNIT_ARMORED_INFANTRY</DefaultUnit>
</UnitClassInfo>
</UnitClassInfo>
<UnitClassInfo>
<Type>UNITCLASS_SPEARMAN</Type>
<Description>TXT_KEY_UNIT_SPEARMAN</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<DefaultUnit>UNIT_SPEARMAN</DefaultUnit>
</UnitClassInfo>


you have an extra "</UnitClassInfo>"

erase that and it should fix it

(also line 121 refers to where the error is occuring)

you might want to use notepad++ to edit XML files

its free and color coordinated (easier on the eyes :mischief:)

plus if you go to the control tabs you can have it "check" your XML taglines where it lets you know if there is a mismatch or incorrect tag
it's a basic checker but it will find your errors
(and wont let you re-save until you fix the error ;) )

it found your error... and made my job easier

go here to d/l notepad++


http://notepad-plus.sourceforge.net/

let me know if the changes help ya! :)

...2. Tag: UNITCLASS_PROPHET in Info class was incorrect. (This one is funny as I didn't even touch that part of it.)

3. Tag: UNITCLASS_ARTIST in Info class was incorrect. Same for the _SCIENTIST, _MERCHANT, ENGINEER, and so on. Basically seems to be doing it to a whole list of 'em.



usually when you make one mistake... it affects the whole XML database and gives you sorts of errors... once you fix the original mistake... the others clear up :crazyeye:


hope this helps :p

generalshake
Jun 20, 2006, 07:16 PM
well I found one problem:

<UnitClassInfo>
<Type>UNITCLASS_ARMORED_INFANTRY</Type>
<Description>TXT_KEY_UNIT_SWORDSMAN</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<DefaultUnit>UNIT_ARMORED_INFANTRY</DefaultUnit>
</UnitClassInfo>
</UnitClassInfo>
<UnitClassInfo>
<Type>UNITCLASS_SPEARMAN</Type>
<Description>TXT_KEY_UNIT_SPEARMAN</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<DefaultUnit>UNIT_SPEARMAN</DefaultUnit>
</UnitClassInfo>


you have an extra "</UnitClassInfo>"

erase that and it should fix it

(also line 121 refers to where the error is occuring)

you might want to use notepad++ to edit XML files

its free and color coordinated (easier on the eyes :mischief:)

plus if you go to the control tabs you can have it "check" your XML taglines where it lets you know if there is a mismatch or incorrect tag
it's a basic checker but it will find your errors
(and wont let you re-save until you fix the error ;) )

it found your error... and made my job easier

let me know if the changes help ya! :)

hope this helps :p

LoL thanks for the catch, and the tip on Notepad++ Using it now.

I'm thinking it's tied to the civilizationinfos file. I use the modded unit files and the old civ4civilizationsinfos file and it loads. When I put in the file to add it as an extra UU for rome that's when it gives me the error. The Error that pops up is

Tag: CIVILIZATION_BARBARIAN in Info class was incorrect.
Current XML file is: Interface/CIV4WorldPickerInfos.xml

I'm gonna keep tinkering with that file and see if something pops up, though can't figure it out as I didn't even touch the Barb civ lol.

Officer Reene
Jun 20, 2006, 07:48 PM
LoL thanks for the catch, and the tip on Notepad++ Using it now.

I'm thinking it's tied to the civilizationinfos file. I use the modded unit files and the old civ4civilizationsinfos file and it loads. When I put in the file to add it as an extra UU for rome that's when it gives me the error. The Error that pops up is

Tag: CIVILIZATION_BARBARIAN in Info class was incorrect.
Current XML file is: Interface/CIV4WorldPickerInfos.xml

I'm gonna keep tinkering with that file and see if something pops up, though can't figure it out as I didn't even touch the Barb civ lol.


once you add a UU to a civ... there are other files that you need to edit other XML files...

check this tutorial out... it helps alot

and I was able to make a new civ with 2 UU w/o problems...

http://forums.civfanatics.com/showthread.php?t=148507


I gotta go do some things... but I'll check in later tonight or tomorrow morning...

yeah adding stuff is a pain (but not really once you get the hang of it :crazyeye: ) because you have to edit alot of XML files to get just one thing working :mischief:


hope this helps;)

generalshake
Jun 21, 2006, 05:48 AM
once you add a UU to a civ... there are other files that you need to edit other XML files...

check this tutorial out... it helps alot

and I was able to make a new civ with 2 UU w/o problems...

http://forums.civfanatics.com/showthread.php?t=148507


I gotta go do some things... but I'll check in later tonight or tomorrow morning...

yeah adding stuff is a pain (but not really once you get the hang of it :crazyeye: ) because you have to edit alot of XML files to get just one thing working :mischief:


hope this helps;)

I just wanted to thank you for all your help. The link will help me greatly, perhaps convince me to try and create my own mod oneday instead of just tinkering with others :lol: .

The best thing you done though is show me the Notepad++. I took an unmodded civ4civilizationsinfo file and opened it in N++ and modded as I had done the first file I modded. The mod loaded and worked perfectly. I'm not sure what was actually happening as I done everything the same as I did, but my theory is the crap windows notepad program has a max character limit, and the N++ either doesn't, or a higher max. I'm going to try and compare the two old modded files and see if that's the case. If so that'd explain why it kept flippin out on me.

Either way I'm just glad it's finally working, and definitly appreciate the help you gave. :D

Officer Reene
Jun 21, 2006, 08:02 AM
I just wanted to thank you for all your help. The link will help me greatly, perhaps convince me to try and create my own mod oneday instead of just tinkering with others :lol: .


hey no problem... I find modding quite fun (when the mod runs correctly :D )

I'm glad I could help... I am just a bit pre-occuppied with my own mod testing right now :cool:

The best thing you done though is show me the Notepad++. I took an unmodded civ4civilizationsinfo file and opened it in N++ and modded as I had done the first file I modded. The mod loaded and worked perfectly. I'm not sure what was actually happening as I done everything the same as I did, but my theory is the crap windows notepad program has a max character limit, and the N++ either doesn't, or a higher max.

yeah notepad++ is a neat little program


I'm going to try and compare the two old modded files and see if that's the case. If so that'd explain why it kept flippin out on me.


you can compare them both at the same time using notepad++ :eek:

just open both xml files

click on one of the files tabs and click "open to another view" or something like that...

it then opens the files next to each other :goodjob:

I'm sure there is also an option in the top menu bar...


and you can lock the horizontal and vertical scrolling with the the buttons in the menu bar! :p

this way you can scroll simultaneously and compare line for line what is the difference (and possibly the error) between the two files

there are lots of options to use... just check all the options in the menu bar....

the search capabilities has some neat stuff too!


Either way I'm just glad it's finally working, and definitly appreciate the help you gave. :D

great to hear that your mod's working !

that's all I like to hear and Im glad I can help in any way!:D


good luck and happy modding :king:

N8DoGG
Jun 25, 2006, 10:33 AM
First of all you must unpak the Art0.fpk file using the PakBuild Utility to get the unit.

How do you do this? I got PakBuild but now I'm stumped... :confused:

Don't hate... :sad:

Officer Reene
Jun 25, 2006, 05:39 PM
How do you do this? I got PakBuild but now I'm stumped... :confused:...


1) Run the pakbuild program

2) click on "PAK" Tab (next to File and View Tabs)
*DO NOT CLICK on FILE or OPEN (file)

3) click on Unpack

(make sure you are in the Assets FOLDER of the main CIV4 Directory)

4) Unpack (click on)

Assets0.fpk

***SAVE in NEW FOLDER***


***NOT IN MAIN CIV4 Directory***


repeat steps 2-4 for Assets1.fpk, Assets2.fpk, and Assets3.fpk
(NOTE: you can save them all in the same directory you just created in step 4.... the first time around)


now you have the skins to reference this tutorial ;)


Follow the instructions in the begining of this post :D


Hope this helps :)

N8DoGG
Jun 25, 2006, 11:53 PM
Thanks dogg... :beer:

Officer Reene
Jun 26, 2006, 12:28 AM
Thanks dogg... :beer:


post if you have any other problems ;)

Sentoa
Jul 10, 2006, 12:25 AM
I found the answer. I wasn't clearing the cache properly! I thought it was in My Documents but no, it's in Application Data\My Games. ahem :blush:

- Pete


I'm having the same problem:
"Tag: UNITCLASS_HUMVEE in Info class was incorrect Current XML file is: Units\CIV4UnitInfos.xml"

This may be a stupid question, but how do you go about clearing the cache? Also, I finally got the Humvee to show up in the game, but it does nothing when you order it to attack... on the other hand is does a great job of shooting back, then exploding when attacked.

Since there is a RangedStrike.kf file in the folder, I'm at a loss why that function only does not work. My armies are inept enough without extra units that are qualified only at bursting into flames :crazyeye:

Officer Reene
Jul 10, 2006, 05:59 AM
I'm having the same problem:
"Tag: UNITCLASS_HUMVEE in Info class was incorrect Current XML file is: Units\CIV4UnitInfos.xml"

can u please post your XML files or cut and paste the portion that refers to your UNITCLASS_HUMVEE in your CIV4UnitInfos.xml?

It's hard to comment what may be the error since I dont know what your tagline data looks like :mischief:

that error is usually because you did not properly define the unit in the CIV4UnitClassInfos.xml

or you have the wrong data in one of your taglines in your CIV4UnitInfos.xml File...

but without seeing the raw data I cant be more specific :crazyeye:



This may be a stupid question, but how do you go about clearing the cache?...

usually the cache is found here:

C:\Documents and Settings\[USER LOGIN NAME]\Application Data\My Games\[Civilization 4 folder]\cache Folder


I dont know why they made two different civ4 folders...

its stupid :mad:

everytime after you exit CIV4 (or before you start CIV4) empty all the files in that cache folder...

(I made a shortcut to that folder on my desktop to make it easier to access :goodjob: )



Also, I finally got the Humvee to show up in the game, but it does nothing when you order it to attack... on the other hand is does a great job of shooting back, then exploding when attacked....Since there is a RangedStrike.kf file in the folder, I'm at a loss why that function only does not work. My armies are inept enough without extra units that are qualified only at bursting into flames :crazyeye:

not sure but here is a general tutorial on placing custom unit skins in the game:

http://forums.civfanatics.com/showthread.php?t=176460


hope that helps ;)



post if you need more help :)

NeX
Jul 25, 2006, 05:44 AM
i cant find art0.fpk :(

Officer Reene
Jul 25, 2006, 06:34 AM
i cant find art0.fpk :(


the 1.62/1.52 patch breaks it up to smaller files...

see post 115 for info....;)

Splinter13
Aug 07, 2006, 10:47 AM
I'm making a WW2 Pacific theatre scenerio and i'm wondering how to make a unit specialized to only one civilization using XML

for example i want to make a Japanese Infantry unit, but I don't want the Americans building them aswell.

I'm quite new to modding so please be very explained in your answers.

Officer Reene
Aug 07, 2006, 03:14 PM
I'm making a WW2 Pacific theatre scenerio and i'm wondering how to make a unit specialized to only one civilization using XML

for example i want to make a Japanese Infantry unit, but I don't want the Americans building them aswell.

I'm quite new to modding so please be very explained in your answers.


I dont know if this works with Warlords Expansion...


but here is an excellent Tutorial for the vanilla version:


http://forums.civfanatics.com/showthread.php?t=148507

hope this helps ;)

Longinus
Aug 08, 2006, 12:24 PM
What I need to do if I wan't to give some unit a civ specific texture, but leave it otherwise unchanged (same name, same stats etc). For example, I have created red-coated texture for english grenadier. How I get it to work?

Officer Reene
Aug 08, 2006, 05:24 PM
What I need to do if I wan't to give some unit a civ specific texture, but leave it otherwise unchanged (same name, same stats etc). For example, I have created red-coated texture for english grenadier. How I get it to work?


that is pretty easy...

just go to your CIV4UnitInfos.xml file and find the redcoat art tag that should look like this:

<UnitMeshGroup>
<iRequired>1</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_ENGLISH_REDCOAT</EarlyArtDefineTag>
</UnitMeshGroup>



just make sure that tag is in your english grenadier unit's info

(Of course you have to create a new unit called english Grenadier... easiest thing to do is copy the grenadier stats and rename the "type" tagline... as well as edit the other related XML files... )

and it is done! :goodjob:


hope that helps ;)

JammerK
Aug 18, 2006, 11:47 PM
Please be patient with an old man just learning to add/modify units. I thought I understood the instructions, but fear I am incorrectly defining the directory concatenation for my modified files. My path is C:\Fraxis\Civ4\Mods\Assets\XML\Units into which I copied over the main Civ4unitinfo XML file. To start simple, I just increased Keshik's icombat strength to 8. However, upon playing the game, it still used the value of 6 from the main
Civ4unitinfo file. If I update the main file directly the change takes effect. However, I want to next get into adding new units, so I need to learn the right way to do this thru the Mods directory path/approach. Please advise. many thanks, Jk

Officer Reene
Aug 19, 2006, 01:08 AM
... My path is C:\Fraxis\Civ4\Mods\Assets\XML\Units into which I copied over the main Civ4unitinfo XML file...




you have to make a new folder in the MODS folder


ex. Calling your mod "MyMod" (name the folder what you want)

then your path should look like this:

C:\Fraxis\Civ4\Mods\MyMod\Assets\XML\Units folder

then copy the original files in the corresponding MyMod folder (following the correct path and making new folders to match it :crazyeye: )

then edit the copies :p

and you have new values for your tags! :)


then you must load the mod... which can be accomplished by three different ways:


1) making a shortcut (copying the civ4 "gamestart" shortcut on your desktop) then editing the target line

ex. C:\Civ4\Civilization4.exe -mod= MyMod

if that dont work try this:


"C:\Civ4\Civilization4.exe -mod= MyMod"


2) Editing your Civ4 Config file

search for "mods" and follow the example


3) Loading up the game and then picking the "load a mod" option


any three methods will load up your mod (You only have to do one! :D )



Hope that helps! ;)

damionslain
Aug 19, 2006, 04:28 PM
sorry if this has been asked, but i'm really having a hard time.

I'm trying to apply 2 of the new units from the warlords expansion to my mod which i created for the original civ4.

i tried following this guide, by copying the unit folder and linking where applicable. But the hole thing didn't work at all.

I assume it's due to changes in the units design.

OH! i just thought of something, using the framework of another similar unit, then just changing the art tags! (then ajusting the text name and hit points etc, manually!!!) that should work!!!

so why am i still posting this?
um....
incase someone has a better idea......
or an easier one, i should say.

JammerK
Aug 20, 2006, 04:43 PM
Thank You, Officer Renee. You hit on exactly what I needed to know. BTW: to launch the mod, the technique I settled on was to create a new short cut, select properties, and specify the mod I wanted the game launched with. The syntax was; c:\bla bla bla\Civilization4.exe" mod=\mymod

again, thanks to your excellent & fast response to my dilemma

Officer Reene
Aug 20, 2006, 09:56 PM
Thank You, Officer Renee. You hit on exactly what I needed to know. BTW: to launch the mod, the technique I settled on was to create a new short cut, select properties, and specify the mod I wanted the game launched with. The syntax was; c:\bla bla bla\Civilization4.exe" mod=\mymod

again, thanks to your excellent & fast response to my dilemma


No problem:goodjob:

if you have any other issues... please post and Ill try to help:mischief:


please note that I have not figured how to update to the Warlords expansion yet :sad:


other than that I glad it helped ;)

Thorn
Sep 04, 2006, 12:56 PM
I installed a custom unit w/graphics. Everything seems okay except the entire unit is purple! Any ideas???

Officer Reene
Sep 04, 2006, 01:22 PM
I installed a custom unit w/graphics. Everything seems okay except the entire unit is purple! Any ideas???

well that usually means you have not edited the XML files correctly....

(where the xml points to the new unit...)


try to use this tutorial:

http://forums.civfanatics.com/showthread.php?t=176460


if that doesnt work... please be more specific in what you did to add the custom unit :mischief:

then maybe I could figure it out.....


hope that helps ;)

Thorn
Sep 04, 2006, 02:28 PM
Well, I have a nif file and a dds file. The dds file looks like it contains the skins, but I'm not sure where to put the file or where to point to it from.

Officer Reene
Sep 04, 2006, 06:36 PM
Well, I have a nif file and a dds file. The dds file looks like it contains the skins, but I'm not sure where to put the file or where to point to it from.


are you replacing a existing unit model with a new skin?

if so which one?

are you making a new unit model?


basically if you are reskinning an existing unit you need to follow this path:

Custom Assets\Art\unit folder

and create a NEW folder with the original unit's name

then place all those files in the NEW folder


if you are creating a new unit... that's similar to the reskinning unit...
just make sure your folder is the one you designate in the CIV4ArtDefines_Unit.XML file

FYI all folder names of the original units can be for found in the CIV4ArtDefines_Unit.XML file


FYI if you are putting this in a mod... well change custom Assets foler to assets folder... and place the assets in the your new mod folder...

(Note the new mod folder should be in your MODS folder of your CIV4 Directory)


hope that helps ;)

Thorn
Sep 04, 2006, 08:53 PM
Thanks so much for the help Officer Renee. It turned out to be a filename mismatch. The DDS filename in the NIF file didn't match the actual DDS file. :rolleyes:

Quetz
Sep 05, 2006, 05:04 PM
Question for anyone out there with some experience.

I have gotten my unit in the game, however, I can't seem to get it to act as an air unit. I have it set almost the same as the vanilla bomber from what I can see, but I think there must be another file I have to change to get it to use the air movement system, which will hopefully make it interceptable. I've been looking through files with no luck. Anyone have an idea?

edit: Got it. Domain_air :)

tombyo
Sep 11, 2006, 06:46 PM
Am new to modding Civ IV, so I was wondering if anyone could help with my problem. I have the 1.52 patch installed. I have successfully added a new unit to my CustomAssets folder & modified all the necessary XML files. The new unit behaves properly under World Builder fro