Is there a practical way to switch unit palettes?

Information and discussion for custom maps and mods.
Post Reply
thebestwes
Posts: 18
Joined: Fri Jul 17, 2015 7:08 pm

Is there a practical way to switch unit palettes?

Post 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?

fernoe
Posts: 33
Joined: Sat Sep 24, 2005 10:21 pm

Post 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

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post 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.

thebestwes
Posts: 18
Joined: Fri Jul 17, 2015 7:08 pm

Post 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.

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post 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

thebestwes
Posts: 18
Joined: Fri Jul 17, 2015 7:08 pm

Post 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!

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post 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.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

Post Reply