Can't get Serialization to load Color3 rather than BrickColor

To make it clear this is a script made by AwesomeXForLife, I have looked through it’s code and tried to understand it but It is way more complex than my level of coding.

It all works fine and is super easy to setup, though it loads parts with their BrickColor rather than their Color3, meaning two similar colours will be changed to the closest BrickColor, I checked and it does say it supports Color3.

If you have used this before or think you might be able to figure it out here is the link to the Forum post and the link to it’s model:

RBLXSerialize - a easy to use and really cool all-in-one Roblox Serializer - Resources / Community Resources - DevForum | Roblox

RBLXSerialize0.7 - Roblox

Any help is appreciated, thank you.

Instead I would suggest to save it as a Vector3 with X = R, Y = G, Z = B.

The docs suggest it does serialise color3, so try printing the decoded values to output just to check it does this correctly. It may be that when the part is recreated it sets the brickcolor rather than the color3 value.

You mean save a Vector 3 value then after decoding run a loop to set the values to the parts Color3 value?

If so that is a valid option but would increase the data size.

Yes, that’s the best thing you could do, else you could save the HEX-code (without the hashtag), this in it’s turn would become a string.

For this you can use :ToHex() and Color3.fromHex().

1 Like

Decoded values are just the physical objects, so I can’t really check, I would happily remove saving of BrickColor, it is totally redundant if (as it says it does) saves the Color3 Value, but I can’t understand the script at all, if I cant figure it out I will go with @KJry_s option.

If I can’t remove BrickColor saving or just not apply it I will definitely go with this method thank you, Though I hope it doesn’t effect the amount it saves by much as there will potentially be a lot of parts to save.

Also a bit unrelated to the topic, but if you want to take extreme measures and make it even compacted you can use a “default” property list and save it as well. This list would contain the properties which the majority of parts share with eachother so it would compact the size even more, though calculating it would take a bit.

Make sure to first apply the default properties and then the part properties, so the default properties do not overlap.

TL;DR make a list of commonly used properties, do not save part properties if they are the same as the commonly used properties, this would compact the save file even more.

1 Like

Within “Converters” at line 285 I just ripped out the code for converting BrickColors, it doesn’t error and now loads Color3 without overriding it with BrickColor.

Here is that code:

["BrickColor"] = function(isClass,brickColor)  
		if isClass then 
			return deflate(nil,math.floor(brickColor.Number))
		else 
			local id = flate(nil,brickColor,1)
			return BrickColor.new(id)
		end
	end,

Hope this obscure problem helps someone else and thank you to those who gave suggestions and help.

1 Like

use the newer version, and put BrickColor on NeverSave

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.