Issue with using ' BuildRuntimeAutoCompleteList'.

Hi,

Question from one of my engineers.

Subject:

Custom UConsole Subclass Doesn’t Persist HistoryBuffer—Manual Save/Load Required via ConsoleHistory.ini

Details:

Implemented `UP1Console` derived from `UConsole` using the following details:

UCLASS(Within=GameViewportClient, config=Input, MinimalAPI)

class UP1Console : public UConsole

1. Matching the UCLASS specifiers of UConsole (with and without the Transient)

2. DefaultEngine.ini

[/Script/Engine.Engine]

ConsoleClassName=/Script/P1Game.P1Console

3. DefaultEditor.ini

[/Script/UnrealEd.UnrealEdEngine]

ConsoleClassName=/Script/P1Game.P1Console

I created the class in order to register auto complete entries for custom cheat commands, so really the only function I overloaded was BuildRuntimeAutoCompleteList

What broke was the console command history between app sessions was lost (specifically in a PIE session). Ultimately to patch it I wrote brute force saves/loads. But I shouldn’t have to do that, so it feels like there is something crucial missing or perhaps it’s an engine bug.

Files attached, it’s generic code and nothing propriety.

Thanks,

Simon

Hi,

Any update on this.

Thanks,

Simon

Hey Simon,

Apologies for the delay. I started looking at this last week but got swamped with other tasks.

The issue here is that the HistoryBuffer member misses the GlobalConfig UProperty flag. That flag ensures that any derived classes save into the parent class section in the .ini file (i.e. save into [/Script/Engine.Console] rather than [/Script/GameName.P1Console] ).

You can manually set the config section to save to by overriding the virtual OverrideConfigSection() function in your custom console class like this:

virtual void OverrideConfigSection(FString& SectionName) override { SectionName = UConsole::StaticClass()->GetPathName(); }I’ll double check with our config devs and add the GlobalConfig flag to that property so that the workaround is hopefully no longer necessary in future releases.

Best,

Sebastian