Recolouring Second Colour Palette for Armour

Lasko

Moderator
Staff member
Moderator
Feb 13, 2012
259
9
18
#1
This file adds the second radial menu to re-colour both palettes for armour that has different colour variations.... ie. most crafted armour.

This is my version of it. I'm no C++ expert so if someone could take a look and verify it that'd be cool.

Download.

It goes in

src/server/zone/objects/tangible/components/.

The armour object Lua file has to have the following line in it:

objectMenuComponent = {"cpp", "ArmorObjectMenuComponent"},

Just look at any piece of composite for reference.

A word of warning. Not all armours are ok to recolour. It spams errors on the server terminal if you try and colour armour that would not normally be colourable, Imp Assault etc.

Anyways..... Enjoy:)
 
May 31, 2012
66
1
6
41
www.tpot.ca
#2
Lasko said:
objectMenuComponent = {"cpp", "ArmorObjectMenuComponent"},
Potentially confusing typo: This actually goes in the LUA file for each armor piece, not the c++. Like so,

https://github.com/kinshi/tarkin_scripts/blob/Development/scripts/object/tangible/wearables/armor/zam/armor_zam_wesell_chest_plate.lua

Code:
object_tangible_wearables_armor_zam_armor_zam_wesell_chest_plate = object_tangible_wearables_armor_zam_shared_armor_zam_wesell_chest_plate:new {
	templateType = ARMOROBJECT,

	objectMenuComponent = {"cpp", "ArmorObjectMenuComponent"},	
	
	playerRaces = { "object/creature/player/bothan_male.iff",
				"object/creature/player/bothan_female.iff",
				"object/creature/player/human_male.iff",
				"object/creature/player/human_female.iff",
				"object/creature/player/moncal_male.iff",
				"object/creature/player/moncal_female.iff",
				"object/creature/player/rodian_male.iff",
				"object/creature/player/rodian_female.iff",
				"object/creature/player/sullustan_male.iff",
				"object/creature/player/sullustan_female.iff",
				"object/creature/player/trandoshan_male.iff",
				"object/creature/player/trandoshan_female.iff",
				"object/creature/player/twilek_male.iff",
				"object/creature/player/twilek_female.iff",
				"object/creature/player/zabrak_male.iff",
				"object/creature/player/zabrak_female.iff",
				"object/mobile/vendor/aqualish_female.iff",
				"object/mobile/vendor/aqualish_male.iff",
				"object/mobile/vendor/bith_female.iff",
				"object/mobile/vendor/bith_male.iff",
				"object/mobile/vendor/bothan_female.iff",
				"object/mobile/vendor/bothan_male.iff",
				"object/mobile/vendor/devaronian_male.iff",
				"object/mobile/vendor/gran_male.iff",
				"object/mobile/vendor/human_female.iff",
				"object/mobile/vendor/human_male.iff",
				"object/mobile/vendor/ishi_tib_male.iff",
				"object/mobile/vendor/moncal_female.iff",
				"object/mobile/vendor/moncal_male.iff",
				"object/mobile/vendor/nikto_male.iff",
				"object/mobile/vendor/quarren_male.iff",
				"object/mobile/vendor/rodian_female.iff",
				"object/mobile/vendor/rodian_male.iff",
				"object/mobile/vendor/sullustan_female.iff",
				"object/mobile/vendor/sullustan_male.iff",
				"object/mobile/vendor/trandoshan_female.iff",
				"object/mobile/vendor/trandoshan_male.iff",
				"object/mobile/vendor/twilek_female.iff",
				"object/mobile/vendor/twilek_male.iff",
				"object/mobile/vendor/weequay_male.iff",
				"object/mobile/vendor/zabrak_female.iff",
				"object/mobile/vendor/zabrak_male.iff" },

	-- Damage types in WeaponObject
	vulnerability = STUN + LIGHTSABER,

	-- These are default Blue Frog stats
	healthEncumbrance = 1,
	actionEncumbrance = 1,
	mindEncumbrance = 1,

	-- LIGHT, MEDIUM, HEAVY
	rating = LIGHT,

	kinetic = 15,
	energy = 15,
	electricity = 15,
	stun = 15,
	blast = 15,
	heat = 15,
	cold = 15,
	acid = 15,
	lightSaber = 0,

	numberExperimentalProperties = {1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 1},
	experimentalProperties = {"XX", "XX", "XX", "XX", "OQ", "SR", "OQ", "UT", "MA", "OQ", "MA", "OQ", "MA", "OQ", "XX", "XX", "OQ", "SR", "XX"},
	experimentalWeights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
	experimentalGroupTitles = {"null", "null", "null", "null", "exp_quality", "exp_durability", "exp_durability", "exp_durability", "exp_durability", "null", "null", "exp_resistance", "null"},
	experimentalSubGroupTitles = {"null", "null", "sockets", "hit_points", "armor_effectiveness", "armor_integrity", "armor_health_encumbrance", "armor_action_encumbrance", "armor_mind_encumbrance", "armor_rating", "armor_special_type", "armor_special_effectiveness", "armor_special_integrity"},
	experimentalMin = {0, 0, 0, 1000, 1, 30000, 250, 66, 25, 1, 0, 5, 30000},
	experimentalMax = {0, 0, 0, 5000, 40, 50000, 150, 39, 15, 1, 0, 55, 50000},
	experimentalPrecision = {0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0},
	experimentalCombineType = {0, 0, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4, 1},
}

