View Full Version : HOW TO create a decalc flag and use it with proper colors


LAnkou
Nov 15, 2005, 06:33 PM
thanks to WaxonWaxov for this, it may help a lot of people for creating flags in decalc

I just create a 128x128 pixel .PNG file in Phtoshop with a transparent background.

Then I add a WHITE pattern to it (say a skull and crossbones)

save it as a .PNG

Use .dds converter to convert it to .dds

When you choose your civ's color scheme. it has TWO colors. a Primary and a secondary. For example. The DARK_BLUE color scheme has a Primary color fo dark blue and a secondary of yellow.

The transparent part of your .dds with appear the PRIMARY color and the white part of your .dds will appear as the Secondary.

the color scheme of your civ can be found in the Civilization4infos.xml file in your mod/assets/xml/civilizations directory

it shows like this:

<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>

see the "PLAYERCOLOR_BLUE"? that's the color scheme of the civ

now, go into the mod/assets/xml/interface directory

search for the PLAYERCOLOR_BLUE in the Civ4PlayerColorInfos.xml

it shows like this:

<PlayerColorInfo>
<Type>PLAYERCOLOR_BLUE</Type>
<ColorTypePrimary>COLOR_PLAYER_BLUE</ColorTypePrimary>
<ColorTypeSecondary>COLOR_PLAYER_WHITE</ColorTypeSecondary>
<TextColorType>COLOR_PLAYER_BLUE_TEXT</TextColorType>
</PlayerColorInfo>

so the scheme is Blue(principal) and White(secondary)

if you look after a particular scheme (the one of France, Incans), just look in the first file the <PlayerColorInfo> under the civ name.

next episode, add colors and colors schemes

LAnkou
Nov 15, 2005, 06:33 PM
now, we gonna try to add some colors:
you have to go in Civ4ColorsVals.xml

thanks to wikipedia for the following:

This file stores information regarding the modifiable color values for civilizations and the UI.

Those that modify the default colors of civilizations are designated with COLOR_PLAYER_[the name of the color]. Below the name of the color are RGBA values for the color.

For example, in this entry:

<ColorVal>

<Type>COLOR_PLAYER_DARK_CYAN</Type>
<fRed>0.00</fRed>
<fGreen>0.54</fGreen>
<fBlue>0.55</fBlue>
<fAlpha>1.00</fAlpha>

</ColorVal>

<fRed>, <fGreen> and <fBlue> tags give the RGB values of the color on a scale of 0 to 1 with 0 being the absence of the color and 1 being complete saturation. The <fAlpha> tag should always be set to 1 for COLOR_PLAYER types.

For each COLOR_PLAYER entry there is a corresponding COLOR_PLAYER_[the name of the color]_TEXT which defines the color of the leader/username in the score pane above the minimap and other civ specific text displays. It should always be brighter than the corresponding COLOR_PLAYER value, since it appears over the UI's default dark blue color in most situations, making dark colors difficult to see.

now, we gonna try to write another set of color scheme for a civ. Go to Civ4colorplayerInfos.xml

thanks wiki again:
This file defines the default combinations of colors from CIV4ColorVals into PLAYERCOLOR_[the name of the color] structs.

For example in:

<PlayerColorInfo>

<Type>PLAYERCOLOR_BLUE</Type>
<ColorTypePrimary>COLOR_PLAYER_BLUE</ColorTypePrimary>
<ColorTypeSecondary>COLOR_PLAYER_WHITE</ColorTypeSecondary>
<TextColorType>COLOR_PLAYER_BLUE_TEXT</TextColorType>

</PlayerColorInfo>

<ColorTypePrimary> defines the color for the civilization's borders, the primary color of its flag, and certain defined sections of its units. <ColorTypeSecondary> defines the secondary color of its flag (most often the symbol, but this is determined by the content of the flag's dds file) as well as certain defined sections of its units. <TextColorType> defines the color of the leadername/username in the panel above the minimap which shows the current scores.

To add a new color or a new schem, you don't have to delete an existing, on the opposite, you shouldn't do that since it will cause some problem to the vanilla civ.

Just add them following the previous schem for color

now you can define the scheme and colors for your civs and have the flag properly designed

