[Help] A certain icon gets set to the default icon.

theGuitarist27

Chieftain
Joined
Nov 4, 2017
Messages
16
So as always when creating a civilization, you make the icon representing that civ. And so did I, in all the right sizes. And the icon works, in most cases. Except in two: when in the World Congress and next to the city name. There it seems to get replaced by the default icon, and I have no idea how to fix this. I've posted a link down below with screenshots of the intended and default icon. Hopefully anyone here can help me.
Thanks in advance

https://imgur.com/gallery/UoWnw
 
Did you omit the AlphaIconAtlas by any chance? (Several screens such as the religion overview and diplomacy screen use the alpha rather than the normal icon)
Code:
<Civilizations>
        <Row>
            <Type>CIVILIZATION_TRL_BOB_OMB_BATTLEFIELD</Type>
             <!--snip-->
            <PortraitIndex>0</PortraitIndex>
            <IconAtlas>TRL_BOBOMB_BATTLEFIELD_ICON_ATLAS</IconAtlas>
            <AlphaIconAtlas>TRL_BOBOMB_BATTLEFIELD_CIV_ICON_ALPHA_ATLAS</AlphaIconAtlas>
        </Row>
</Civilizations>
If that's not it you might be missing an icon size.
 
Well, I sure didn't include this code, thanks! Could you elaborate a bit more what I still need? I mean, all my icons are in A8R8B8G8 format, so in some way I do have an alpha value, but what do I have to do with the atlas? Make a new icon or index the same icon in the new atlas? And do I index the alpha atlas the same way as the normal atlas, or is there something else?
 
Well, I sure didn't include this code, thanks! Could you elaborate a bit more what I still need? I mean, all my icons are in A8R8B8G8 format,
Hmm I've always encoded my stuff in RGBA8 (using a GIMP plugin), but it seemed to work for you so w/e.


, but what do I have to do with the atlas? Make a new icon or index the same icon in the new atlas? And do I index the alpha atlas the same way as the normal atlas, or is there something else?
Your icon alpha needs to be in a different atlas at the same portraitIndex as your normal icon. Other than that the alpha atlas is the same as your normal atlas.
Spoiler :

My normal atlas:


My alpha atlas (consists of only 1 icon)

*actual icon sizes differ from what is shown here; the latter icon is zoomed in on.

As you can see the civ icon is at PortraitIndex = 0 in the first icon sheet. Also, the icon alpha for the civ icon is located at PortaitIndex = 0, but in a different icon sheet instead.

Note that the alpha civ icon is in white and transparent (and cannot really be any other colours!). The game automatically fills the white parts with the civ's foreground colour and the transparent parts with the civ's background colour.
This is similar to how unit flags are handled (though those do not necessarily have to be placed in a different atlas due to them having a separate alpha portrait index).
 
I think I get it now, thanks for the help!

Moderator Action: Moved to main C&C forum as that is where questions belong. leif
 
Last edited by a moderator:
Top Bottom