Adding a Civ from one Mod to another

Jeckel

Great Reverend
Joined
Nov 16, 2005
Messages
1,637
Location
Peoria, IL
I have been thinking someone should cover this topic. Seeing as I am takeing a break (just spent the last 9 hours putting the Mayan, Zulu, Portugal, and Vikings Civs, the Promotions 'n Traits and Caravan Mods, and the Nuclear Tech/Units from the Realism Mod into mymod:crazyeye: ) I'll see what I can say about it.
 
First, obviously you will have the Mod you want to put something into, we'll call that 'MyMod' from here on out. For this descussion I am going to use the wonderful Celt Mod with its 2 leaders and Commando Gaelic Warriors.

Step 1) Installing Art Files from Celt Mod to MyMod.
Root Import Directory) \Mods\MyMod\Assets\Art
Root Export Directory) \Mods\Celts\Assets\Art

Before we begin moveing files I suggest haveing 2 file folders open for this procedure, one for each of the directorys mentioned above. Also a good idea to have your preferred XML editor warming up.

I find it is easyest to go in order of the top files to the bottom so...

Open the folder \Mods\Celts\Assets\Art\Interface\Button\Civilizations
Copy the DDS file in there 'Celt.dds' to \Mods\MyMod\Assets\Art\Interface\Button\Civilizations
Go to folder \Mods\Celts\Assets\Art\Interface\Button\Units
Copy the DDS file in this folder 'Gaelicwarrior.dds' to \Mods\MyMod\Assets\Art\Interface\Button\Units
Now go to folder \Mods\Celts\Assets\Art\Interface\Leaderheads
Copy all the files and folders from there to \Mods\MyMods\Assets\Art\Interface\Leaderheads
Next open folder \Mods\Celts\Assets\Art\Interface\TeamColor
Say it with me, copy this file to \Mods\MyMod\Assets\Art\Interface\TeamColor
That concludes the \Assets\Art\Interface\ stuff.

One note though, in the folder \Assets\Art\Interface\Button often you will find 3 DDS files
'actions_builds_leaderheads_specialists_atlas.dds'
'civics_civilizations_religions_atlas.dds'
'unit_resource_atlas.dds'
for an example look at the Nguni (former Zulu) Mod.
For now just ignore these files, don't copy them or anything. I will explain shortly the reasoning.

Next in line is \Assets\Art\Movies.
Unless you are slicing in a Mod with new/changed movies you can just ignore this folder.
As I haven't done this yet (Lost Wonder Mod your on the list) we will skip this folder.

Next for real is the all import \Assets\Art\Units folder.
Open \Mods\Celts\Assets\Art\Units. Inside you will find a folder named for the Civs UU 'GaelicWarrior'.
Copy this folder to \Mods\MyMods\Assets\Art\Units

Cheers around, we have finished the easy part and are moving on to the fun parts...
 
Step 2) Slicing the Celts XML code into MyMod's files.
Root Import Directory) \Mods\MyMod\Assets\XML
Root Export Directory) \Mods\Celts\Assets\XML

Now its time to bring out your favorite little XML Editor. I hear alot of people use XMLSpy, but I still have dialup so I went for the faster to download CookTop that I have come to like alot. They say you can use notepad or whatever, but it is safer to use an editor so you know it is getting saved as XML and not TXT or somthing. The XML files and language in general are relatively easy to figure out so I won't be going into any in depth explanations of how the code works, just how to use it in this context. Lastly before we move on, it never hurts to be reminded --Check you syntax and cut/pasting-- little user errors are the biggest cause of code not running right or at all.

Now on with the fun...
 
Step 2.1) Slicing the ArtDefines.
Root Import Directory) \Mods\MyMod\Assets\XML\Art
Root Export Directory) \Mods\Celts\Assets\XML\Art

XML Editor
Open \Mods\MyMod\Assets\XML\Art\Civ4ArtDefines_Civilization.xml

