[TUTORIAL] Video Tutorials on Modding Civ4

1. Change all the Unique Units in CivilizationInfos file to have the correct unit class. This should be the same as the UnitClass in the UnitInfos file.
Example below.

Original in CivilizationInfos:
Code:
                <Unit>
                    <UnitClassType>UNITCLASS_USN_CARRIER</UnitClassType>
                    <UnitType>UNIT_AMERICAN_USN_CARRIER</UnitType>
                </Unit>

Corrected:
Code:
                <Unit>
                    <UnitClassType>UNITCLASS_CARRIER</UnitClassType>
                    <UnitType>UNIT_AMERICAN_USN_CARRIER</UnitType>
                </Unit>

2. Delete all the extra classes you made in UnitClassInfos file. Yes, delete them. Unique units do not need their own class.
Example below.

Original in UnitClassInfos:
Code:
        <UnitClassInfo>
            <Type>UNITCLASS_USN_CARRIER</Type>
            <Description>TXT_KEY_UNIT_USN_CARRIER</Description>
            <iMaxGlobalInstances>-1</iMaxGlobalInstances>
            <iMaxTeamInstances>-1</iMaxTeamInstances>
            <iMaxPlayerInstances>-1</iMaxPlayerInstances>
            <iInstanceCostModifier>0</iInstanceCostModifier>
            <DefaultUnit>UNIT_USN_CARRIER</DefaultUnit>
        </UnitClassInfo>

Corrected:
Deleted

Repeat 1 & 2 for each Unique Unit. That should solve your problems.
 
1. Change all the Unique Units in CivilizationInfos file to have the correct unit class. This should be the same as the UnitClass in the UnitInfos file.
Example below.

Original in CivilizationInfos:
Code:
                <Unit>
                    <UnitClassType>UNITCLASS_USN_CARRIER</UnitClassType>
                    <UnitType>UNIT_AMERICAN_USN_CARRIER</UnitType>
                </Unit>

Corrected:
Code:
                <Unit>
                    <UnitClassType>UNITCLASS_CARRIER</UnitClassType>
                    <UnitType>UNIT_AMERICAN_USN_CARRIER</UnitType>
                </Unit>

2. Delete all the extra classes you made in UnitClassInfos file. Yes, delete them. Unique units do not need their own class.
Example below.

Original in UnitClassInfos:
Code:
        <UnitClassInfo>
            <Type>UNITCLASS_USN_CARRIER</Type>
            <Description>TXT_KEY_UNIT_USN_CARRIER</Description>
            <iMaxGlobalInstances>-1</iMaxGlobalInstances>
            <iMaxTeamInstances>-1</iMaxTeamInstances>
            <iMaxPlayerInstances>-1</iMaxPlayerInstances>
            <iInstanceCostModifier>0</iInstanceCostModifier>
            <DefaultUnit>UNIT_USN_CARRIER</DefaultUnit>
        </UnitClassInfo>

Corrected:
Deleted

Repeat 1 & 2 for each Unique Unit. That should solve your problems.
@Arizona15G
 

Attachments

  • Error 1.png
    Error 1.png
    19.7 KB · Views: 27
  • Error 2.png
    Error 2.png
    9.8 KB · Views: 25
  • Error 3.png
    Error 3.png
    11.4 KB · Views: 29
So I must of done something wrong because I got these Errors....

In the civ pedia the Leaders & Civs are now blank. & the game crashes at start game.
The error is in the CivilizationInfos file. The game is telling you it is expecting <UnitClassType> but you have <Class> there instead.

You need to change:
Code:
                <Unit>
                    <Class>UNITCLASS_FIGHTER</Class>
                    <Type>UNIT_AMERICAN_P51</Type>
                </Unit>
to
Code:
                <Unit>
                    <UnitClassType>UNITCLASS_FIGHTER</UnitClassType>
                    <UnitType>UNIT_AMERICAN_P51</UnitType>
                </Unit>

