Cover image of Avoiding Prefab Data Loss in 1.2 Update

With the 1.2 Experimental update just released and heading to the main application soon, some components had to be reworked. Because of those reworks, some prefabs working in 1.1 won't load properly in 1.2, and if you save such a loaded prefab, you will lose the data before the part that changed. To give you an example and a possible solution, I will use RHS and their 2S1 turret.

Upon spawning the prefab, we can already see that there is something wrong as it is not visible both in the prefab preview, as well as in the actual world:

When we check its parent prefab, we will notice that multiple components are missing:

When we look at the console, we'll see something like this, which will provide us with the necessary information about what is causing the problem:

Just to be safe, we recommend creating a copy of such a file. After that, we need to open that prefab in an external editor (like Notepad++) and find that problematic "ContextName."

In this example, there are multiple entries, but we know that the problem occurred somewhere around SCR_BaseCompartmentManagerComponent as it was the last component that was loaded, so it's very likely that this is the problem to be resolved:

Unless we know what if this was just renamed and we happen to know what is the proper new name for this attribute, then we can change that attribute name, but if that is not the case, then the best we can do is remove that line. After that, we will save the file and go back to the World Editor, where we will reimport the prefab and see if that fixes the issue:

Sadly, in this case, it wasn't, and we can either continue working with single lines or we can clear the whole class, as we can see that those entries are also in CompartmentDoorInfo:

Because of that, this time, we're going to remove the whole entry:

Now again, we save and reimport the prefab in the World Editor to see that it was enough for the prefab to be fully loaded:

Despite the fact that the prefab was loaded, there may still be some issues, but now, if we save that prefab, we will not lose any important data.

To give you an example of how much potential data could have been lost if we hadn't done this manual process, we will revert back, attempt to try and "fix it" in World Builder, and then save those changes. This is how the file and its overview look before we saved any changes to a broken prefab in World Builder:

We will clear "Door Info List" as we now know that was the issue, and this is what the file looks like after we cleared the problematic attribute in World Builder and decided to save it:

As we can see, we lost a lot of data, and if you do not have some form of backup, you may need to recreate all that manually.

We hope that this process will help you update your content without any potential loss of data or work, and we look forward to seeing your mods and creations in the future.

Published on 

We want you for our mailing list!

We offer great content once a month just for you!