Page 1 of 1

Is there a practical way to switch unit palettes?

Posted: Fri Jul 24, 2015 8:00 pm
by thebestwes
I'm trying to copy a unit's shp between RA and TD, but I'm not sure what the best way to change the palette is (I'm using XCC Mixer, albeit not skillfully).

My backup plan is just to create a photoshop action to open each image, cut the pixels, change the color table, and then paste them back in (which works okay for single images like cameos), but even that is going to be kind of time consuming, and it seems like there has to be a simpler way to do it.

Thoughts?

Posted: Fri Jul 24, 2015 11:32 pm
by fernoe
copy and paste the images into SHP editor. I think it converts the copy pasted image into whatever palette you have selected.

Not really sure how well this works between TD and RA but I know it worked for converting TS buildings into the RA2 palette

SHP editor can be found here http://www.ppmsite.com/?go=shpbuilderinfo

Posted: Sat Jul 25, 2015 6:25 pm
by Graion Dilach
Sadly XCC Mixer can only read pals from mixes, not loose folders. So any additional pal you'd use should be mixed for Mixer beforehand (you can drag'n'drop files to be added into the mix).

However in the particular OP case, I don't think that's needed. You end up better if you copy RA temperat.pal into your TD mod with a name e.g. ra1.pal then add it as a PlayerHighlightPalette and PaletteFromFile entry, then override the palette on RenderSprite/(WithDeathAnimation if needed) level.

Posted: Sat Jul 25, 2015 7:13 pm
by thebestwes
Thanks, guys! Graion, that sounds like exactly what I need. I'm assuming the PaletteFromFile trait goes in the palettes.yaml in a similar format to the rest ("PaletteFromFile@[name]:" followed by the filename etc., but where does PlayerHighlightPalette go, and how is it used? I assumed it goes in player.yaml, but I'm not sure how the BaseName property works. I've added all of those traits and nothing crashes, but the glitchy palette for the RA unit is still there.

Posted: Sun Jul 26, 2015 12:39 pm
by Graion Dilach
Sorry, mixed the definitions, what you need is the PlayerColorPalette along with it, not the Highlight variant.

Practically this one: https://github.com/OpenRA/OpenRA/blob/b ... s.yaml#L67
Just copy it out, set the base palette to however you refer the pal in PaletteFromFile and then you can refer that in RenderSprites/Voxels->PlayerPalette.
Something like this (keep in mind, I'm using TS-based palettes, so my RemapIndex is the TS remap colors, not the RA1 ones). The defaults of PlayerColorPalette are set to player both on BaseName and BasePalette.

Code: Select all

	PlayerColorPalette@voxels:
		BasePalette: voxels
		BaseName: voxels
		RemapIndex: 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
	PlayerColorPalette@infantry:
		BasePalette: infantry
		BaseName: infantry
		RemapIndex: 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
	PaletteFromFile@infantry:
		Name: infantry
		Filename: infa.pal
		ShadowIndex: 12
	PaletteFromFile@voxels:
		Name: voxels
		Filename: unittem.pal
		ShadowIndex: 1

Posted: Sun Jul 26, 2015 6:58 pm
by thebestwes
Graion, you are a hero.

It's still giving me a bit of an issue with the non-remapped colors (I tried setting both the palette and PlayerPalette under RenderSprites to the RA palette and remapped version respectively, but I guess that just overrides the PlayerPalette with a static one), but it's not really that noticeable for the time being.

Thanks so much for the in-depth explanation!

Posted: Sun Jul 26, 2015 10:39 pm
by Graion Dilach
Show me a screenshot where that bug pops out, then I can probably track down what causes it - I personally found Palette not need to be overrid though.