Notepad or somthing
Open \Mods\Celts\Assets\XML\Art\Civ4ArtDefines_Civilization.xml
Note: You can use notepadish progs to open file you tak info FROM(Celts files) as the XML Editor will forma it for you.
In this file find
<CivilizationArtInfo>
<Type>ART_DEF_CIVILIZATION_CELT</Type>
<Button>,Art/Interface/Buttons/Civilizations/Celt.dds</Button>
<Path>Art/Interface/TeamColor/FlagDECAL_Triskell.dds</Path>
<bWhiteFlag>0</bWhiteFlag>
</CivilizationArtInfo>
Note: Notice how it is calling the Civilization and FlagDecal DDS files we copied earlyer.
With this file and a few others the modded part is mixed in aphabetically.
Cut this portion and paste it in \Mods\MyMods\Assets\XML\Art\Civ4ArtDefines_Civilization.xml
I will say only this right here, Use good practices from the start and put it at the top or bottom in you file (see rant at bottom).

To take a quick semi tangent, to the reason I had to not copy those 3 DDS files from the \Assets\Art\Interface\Button folder above. In the Civ4ArtDefines_Civilization.xml file you define the button picture to use for the Civ. In the Celts example the button is
<Button>,Art/Interface/Buttons/Civilizations/Celt.dds</Button>
But in other Mods you'll run across, say Nguni, it will look like this
<Button>,Art/Interface/Buttons/Civilizations/Nguni.dds,Art/Interface/Buttons/Civics_Civilizations_Religions_Atlas.dds,5,7</Button>
When the second ',Art/' stuff is there it doesn't draw its picture from the first ',Art/' part. As to why this is so I have not the foggyest, but there you are. Fixing this however is as easy as deleting the second part so that
<Button>,Art/Interface/Buttons/Civilizations/Nguni.dds,Art/Interface/Buttons/Civics_Civilizations_Religions_Atlas.dds,5,7</Button>
becomes
<Button>,Art/Interface/Buttons/Civilizations/Nguni.dds</Button>
As far as I've seen this works just fine, if I am missing anything just let me know.

Back to work...

XML Editor
Open \Mods\MyMod\Assets\XML\Art\Civ4ArtDefines_Leaderhead.xml

Notepad or somthing
Open \Mods\Celts\Assets\XML\Art\Civ4ArtDefines_Leaderhead.xml
Locate the section
<LeaderheadArtInfo>
<Type>ART_DEF_LEADER_VERCINGETORIX</Type>
<Button>,Art/interface/LeaderHeads/Btn_LH_Celt_Vercingetorix.dds</Button>
<NIF>art/interface/LeaderHeads/Vercingetorix/Vercingetorix.dds</NIF>
<KFM>art/LeaderHeads/Victoria/victoria.kfm</KFM>
<NoShaderNIF>art/LeaderHeads/Victoria/victoria_noshader.nif</NoShaderNIF>
<BackgroundKFM>art/LeaderHeads/Victoria/Victoria_BG.kfm</BackgroundKFM>
</LeaderheadArtInfo>
and
<LeaderheadArtInfo>
<Type>ART_DEF_LEADER_BRIAN_BORU</Type>
<Button>,Art/interface/LeaderHeads/Btn_LH_Celt_Brian_Boru.dds</Button>
<NIF>art/interface/LeaderHeads/Brian_Boru/Brian_Boru.dds</NIF>
<KFM>art/LeaderHeads/Victoria/victoria.kfm</KFM>
<NoShaderNIF>art/LeaderHeads/Victoria/victoria_noshader.nif</NoShaderNIF>
<BackgroundKFM>art/LeaderHeads/Victoria/Victoria_BG.kfm</BackgroundKFM>
</LeaderheadArtInfo>
Note: Notice the Leaderhead DDS files we copied being used.
Note: You may have to edit the <Button> tag here as we did above.
Now c/p these sections to \Mods\MyMod\Assets\XML\Art\Civ4ArtDefines_Leaderhead.xml

XML Editor
Open \Mods\MyMod\Assets\XML\Art\Civ4ArtDefines_Unit.xml

