How to override DefaultGame.ini after Packaging?
I subclassed the GameState and added a couple of string variables exposed in DefaultGame.ini, here it is:
After packaging, I would like to change this value with another address, how could I do?
I tried putting another DefaultGame.ini file under all folders in the package, such as Project/Config, or Saved/Config, but it never changed. What am I missing?
Thanks a lot
asked May 13 '16 at 02:13 PM in Packaging & Deployment
I think I solved my problem.
I try to explain the solution in case someone else gets trapped in this point.
I created a new class, say MySettings, and stated that I want it to be written on a custom Config file, and added the variables tagged as "Config" .
Then I told my GameState-derived class to instanciate it at BeginPlay (now I'll try to load it at construction time, but it's almost the same).
In the config file I wrote: [/Script/MyProject.MySettingClass] WebServerURL=pluto
And put this file under "Saved/Config/WindowsNoEditor/MySettingClass.ini And it works as expected.
I suppose that the part I was missing was that the GameState, as a uasset, is cooked. Maybe unreal gives precedence to the cooked value rather than my default .ini file.
Implementing it this way, instead, I put it under the domain of /Script/, not /Game/, so there's no other variable that could override it in cooking.
answered Jun 08 '16 at 04:54 PM
We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.
answered May 20 '16 at 04:19 PM
If you're just trying to find the DefaultGame.ini for your project simply try this example: C:\Users\mycomputer\Desktop\MyProject\Config and then inside of the Config folder there will be the DefaultGame.ini.
answered May 27 '16 at 09:36 PM
The configs only use the prepended "Default" in 1 location. That is /Config.
so for DefaultGame.ini that is /Config/DefaultGame.ini. Default is the only file looked for in this folder, and this folder is the only place Default is looked for.
In the engine config is a BaseGame.ini, a Platform split in the configs/platform folder, then we get to the DefaultGame.Ini in the project config folder, and a Project config / platform folder, IE: PS4Game.ini, and finally in your project/saved/config is just Game.ini.
When you cook and package these are all compiled into a single Game.ini which is placed into the .PAK file.
I dont think this works, but you can try. The Saved Folder does not have the "Default" prefix. It would just be Game.ini.
But this should not work. It is a hacking exploit. And I thought that it dropped out of shipping / test builds. If not then this is a bug in unreal.
answered Apr 02 '18 at 09:06 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here