I have Steam cloud saves set up and working, but my continue from last save button doesn't work as intended. the continue button loads the last save made on that device, so if I save, change device, then continue it loads the 'wrong' save. I think this is because cloud saves share the data in the save file location, and the info for the last save is saved in playerprefs? Is it somehow possible to store the last save ID info with the save files instead, so they can be synched?
AC 1.75.8, Unity 2020.3.22f1
Thanks )
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
You're right - currently, the Options Data keeps track of which save was the last to be recorded.
It's possible, however, to have a custom script that iterates through the available saves to get the latest by reading their updateTime value:
To use, attach to a prefab and use the Object: Call event Action to invoke its
ContinueGame
function.This gives me error CS1503: Argument 1: cannot convert from 'AC.SaveFile' to 'int'...
May be an issue with your AC version.
Try this:
This got rid of the error. But still not working quite right, it seems to ignore autosaves and only load the most recent manual save, whereas save>continue from last save will load autosave if it is the newest...
I added a debug log and it seems the autosave update time is always 0...
This behaviour will likely be changed in the next update, but for an older release you can open up SaveFileHandler_SystemFile (or whichever file handler script you're using), and remove the
isAutoSave
check from theGetSaveFile
function:Mine looks slightly different, but I did this - https://www.dropbox.com/scl/fi/tpz0vbuhcaegrusqbxvl8/Screenshot-2024-10-15-103258.png?rlkey=bxv6afcrzgefpujujyfigsznu&dl=0
But now nothing loads and the log says all saves have update time 0...
Wait, I misunderstood and removed the whole thing
Just removing the check fixed this issue.
All working as intended now, thanks Chris! x
Separate, related question: How are the save labels stored? It seems my save data is synching with Steam cloud, but the Time/date on the save label does not... Any idea why his would be or how to fix it?
Save file label data is stored within the Profile, i.e. the Options Data, so that it can be extracted without having to load the save file itself.
If you don't have access to this, you can override the SaveFile's label based on its GetUpdatedTime function, formatted to your intent.
Something along these lines, set to rewrite save labels when the Save menu is turned on:
This gives me:
error CS1061: 'SaveFile' does not contain a definition for 'GetUpdatedTime' and no accessible extension method 'GetUpdatedTime' accepting a first argument of type 'SaveFile' could be found (are you missing a using directive or an assembly reference?)
Looks like it's down to the older version you're using.
Try copy/pasting this into your SaveFile script:
Like this?
https://www.dropbox.com/scl/fi/x5dybeepyqckbp9l4wovn/Screenshot-2024-10-18-131955.png?rlkey=cbgt4egoiwj6qf9kn45gzj8ob&st=1wfqemqr&dl=0
That gave me this error:
Assets\AdventureCreator\Scripts\Save system\FileHandling\SaveFile.cs(117,10): error CS0246: The type or namespace name 'DateTime' could not be found (are you missing a using directive or an assembly reference?)
Add
using System;
to the top of the script.