Help with the serialization of welds

Im trying to create a weld serialization system for my game, but im starting to think thats impossible

And the way my serialization tables are shaped is that, all the data about the model, is in it, and the last line of the table is just the serialized children of the model which goes in a cycle, same for parts

i’ve thought of a passphrase, but how will the other part of the weld know about it?

I saw a pre-existing topic ( How to save welds to datastore ), but there still wasn’t a solution, nor they probably didn’t serialize parts this way

(how the serialization is modeled for visual understanders)
{
[1] = ▼ {
[1] = true,
[2] = “Model”,
[3] = ▼ {
[1] = ▼ {
[1] = false,
[2] = “Part”,
[3] = :arrow_forward: {…},
[4] = :arrow_forward: {…},
[5] = :arrow_forward: {…},
[6] = :arrow_forward: {…},
[7] = “Plastic”,
[8] = 0,
[9] = “Block”,
[10] = 0,
[11] = true,
[12] = :arrow_forward: {…},
[13] = false,
[14] = :arrow_forward: {…},
[15] = :arrow_forward: {…},
[16] = “Smooth”,
[17] = “Smooth”,
[18] = “Smooth”,
[19] = “Smooth”,
[20] = “Smooth”,
[21] = “Smooth”,
[22] = “Part”,
[23] = :arrow_forward: {…}
},
[2] = ▼ {
[1] = false,
[2] = “Part”,
[3] = :arrow_forward: {…},
[4] = :arrow_forward: {…},
[5] = :arrow_forward: {…},
[6] = :arrow_forward: {…},
[7] = “Plastic”,
[8] = 0,
[9] = “Block”,
[10] = 0,
[11] = true,
[12] = :arrow_forward: {…},
[13] = false,
[14] = :arrow_forward: {…},
[15] = :arrow_forward: {…},
[16] = “Smooth”,
[17] = “Smooth”,
[18] = “Smooth”,
[19] = “Smooth”,
[20] = “Smooth”,
[21] = “Smooth”,
[22] = “Part”,
[23] = ▼ {
[1] = ▼ {
[1] = false,
[2] = “Fire”,
[3] = :arrow_forward: {…},
[4] = :arrow_forward: {…},
[5] = 9,
[6] = 5,
[7] = 1
}
}
}
}
}
}

(this all later gets compressed into a lightweight string)
(and im using the old welds)

I can’t figure out what you are trying to do from this. Are you trying to send a Weld instance without passing the instance itself? Or put it in a datastore?

im trying to send a weld instance without passing the instance itself, and then later put it in a datastore when the player leaves

What is this table then? It seems like there are way more properties than you would need. Shouldn’t you just need a single CFrame?

the table is just there to show you how the serialization is modeled, just incase, and im just trying to figure out how to save connections between parts

You just need to save the CFrame between them. You can generate the welds from that, and it doesn’t matter what they are parented to unless scripts need to find them

1 Like

i was thinking about that, but it is a free-build game so people might have parts in the same exact spot, so that’d make this method obsolete

Why would that prevent it from working? It would just store two of the same CFrame.

it would weld it to the wrong part, causing errors

Do you care which parts are welded to which or just that they are in the right position?

i care about which parts are welded to which

Well since you can’t serialize instances you need to turn Instance values into some kind of relative path and store that. Then you can store 3 things, the two parts being welded and the CFrame between them. Welds have a C0 and C1 but unless you’re animating this doesn’t matter, you can make one of them Identity.

i dont think the welds would know what table its in, when serialized, but i’ll give it a try

I have an example of this but you would have to dig through it significantly. Look in ReplicatedStorage.Shared.BuildingSerialization

im kinda skeptical with using this path system, since the models/parts dont have unique names

nevermind ill just rename them with a unique name

Yeah you just need the paths to be unique, if they already are you don’t have to rename anything. I think I have a function that does that.

could i just add in the welds and do all the stuff after the parts are loaded, so there isnt a need for paths?

shockingly it works!, thank you very much for your help