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"

Config values resetting

I'm currently struggling with an issue regarding config files. I have a config value in my character which is storing in the game config. I have an options setting which can adjust the value and it saves correctly, when I quit the program and check the config, the value has been changed accordingly. However when I re-open the program the value resets, to whatever the value was in the editor before I packaged it into a game.

I've tried checking throughout my code and I don't see anywhere where I am somehow resetting the config value, at some point when opening the program, the value is either resetting, or not getting updated to the value that is currently in the config file.

At what point are config values set to whatever the contents of the config file contains? I've tried checking the documentation but it doesn't state specifically at what point they get loaded.

Product Version: UE 4.8
Tags:
more ▼

asked Jan 11 '16 at 02:19 PM in C++ Programming

avatar image

Ungalyant
100 10 15 21

avatar image Matthew J ♦♦ STAFF Jan 11 '16 at 03:57 PM

I'm not familiar with editing config values myself so please bare with me, but what particular setting are you trying to change? Is it something that is part of DefaultEngine.ini or something similar? Also, can you post the code where you're setting this value? Any details you can provide would be helpful.

avatar image Ungalyant Jan 12 '16 at 01:19 PM

The value itself is to store language:

 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite)
 FString LanguageSetting;

In this class:

 UCLASS(Config=Game)
 class AGameCharacter : public ACharacter
 {
     ...

The config value gets correctly stored in the game.ini but the language setting value seems to not be grabbing the value saved in the .ini when the game starts up (that's my best guess). I quit the game, check the .ini and the language is "french" let's say, as soon as I start up the game again and I call my set language function to read from the config value in player, it says the value contains "english". My only guess is that I'm trying to use the config value before it's being loaded in by the engine (that might be a ridiculous assumption) I'm doing it on HandleMatchHasStarted in GameMode.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Are you writing to your own .ini and not directly to one of the engine/project specific ones? If so, you'll need to read that data manually and set it to the variable. It won't be automatically read at any point. This will also allow you to determine when it is read, such as just before the call to use it in HandleMatchHasStarted.

more ▼

answered Jan 12 '16 at 03:34 PM

avatar image

Matthew J ♦♦ STAFF
31.8k 526 91 417

avatar image Ungalyant Jan 12 '16 at 03:55 PM

After struggling with this issue for literally weeks, I found out the same answer your just stated on my own, mere minutes before you posted this response -.- very good to have my suspicions confirmed though. Thanks a lot!

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