# Is there a way to get all savegames in BP

**URL:** <https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270>\
**Category:** Editor Scripting\
**Tags:** savegame, load, files, unreal-engine, Blueprint, question\
**Created:** [December 11, 2014, 8:53am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270 "2014-12-11T08:53:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![DekanTrue](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DekanTrue](https://forums.unrealengine.com/u/DekanTrue)\
**Post date:** [December 11, 2014, 8:53am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/1 "2014-12-11T08:53:50Z")

</div>

I was wondering if there is a way to get all savegames in the savegame directory, without having to have a savegame with the list of your savegames?

So far I have only seen it done in C++.

What I would like, is to be able to copy/paste savegames to the folder, and then dynamically load them.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_01dd28a6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_01dd28a6](https://forums.unrealengine.com/u/anonymous_user_01dd28a6)\
**Post date:** [July 12, 2015, 12:34am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/2 "2015-07-12T00:34:36Z")

</div>

A direct solution. **WINDOWS ONLY.** In my static helper blueprint class…

---- .h -----

```
	UFUNCTION(BlueprintCallable, Category = TDLHelpers)
		static TArray<FString> GetAllSaveGameSlotNames();

```

---- .cpp -----

```
#include "PlatformFeatures.h"
#include "GameFramework/SaveGame.h"

...

TArray<FString> UtdlBlueprintHelpers::GetAllSaveGameSlotNames()
{
	TArray<FString> ret;

	ISaveGameSystem* SaveSystem = IPlatformFeaturesModule::Get().GetSaveGameSystem();
	
	// If we have a save system and a valid name..
	if (SaveSystem)
	{
		// From SaveGameSystem.h in the Unreal source code base.
		FString saveGamePath = FString::Printf(TEXT("%s/SaveGames/*"), *FPaths::GameSavedDir());

		UE_LOG(TDLLog, Log, TEXT("Search path %s"), *saveGamePath);

		WIN32_FIND_DATA fd;
		HANDLE hFind = ::FindFirstFile(*saveGamePath, &fd);
		if (hFind != INVALID_HANDLE_VALUE) {
			do {
				UE_LOG(TDLLog, Log, TEXT(" test name: %s"), fd.cFileName);
				// Disallow empty names and . and .. and don't get all tied up in WCHAR issues.
				if (fd.cFileName[0] == '\0'|| 
					fd.cFileName[0] == '.' && fd.cFileName[1] == '\0' ||
					fd.cFileName[0] == '.' && fd.cFileName[1] == '.' && fd.cFileName[2] == '\0')
				{ }
				else if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0 && fd.cFileName[0] != '.') {
					ret.Add(FString(fd.cFileName));
				}
			} while (::FindNextFile(hFind, &fd));
			::FindClose(hFind);
		}
	}

	return ret;
}

```

---

<div class="post-metadata">

**Author:** ![Commander\_Shepard](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Commander\_Shepard](https://forums.unrealengine.com/u/Commander_Shepard)\
**Post date:** [November 20, 2015, 1:21pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/3 "2015-11-20T13:21:31Z")

</div>

Why not use a known name save file as master save file which contains names of all other save files?

1. Create a save file “MASTER”
2. Save your game with any name e.g “Savegame1”
3. Add Savegame1 in “MASTER”'s file list

to load

1.Load Save file MASTER

2.Get the name of all save files from step 2 above

3.Load the save file you want from the list.

---

<div class="post-metadata">

**Author:** ![apoisonedgift](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@apoisonedgift](https://forums.unrealengine.com/u/apoisonedgift)\
**Post date:** [March 21, 2016, 3:44am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/4 "2016-03-21T03:44:20Z")

</div>

The issue with this method is that if something happens to that master save, the user will lose the reference to all their other saves and most likely think all their save data has been lost. BPs really need a way to list all save games properly.

---

<div class="post-metadata">

**Author:** ![Ixiguis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ixiguis](https://forums.unrealengine.com/u/Ixiguis)\
**Post date:** [June 25, 2017, 8:04pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/5 "2017-06-25T20:04:47Z")

</div>

This code should work for any platform.

.h

```
	/** returns a list of all save games in /Saved/SaveGames folder, without the .sav extension (filename only) */
	UFUNCTION(BlueprintPure, Category = Game)
	static TArray<FString> GetAllSaveGameSlotNames();

```

.cpp

```
#include "Paths.h"
#include "PlatformFile.h"
#include "PlatformFilemanager.h"

TArray<FString> USnakesBlueprintFunctionLibrary::GetAllSaveGameSlotNames()
{
	//////////////////////////////////////////////////////////////////////////////
	class FFindSavesVisitor : public IPlatformFile::FDirectoryVisitor
	{
	public:
		FFindSavesVisitor() {}

		virtual bool Visit(const TCHAR* FilenameOrDirectory, bool bIsDirectory)
		{
			if (!bIsDirectory)
			{
				FString FullFilePath(FilenameOrDirectory);
				if (FPaths::GetExtension(FullFilePath) == TEXT("sav"))
				{
					FString CleanFilename = FPaths::GetBaseFilename(FullFilePath);
					CleanFilename = CleanFilename.Replace(TEXT(".sav"), TEXT(""));
					SavesFound.Add(CleanFilename);
				}
			}
			return true;
		}
		TArray<FString> SavesFound;
	};
	//////////////////////////////////////////////////////////////////////////////

	TArray<FString> Saves;
	const FString SavesFolder = FPaths::GameSavedDir() + TEXT("SaveGames");

	if (!SavesFolder.IsEmpty())
	{
		FFindSavesVisitor Visitor;
		FPlatformFileManager::Get().GetPlatformFile().IterateDirectory(*SavesFolder, Visitor);
		Saves = Visitor.SavesFound;
	}

	return Saves;
}

```

If you don’t know what to do with this, look up in the wiki: “C++ blueprint function library tutorial”.

---

<div class="post-metadata">

**Author:** ![Reactant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Reactant](https://forums.unrealengine.com/u/Reactant)\
**Post date:** [July 23, 2017, 4:03pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/6 "2017-07-23T16:03:59Z")

</div>

I’m not very good at C++, could someone explain why when i try and compile the above code i get an error saying USnakesBlueprintFunctionLibrary is not a class, If anyone could point me in the right direction id appreciate it

---

<div class="post-metadata">

**Author:** ![Ixiguis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ixiguis](https://forums.unrealengine.com/u/Ixiguis)\
**Post date:** [July 23, 2017, 5:08pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/7 "2017-07-23T17:08:46Z")

</div>

> If you don’t know what to do with this, look up in the wiki: “C++ blueprint function library tutorial”.

---

<div class="post-metadata">

**Author:** ![Reactant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Reactant](https://forums.unrealengine.com/u/Reactant)\
**Post date:** [July 24, 2017, 3:14pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/8 "2017-07-24T15:14:23Z")

</div>

i have looked that up but all i find is ramas tutorial and he doesnt explain much of anything

---

<div class="post-metadata">

**Author:** ![LatFoued](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LatFoued](https://forums.unrealengine.com/u/LatFoued)\
**Post date:** [November 5, 2017, 1:35pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/9 "2017-11-05T13:35:02Z")

</div>

Thanks!  
This works perfectly.

---

<div class="post-metadata">

**Author:** ![dollon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dollon](https://forums.unrealengine.com/u/dollon)\
**Post date:** [August 8, 2019, 11:14am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/10 "2019-08-08T11:14:28Z")

</div>

You my sir are a life Saver.

---

<div class="post-metadata">

**Author:** ![Mewbits](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mewbits/32/1194714_2.png) [@Mewbits](https://forums.unrealengine.com/u/Mewbits)\
**Post date:** [November 8, 2019, 2:10am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/11 "2019-11-08T02:10:14Z")

</div>

You need to use your own class name instead. For instance mine is called something like UNewGameInstance because it’s in my game instance cpp file, which handles all my saving and loading.

If you use Visual Studio’s Create Definition helper (by right clicking the header file function) it will create this part for you.

---

<div class="post-metadata">

**Author:** ![Leie\_Sistal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Leie\_Sistal](https://forums.unrealengine.com/u/Leie_Sistal)\
**Post date:** [May 8, 2021, 1:10pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/12 "2021-05-08T13:10:25Z")

</div>

I think you can do it like this in blueprint

 ![338304-image-2021-05-08-150843.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/7/8/57882240117d241303032952b6977a9b37550937.png)

---

<div class="post-metadata">

**Author:** ![Ixiguis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ixiguis](https://forums.unrealengine.com/u/Ixiguis)\
**Post date:** [May 8, 2021, 7:21pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/13 "2021-05-08T19:21:58Z")

</div>

I don’t have this “Find Files” node, I think that’s from some plugin that you have.

---

<div class="post-metadata">

**Author:** ![Leie\_Sistal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Leie\_Sistal](https://forums.unrealengine.com/u/Leie_Sistal)\
**Post date:** [May 8, 2021, 8:34pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/14 "2021-05-08T20:34:52Z")

</div>

Yes it is a plugin but this is a build-in plugin called Blueprint File Utilities

---

<div class="post-metadata">

**Author:** ![Ale3D](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ale3D](https://forums.unrealengine.com/u/Ale3D)\
**Post date:** [November 4, 2021, 7:10pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/15 "2021-11-04T19:10:06Z")

</div>

Prefect, thx!

---

<div class="post-metadata">

**Author:** ![Videovse](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Videovse](https://forums.unrealengine.com/u/Videovse)\
**Post date:** [April 20, 2022, 6:24am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/16 "2022-04-20T06:24:39Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![JusticeMcFly](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JusticeMcFly](https://forums.unrealengine.com/u/JusticeMcFly)\
**Post date:** [July 11, 2022, 8:37am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/17 "2022-07-11T08:37:32Z")

</div>

Awesome thanks mate, very helpful.

---

<div class="post-metadata">

**Author:** ![HajimeXNagumo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HajimeXNagumo](https://forums.unrealengine.com/u/HajimeXNagumo)\
**Post date:** [January 6, 2023, 9:34am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/18 "2023-01-06T09:34:55Z")

</div>

Helps me a lot. Thank you very much!!!

---

<div class="post-metadata">

**Author:** ![lord\_sombo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lord\_sombo](https://forums.unrealengine.com/u/lord_sombo)\
**Post date:** [January 9, 2023, 7:18pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/19 "2023-01-09T19:18:17Z")

</div>

Just came across this now and it’d be nice to note that you need to activate the Blueprint File Utilities plugin

---

<div class="post-metadata">

**Author:** ![Ad04a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ad04a](https://forums.unrealengine.com/u/Ad04a)\
**Post date:** [February 18, 2023, 7:32am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270/20 "2023-02-18T07:32:18Z")

</div>

Will this work in packaged for production game?

[Next page](https://forums.unrealengine.com/t/is-there-a-way-to-get-all-savegames-in-bp/301270.md?page=2)
