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).
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.
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/.
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:
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.
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
my_project/Config/MyPluginsSettings.ini
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
my_project/Saved/Config/Windows
to
my_project/Config
The only way I see is to stay on the plugins/Config directory as I wrote in my previous comment.