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

From Nexus Mods Wiki
Jump to: navigation, search
m (Updated references)
 
(One intermediate revision by the same user not shown)
Line 20: Line 20:
 
The various color palettes are contained in the ''UnitPalettes'' object, located in '''Startup.UPK'''. Here the arrays can be directly edited.  See also the following related wiki articles:  
 
The various color palettes are contained in the ''UnitPalettes'' object, located in '''Startup.UPK'''. Here the arrays can be directly edited.  See also the following related wiki articles:  
 
* [[Adding and changing art assets - XCOM:EU 2012]]
 
* [[Adding and changing art assets - XCOM:EU 2012]]
* [[Initial soldier appearance - XCOM:EU 2012|Initial soldier appearance]]
+
* [[Initial soldier appearance - XCOM:EU 2012]]
  
 
==Programs and Tools==
 
==Programs and Tools==
Line 76: Line 76:
 
[[File:Adjusted_XCOM_Pallettes.jpg|1000px|Adjusted XCOM Palettes]]
 
[[File:Adjusted_XCOM_Pallettes.jpg|1000px|Adjusted XCOM Palettes]]
  
==Related==
+
 
 +
== Related ==
 +
 
 
Referred to by this article:
 
Referred to by this article:
* [[Adding and changing art assets - XCOM:EU 2012]]
+
 
* [[Initial soldier appearance - XCOM:EU 2012|Initial soldier appearance]]
+
*[[Adding_and_changing_art_assets_-_XCOM:EU_2012]]  
* [[Modding Tools - XCOM:EU 2012]]
+
*[[Initial_soldier_appearance_-_XCOM:EU_2012]]  
* [[UPK File Format - XCOM:EU 2012]]
+
*[[Modding_Tools_-_XCOM:EU_2012]]  
* [[XComGame.upk]]
+
*[[UPK_File_Format_-_XCOM:EU_2012]]  
* [[Hex editing UPK files]]
+
*[[XComGame.upk|XComGame.upk]]  
* [[Hex values XCOM Modding]]
+
*[[Hex_editing_UPK_files|Hex editing UPK files]]  
 +
*[[Hex_values_XCOM_Modding|Hex values XCOM Modding]]  
 +
 
 
That refer to this article:
 
That refer to this article:
* [[Adding and changing art assets - XCOM:EU 2012]]
 
* [[Initial soldier appearance - XCOM:EU 2012|Initial soldier appearance]]
 
  
[[Category:XCOM Modding]]
+
*[[Adding_and_changing_art_assets_-_XCOM:EU_2012]]
[[Category:Game_Files_%26_Modding_-_XCOM:EU_2012]]
+
*[[Initial_soldier_appearance_-_XCOM:EU_2012]]
[[Category:XCOM]]
+
 
 +
[[Category:XCOM Modding]] [[Category:Game Files & Modding - XCOM:EU 2012]] [[Category:XCOM]] [[Category:Mod_Creation]]

Latest revision as of 00:38, 16 November 2018

Overview

The Color Palettes used in the Unit Customization options in the Barracks are populated by XComGame.XComContentManager. The native functions in this class are directed by entries in DefaultContent.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. See also the following related wiki articles:

Programs and Tools

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

Wasteland Ghosts' UPKUtils tool include the functionality to expand function and object size, and so can be used to indefinitely extend the color palettes.

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 (Palette=ePalette_ArmorTint) 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 Palettes


Related

Referred to by this article:

That refer to this article: