Icon replacement

Zorro 695

Chieftain
Joined
Feb 22, 2008
Messages
62
Location
Perth, Australia
Is there a way to change a Tech Icon?
Specifically, I want to change the TECH_RAILROAD icon in one of my mods. The steam train image looks out of place...
The new icon is ready to go, but I don't know how to place it.
Would it be something like:
<Update>
Where Tech = Tech_Railroad, set <IconAtlas>XXX</IconAtlas>, set <PortraitIndex>0</PortraitIndex>
</Update>

What is the appropriate formula?
I'm not changing anything else about the Tech, just its Icon.

TIA :)
 
You have it, but then you need to add the atlas:
Code:
<IconTextureAtlases>
    <Row>
        <Atlas>XXX</Atlas>
        <IconSize>256</IconSize>
        <Filename>XXX256.dds</Filename>
        <IconsPerRow>1</IconsPerRow>
        <IconsPerColumn>1</IconsPerColumn>
    </Row>
    <Row>
        <Atlas>XXX</Atlas>
        <IconSize>214</IconSize>
        <Filename>XXX214.dds</Filename>
        <IconsPerRow>1</IconsPerRow>
        <IconsPerColumn>1</IconsPerColumn>
    </Row>
    <Row>
        <Atlas>XXX</Atlas>
        <IconSize>128</IconSize>
        <Filename>XXX128.dds</Filename>
        <IconsPerRow>1</IconsPerRow>
        <IconsPerColumn>1</IconsPerColumn>
    </Row>
    <Row>
        <Atlas>XXX</Atlas>
        <IconSize>80</IconSize>
        <Filename>XXX80.dds</Filename>
        <IconsPerRow>1</IconsPerRow>
        <IconsPerColumn>1</IconsPerColumn>
    </Row>
    <Row>
        <Atlas>XXX</Atlas>
        <IconSize>64</IconSize>
        <Filename>XXX64.dds</Filename>
        <IconsPerRow>1</IconsPerRow>
        <IconsPerColumn>1</IconsPerColumn>
    </Row>
    <Row>
        <Atlas>XXX</Atlas>
        <IconSize>45</IconSize>
        <Filename>XXX180.dds</Filename>
        <IconsPerRow>4</IconsPerRow>
        <IconsPerColumn>4</IconsPerColumn>
    </Row>
</IconTextureAtlases>

Then you need to do the appropriate resizing. Note the icons per row/column for the last one, for the 45x45 icon. The DDS must be a multiple of 4, so after you've resized your icon to 45x45 properly, you'll want to increase the canvas size to 180x180, pinning your existing canvas to the upper left, corresponding to PortraitIndex 0.

EDIT: Remember to set all your dds icons to VFS=true.
 
In addition to what Nutty said (which tells the game all the information regarding the new files and the icon)

You must then include this:

Code:
	<Technologies>
		<Update>
			<Where Type="TECH_RAILROAD" />
			<Set IconAtlas="[COLOR="Red"]ATLASNAME[/COLOR]" />
		</Update>
		<Update>
			<Where Type="TECH_RAILROAD" />
			<Set PortraitIndex="[COLOR="Red"]0[/COLOR]" />
		</Update>
	</Technologies>

replacing "ATLASNAME" with the atlas name that you will give to your new file (the same that you will write between <Atlas> and </Atlas>). You may leave "0" if the right icon is the first one in the file.
 
Thanks Nutty and Ryoga! You probably saved me hours of frustration and head scratching.

I'd forgotten about the 214 size dds and wasn't sure how to word the 'Update' part.

You'll be pleased to know that the new Icon works beautifully!

Thanks again.
 
You can do it in one update:

Code:
	<Technologies>
		<Update>
			<Where Type="TECH_RAILROAD"/>
			<Set IconAtlas="[COLOR="Red"]ATLASNAME[/COLOR]" PortraitIndex="[COLOR="Red"]0[/COLOR]"/>
		</Update>
	</Technologies>
 
Top Bottom