Hello everyone. I'm using AC v 1.74.2
I have a "continue“ button in my main menu. I'm using the "continue from last save" node. It works great when I'm on a single computer. However, I noticed that it uses OptionsData to determine the last save from the ID.
public static bool ContinueGame ()
{
if (Options.optionsData != null && Options.optionsData.lastSaveID >= 0)
{
return LoadGame (Options.optionsData.lastSaveID);
}
return false;
}
This causes problems when trying to continue on another device with synced save files. The options data is saved to player prefs, and thus, not carried over to the new device. So on the new device, the lastSaveID might be different or not exist at all. So is there some setting or something I could do to safely retrieve the last save? Or a way to edit the script to do so?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
You can switch your Options file handled to OptionsFileHandler_SystemFile to have Options data be placed in files in the same way as save-games:
Otherwise, a custom script could read the save files themselves and work out which has the latest modified timestamp.
A function along these lines should return the ID of the latest save this way:
Oh great! So I could just add this to a script in my main menu and set Options.optionsData.lastSaveId to this?