And you also did the same with the German fighter.

You need to change:
Code:
                <Unit>
                    <Class>UNITCLASS_FIGHTER</Class>
                    <Type>UNIT_GERMAN_FW190</Type>
                </Unit>
to
Code:
                <Unit>
                    <UnitClassType>UNITCLASS_FIGHTER</UnitClassType>
                    <UnitType>UNIT_GERMAN_FW190</UnitType>
                </Unit>
 
The error is in the CivilizationInfos file. The game is telling you it is expecting <UnitClassType> but you have <Class> there instead.

You need to change:
Code:
                <Unit>
                    <Class>UNITCLASS_FIGHTER</Class>
                    <Type>UNIT_AMERICAN_P51</Type>
                </Unit>
to
Code:
                <Unit>
                    <UnitClassType>UNITCLASS_FIGHTER</UnitClassType>
                    <UnitType>UNIT_AMERICAN_P51</UnitType>
                </Unit>

And you also did the same with the German fighter.

You need to change:
Code:
                <Unit>
                    <Class>UNITCLASS_FIGHTER</Class>
                    <Type>UNIT_GERMAN_FW190</Type>
                </Unit>
to
Code:
                <Unit>
                    <UnitClassType>UNITCLASS_FIGHTER</UnitClassType>
                    <UnitType>UNIT_GERMAN_FW190</UnitType>
                </Unit>
Okay, thanks that looks to have fix that!
Next issue lol, The Art is gone.
 

Attachments

Missing art like that means that the path you wrote in the XML file is not correct. Just make sure that the paths point to the actual folder that the NIF and KFM files are in.
 
Missing art like that means that the path you wrote in the XML file is not correct. Just make sure that the paths point to the actual folder that the NIF and KFM files are in.
That’s the thing. They used to work and I didn’t touch it and now it doesn’t work. Clearly something happened but Idk what and my eyes can’t find the mistake.
 
That’s the thing. They used to work and I didn’t touch it and now it doesn’t work. Clearly something happened but Idk what and my eyes can’t find the mistake.
Well what did you change exactly? Did you maybe change the art files, move them around etc.?

These things can't happen on their own.
 
Well what did you change exactly? Did you maybe change the art files, move them around etc.?

These things can't happen on their own.
I was changing what Top Secret told me to do in the previous posts with the Civillizationinfo, unitinfos, & class infos.
I didn't even open the ArtDefines.
 
The ArtDefines are exactly the same, so the only reason it can't be showing is due to some sort of change in the file structure. As far as I know that's the only thing that could mess it up, since the ArtDefineTag is the same.

Example:
Code:
        <UnitArtInfo>
            <Type>ART_DEF_UNIT_USN_CARRIER</Type>
            <Button>Art/Interface/Buttons/Units/EarlyCarrier.dds</Button>
            <fScale>1.0</fScale>
            <fInterfaceScale>0.92</fInterfaceScale>
            <bActAsLand>0</bActAsLand>
            <bActAsAir>0</bActAsAir>
            <NIF>Art/Units/USN_CARRIER/CV2.nif</NIF>
            <KFM>Art/Units/Carrier/Carrier.kfm</KFM>
            <SHADERNIF>Art/Units/USN_CARRIER/CV2.nif</SHADERNIF>
            <ShadowDef>
                <ShadowNIF>Art/Units/01_UnitShadows/DestroyerShadow.nif</ShadowNIF>
                <ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
                <fShadowScale>0.8</fShadowScale>
            </ShadowDef>
            <iDamageStates>4</iDamageStates>
            <TrailDefinition>
                <Texture>Art/Shared/water_ship_wake.dds</Texture>
                <fWidth>1</fWidth>
                <fLength>180.0</fLength>
                <fTaper>1</fTaper>
                <fFadeStartTime>.2</fFadeStartTime>
                <fFadeFalloff>0.35</fFadeFalloff>
            </TrailDefinition>
            <fBattleDistance>0.35</fBattleDistance>
            <fRangedDeathTime>0.31</fRangedDeathTime>
            <bSmoothMove>1</bSmoothMove>
            <fAngleInterpRate>720.0</fAngleInterpRate>
            <fBankRate>.2</fBankRate>
            <fExchangeAngle>25.0</fExchangeAngle>
            <bActAsRanged>0</bActAsRanged>
            <TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
            <AudioRunSounds>
                <AudioRunTypeLoop>LOOPSTEP_DESTOYER</AudioRunTypeLoop>
                <AudioRunTypeEnd>ENDSTEP_DESTROYER</AudioRunTypeEnd>
            </AudioRunSounds>
            <SelectionSound>AS3D_UN_DESTROYER_FORT</SelectionSound>
            <ActionSound>AS3D_UN_DESTROYER_FORT</ActionSound>
        </UnitArtInfo>