Enjoy

Velja
Nov 18, 2005, 08:14 AM
I want to make a three-color-flag.
OK, I have primary, secondary color......but I still miss one!!!
What should I do??

LAnkou
Nov 18, 2005, 11:07 PM
if you have more than two color, it can't be decal Flag...

make your image, put the alpha channel to black and in the Artcivilisation xml files, put the whiteflag to 1
Normally, it should work...

Xeneise01
Nov 29, 2005, 04:37 PM
This is probably a stupid question but once you created a flag and converted it to .dds, where do you find the folder with the rest of the flags so you can use it in the game.

I looked at the path and says art/interface/teamcolors/DecalcFlag_star.dds
but I can't find teamcolors anywhere except in the Mods section (American Revolution, etc...)
Your help would be much appreciated.:confused:

LAnkou
Nov 29, 2005, 05:21 PM
you need to create it in your mod folder

the best advice i can give you is to download a (currently working) mod and look at the way it is construct in term of folders

Xeneise01
Nov 30, 2005, 12:49 PM
Thanks, I'll try that.

Shqype
Jan 09, 2006, 11:49 PM
Lankou, or anyone else that is familiar with Gimp 2.2, perhaps you can offer some assisstance.

I've been having trouble recently creating proper flag decals using Gimp... The transparency shows ingame as black, no matter what color it should be, but only the white comes to be the color it should be. What course of action should I take in creating a flag decal when using this program?

Also, I need to make a flag (non-decal) with 3 colors. How should I accomplish this with Gimp? How do I set the Alpha channel to black?

Your help would be appreciated.

wotan321
Jan 10, 2006, 08:37 PM
I'm having the same problem.... and in a month no one has come up with an answer?

keldath
Jan 11, 2006, 02:50 AM
hello all

i need help im unable to set the flags in mt mod right

it shows black or white....

LAnkou
Jan 11, 2006, 05:04 AM
as i don't use gimp i can't help you on this software

for the decal, do you set white flag on 1?

for the alpha channel, the best tip to find where to change it is to DL an existing flag, copy the alpha channel, and paste it over your new flag (works with photoshop)

HIH

wotan321
Jan 11, 2006, 08:30 AM
Well that does make perfect sense.... thanks.

keldath
Jan 11, 2006, 12:25 PM
what is alpha chanel? what to pste where ?
i played with 1 and 0 and got black and then white...

LAnkou
Jan 11, 2006, 02:53 PM
the alpha channel is a kind of layer (red, green, blue and alpha) that determine the transparency of your picture in software like photoshop or GIMP (none in paint, sorry).

all the actions described have to been done in the software used...

strategyonly
Jun 25, 2006, 10:51 AM
I am making my own flag, but when i try it, its shows up white. I have changed the the code from 0 to 1 , still white. When i tried the DDS Converter to see its says : Conversion from BMP to DDS using nvDXT started
Error [My.bmp] size = not a power of 2
Conversion failed.

I have my BMP sized to 119 X 128, with black alpha channel behind it. What am i doing wrong?
Also tried DXTBMP to convert to dds , no problem there. I think.
But still will not work, maybe i am putting it in the wrong files, so i will ask, where and how do i make/change flags to make them work correctly?? I have look for about thre hours now in the forum and i cant find a good flag on how to make them and put them in a certain civ?

0d1n3oo3Broad
Jun 26, 2006, 10:19 AM
The size for the flag´s graphics is usually 128 x 128. Probatly it´s the size of your bmps (119 x 128) why it won´t work.

strategyonly
Jun 26, 2006, 12:51 PM
Changed BMP to 128 X 128 still BMP to DDS converter says same thing. Not a power of 2???

0d1n3oo3Broad
Jun 26, 2006, 02:52 PM
be sure to save the dds-files as a dxt3-dds

or

try the way i do it:
1st: use DXTBmp (for me the best prog for dds-files)
2nd: open a aviable flagdecal_XX.dds
3rd: replace the graphics with your ones in the 128x128 format
4th: save the dds-file as your new flagdecal_YY.dds
5th: should work :)

strategyonly
Jun 26, 2006, 03:51 PM
EDIT: figured it out myself, thx.