If I go to Edit → Project Settings → Project - Description, I get a page where I can fill in settings like the “About”, the “Publisher” etc. In the “About” tab I can choose things like the Project Thumbnail, the Description, Project Version etc. I want to display the project version in the “about” page in my game dynamically.
On top of the page there is a notification:
These settings are saved in DefaultGame.ini, which is currently checked out.
I checked the file, and most of the settings are indeed saved here, but the “Project Version” is missing.
How do I get this Project Version, so I can use it in a blueprint?
The Project Settings (in your case the Genreal Project Settings; the Project ID, Project Name, Project Version, etc.) indeed get saved into the DefaultGame.ini inside your Projects Config folder, under the ‘[/Script/EngineSettings.GeneralProjectSettings]’ section inside the file.
But the Project Version is an exception, it only get’s saved into the INI file, if it differs to the Default ‘1.0.0.0’ from the Engine’s DefaultGame.ini (found inside the Engine’s config folder).
Which by itself is the default behavior, Unreal only saves differences from the ‘parent’ file. You can find the configuration file hierarchy here: Configuration Files | Unreal Engine Documentation .
If you want the Project Version to be saved into this config file, you basically have to change it to something else than ‘1.0.0.0’. If you want to retrieve that data, you can use the code given in the answer you linked in your question, but I’ll give it here again:
One could replace the BlueprintCallable with the BlueprintPure tag making it a pure blueprint function. Which would make more sense as we’re not modifying anything. You can look at this article: Functions | Unreal Engine Documentation , for further details on pure vs impure functions.
And don’t forget about the #include "CoreMinimal.h" otherwise the GConfig is not available to you.
Everything is placed inside a Blueprint Function Libary c++ class.
Hope that helps. Just let me know, if you have any questions.
Regards,
Vecherka.
Edit: Corrected the post and added references to it.