How to Add custom color for Nation

asioasioasio

Fallout Scrubber
Joined
Mar 4, 2006
Messages
3,059
Location
Poland, EU
English isn't my primary language so sorry for mistakes :)

Ok So you have added new nations but they use the same colors as other. Or you hate this ..... color wich is used for ....... nation. I'll try to explain how to fix it :). I assume you have basic cIV modding (XML) and graphic knowledge.

1. You create or edit mod... (as usual)
copy / edit this files
Civilization4infos.xml in folder mod/assets/xml/civilizations
Civ4PlayerColorInfos.xml in folder mod/assets/xml/interface
Civ4ColorsVals.xml in folder mod/assets/xml/interface

2. In Civilization4infos.xml you'll have to change the name of color
we would change <DefaultPlayerColor> tag from PLAYERCOLOR_BLUE to PLAYERCOLOR_GREENCUSTOM

so we change:

<CivilizationInfo>
<Type>CIVILIZATION_AMERICA</Type>
<Description>TXT_KEY_CIV_AMERICA_DESC</Description>
<ShortDescription>TXT_KEY_CIV_AMERICA_SHORT_DESC </ShortDescription>
<Adjective>TXT_KEY_CIV_AMERICA_ADJECTIVE</Adjective>
<Civilopedia>TXT_KEY_CIV_AMERICA_PEDIA</Civilopedia>
<DefaultPlayerColor>PLAYERCOLOR_BLUE</DefaultPlayerColor>
.
.
.


to

<CivilizationInfo>
<Type>CIVILIZATION_AMERICA</Type>
<Description>TXT_KEY_CIV_AMERICA_DESC</Description>
<ShortDescription>TXT_KEY_CIV_AMERICA_SHORT_DESC </ShortDescription>
<Adjective>TXT_KEY_CIV_AMERICA_ADJECTIVE</Adjective>
<Civilopedia>TXT_KEY_CIV_AMERICA_PEDIA</Civilopedia>
<DefaultPlayerColor>PLAYERCOLOR_GREENCUSTOM</DefaultPlayerColor>
.
.
.


3. We choose our color and it's color values. We setup the color (in fact two colors - darker we should use for text). All colors are described as R(ed)G(reen)B(lue). For example our desired green colors are (lighter - for look of our nation on map, darker for text):
kolorkinp1.jpg

So we would need (probably everything including M$ Paint will work here) graphic software to get this values - I recommend and explain it in free GIMP

a) click on the main (foreground) color button
gimp01ct0.jpg


b) choose desired color
gimp02kq0.jpg


c) and look on the R G B color values

4. Transform the RGB color values to language of civ4
This is how we do this - we'll make proportion
In graphic program color values are from 0 to 255
and in cIV is from 0.00 to 1.00 (i use two places after coma but if you want to be more accurate you can use more places after coma)

So 1.00 in civ means 255
and x means 58 in R value in graphic program
1.00 ----------- 255
x-----------------58
and x=1.00*58/255=0.23
We follow this for G B values of light green color and R G B values of dark green color

5. Add new tags In Civ4ColorsVals.xml and type translated values
note: in COLOR_PLAYER_GREENCUSTOM <fRed> = x = 0.23 = this is what we get after making proportion

<ColorVal>
<Type>COLOR_PLAYER_GREENCUSTOM</Type>
<fRed>0.23</fRed>
<fGreen>0.53</fGreen>
<fBlue>0.25</fBlue>
<fAlpha>1.00</fAlpha>
</ColorVal>
<ColorVal>
<Type>COLOR_PLAYER_GREENCUSTOM_TEXT</Type>
<fRed>0.16</fRed>
<fGreen>0.41</fGreen>
<fBlue>0.18</fBlue>
<fAlpha>1.00</fAlpha>
</ColorVal>


6. In Civ4PlayerColorInfos.xml add new tags

<PlayerColorInfo>
<Type>PLAYERCOLOR_GREENCUSTOM</Type>
<ColorTypePrimary>COLOR_PLAYER_GREENCUSTOM</ColorTypePrimary>
<TextColorType>COLOR_PLAYER_GREENCUSTOM_TEXT</TextColorType>
</PlayerColorInfo>


In <Type> you add the name used in Civilization4infos.xml
In <ColorTypePrimary> Your primary color added in Civ4ColorsVals.xml
In <TextColorType> Your text color added in Civ4ColorsVals.xml

That's it :) :goodjob:
 
Reserved for Q and A or future updates
 
Hmm it's directly in Civ4 - Creation & Customization so i didn't saw this. I think it can be combined - it's supossed to be tutorial and there's Q A form so it could explain or expand some parts
 
Back
Top Bottom