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

From Nexus Mods Wiki
Jump to: navigation, search
m (typo <_<)
 
(3 intermediate revisions by the same user not shown)
Line 18: Line 18:
 
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. See also the following related wiki articles:
 +
* [[Adding and changing art assets - XCOM:EU 2012]]
 +
* [[Initial soldier appearance - XCOM:EU 2012]]
  
 
==Programs and Tools==
 
==Programs and Tools==
Line 25: Line 27:
 
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>
 
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.
+
Wasteland Ghosts' [http://www.nexusmods.com/xcom/mods/448/? UPKUtils] tool include the functionality to expand function and object size, and so can be used to indefinitely extend the color palettes.
  
 
==Code Breakdown==
 
==Code Breakdown==
Line 72: Line 74:
 
</code>
 
</code>
  
[[File:Adjusted_XCOM_Pallettes.jpg|1000px]]
+
[[File:Adjusted_XCOM_Pallettes.jpg|1000px|Adjusted XCOM Palettes]]
  
==Related==
 
* [[Modding Tools - XCOM:EU 2012]]
 
* [[UPK File Format - XCOM:EU 2012]]
 
* [[XComGame.upk]]
 
* [[Hex editing UPK files]]
 
* [[Hex values XCOM Modding]]
 
  
[[Category:XCOM Modding]]
+
== Related ==
[[Category:Game_Files_%26_Modding_-_XCOM:EU_2012]]
+
 
[[Category:XCOM]]
+
Referred to by this article:
 +
 
 +
*[[Adding_and_changing_art_assets_-_XCOM:EU_2012]]
 +
*[[Initial_soldier_appearance_-_XCOM:EU_2012]]
 +
*[[Modding_Tools_-_XCOM:EU_2012]]
 +
*[[UPK_File_Format_-_XCOM:EU_2012]]
 +
*[[XComGame.upk|XComGame.upk]]
 +
*[[Hex_editing_UPK_files|Hex editing UPK files]]
 +
*[[Hex_values_XCOM_Modding|Hex values XCOM Modding]]  
 +
 
 +
That refer to this article:
 +
 
 +
*[[Adding_and_changing_art_assets_-_XCOM:EU_2012]]
 +
*[[Initial_soldier_appearance_-_XCOM:EU_2012]]  
 +
 
 +
[[Category:XCOM Modding]] [[Category:Game Files & Modding - XCOM:EU 2012]] [[Category:XCOM]] [[Category:Mod_Creation]]

Latest revision as of 23:38, 15 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: