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
asked Sep 05 '17 at 04:06 PM in C++ Programming
You need add the directory
But I recommend you write a setting class, if the json file is just for configuration. The setting class was defined like
answered Sep 06 '17 at 03:20 PM
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.
answered Sep 07 '17 at 09:15 AM
Ok, found the answer. To get the plugin settings file copied I have to add it to the MyPlugin.Build.cs
And in UCLASS
answered Sep 07 '17 at 02:10 PM
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,
there are at least two problems:
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:
answered Sep 10 '17 at 03:51 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here