Difference between revisions of "Color Palettes - XCOM:EU 2012"

From Nexus Mods Wiki
Jump to: navigation, search
(Molded better to template, added example)
m (updated data)
Line 1: Line 1:
 
==Overview==
 
==Overview==
  
The Color Palettes used in the Customization options in the Barracks are populated by XComGame.XComContentManager. The native functions in this class are directed by entries in DefaultContant.ini
+
The '''Color Palettes''' used in the Customization options in the Barracks are populated by ''XComGame.XComContentManager''. The native functions in this class are directed by entries in '''DefaultContant.INI'''.
  
 
<code>
 
<code>
Line 16: Line 16:
 
</code>
 
</code>
  
Each of these links a Palette type to an ArchetypeName string, which the native function GetArchetypeFromCache uses to locate the desired object in the upk files.
+
Each of these links a Palette type to an ''ArchetypeName'' string, which the native function ''GetArchetypeFromCache'' uses to locate the desired object in the UPK files.
  
The various color palettes are contained in the UnitPalettes object, located in Startup.upk. Here the arrays can be directly edited.
+
The various color palettes are contained in the ''UnitPalettes'' object, located in '''Startup.UPK'''. Here the arrays can be directly edited.
  
 
==Programs and Tools==
 
==Programs and Tools==
  
As these are bare data structures, no decompiler is necessary. All that is needed is a Hex editor, such as [http://mh-nexus.de/en/hxd/ HxD].
+
As these are bare data structures, no decompiler is necessary. All that is needed is a Hex editor, such as [http://mh-nexus.de/en/hxd/ HxD].<br>
  
 
Though it is still in development, Wasteland Ghosts' [http://www.nexusmods.com/xcom/mods/448/? UPKUtils] tool will include the functionality to expand function and object size, and so could be used to indefinitely extend the color palettes.
 
Though it is still in development, Wasteland Ghosts' [http://www.nexusmods.com/xcom/mods/448/? UPKUtils] tool will include the functionality to expand function and object size, and so could be used to indefinitely extend the color palettes.
 +
 +
(For these and other tool descriptions and links, see [[Modding Tools - XCOM:EU 2012]].)
  
 
==Code Breakdown==
 
==Code Breakdown==
Line 53: Line 55:
 
   92 03 00 00 00 00 00 00  
 
   92 03 00 00 00 00 00 00  
 
</code>
 
</code>
Only the ArmorTint palette uses the Secondary Colors. In other palettes, all four 4-Byte chunks in the Secondary Color field are replaced with CC CC CC CC.
+
Only the ''ArmorTint'' palette uses the Secondary Colors. In other palettes, all four 4-Byte chunks in the Secondary Color field are replaced with "CC CC CC CC".
 
<code>
 
<code>
 
   {Object Ending}
 
   {Object Ending}
Line 62: Line 64:
 
==Example==
 
==Example==
  
For the first four entries in ArmorTint, the Primary and Secondary RGB values have both been replaced with (from left to right)
+
For the first four entries in ''ArmorTint'', the Primary and Secondary '''RGB''' values have both been replaced with (from left to right)
  
 
<code>
 
<code>

Revision as of 07:23, 22 December 2013

Overview

The Color Palettes used in the Customization options in the Barracks are populated by XComGame.XComContentManager. The native functions in this class are directed by entries in DefaultContant.INI.

 ColorPaletteInfo=(Palette=ePalette_HairColor,ArchetypeName="UnitPalettes.HairColor")
 ColorPaletteInfo=(Palette=ePalette_ShirtColor,ArchetypeName="UnitPalettes.ShirtColor")
 ColorPaletteInfo=(Palette=ePalette_PantsColor,ArchetypeName="UnitPalettes.PantsColor")
 ColorPaletteInfo=(Palette=ePalette_FormalClothesColor,ArchetypeName="UnitPalettes.FormalClothesColor")
 ColorPaletteInfo=(Palette=ePalette_CaucasianSkin,ArchetypeName="UnitPalettes.CaucasianSkin")
 ColorPaletteInfo=(Palette=ePalette_AfricanSkin,ArchetypeName="UnitPalettes.AfricanSkin")
 ColorPaletteInfo=(Palette=ePalette_HispanicSkin,ArchetypeName="UnitPalettes.HispanicSkin")
 ColorPaletteInfo=(Palette=ePalette_AsianSkin,ArchetypeName="UnitPalettes.AsianSkin")
 ColorPaletteInfo=(Palette=ePalette_EyeColor,ArchetypeName="UnitPalettes.EyeColor")
 ColorPaletteInfo=(Palette=ePalette_ArmorTint,ArchetypeName="UnitPalettes.ArmorTint")

Each of these links a Palette type to an ArchetypeName string, which the native function GetArchetypeFromCache uses to locate the desired object in the UPK files.

The various color palettes are contained in the UnitPalettes object, located in Startup.UPK. Here the arrays can be directly edited.

Programs and Tools

As these are bare data structures, no decompiler is necessary. All that is needed is a Hex editor, such as HxD.

Though it is still in development, Wasteland Ghosts' UPKUtils tool will include the functionality to expand function and object size, and so could be used to indefinitely extend the color palettes.

(For these and other tool descriptions and links, see Modding Tools - XCOM:EU 2012.)

Code Breakdown

Each palette object consists of a header and footer sandwiching all the individual color options.

 {Object Header}
 01 00 00 00 28 02 00 00 00 00 00 00 22 00 00 00 00 00 00 00 
    04 0D {Object size-64, reverse order,} 
 00 00 00 00 00 00 
    20 {# of Entries} 
 00 00 00

Each color in the palette has an entry in the body of the object.

 {Entry}
 DE 03 00 00 00 00 00 00 02 0B 00 00 00 00 00 00 10 00 00 00 00 00 00 00 40 03 00 00 00 00 00 00 
 {Primary Color}
    3B FF 9C 3E {R - 4 bytes, reverse order}
    48 63 11 3E {G - 4 bytes, reverse order}
    36 AB 17 3D {B - 4 bytes, reverse order}
    00 00 80 3F {Unknown - 4 bytes}
 92 04 00 00 00 00 00 00 02 0B 00 00 00 00 00 00 10 00 00 00 00 00 00 00 40 03 00 00 00 00 00 00 
 {Secondary Color}
    27 9C 5F 3D {R - 4 bytes, reverse order}
    D1 7C 36 3D {G - 4 bytes, reverse order}
    C1 EF B4 3B {B - 4 bytes, reverse order}
    00 00 80 3F {Unknown - 4 bytes}
 92 03 00 00 00 00 00 00 

Only the ArmorTint palette uses the Secondary Colors. In other palettes, all four 4-Byte chunks in the Secondary Color field are replaced with "CC CC CC CC".

 {Object Ending}
 55 00 00 00 00 00 00 00 0E 03 00 00 00 00 00 00 04 00 00 00 00 00 00 00 
    20 {# of Entries} 
 00 00 00 92 03 00 00 00 00 00 00

Example

For the first four entries in ArmorTint, the Primary and Secondary RGB values have both been replaced with (from left to right)

 00 00 00 50 00 00 00 50 00 00 00 50 {All values far higher than normally used}
 00 00 00 00 00 00 00 00 00 00 00 00 {Entirely colorless}
 1C 43 25 41 1C 43 25 41 1C 43 25 41 {Somewhat whiter than default white}
 00 00 00 00 00 00 00 43 00 00 00 00 {Ridiculously green}

Adjusted XCOM Pallettes.jpg

Related