How to mod civ colors?

ShroudedMist said:
Speaking of colors.

Has anyone looked into modding the opacity of your civilizations cultural area and its boundary lines? On the main map it's damn hard to see when you bump into a player's area, especially in certain terrains.

I have to admit, I have not run into this problem. Still, does anyone have an idea of where the cultural/boundary line code is located?
 
I have run into a snag, maybe someone else can help.

I wanted to add a new color to my new modded civilization so it wouldn't clash. So in my mod's Assets\XML\Interface I edited CIV4ColorVals.xml to include the following:

Code:
<ColorVal>
	<Type>COLOR_PLAYER_NAVY_BLUE</Type>
	<fRed>0.21</fRed>
	<fGreen>0.40</fGreen>
	<fBlue>1.00</fBlue>
	<fAlpha>1.00</fAlpha>
</ColorVal>
<ColorVal>
	<Type>COLOR_PLAYER_NAVY_BLUE_TEXT</Type>
	<fRed>0.698</fRed>
	<fGreen>0.776</fGreen>
	<fBlue>1.00</fBlue>
	<fAlpha>1.00</fAlpha>
</ColorVal>

I realize it's actually the same color as BLUE, but I tried using different values last night had problems, so I wanted to take one of the possible problems (new color's numbers) out of the mix.

Then I went into CIV4PlayerColorInfos.xml and added the following:

Code:
<PlayerColorInfo>
	<Type>PLAYERCOLOR_NAVY_BLUE</Type>
	<ColorTypePrimary>COLOR_PLAYER_NAVY_BLUE</ColorTypePrimary>
	<ColorTypeSecondary>COLOR_PLAYER_YELLOW</ColorTypeSecondary>
	<TextColorType>COLOR_PLAYER_NAVY_BLUE_TEXT</TextColorType>
</PlayerColorInfo>

Last, in CIV4CivilizationInfos.xml I edited the tag under my new civ to be:

Code:
<DefaultPlayerColor>PLAYERCOLOR_NAVY_BLUE</DefaultPlayerColor>

Should work, right? I can't see anything I'm doing wrong. Yet when I load the mod, when it's doing the InitXML before the game even starts it gives the following error:

Code:
Tag:PLAYERCOLOR_NAVY_BLUE in Info class was incorrect
Current XML file is Civilizations/CIV4CivilizationsInfos.xml

For the life of me I can't see what I have done wrong. But these sorts of problems have plagued me from the very beginning with this mod. I put in everything right, yet it doesn't work (I don't have a cache folder, I'm on Windows 2000).
 
Is there another function you have to add someplace to get it to recognize that you've added a new color?

If youfeel like re-arranging colors, "DARK_RED" exists as a pre-defined color -- you could, perhaps, color France dark red, and give "DARK_BLUE" to your new civ. Just a thought.
 
As for another place to change the colors, I'm not sure. PeteT claimed that when he made a new PLAYERCOLOR scheme in CIV4PlayerColorInfos.xml that it worked. Granted, he used existing colors and didn't try to make new colors themselves like I did. But I'm not getting an error in CIV4PlayerColorInfos.xml, my error is in CIV4CivilizationInfos.xml. As for that, I don't know why as all I'm doing is referencing a tag in CIV4PlayerColorInfos.xml that looks set up correctly to me.

I also looked in the Turkey mod. He made a brand new color scheme (Crimson), pointed Turkey to that scheme in CIV4CivilizationInfos.xml, set up the new scheme in CIV4PlayerColorInfos.xml, then defined the new color variables in CIV4ColorVals.xml. I even took his colors directly from his files and put them in mine . . . same error. For some reason, my CIV4CivilizationInfos.xml won't accept anything new for a color scheme.

And I noticed DARK_RED last night. I dropped DARK_RED into my civ, just to try it, it did work. It's almost like it doesn't want any new colors other than the ones already set up by the game. But if that's the case, then how does the Turkey mod do it? I'm so very confused. It's like I keep hitting 2+2 on my calculator and it keeps coming up 5 (sometimes it comes up 3), while for everyone else in the world it comes up 4!

One thing I was curious about. In the schema, a lot of things say textonly, but for some of the color info it says "eltonly". What is "elt"? Can some programmer (or at least someone more closely resembling a programmer than myself) chime in on that one?
 
One thing I was curious about. In the schema, a lot of things say textonly, but for some of the color info it says "eltonly". What is "elt"?

Code:
<ElementType name="PlayerColorInfos" content="eltOnly">

This line states that we will have an element with the name 'PlayerColorInfos' that will only contain other elements and no other values.

The above was adapted from A Quick Introduction to XML Schemas , a brief but useful tutorial.

Fabius, if you haven't sorted it out yet, could you zip up the three xml files that you changed and attach them to a post. I copied and pasted from your first post but didn't get the error that you mentioned.
 
Fabius, I went through the same procedure as you to make nine new player colours for a mod. These were paired up with new flags and eventually they'll replace the names of towns, leader names and such. The mod is called 'Aberrant', based on a Diplomacy variant.

Here's the changes I made for Byzantium, which was a sort of salmon-pink colour. Hopefully this should help you out.

