Different ways to obtain all available save slot names

is it possible to get all saved game slot names to create a menu system so user can choose the save file?

You need a save game that just holds save game names :slight_smile:

When you make a new slot, put the name in there.

( There is now ‘get slot names’ that I know of ).

3 Likes

Victory Plugin

image

*I am almost sure this plugin is not compatible with Android. I wanted to use it before and crashed the APP

**just found a topic about Android compatibility and seems there is a solution

2 Likes

This is smart and efficient. I wish there was a get save slot names method. But I couldnt find it either.

are file names exactly the same as slot names?

include the .sav extension but is really easy to trim it.

1 Like

Thank you

1 Like

I found out that this solution works best

first, define these const objects in the header file of your custom GameInstance class

then, create this function as a blueprint callable and call it in the blueprint

header file:

cpp file:

You can also use the Save Game system interface which is probably slightly cleaner:

TArray<FString> SaveGameNames;
ISaveGameSystem* SaveSystem = IPlatformFeaturesModule::Get().GetSaveGameSystem();`
if (SaveSystem) {
            // Assuming UserIndex 0, adjust if needed
            const int32 UserIndex = 0;
            SaveSystem->GetSaveGameNames(SaveGameNames, UserIndex);
        }

take a look at the source code to see the implementation details.

1 Like

This solution is really really wrong because the following line:

inline static const FString SaveGameDirPath = FPaths::ProjectSavedDir() + SaveDirName;

Works fine in editor builds and executions. But when packaging the game or launching on windows target it causes the engine to exit with error code 777006, which is very difficult to track, as the Unreal application .exe not even produces logs or error messages or launches the bug tracker. SImply does not launch at all, without any logs and no indication of what line or file or C++ or blueprint is wrong so far. The application error code appears on a genericplatform header file and the code description on an enum on that file, indicating kernel failed due to “static initialization error”. The application exit code 777006 is also very difficult to obtain from windows shell, I found it launching on target from editor.

You can not put FPaths::ProjectSavedDir() call on a static variable initialisation.