JSearUK / Playthroughs

The aim is to create the system in such a way that it can be safely dropped into any other project
The Unlicense
0 stars 0 forks source link

Attempt to handle mod deletion #46

Closed JSearUK closed 2 years ago

JSearUK commented 2 years ago

If the mod is deleted, any saves made in the (remaining) original system will crash on load because unpickling them references objects that no longer exist. I'd like to find a way to handle this more gracefully (though I'll settle for successfully...). It's possible that having all variables and objects in a separate named store might do the trick. It's also possible that it'll throw up regardless.

Worst comes to worst, we could install a file in /game that catches that particular exception and handles it, which likely would not be deleted (and therefore still be present) by a player who has simply removed the /Mods or /Playthroughs folder(s). Not ideal, though.

JSearUK commented 2 years ago

This cannot be done without making the code entirely stateless. All information gleaned from the files, and data passed only from function to function with no storage. That is not going to happen. So... better make sure the whole thing works correctly first time it's released