Firstly I worked out the new colours I needed : The RGB value was 253,139,139 - each value has to be normalised to make it fit into Civ's 0 to 1 colour value range (divide the values by 255). That gave me 0.99, 0.545 and 0.545.

The first XML edited was the Assets\XML\Interface\CIV4ColorVals.xml file. I added this script to the bottom end of the main script:

<ColorVal>
<Type>COLOR_PLAYER_BYZA</Type>
<fRed>0.99</fRed>
<fGreen>0.545</fGreen>
<fBlue>0.545</fBlue>
<fAlpha>1.00</fAlpha>
</ColorVal>

Next I needed to change the Civ that was going to become Byzantine to use this new colour. This is handled by the Assets\XML\CivilizationsCIV4CivilizationInfos.xml file, and you only need to edit two lines there (for each civ):

<DefaultPlayerColor>PLAYERCOLOR_BYZA</DefaultPlayerColor>
<ArtDefineTag>ART_DEF_CIVILIZATION_BYZA</ArtDefineTag>

Next I needed to add the links to the new flag, and that's done by adding to the end of the Assets\XML\Art\CIV4ArtDefines_Civilization.xml file. Here I've used spain's code as a template. Eventually I'll draw buttons for the new nations too.

<CivilizationArtInfo>
<Type>ART_DEF_CIVILIZATION_BYZA</Type>
<Button>,Art/Interface/Buttons/Civilizations/Spain.dds,Art/Interface/Buttons/Civics_Civilizations_Religions_Atlas.dds,1,6</Button>
<Path>Art/Interface/TeamColor/flag_byza.dds</Path>
<bWhiteFlag>1</bWhiteFlag>
</CivilizationArtInfo>

Last I added the new colours to the Assets\XML\InterfaceCIV4PlayerColorInfos.xml file.

<PlayerColorInfo>
<Type>PLAYERCOLOR_BYZA</Type>
<ColorTypePrimary>COLOR_PLAYER_BYZA</ColorTypePrimary>
<ColorTypeSecondary>COLOR_PLAYER_PEACH</ColorTypeSecondary>
<TextColorType>COLOR_PLAYER_WHITE_TEXT</TextColorType>
</PlayerColorInfo>

And there you have it.
 
Screenshot of the Byzantine border colour in-game. Looks like some Spanish git wanted to get in the screenshot too.


byzantines.jpg
 
For colors:

Files needed:
  • \Assets\xml\interface\CIV4ColorVals.xml
  • \Assets\xml\interface\CIV4PlayerColorInfos.xml
  • \Assets\xml\civilizations\CIV4CivilizationInfos.xml

CIV4ColorVals.xml

here, you put your new color:

Code:
		<ColorVal>
			<Type>COLOR_PLAYER_BLUEGREEN</Type>
			<fRed>0.220</fRed>
			<fGreen>0.70</fGreen>
			<fBlue>0.51</fBlue>
			<fAlpha>1.00</fAlpha>
		</ColorVal>
		<ColorVal>
			<Type>COLOR_PLAYER_BLUEGREEN_TEXT</Type>
			<fRed>0.213</fRed>
			<fGreen>0.70</fGreen>
			<fBlue>0.512</fBlue>
			<fAlpha>1.00</fAlpha>
		</ColorVal>

be careful to add the COLOR_PLAYER_XXX_TEXT (where XXX is the color) to the file... or crash :p.

CIV4PlayerColorInfos.xml

Here you will define the valors linked to the color

Code:
		<PlayerColorInfo>
			<Type>PLAYERCOLOR_BLUEGREEN</Type>
			<ColorTypePrimary>COLOR_PLAYER_BLUEGREEN</ColorTypePrimary>
			<ColorTypeSecondary>COLOR_PLAYER_DARKVIOLET</ColorTypeSecondary> <!--COLOR_PLAYER_DARK_BLUE-->
			<TextColorType>COLOR_PLAYER_BLUEGREEN_TEXT</TextColorType>
		</PlayerColorInfo>

CIV4CivilizationInfos.xml

Finally you have to put it in the civilizations entries:

Code:
	<DefaultPlayerColor>PLAYERCOLOR_BLUEGREEN</DefaultPlayerColor>

Find an entry and replace the color with your color.
BE CAREFUL: Don't put same color for 2 civilizations.... if you do that it would work for some turns until... return to windows :)


For flags:

Files needed:
  • \Assets\xml\art\CIV4ArtDefines_Civilization.xml
  • \Assets\xml\civilizations\CIV4CivilizationInfos.xml

CIV4ArtDefines_Civilization.xml

Code:
		<CivilizationArtInfo>
			<Type>ART_DEF_CIVILIZATION_PERSIA</Type>
			<Button>,Art/Interface/Buttons/Civilizations/Persia.dds,Art/Interface/Buttons/Civics_Civilizations_Religions_Atlas.dds,6,6</Button>
			<Path>Art/Interface/TeamColor/Persia.dds</Path>
			<bWhiteFlag>0</bWhiteFlag>
		</CivilizationArtInfo>

Type: the entry. You can define it in the file \Assets\xml\civilizations\CIV4CivilizationInfos.xml

