[Solved] Script UUID Conflicts

Hello,

We’re having a very specific issue, and I’m hoping that some light can be shed on it.

We’ve been building a bunch of levels, it’s been an external team, and what they did was essentially copy the project. Rename the scripts and assets to reflect the new level name, and make the appropriate adjustments. This has had the unfortunate side effect of all of the level component scripts having the same UUIDs. So what happens is ( after importing the level using the import/export tool [v1.6.1] ) the first level will load in fine, but when the second one loads in all of the nodes in the prefabs are pointing to the scripts in the first level. This breaks the game as the scripts are similar and based off of one another, they are in fact different.

So, I figured what I could do is since all the prefab and script meta files are text, I could write a script to run through all the uuid pairs and map them to new uuids and (hopefully) everything is peachy. (note, the levels are extremely large, and manually remapping all the properties and scripts would be extremely costly. ). However the problem I’m running into is that the relationship between the script uuids and the components that get created by them isn’t exactly clear.

For instance, in Test.prefab
27 PM

And then in TestScript.ts.meta
21 PM

It seems to me the two values must be related, I can’t imagine the first 5 characters being the same is a coincidence, and somehow the engine/editor is able to resolve the link between the two files. So my question is, what exactly is the relationship between those two values so that I can write my script to remap those uuids.

I’ll also gladly accept any other suggestions to my issue.

Thank you very much for your time.

Edit: @nantas @jare @pandamicro @slackmoehrle Sorry for the pings guys, but I really need help on this one!

Great news! I’ve found a solution to my problems!

The uuid is being compressed and decompressed using the compressUUID and decompressUUID functions found here:

I’ll leave this here hoping it helps someone in the future!

Thanks again for this forum!

2 Likes