Can't read variables from DefaultEngine.ini file. Going crazy!

Please help, I am losing my mind here. Posting only after reading a ton of docs and forum posts to no avail.

I have a generative art project built in UE5.4.4 and would like to feed it certain parameters from a config file (currently I have to edit them in editor and create new builds each time I change something).

Following the official docs and suggestions in forum posts here’s my test setup:

In a pawn named BP_CanvasCamera I have created two veriables:
testNumber and testString (an int and a string, respectively) and marked them both as Config Variable.

The BP_CanvasCamera is stored in the Content/Blueprints folder:
image

Based on the tooltip from Config Variable and some info from official UE Docs, I created the following code:

[/Game/Blueprints/BP_CanvasCamera.BP_CanvasCamera_C]
testNumber=777
testString="changed"

…and appended it to the DefaultEngine.ini config file in my PROJECTNAME/Config/ directory.

I then have a simple function that executes on Event BeginPlay that logs the values of both variables:

No matter what I do, The values show 2024 for the testNumber and Default for testString - their Default Values from the editor. I cannot get it to read the values from INI, no mater which INI file I put it in.

I also tried using the SKEL_ syntax in config section. No difference.

I’ve spent two days trying to get this to work. It’s probably something dumb and simple - but I cannot for the life of me figure it out. HELP, PLZ.

i like

Seriously? Nobody?

There must be someone willing and able?

maybe the default values in editor are overriding the values set in defaultengine.ini?

They definitely are, but that’s not how it’s supposed to work.

Variables need default values, when initialized in a BP. .ini files are supposed to allow one to overwrite them externally, without the need to recompile from the editor.

Based on few other forum posts, which i will link, this is only working in actors and not on player controllers or maybe pawns in your reason. What we can do is, try the same setup in an bp actor, put it in level so that config values are loaded and then on actor’s begin play, cast to bp canvas pawn and set values?

How to configure ini file value for a Blueprint Config Variable? - General / Feedback & Requests - Epic Developer Community Forums (unrealengine.com)

Does “Config Variable” work in packaged game as well? - Development / Programming & Scripting - Epic Developer Community Forums (unrealengine.com)

That’s an awesome discovery. I have not come across that lead yet.
Will try it tomorrow and report right back :slight_smile:
Thank you!

@Ram07 you were so right, thank you a 1000-fold.

As soon as I moved the config variables to a separate BP, everything started working. Wild.

It still does not do anything while in editor, and only kicks in once compiled, but w00t! It’s alive.

Now I just gotta find in which folder that EngineDefault.ini ended up :slight_smile:

Is it possible it got packed into one of the pak/ucas files?? Please, no!

good to hear that you got it working … like after packaging you mean?

Yea, apparently when I build/package the project, the ini file gets packed too (it’s listed in the Manifest_UFSFiles_Win64.txt) – so I still don’t have a way of editing it outside of the editor environment.

This thing is driving me mad.

i think as the new builds take very less as the binaries will already be there, and also these builds are for testing purposes, so maybe editing the values, taking builds, and repeating process as of now can do?

I will be sending the project to a gallery where it needs to be setup and in there nobody will be able to use Unreal Editor. I gotta find a way to use a config file.

maybe remove this as solved or create new post bro so that others may see and if they know something, they may share, :sweat_smile: i will also see though

Well, you’ve gotten me closer to the solution, so thank you for that.

It’s really mind-boggling how complicated this is.

I tried disabling PAKing of the files, and sure, it packaged the project with all files exposed – but changing values in the packaged DefaultEngine.ini no longer has any effect.

The build shows the value entered in DefaultEngine.ini in before it was built, but won’t change when I edit the config. Jeez.

Does removing the intermediate/saved/etc folders help with that or is still there?

then i think you can use external db’s as such and give them another UE application or web app or something like that where they can change values so that this main Unreal app now gets the values from online

Removing them from where?

According to the documentation, ini files are the way to do it. I just don’t know what I am doing wrong (or whether the documentation is incomplete). I don’t think I should need to resort to building a whole new system when one is already (supposedly) in place, built by Epic…