Button: the picture used in the civilopedia. Here I don't have tried yet to put a new button, I personnally use the existing one...

Path: here is the entry for the flag. put here the link to your flag you want to use.
If you use the "Civilization 4\CustomAssets\art\interface\teamcolor" folder you can use for the link: "Art/Interface/TeamColor/"

Exemple you make a new flag for Russia. You name it "Russia.dds" and put it in the "Civilization 4\CustomAssets\art\interface\teamcolor" folder. In the path field you will put: Art/Interface/TeamColor/Russia.dds

bWhiteFlag: tell the game if the flag is a white flag (valor: "1") or a black flag (valor: "0").

CIV4CivilizationInfos.xml

in this file you can precise the entries used for the flag and civilopedia button.

Code:
	<ArtDefineTag>ART_DEF_CIVILIZATION_RUSSIA</ArtDefineTag>


Making a flag

You need this plug in from Nvidia for Photoshop. This permit Photoshop to load the DDS files

http://developer.nvidia.com/object/photoshop_dds_plugins.html
Plug in for gimp is here: http://nifelheim.dyndns.org/~cocidius/dds/

After go into the directory: Assets\art\interface\teamcolor

Open one and edit it. When you are satisfied save it as DXT3 or DXT5.
Be careful with the alpha channel, if you don't define them.
The white tell to the program what is not displayed in the game, the black tell to the game what is displayed.

The way to make simply a new flag is to copy one picture in the RGB channels and fill the alpha channel in black.
Finally you configure in "CIV4ArtDefines_Civilization.xml" the flag as a white flag.
And you have a new flag in your game...

Hope this will help some ;).
 
jkp1187 said:
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?

i did that too and ended up with the damned Danish flag!! And for some reason the Jap's flag reversed colours too!

I would just like to say that I have some knowledge of programming and I have so enjoyed tinkering with things like traits, colours, techs, etc.

It makes the game more personal I feel!
 
Hentooth said:
i did that too and ended up with the damned Danish flag!! And for some reason the Jap's flag reversed colours too!

I would just like to say that I have some knowledge of programming and I have so enjoyed tinkering with things like traits, colours, techs, etc.

It makes the game more personal I feel!

You need to alter the (equivalent) boldfaced code below (stealing the code from above):

Code:
 <CivilizationArtInfo>
<Type>ART_DEF_CIVILIZATION_ENGLAND</Type>
<Button>,Art/Interface/Buttons/Civilizations/<snip></Button>
<Path>Art/Interface/TeamColor/flag_St_George.dds</Path>
[B]<bWhiteFlag>1</bWhiteFlag>[/B]
</CivilizationArtInfo>

Make sure that the "Whiteflag" = "1", not "0". This should stop the bleed-thru on the English flag. Not sure how it'll work on the Japanese flag (I changed england to "Dark Red" and changed Japan back to "Red".) I also switched the English flag to the Union Jack from the American Revolution mod included with your game.

(You know what, I'm not sure this will work....it worked for me b/c I actually just started using the pre-drawn flags from the Am Rev mod, which were pre-drawn.)
 
I am trying to change the color of a civilization in a mod I have downloaded, I have done it by changing the values. However, I am trying to find a specific color and have tried over 30 times now and can't figure out how I can get the color I want. Does anyone know what values I would have to set

<fRed>0.14</fRed>
<fGreen>0.00</fGreen>
<fBlue>0.35</fBlue>
<fAlpha>1.00</fAlpha>

For a sky blue , similar to the Greek empire, I can't find the right color combination and am getting slightly bored now!

Many thanks!
 
Does anyone know how to find the color value for the txt color I found the color I wanted but how do you figure out for the txt I notice that the values are higher than the color type or does it make a difference. Plz help.
 
Does anyone know if there's a way to do this for a saved/current game? In my current game: Hannibal shares borders with William Orange, Ghenghis shares borders with Sitting Bull, and Alexander shares borders with Darius. When looking at the map (the main screen or the world map on the lower right), it's difficult to see where one country ends and the other begins. For example, the Carthaginians and the Dutch look like one big orange country. Can this be changes in a current game? Thanks in advance

By the way, I'm using Lt. Bob's 40 civ mod with Bhuric's unofficial patch.
 
I don't know if there's a way to do it, other than hacking into the save file directly.) I've heard that if you create a scenario via WorldBuilder, there is a editable text file that's generated wherein you can alter the characteristics of various civs.
 
I did everything you recommended, but when I tried to save the file, I got a box saying that it could not save that file. Something about not finding the path. Any suggestions? I love to play the English, but I can't see my cities.
 
I did everything you recommended, but when I tried to save the file, I got a box saying that it could not save that file. Something about not finding the path. Any suggestions? I love to play the English, but I can't see my cities.

I'm not sure what would cause that. I've changed the color of the English to Dark Red (and Russia to White) in my NextWar mod -- perhaps take a look at how it was done there.
 
can someone tell me how to access my editor? i bought civilization III Complete edition. i really just want to know how to access the editor and change civ colors. If someone could write step by step directions on how to do that that would be great thanks!
 
Back
Top Bottom