I’d like to start off my post by stating up front that I am not a very strong C++ programmer. I have been following the tutorials on the wiki in order to gain a better understanding of the engine, as well as C++. I’ve reached the point where I began reading through the save system written by Rama. He does state that it isn’t in a copy/paste format, but even as a concept overview, I find parts of it missing(?) or confusing.
Everything makes sense until we get to the “Core Header Files section.” He states that we’ll be using GFileManager to access the functions in FileManager.h. I don’t see any reference to a GFileManager; mine is IFileManager. Sorry if that seems like a stupid question, but that would be the same thing, right?
Once I get to the section “Saving Binary Files”, I don’t even see GFileManager referenced under the function SaveGameDataToFile. I only see FFileHelper. I feel like I am missing something, but I am not sure what it is.
After this code window there is “FBufferArchive.” Is that supposed to be contained in the code window, or was it just a typo?
I have a few other questions, but those are the big ones that have me stuck right now. I’m sorry for leaving a book for someone to read, but I didn’t want to break this thing up into 3-4 question posts. Hopefully, someone else has completed the tutorial and can give me a tiny bit more insight on what I need to do in order to make things work. Thanks in advance for your help!
since I had the pleasure of trying to walk through the same tutorial here are the answers i came up with:
IFileManager and GFileManager are not the same thing. The I in IFileManager indicates an Interface (hence, a class). In Unreal Coding Conventions the G in front of the GFileManager points out a pointer to a Singleton (pointer to an Instance, like GEngine; correct me, if I’m totally wrong here). Since I cannot find GFileManager either, I guess the functionality has been scrapped, renamed or moved somewhere else. There is an FPlatformFileManager with a static Get()-Function that Rama uses in another one of his tutorials. Its usage is like this:
The Functions for Saving or Loading binary files are static functions of the FFileHelper-Class. So you can access these functions with FFileHelper::RandomFunctionName(parameters); I
The FBufferArchive-Box is neither a typo nor a misplacement. Rama actually referenced the Header-file of FBufferArchive (this class already exists, you don’t have to write it, it’s in the Archive.h) to avoid confusion with his ‘both archive and array’-statement. Ironically, it caused confusion instead.
I hope this helps you a bit.
The IFileManager has a static Get()-Function, too. The FFileHelper::SaveArrayToFile()-Function uses it (by default) to acquire its third parameter.