x

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"

How to override DefaultGame.ini after Packaging?

Hello!

I subclassed the GameState and added a couple of string variables exposed in DefaultGame.ini, here it is:

[/Game/MyProject/MyGameStateBP.MyGameStateBP_C] MyServer="http://192.168.127.103:3030"

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

Product Version: UE 4.11
Tags:
more ▼

asked May 13 '16 at 02:13 PM in Packaging & Deployment

avatar image

littlerussian
21 1 3 6

avatar image Samantha Sutton ♦♦ STAFF May 16 '16 at 04:14 PM

Hey LittleRussian,

Did you save your DefaultGame.ini file in the correct location? Please check here with our Configuration Files Documentation!

Thanks!

avatar image littlerussian May 20 '16 at 08:33 PM

Hi samantha,

I read that document and tried to put that file in several folders, but none worked. What is the correct folder? The easiest one, I dont need localization nor different platform. Just simple windows.

Thanks

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

4 answers: sort voted first

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.

more ▼

answered Jun 08 '16 at 04:54 PM

avatar image

littlerussian
21 1 3 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hey LittleRussian,

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.

Thank you!

more ▼

answered May 20 '16 at 04:19 PM

avatar image littlerussian May 24 '16 at 01:31 PM

Hi samantha,

I read that document and tried to put that file in several folders, but none worked. What is the correct folder? The easiest one, I dont need localization nor different platform. Just simple windows.

Thanks

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered May 27 '16 at 09:36 PM

avatar image littlerussian Jun 08 '16 at 01:56 PM

I tried. But nothing happened. Maybe because I have some "GameState" config variables, I don't know. I tried to debug the engine, but the ConfigCacheIni.cpp seems to be outside the scope of the PDB so I cannot break inside to see what is happening under the hood.

What else could I try? Is it possible to override the game.ini from the command line? Thank you

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Apr 02 '18 at 09:06 PM

avatar image

DanHollingsworth
29 1 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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