Hi,
How can i get/set values in Project Settings/Project/Description ? like Project Version, Company Name… ?
I think it’s possible to read/write inside DefaultGame.ini with blueprint in realtime ?
Thanks
Hi,
How can i get/set values in Project Settings/Project/Description ? like Project Version, Company Name… ?
I think it’s possible to read/write inside DefaultGame.ini with blueprint in realtime ?
Thanks
Can’t do this in Blueprint (can’t find a way at least).
But it’s not hard in CPP to make a simple Blueprint function.
CPP:
FString AppVersion;
GConfig->GetString(
TEXT("/Script/EngineSettings.GeneralProjectSettings"),
TEXT("ProjectVersion"),
AppVersion,
GGameIni
);
I also tried using the EngineSettings object, but I couldn’t get it compiling. So, reading ini file directly will have to do!
See A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums,Read%26_Write_to_Config_Files for more on ini giles
you for this, and I know this is not my topic but can you explain to me how to create this Blueprint node step by step? What I’ve done so far is: File-> Add code to project… and created an empty class. Is that alright or should I choose a different one. And now what? I’m sorry to ask this but I can’t find any good tutorials on this out there.
While I can’t teach you how to code in CPP in a UE4 answers comment, I can give some snippets. There are tons of programming guides on the UE4 help site and forums to get started with UE4 programming.
I assume you want this generally available in your project, so you need to add this to a Blueprint function library. In the header file of the class you made, first extend your class by UBlueprintFunctionLibrary (replacing UMyBlueprintLibrary with your class name):
UMyBlueprintLibrary : public UBlueprintFunctionLibrary
You might need to add “#include “Kismet/BlueprintFunctionLibrary.h”” before the other includes if it moans about UBlueprintFunctionLibrary.
In the “public:” section, create a new UFUNCTION like so:
UFUNCTION(BlueprintCallable, Category="Game Config")
static FString GetAppVersion();
Then in the CPP file, create the actual function:
FString UMyBlueprintLibrary::GetAppVersion() {
FString AppVersion;
GConfig->GetString(
TEXT("/Script/EngineSettings.GeneralProjectSettings"),
TEXT("ProjectVersion"),
AppVersion,
GGameIni
);
return AppVersion;
}
Can’t believe I missed your reply. you for your great help!
I’ve created a video tutorial for those who need some help in the future:
Here is an other text based tutorial with pictures and the source code link text
Thanks for the code snippet! To compile on 4.20 I had to add this include : #include “Misc/ConfigCacheIni.h”
Cheers
I actually just released a plugin that implements this feature! It’s called Fortuna Extended Function Library and contains functions for retrieving project settings, legal info, company info, and a bunch more