How to mod civ colors?

jkp1187

Unindicted Co-Conspirator
Joined
Aug 29, 2004
Messages
2,496
Location
Pittsburgh, Pennsylvania
This should be an easy one. How do I mod the colors assigned to the various civs? I've just gotten so used to barbs being white that it just doesn't feel right for a civ to have that color.

Thanks in advance!
 
in civ III, you could go on to the editor and change what colours are for what civs, but I'm not sure about Civ IV. I personaly would like to add my own colours but I'm even more unsure about that.
 
The key to the new editor is simple: there isn't an "editor", there's several different layers of editors that have to all be used to achieve anything substantial, requiring skills in understanding XML editing (so you don't screw it all up), plus Python, plus the upcoming SDK, and the World Builder (which lacks a way to randomly-generate a new world on the fly, you have to log out to the main menu, start a new game, to "achieve" this simple task).

Back in college in the various programming classes I took, we were told to strive for the maximum level of involvement and complexity delivered through the simplest and easiest-to-use interfaces. Guess they didn't decide to subscribe to that theory this time.
 
To change the Barbs to white, go to ...\Assets\XML\ and you'll find a file called CIV4CivilizationInfos.xml. You can open it with any text editor (e.g., NotePad). Scroll down well towards the bottom and you'll see:

Code:
<CivilizationInfo>
	<Type>CIVILIZATION_BARBARIAN</Type>
	<Description>TXT_KEY_CIV_BARBARIAN_DESC</Description>
	<ShortDescription>TXT_KEY_CIV_BARBARIAN_SHORT_DESC</ShortDescription>
	<Adjective>TXT_KEY_CIV_BARBARIAN_ADJECTIVE</Adjective>
	<Civilopedia>TXT_KEY_CIV_BARBARIAN_PEDIA</Civilopedia>
	<DefaultPlayerColor>PLAYERCOLOR_BLACK</DefaultPlayerColor>

Change "PLAYERCOLOR_BLACK" to "PLAYERCOLOR_WHITE".

Similarly, you can change the English from white to some other colour.

Not everything is that easy.
 
PeteT said:
To change the Barbs to white, go to ...\Assets\XML\ and you'll find a file called CIV4CivilizationInfos.xml. You can open it with any text editor (e.g., NotePad). Scroll down well towards the bottom and you'll see:

Code:
<CivilizationInfo>
	<Type>CIVILIZATION_BARBARIAN</Type>
	<Description>TXT_KEY_CIV_BARBARIAN_DESC</Description>
	<ShortDescription>TXT_KEY_CIV_BARBARIAN_SHORT_DESC</ShortDescription>
	<Adjective>TXT_KEY_CIV_BARBARIAN_ADJECTIVE</Adjective>
	<Civilopedia>TXT_KEY_CIV_BARBARIAN_PEDIA</Civilopedia>
	<DefaultPlayerColor>PLAYERCOLOR_BLACK</DefaultPlayerColor>

Change "PLAYERCOLOR_BLACK" to "PLAYERCOLOR_WHITE".

Similarly, you can change the English from white to some other colour.

Not everything is that easy.

Dude! You rock!!!! Thanks!

Now, I'm going to press my luck and ask one more question: Is there a list of colors available anywhere, or do the colors used represent the total colors available?
 
Check out .../Assets/XML/Interface/CIV4PlayerColorInfos.xml. Each PLAYERCOLOR_XXX actually has a ColorTypePrimary and a ColorTypeSecondary. But anyway, all the available colours should be there.

You might be able to add your own new colour scheme. I dunno though cause I haven't tried that.
 
If you want to use the existing colour schemes, you just have to change the one line in CIV4CivilizationInfos.xml (like from "PLAYERCOLOR_BLACK" to "PLAYERCOLOR_WHITE").

OTOH, I just had a go at putting in a new colour scheme. At the bottom of CIV4PlayerColorInfos.xml I added PLAYERCOLOR_GREEN_YELLOW:

Code:
 <PlayerColorInfo>
	<Type>PLAYERCOLOR_YELLOW</Type>
	<ColorTypePrimary>COLOR_PLAYER_YELLOW</ColorTypePrimary>
	<ColorTypeSecondary>COLOR_PLAYER_DARK_BLUE</ColorTypeSecondary>
	<TextColorType>COLOR_PLAYER_YELLOW_TEXT</TextColorType>
</PlayerColorInfo>
[b]<PlayerColorInfo>
	<Type>PLAYERCOLOR_GREEN_YELLOW</Type>
	<ColorTypePrimary>COLOR_PLAYER_GREEN</ColorTypePrimary>
	<ColorTypeSecondary>COLOR_PLAYER_YELLOW</ColorTypeSecondary>
	<TextColorType>COLOR_PLAYER_GREEN_TEXT</TextColorType>
</PlayerColorInfo>[/b]

This combo wasn't used before. But you have to make up a unique name because PLAYERCOLOR_GREEN was previously used with the secondary colour black.

So next I went to CIV4CivilizationInfos.xml and gave the Japanese this new scheme:

Code:
 <Type>CIVILIZATION_JAPAN</Type>
	<Description>TXT_KEY_CIV_JAPAN_DESC</Description>
	<ShortDescription>TXT_KEY_CIV_JAPAN_SHORT_DESC</ShortDescription>
	<Adjective>TXT_KEY_CIV_JAPAN_ADJECTIVE</Adjective>
	<Civilopedia>TXT_KEY_CIV_JAPAN_PEDIA</Civilopedia>
	<DefaultPlayerColor>PLAYERCOLOR_GREEN_YELLOW</DefaultPlayerColor>

And it worked: when I started a new game the Japanese had my new colour scheme. :)
 