In both files it points to this entry which is the same.

You need to:

1. Check your directory. Since the directory is Art/Units/USN_CARRIER/CV2.nif,

Go to the mod's file -> Assets -> Art -> Units -> USN_CARRIER -> CV2.nif

If even one letter or file is off, then it will display red.

If that is fine, we will cross that bridge when we come to it.
 
Oh there's only one other thing I can think of - there's random lines added to the ArtDefines file and I don't know why.

Maybe delete those?
 
Yes, definitively do NOT leave blank lines in the XML files. CIV4 does not like those.
 
Oh there's only one other thing I can think of - there's random lines added to the ArtDefines file and I don't know why.

Maybe delete those?
I got it all Fixed Thank you! I have popped out 5 unique Units already.
I do have a couple small questions...
1st off, I added Stalingrad & Leningrad to Russian Cities. But it comes up off and I don't see where the very slight issue of the TEXT_KEY not actually showing up in the city name.
 

Attachments

  • Stalingrad.png
    Stalingrad.png
    1,003.9 KB · Views: 24
  • Info.png
    Info.png
    31.2 KB · Views: 23
You also have to add it in the text files under XML/Text.

Think of the capital letters as pointing to a reference. The game is looking in the XML/Text/ files for an entry with that exact name. If it cannot find it, it just puts what it had instead.
 
You also have to add it in the text files under XML/Text.

Think of the capital letters as pointing to a reference. The game is looking in the XML/Text/ files for an entry with that exact name. If it cannot find it, it just puts what it had instead.
In the 'Civ4GameText_cities_bts'? just add them to the list in the same format as the others? I don't have to add multiple language versions right?
 
In the 'Civ4GameText_cities_bts'? just add them to the list in the same format as the others? I don't have to add multiple language versions right?
No you can leave the other languages blank or just put English in them if you want. I just put the English in all of the languages.

The file actually doesn't matter, the text is weird compared to everything else. It will read the text anywhere. Just pick one file, cities is probably the best.
 
C
No you can leave the other languages blank or just put English in them if you want. I just put the English in all of the languages.

The file actually doesn't matter, the text is weird compared to everything else. It will read the text anywhere. Just pick one file, cities is probably the best.
I think I got it fixed, thanks. Okay so similar issues. I created a new unit with a new class the 'light tank' I added it to the art, info, & class info (I also created a unique French light tank and it works perfectly) however when it shows up in the game you cannot click on it to activate the unit. also in the pedia it does the same unit_text_ code thing.
 

Attachments

C

I think I got it fixed, thanks. Okay so similar issues. I created a new unit with a new class the 'light tank' I added it to the art, info, & class info (I also created a unique French light tank and it works perfectly) however when it shows up in the game you cannot click on it to activate the unit. also in the pedia it does the same unit_text_ code thing.
Hello @Arizona15G I didn't read this properly the first time I clicked into the thread and just now realized you need more help. Do you still need some help?
 
Back
Top Bottom