Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Use .json file in plugin content

Hi, I wrote a plugin for editor and game. I want to read/write some plugin settings to a json file. The plugin file structure is:


In editor mode everything works fine. In game mode not. The my.json file is not packaged! How can I package this file to?

Thanks in advance

Product Version: UE 4.17
more ▼

asked Sep 05 '17 at 04:06 PM in C++ Programming

avatar image

58 2 7 12

(comments are locked)
10|2000 characters needed characters left

4 answers: sort voted first

You need add the directory config into the Directories to never cook list in packaging of project settings. alt text Then all file in that directory will be packaged.

But I recommend you write a setting class, if the json file is just for configuration. The setting class was defined like UCLASS(config = MyPluginSettings, defaultconfig). And the property of the setting class was defined like UPROPERTY(Config, EditDefaultsOnly, BlueprintReadOnly).

package.jpg (88.4 kB)
more ▼

answered Sep 06 '17 at 03:20 PM

avatar image

146 1 4 3

(comments are locked)
10|2000 characters needed characters left

Thanks c4g.io !

As you recomended, I switched to a settings class. In editor reading and writing properites of my plugin works. I use Engine.ini.

Next step, how to bring these settings, made in the editor, into the packaged game (which includes my plugin)? If I package the game the extended Engine.ini is not included.

Any idea?

more ▼

answered Sep 07 '17 at 09:15 AM

avatar image

58 2 7 12

avatar image c4g.io Sep 09 '17 at 03:10 PM

The MyPluginSettings will be generated and saved in [Project]/Config/DefaultMyPluginSettings.ini then the parameter of the settings is changed in the UE4 editor. You know all ini files is created for the project not the plugin, so it will be saved in [Project]/Config/.

(comments are locked)
10|2000 characters needed characters left

Ok, found the answer. To get the plugin settings file copied I have to add it to the MyPlugin.Build.cs

 if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32)
     string ConfigFile = "$(ProjectDir)/Plugins/MyPlugin/Config/MyPluginSettings.ini";
     RuntimeDependencies.Add(new RuntimeDependency(ConfigFile));


 UCLASS(Config="Plugins/MyPlugin/Config/MyPluginSettings", defaultconfig)
more ▼

answered Sep 07 '17 at 02:10 PM

avatar image

58 2 7 12

(comments are locked)
10|2000 characters needed characters left

Thanks c4g.io. If I understand the handling of configuration files (UPROPERTY) correctly, it is unusable for plugin settings. For example, using the project config directory,

UCLASS(Config="MyPluginSettings", defaultconfig)

there are at least two problems:

  1. It is not possible to read in default settings which are shipped with the plugin. Default settings have to be in my_plugin/Config directory. Though the plugin should look at my_project/Config.

  2. First problem is not too bad. Because the default settings can be hard coded into the plugin. The next problem is to get the config file written to the right place. For example I modify the plugin settings in the Unreal editor. Then the MyPluginSettings.ini is saved at


If i launch or package the project the MyPuginSettings.ini are expected to be in


I dont want to tell the plugin user to hand copy this or modify his project package settings. So how to copy the MyPluginSettings.ini automatically after they are modified, or before launch/package, from




The only way I see is to stay on the plugins/Config directory as I wrote in my previous comment.

My test code for project configuration handling:


 UCLASS(Config="MYPluginSettings", defaultconfig)
 class MYPLUGIN_API UMySettings : public UObject
     UPROPERTY(Config, BlueprintReadOnly, Category=MyPlugin)
     int32 IntegerSetting;    
     int32 GetIntegerSetting() const;
     void SetIntegerSetting(int32 value;)


 UMySettings::UMySettings(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
     // maybe set default values, problematic if a .ini file already exist
     //IntegerSetting = 1;
 int32 UMySettings::GetIntegerSetting() const {
        return IntegerSetting;
 void UMySettings::SetIntegerSetting(int32 value) {
     IntegerSetting = value;

more ▼

answered Sep 10 '17 at 03:51 PM

avatar image

58 2 7 12

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question