jkp1187 said:
SO was the color...blue...? :D

Nevermind. Now I see what you mean about secondary colors.

I changed the color of England to Red, and Barbarians to white. It worked. Now, however, the English flag thingy is a white cross on a red background instead of vice-versa. Any way to change the color of *just* the banner?
 
You'll need to edit the color itself. For example, you chose england to Red.

if you open up the CIV4PlayColorInfos XML in the interface folder, you'll see the list of colors, if you scroll down to red you get this:

<PlayerColorInfo>
<Type>PLAYERCOLOR_RED</Type>
<ColorTypePrimary>COLOR_PLAYER_RED</ColorTypePrimary>
<ColorTypeSecondary>COLOR_PLAYER_WHITE</ColorTypeSecondary>
<TextColorType>COLOR_PLAYER_RED_TEXT</TextColorType>
</PlayerColorInfo>

Because these colors also show up on the player flag ingame, there is the secondary color that makes up the design, in this case, the cross.

The primary color will always equal your border color for the civ, so we leave that as red for endland. The secondary color is the stripe, if you want to have a blank red flag, then you can choose red again. Or you can come up with any other combo.

just a note; when editing the colors it's best to go ingame first to see what the color combo actually is, for example; here for englane we have the background the primary color, while the cross is the 2ndary, conversely for Japan (who originally has red in civ4) the Circle has the primary, where the background has the 2ndary.

So you'll need to figure those out first.

one rule that's always the same is that the primary color is always the color of the nation's borders.
 
I see. So if you specify primary color to be, for instance, RED, then the game looks in the other file, sees that if Red = primary, then white = secondary, then applies those colors to the cross pattern assigned to the English flag, and I end up with a white cross on a red background, looking much like the Danish flag.

I note that the flags in the scenarios (scenaria?) are different -- the English flag is the Union Jack, for example. So much more extensive mods of hte flag must be possible. Any thoughts on how I would go about changing the BASIC DESIGN of the flag?

To keep it simple, let's say I just want to change the coloring of the "St. George's Cross" flag, so that the PRIMARY color goes to the cross and the SECONDARY color goes to the background.

Again, I appreciate all the help you guys are giving here!
 
Okay, I noticed that in the Revolutionary War folder, there is an /Art/TeamColor directory that containes files such as these:

FlagDECAL_BetsyRoss.dds
FlagDECAL_France.dds
FlagDECAL_FranceAlternative.dds
FlagDECAL_FranceBleu.dds
FlagDECAL_Rebels.dds
FlagDECAL_Spain.dds
FlagDECAL_Spain1785.dds
FlagDECAL_UK.dds

I have searched the various Python and XML files, and none of them seem to point to these files or the *.dds files. I'd like to import these into my game and use them in a regular game, but I'm not sure how to do that.

The corresponding "CIV4CivilizationInfos" file in the Am Rev scenario seems simliar to the one for the default game.

Confused here.
 
I don't have the final version of the American Revolution Mod, but there should be in it's .../Assets/XML/Art folder a file called CIV4ArtDefines.xml. Here's a snippet from the corresponding file in the North Africa Mod:

Code:
<!--WW2NA - Civs-->
<CivilizationArtInfo>
	<Type>ART_DEF_CIVILIZATION_UK</Type>
	<Button>Art/Interface/Buttons/Civilizations/England.dds</Button>
	<Path>Art/Interface/TeamColor/FlagDECAL_UK.dds</Path>
	<bWhiteFlag>1</bWhiteFlag>
</CivilizationArtInfo>

(Note that CIVILIZATION_UK is a new civ in this Mod, it's not the same as CIVILIZATION_ENGLAND.)

This is where those FlagDECAL_XXX.dds files that you mentioned get referenced.

The corresponding "CIV4CivilizationInfos" file in the Am Rev scenario seems simliar to the one for the default game.

That's how Mods work. To make a Mod:

1. Create a folder in ...\Mods\ with the name of your Mod, e.g., MyMod.
2. In the folder MyMod, duplicate (where necessary) the file structure of vanilla game.

So if you want to mod the above XML file, CIV4ArtDefines.xml, thats in the vanilla .../Assets/XML/Art, you create a folder Assets in your new MyMod folder; then a folder XML in this new Assets folder; etc. Check out how Locutus, Dale, and Trip/Jon_S did it with the mods that came with the game.

3. Now modify CIV4ArtDefines.xml and put it in your .../MyMod/Assets/XML/Art folder.

4. Go to 2 and repeat for any other files you want to modify.

When you tell the game to load a Mod, it uses these new Mod files instead of it's vanilla files.
 
Looking for clarification:

For a mod do you need to duplicate the entire vanilla tree - or just the files that have changed. I.E. will the mod look for the missing files in the vanilla tree.
 
PeteT said:
You just need to duplicate the paths to the files you've changed.
Thanks! :D :goodjob:
 
Okay, but I was looking for a way to permanently change the file so that I didn't have to go to "mods" every time I played the game. I found the following text in the "vanilla" Civ4ArtDefines_Civilization file:
Code:
<Type>ART_DEF_CIVILIZATION_ENGLAND</Type>
			<Button>,Art/Interface/Buttons/Civilizations/England.dds,Art/Interface/Buttons/Civics_Civilizations_Religions_Atlas.dds,7,5</Button>
			<Path>Art/Interface/TeamColor/FlagDECAL_StGeorgeCross.dds</Path>
			<bWhiteFlag>0</bWhiteFlag>
		</CivilizationArtInfo>
		<CivilizationArtInfo>

I figured I would just put the "FlagDECAL_UK.dds" file in the appropriate path, and either change its name to "FlagDECAL_StGeorgeCross.dds" or just replace the language so that the code points to the path in the Mod file

Thing is, I can't find a "FlagDECAL_StGeorgeCross.dds" file anywhere. Odd. In fact, NONE of the FlagDecal files in the ArtDefines file are anywhere to be found. Well, I'll try to change the code to point to the UK flag in the mod file and see how that works.
 
Well, that didn't work.

[EDIT]

Whoops, typo when I entered the code. I got it to work. Problem is....well, part of the flag's colors are tied to the civ's primary color setting. So the flag won't work unless England has white as a primary color setting. But then that subverts my original goal of having barbarians colored white.

Surely there must be some way around that -- I mean, the British flag is properly colored in the Revolutionary War mod, while the British player has RED as his territorial color. Is there some easily (HA!) accessible XML coding that controls territory color?
 
Back
Top Bottom