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"

Custom config doesn't appear in packaged game

I created custom config by below C++ code

UCLASS(Config = Game) class MYCONFIG_API UMySettings : public UObject { GENERATED_BODY()

 UPROPERTY(config, EditAnywhere, Category = "Basic", meta = (DisplayName = "Test")
     bool TestBool;

}

I can see the properties appear in [ProjectFolder]\Saved\Config\Windows\Game.ini and edit them via UE editor (I implemented an editor module for it). But in packaged game, there is a Game.ini after I ran the .exe file but it's always empty, the game also always runs on default config I assigned in the C++ constructor.

I tried using defaultconfig and GlobalConfig but nothing changed. Did I miss something?

Product Version: UE 4.21
Tags:
more ▼

asked Aug 08 '19 at 10:39 AM in C++ Programming

avatar image

Howard.CH_Huang
1 1

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

1 answer: sort voted first

Hi Howard,

Your setup is correct. The packaged game saved ini files actually only contain values which are different from the default. If TestBool changes at runtime during the game, you should then see it written to your Game.ini file.

/TD

more ▼

answered Aug 09 '19 at 09:27 PM

avatar image

TrifoliumDigital
86 1 3 2

avatar image Howard.CH_Huang Aug 12 '19 at 03:17 AM

Hi, thanks for the info. Now my question became: how do I carry my custom config that had been modified in Project Settings to packaged game?

avatar image Howard.CH_Huang Aug 12 '19 at 07:03 AM

I can alter the config by GetMutableDefault() during runtime, that solved my problem in a different way. But I'm still wondering how to carry the custom config from Project Setting to a packaged game.

avatar image TrifoliumDigital Aug 12 '19 at 10:29 AM

Hey, so based on the setup you mentioned above, you would need to open your Game/Config/DefaultGame.ini and add the following:

 [/Script/MyConfig.MySettings]
 TestBool=True

When you have made these changes, you will need to repackage your game. These settings will be applied to the default object on load.

/TD

(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