View Full Version : Building Icons


Thalassicus
Jan 24, 2006, 03:27 PM
I have a question...I've been trying to get building icons to work, which show up as a black ! on the main map city production bar. I looked at Kael's mod (which uses custom building icons) and wasn't able to figure out what's causing this. Here's what I've done so far:

1) Created icon, converted to DDS and placed it in \art\interface\buttons\Buildings.

2) In CIV4ArtDefines_Building, set the Buildings field to <Button>Art/Interface/Buttons/Buildings/Shipyard.dds</Button>

The normal-size icon shows up exactly right with no problems, but the city production bar icon doesn't appear. Any idea what the problem might be?

RED DIAMOND
Jan 24, 2006, 03:42 PM
Alpha channel? I saw some guys talking about probs with that after editing if it was not saved right.:confused:

Thalassicus
Jan 24, 2006, 10:29 PM
That was my first guess (having had experiences with editing graphics in other games), but I've checked the channels, color mode, and some other things without finding anything that stood out as different. My unit icons work, but not the building icons, and I created them in the same manner.

The significant difference I see between units and buildings is that units have their <Button> line in CIV4UnitInfos, while buildings have it in their ArtDefines file. There must be some difference in format...

Here's the CIV4ArtDefines_Building.xml entry for one of the structures:

<BuildingArtInfo>
<Type>ART_DEF_BUILDING_SHIPYARD</Type>
<bAnimated>0</bAnimated>
<fScale>1.0</fScale>
<fInterfaceScale>0.8</fInterfaceScale>
<NIF>Art/Structures/Buildings/Harbor/Harbor.nif</NIF>
<KFM/>
<Button>,Art/Interface/Buttons/Buildings/Shipyard.dds</Button>
</BuildingArtInfo>

Kael
Jan 24, 2006, 10:31 PM
Don't know. But if you figure it out, definitly let me know.

TheLopez
Jan 24, 2006, 10:47 PM
That was my first guess (having had experiences with editing graphics in other games), but I've checked the channels, color mode, and some other things without finding anything that stood out as different. My unit icons work, but not the building icons, and I created them in the same manner.

The significant difference I see between units and buildings is that units have their <Button> line in CIV4UnitInfos, while buildings have it in their ArtDefines file. There must be some difference in format...

Here's the CIV4ArtDefines_Building.xml entry for one of the structures:

<BuildingArtInfo>
<Type>ART_DEF_BUILDING_SHIPYARD</Type>
<bAnimated>0</bAnimated>
<fScale>1.0</fScale>
<fInterfaceScale>0.8</fInterfaceScale>
<NIF>Art/Structures/Buildings/Harbor/Harbor.nif</NIF>
<KFM/>
<Button>,Art/Interface/Buttons/Buildings/Shipyard.dds</Button>
</BuildingArtInfo>

Thalassicus,

Check out my Military Bases mod, I have 3 new buildings and they work just fine for me.

ArbitraryGuy
Jan 24, 2006, 11:03 PM
Don't you need a term looking up the graphic in the buildings_atlas as well? The game pulls graphics from both the atlas and the individual icon. I've always done this and had no problems as you are experiencing.

Your button needs to maybe be as follows:

<Button>,Art/Interface/Buttons/Buildings/Shipyard.dds,Art/Interface/Buttons/Buildings_Atlas.dds,x,y</Button> where x and y are the column and row of the Shipyard graphic in the atlas. Make sure the alpha channels is correct in the atlas as well.

Good luck.

Thalassicus
Jan 24, 2006, 11:07 PM
I now know it's not the icon: I copied the icon for the Alchemy lab from FFH to test:

http://img90.imageshack.us/img90/3158/shipyardicon18bh.jpg

http://img90.imageshack.us/img90/2533/shipyardicon27up.jpg

The ArtDefines entries for the original alch lab building (which works) and the shipyard with test icon are the same other than name and model line:

Entry in Fall From Heaven:
<BuildingArtInfo>
<Type>ART_DEF_BUILDING_ALCHEMY_LAB</Type>
<bAnimated>0</bAnimated>
<fScale>1.0</fScale>
<fInterfaceScale>0.7</fInterfaceScale>
<NIF>Art/Structures/Buildings/Library/Library.nif</NIF>
<KFM/>
<Button>Art/Interface/Buttons/Buildings/Alchemylab.dds</Button>
</BuildingArtInfo>

Entry in mod:
<BuildingArtInfo>
<Type>ART_DEF_BUILDING_SHIPYARD</Type>
<bAnimated>0</bAnimated>
<fScale>1.0</fScale>
<fInterfaceScale>0.7</fInterfaceScale>
<NIF>Art/Structures/Buildings/Harbor/Harbor.nif</NIF>
<KFM/>
<Button>Art/Interface/Buttons/Buildings/Alchemylab.dds</Button>
</BuildingArtInfo>


So it's not the icon, nor XML entry...hmm...

[edit] TheLopez, it's with these custom building icons, which I'm replacing some of the default ones with for several buildings. The default ones worked ok up to that point.

ArbitraryGuy, I thought of that too. It wasn't necessary for many other mods, though, as far as I know (it works ok in FFH).

I'm thinking it might be a custom assets thing, going to move it to a Mod folder and see if it works.

Thalassicus
Jan 24, 2006, 11:29 PM
Aha! :) That was it.

There's probably a coding mistake in the function that adjusts files to fit the city production bar -- checks the standard files and Mods folders, but forgot CustomAssets. Might have been before that folder was implimented, who knows.

Master Lexx
Jan 25, 2006, 03:54 AM
??? CustomAssets? I use thm only for Blue Marble. If you need help, come into irc.irc-chat.net 6667 in #civmod.