Notepad or somthing
Open \Mods\Celts\Assets\XML\Art\Civ4ArtDefines_Unit.xml
Locate section
<UnitArtInfo>
<Type>ART_DEF_UNIT_CELT_GAELIC_WARRIOR</Type>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<NIF>Art/Units/GaelicWarrior/Axeman.nif</NIF>
<KFM>Art/Units/GaelicWarrior/Axeman.kfm</KFM>
<SHADERNIF>Art/Units/GaelicWarrior/Axeman_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>
Note: This file doesn't have any <Button> tag so no editing should be neccessary.
Note: You may notice that NIF and KFM files from the \Assets\art\ folders are being called.
C/p this part to \Mods\MyMod\Assets\XML\Art\Civ4ArtDefines_Unit.xml
 
Step 2.2) The Civ and Leader Info files.
Root Import Directory) \Mods\MyMod\Assets\XML\Civilizations
Root Export Directory) \Mods\Celts\Assets\XML\Civilizations

XML Editor
Open \Mods\MyMod\Assets\XML\Art\Civ4CivilizationInfos.xml

Notepad or somthing
Open \Mods\Celts\Assets\XML\Art\Civ4CivilizationInfos.xml
Find the part
<CivilizationInfo>
<Type>CIVILIZATION_CELT</Type>
<Description>TXT_KEY_CIV_CELT_DESC</Description>
<ShortDescription>TXT_KEY_CIV_CELT_SHORT_DESC</ShortDescription>
<Adjective>TXT_KEY_CIV_CELT_ADJECTIVE</Adjective>
<Civilopedia>TXT_KEY_CIV_CELT_PEDIA</Civilopedia>
<DefaultPlayerColor>PLAYERCOLOR_CELT</DefaultPlayerColor>
<ArtDefineTag>ART_DEF_CIVILIZATION_CELT</ArtDefineTag>
<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
<bPlayable>1</bPlayable>
<bAIPlayable>1</bAIPlayable>
<Cities>
<City>Entremont</City>
....
....
</CivilizationInfo>
Note: For now take note of all the TXT_KEY_CIV_* stuff. They are important later.
Note: Notice the <ArtDefineTag> tag calling our entry from Civ4ArtDefines_Civilization.xml.
Note: See PS1 at the bottom for something about <Cities> entrys.
Copy this section into your \Mods\MyMod\Assets\XML\Art\Civ4CivilizationInfos.xml

XML Editor
Open \Mods\MyMod\Assets\XML\Art\Civ4LeaderHeadInfos.xml

Notepad or somthing
Open \Mods\Celts\Assets\XML\Art\Civ4LeaderHeadInfos.xml
Find
<LeaderHeadInfo>
<Type>LEADER_BRIAN_BORU</Type>
<Description>TXT_KEY_LEADER_BRIAN_BORU</Description>
<Civilopedia>TXT_KEY_LEADER_BRIAN_BORU_PEDIA</Civilopedia>
...
</LeaderHeadInfo>
Note: More TXT_KEY_* things!
Note: The Celts Mod has two leaders there for two entries in this file and others that are about leaders.
Copy the 2 LeaderHeadInfo sections to \Mods\MyMod\Assets\XML\Art\Civ4LeaderHeadInfos.xml
 
Step 2.3) Gameinfo Stuff.
Root Import Directory) \Mods\MyMod\Assets\XML\GameInfo
Root Export Directory) \Mods\Celts\Assets\XML\GameInfo

XML Editor
Open \Mods\MyMod\Assets\XML\Art\CIV4DiplomacyInfos.xml

Notepad or somthing
Open \Mods\Celts\Assets\XML\Art\CIV4DiplomacyInfos.xml

This file will be in some mods, but not in others. If it isn't there don't worry, it doesn't seem to be required.
If it is there and you are the kind of person that likes to go the full 110 percent then get ready as this is the longest part of the XML work.

