Jump to content

Color Slider mod might not be practical (a discussion).


serratemplar

Recommended Posts

Has anybody else looked into this? I've done two deep dives into it hoping to make it happen myself, and I don't think it can be done easily, if at all with the given tools. I've come away convinced that the only way to support color selection by sliders would be to override one or more core classes in some big ways.

 

The code all assumes that colors are indexed in their pre-baked palette.

 

Everything from color creation (under UIUtilities_Color) to application to the meshes (in XComHumanPawn) assumes that colors are all referenced by (single int) index. When the meshes themselves are updated, the indexed color (selected from one of the swatches the code calls UIColorChip) is unpacked into a (core UE3 class) MaterialInstanceConstant, then the mesh is redrawn with the new color. It looks like the assignment via MIC is how the color is ultimately stored for further use in that Actor.

 

What I'd like to do is create a ScreenListener - listening for UIColorSelector then somehow switching on which of the traits is actually being edited - that pops up three UISliders for RGB input and pipes those values (upon commit) into a MaterialInstanceConstant, and then applies it - permanently - to the mesh in question. But I don't think this will work because, everywhere I look, whenever the mesh is updated for any reason, all of the involved functions assume the color is from their pre-baked palette...so, I think, even if I managed to assign a color to the mesh, the next update for any reason (even backing out of the menu) will just scrub that injection with whatever color index was previously assigned to it.

 

Probably for optimization or stability.

 

I assume this wasn't done arbitrarily by Firaxis: this must be tied into some optimization that's simply outside of my comprehension right now. (I'm very new to UDK and modding in general.) So, I'm hesitant to just gallantly override this class, if I even can. (I haven't tried injecting any log() statements yet, honestly, so this may be a complete wash.) But, even if I can, the amount of stuff to be done to undo the "all colors are on our palette" assumption is some serious heavy lifting.

 

I'm just spit-balling here, but possibly we could override the baked in palette with our own (via config file and an override - syntactically or just brutishly) although this seems really awkward and is far less desirable than sliders would be.

 

But, maybe I'm wrong?

 

So...maybe I've made a mistake above or otherwise am confused and this isn't as hard as I think. Have any of you taken a look at this or have any ideas about it?

 

Wait, whaddya mean by 'practical'?

 

I mean something I could reliably maintain while having a normal day job. :)

 

Thanks in advance.

Edited by serratemplar
Link to comment
Share on other sites

I'm sure you have seen the mods for more armor colors, more hair colors, etc. These basically make a bigger fixed palette. But, at some point, like 256 colors or whatever has to be enough. Is there a specific effect you want to get with sliders?

No, just that folks have been asking for it, so I thought I'd look into it.

 

Although, the current color picker UI is pretty impractical for over a few dozen colors; at some point the slider would just be a more convenient interface.

Link to comment
Share on other sites

I wonder if this problem is mostly addressed by just making the secondary armor color options not universally subdued, desaturated tones? At least that was my biggest gripe about the color picker, over everything else.

Yea, I agree; there's like two or three separated rows of grey. I really wonder why they made the choices they did around the palettes they gave us.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...