This works for the running game, i.e. after calling these functions the screen is correctly set to the desired resolution etc. However, none of these settings are being written to a config (ini) file. In fact, there is no such ini file at all in the packaged game.
I found the ini file to be saved in the following folder: %LOCALAPPDATA%/<APP-NAME>/Saved/Config/WindowsNoEditor/GameUserSettings.ini. However, after calling the C++ code shown above, this ini file becomes completely empty, no settings there. So after starting the packaged game again, obviously no settings set the last time are used (as the ini file is empty).
I am totally out of ideas now
Could someone please explain to me what I am doing wrong, and what I need to do in order to get this to work?
I’m not sure if this a is a preferred method, but you could probably look into creating save game objects.
I can’t remember the specifics, but it’s as easy as deriving from a certain class, putting all the variables you’d like to save in there and then using a function to save to a game slot.
There are like four relevant functions for loading and saving in UGameplayStatics. I’m sure you’ll find the wiki entry for it or such.
You could then load the settings during startup and apply them.
So it turned out that calling RequestResolutionChange() is not enough. That does change the current resolution, but it does not save that internally. Only after calling SetScreenResolution() followed by SaveSettings() those new settings are being saved to the .ini file …
Hi,
We’re having the same issue too. I don’t quite understand the last comment haimat. You say that you need to call SetScreenResolution() first but in your original post SetScreenResolution is already being called? What we’re seeing is that it is failing to save despite calling SetScreenResolution():