There are two important tags to look for in this file, <DiplomacyInfo> and <Response>. Under <DiplomacyInfo> tags you will find <Response> tags for each vanilla leader as well as possibly other system <Response> tags.
Go through the \Mods\Celts\Assets\XML\Art\CIV4DiplomacyInfos.xml file and find all the <Response> sections that have the new leader/s name and c/p them to the appropriate section of the \Mods\MyMod\Assets\XML\Art\CIV4DiplomacyInfos.xml file.

I would be more in depth, but I have spent enough hours with this file and don't want to spend any more. When you get the hang of it this part shouldn't take more then 10-20 minutes.

Again, not all Mods will have this file and it seems to run fine if you just leave it out, though I don't just cause I have a little OCD.
 
Step 2.4) Color Files
Root Import Directory) \Mods\MyMod\Assets\XML\Interface
Root Export Directory) \Mods\Celts\Assets\XML\Interface

There are two files in this folder. Like the GameInfo flie above, these seem to be unneccesary and may or may not be included in any particular Mod. As for the ones that do have these files (which is alot) about the only way to find what is modded is to compare this file with the vanilla versions. Thankfully neither are very large, but I tend to ignore the files if the differences are to hard to find.
 
We are going to skip the Text folder and go with the units first.

Step 2.5) Adding Unique Units
Root Import Directory) \Mods\MyMod\Assets\XML\Units
Root Export Directory) \Mods\Celts\Assets\XML\Units

XML Editor
Open \Mods\MyMod\Assets\XML\Art\CIV4UnitInfos.xml

Notepad or somthing
Open \Mods\Celts\Assets\XML\Art\CIV4UnitInfos.xml
Find the section for your UU
<UnitInfo>
<Class>UNITCLASS_AXEMAN</Class>
<Type>UNIT_CELT_GAELIC_WARRIOR</Type>
<UniqueNames/>
...
</UnitInfo>
and copy it to \Mods\MyMod\Assets\XML\Art\CIV4UnitInfos.xml

Bam! unit added.:)
 
Well that is enough for today. Not bad for just under 3 hours. I'll do Step 2.6) The Text Folder and Files tomorrow. Will also be putting up a quick reference for what file all the different TXT_KEY_* things go with.

Till later yall.

Civ Rules.
 
well, things to precise:

game info/diplomacy.xml is included in mod where there are special diplo text for the new leaders
colors val is quite important: it defines the color of the civ added. In the case of celts (BTW, it would be nice to say who done it ;) ), it's a special green color. If you don't use the file, you will have some error message cause civIV won't find the definition of the colors for celts. If you don't define a new color for new civ, you will use the same one than another civ. If the borders of these two particular civ "touch", you won't see any border (see the finn mod to see the effect). the 'color set is define in the civilisations/civilisationinfos.xml file
 
Thanx for pointing out the color thing LAnkou, I will rewrite that part. Just to be sure I am understanding right, if you leave out the CIV4PlayerColorInfos.xml you will get an error message and if you don't define a new color in CIV4ColorVals.xml then the new Civ and another Civ could use the same color.

As for the CIV4DiplomacyInfos.xml file, if you didn't carry this file over from a mod, am I correct in the assumption that the Civ will just use default Diplomacy Texts? And I'll explain this part more thouroly when I explain the Text folder stuff.

And finnally, heaps and heaps praise go out to LAnkou for makeing the Celts Mod. Wouldn't if be great if all Civs came with 2 Leaders :D

Also throwin some props to CivArmy for the mentioned Nguni Mod (I changed it back to Zulu Empire for my mod, precious few Z civs as it is ;) )
 
in the civilisation file, you get

<DefaultPlayerColor>PLAYERCOLOR_CELT</DefaultPlayerColor>

that is the line that define the color set (one main, one secondary, one color text)

in the playercolor file, you should have an entry corresponding that referes to three color. If not, you will get an error message

in the color file, at the end of the color list, here are the player colors (before are others colors used for menu, etc, etc...) If you use the same main color for two civ, the common borders won't appear... (that's why i have a great time defining different colors for all the civ in Superciv mod)

and yes, if you don't define diplomacy, it will use default one

HIH (Hope It Helps TM)
 
Back
Top Bottom