# Custom INI parameters

**URL:** <https://forums.unrealengine.com/t/custom-ini-parameters/1227854>\
**Category:** C++\
**Tags:** ini, settings, unreal-engine, config, Blueprint, CPP, question\
**Created:** [July 13, 2023, 8:02am UTC](https://forums.unrealengine.com/t/custom-ini-parameters/1227854 "2023-07-13T08:02:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitrogen092](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nitrogen092](https://forums.unrealengine.com/u/nitrogen092)\
**Post date:** [July 13, 2023, 8:02am UTC](https://forums.unrealengine.com/t/custom-ini-parameters/1227854/1 "2023-07-13T08:02:22Z")

</div>

Hello everyone Please tell me how to add a custom parameter to the “Game User Settings.ini” file? For example:  
…  
ResolutionSizeX=1920  
ResolutionSizeY=1080  
bUseVSync=False  
…  
Music Volume = 0.75 // Custom param

And please tell me, is this done in C++ or BP?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [July 13, 2023, 1:39pm UTC](https://forums.unrealengine.com/t/custom-ini-parameters/1227854/2 "2023-07-13T13:39:37Z")

</div>

> [@How to store variables to a custom .ini file?](https://forums.unrealengine.com/t/how-to-store-variables-to-a-custom-ini-file/330274/6):
>
> This is an old question but I was having the same problem and happened across the solution, so I figured I’d post it for posterity. Here’s how it works: Your c++ class definition should look like this. UCLASS(config=NewConfigFileName) class YOURGAME\_API AExample : public AActor { GENERATED\_BODY() UPROPERTY(Config) int32 test\_number; UPROPERTY(Config) FString test\_string; } Edit: Oh and I almost forgot, you can have other properties in your UPROPERTY declarati…

---

<div class="post-metadata">

**Author:** ![nitrogen092](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nitrogen092](https://forums.unrealengine.com/u/nitrogen092)\
**Post date:** [July 13, 2023, 3:20pm UTC](https://forums.unrealengine.com/t/custom-ini-parameters/1227854/3 "2023-07-13T15:20:20Z")

</div>

> [@How to store variables to a custom .ini file?](https://forums.unrealengine.com/t/how-to-store-variables-to-a-custom-ini-file/330274/6):
>
> `NewConfigFileName`

Can an existing INI file be used as a NewConfigFileName?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [July 13, 2023, 3:50pm UTC](https://forums.unrealengine.com/t/custom-ini-parameters/1227854/4 "2023-07-13T15:50:07Z")

</div>

Well that’s the same macro that is used in the unreal classes  
example  
UCLASS(config=Engine, defaultconfig, meta=(DisplayName=“Control Rig”))

or

UCLASS(config=Engine, Blueprintable, editinlinenew)

the key seems to have the correct uproperty markup

UPROPERTY(config)

for the game config I believe it’s

```auto
UCLASS(config=Game, defaultconfig)

```

---

<div class="post-metadata">

**Author:** ![nitrogen092](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nitrogen092](https://forums.unrealengine.com/u/nitrogen092)\
**Post date:** [July 13, 2023, 3:57pm UTC](https://forums.unrealengine.com/t/custom-ini-parameters/1227854/5 "2023-07-13T15:57:56Z")

</div>

It’s probably a stupid question, but I’m going to ask it anyway… Can I write/read custom parameters via BP? I will create a CPP class using your method that you wrote above, and then via BP I will call GetGameUserSettings-\>Apply Settings or SaveSettings (it doesn’t matter). Will my custom parameters be saved/applied?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [July 13, 2023, 4:01pm UTC](https://forums.unrealengine.com/t/custom-ini-parameters/1227854/6 "2023-07-13T16:01:18Z")

</div>

> [@nitrogen092](#):
>
> GetGameUserSettings

TBH I’m not sure it will work by default.

You may need to extend UGameUserSettings perhaps overriding ApplySettings, and probably cast to your custom extended GameUserSettings (that’s at least what I’d do)

---

<div class="post-metadata">

**Author:** ![nitrogen092](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nitrogen092](https://forums.unrealengine.com/u/nitrogen092)\
**Post date:** [July 13, 2023, 4:05pm UTC](https://forums.unrealengine.com/t/custom-ini-parameters/1227854/7 "2023-07-13T16:05:10Z")

</div>

Thank you very much for telling me in which direction to move!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [August 12, 2023, 4:05pm UTC](https://forums.unrealengine.com/t/custom-ini-parameters/1227854/8 "2023-08-12T16:05:14Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
