Unreal editable config file for package

posted in: Non classé | 0
// Config tag can be added to any UCLASS
UCLASS([BlueprintReadOnly,] Config=MyConfigFile)
class PROJET_API MyNewClass : public AActor
{
  GENERATED_BODY()
 
  public: 
  MyNewClass ();
 
  // This will create/read the config file
  UPROPERTY(Config, EditAnywhere)
  FString MySavedVarToConfigFile = "DefaultValue";
 
  //From anywhere inside your class, will generate [YourProject]/Saved/Config/Windows/MyConfigFile.ini
  //SaveConfig();
}

It will generate MyConfigFile.ini in [YourProject]/Config/DefaultMyConfigFile.ini. Reboot Unreal Engine if you modify it

These files will be automatically added to your package.

Leave a Reply

Your email address will not be published. Required fields are marked *