ObjectTemplates:addTemplate(object_tangible_wearables_armor_zam_armor_zam_wesell_chest_plate, "object/tangible/wearables/armor/zam/armor_zam_wesell_chest_plate.iff")
Note that this mod doesn't work on the first and third colors of Tantel Armor, assuming it's the same as what is available on the Tarkin server.
 

Arioch

New Member
Apr 22, 2014
106
0
0
#4
You can just add that line to the .lua and get the same result, unless I did something wrong. I already added that line to the .lua of the mando helm and had 1 palette available from doing only that. I added that file in the components folder and still only have the 1 palette. Ill look it over and if I fix it, Ill repost.

EDIT OK Im a jackass for w/e reason I didnt run build config. :p A little rusty here, love this mod! thanks it works wonderfully!
 
May 6, 2015
36
0
6
#5
so i had it working before but i can't figure out how i lost it, can someone refresh me on how to extend the amount of colors in each palette serverside? i looked everywhere and can't recall what i did the first time.
 

Phoenix

UI Guy
Staff member
Moderator
Sep 25, 2010
205
11
18
28
#8
As Timbab said:

The .pal (palette file) located in the tres under the palette folder control the number of colors in the palette and the colors that are in said palette.

The maximum number of colors is 255 aka FF 00 in the iff hex. Now there is a work around to get 256 aka 00 01, but the client won't accept it. You can use Sytner's IFF Editor (SIE) to edit .pal files and add colors, take away colors, etc and then you can save the pal in a tre and push it out to other people or put it in your client folder as a mod.
 
May 6, 2015
36
0
6
#9
ahh gotcha. thanks phoenix, for some reason i was thinking i did something in eclipse that edited the max number of colors.. must've been something else.
 

Phoenix

UI Guy
Staff member
Moderator
Sep 25, 2010
205
11
18
28
#10
http://i.imgur.com/GTjk6sP.png that 00 01 is where it sets it to 256 as you can see in bottom. Which is 00 + 1-255. If it was 0 - 254 it would be FF 00
[hr]
But the client won't accept higher than that. If you try to click the colors it will revert to one of the previous colors. And anything after 256 or 257 I believe won't show up in the palette at all ingame.
[hr]
So 256 works. My fault. Forgot about the 00 thing. (or should), but anything higher than that shouldn't work at all.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Oct 6, 2010
1,044
40
48
28
Magna Germania
#12
Technically it should be possible, I'm unfamiliar how core3 works, so we'll see, I created a correct .pal file though and the client reads up to 1024 colors in theory, I believe, it's just a matter of if it breaks anywhere else.

For things like skin color in the image design field, I think one would need to modify the UI, due to the box being locked to 256 colors.

My earlier post was incorrect I believe, as I think I took the default max from Microsoft .PAL files (which the SWG .PAL are).
 

Phoenix

UI Guy
Staff member
Moderator
Sep 25, 2010
205
11
18
28
#14
Testing today. Had things pop up yesterday so I wasn't able to, but today looks cloudy/gray out so nothing for me to do lol.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Oct 6, 2010
1,044
40
48
28
Magna Germania
#15
So, I'm still unsure why it's not working server side, but client side it definitely accepts more. Tested it with the chat color: