I have a Fortnite UEFN project that was already published, which included a persistable Verse class called CustomPlayer (along with a weak_map referencing it). Now, I want to remove this class entirely because I no longer need it and I’ve built a new system that doesn’t rely on those old data structures.
However, whenever I try to publish an update without that CustomPlayer class, UEFN/Verse refuses to build/publish, telling me I’m missing definitions that existed in the previously published version. It seems that once a persistable class has been published, I can’t fully delete or rename it without breaking the publication process.
Question: How can I completely remove or rename that old persistable class and weak_map from my code, ignoring all the old data, so that I can publish my new version successfully in Fortnite UEFN? Are there any workarounds or recommended approaches to permanently get rid of unused persistable data?
Modifying Data Between Published Versions of Your Island
(cut out a bunch of stuff, but worth reading)
This backwards compatibility check is essentially a type check on the value type of the module-scoped weak_map variable. For simple types like integers, the type may not be changed after the island is published. This includes structs, where you cannot alter the struct definition after the island is published.
Currently, the only persistable type that you can add more data to after you publish your island is the class type as long as new fields have default values. This means that loading saved data from a previous version will include the new fields and their default values. Check out the best practice for using classes as persistable data for more details.
As such, it sounds like you’re breaking backwards compatibility with your island for your Players and that’s why you can’t publish. You can reset the data but not remove it.
That said, this isn’t ideal and I’m going to see if there are any viable solutions now or in the works.