Skip to content

Config Utils

Introduction

A Blueprint Function Library class used to extract config values

Dependencies

The ConfigUtils relies on other components of this plugin to work:

  • Logger: Used to log useful information to help you debug any issues you might experience

API Reference

Functions

Name Description Params Return
GetConfigValue Extract a config value from a given config file Filename (FString)
The name of the config file

Section (FString)
The section in the config file

Key (FString)
The key in the config file

DefaultValue (FString)
The default value to return if the config file can't be read
FString
The value extracted from the config file
GetGameConfigValue Extract a config value from the default game config file Section (FString)
The section in the config file

Key (FString)
The key in the config file

DefaultValue (FString)
The default value to return if the config file can't be read
FString
The value extracted from the config file

Blueprint Usage

You can use the ConfigUtils using Blueprints by adding one of the following nodes:

  • Ultimate Starter Kit > Utils > Config > Get Config Value
  • Ultimate Starter Kit > Utils > Config > Get Game Config Value

C++ Usage

Before you can use the plugin, you first need to enable the plugin in your Build.cs file:

PublicDependencyModuleNames.Add("USK");

The ConfigUtils can now be used in any of your C++ files:

#include "USK/Utils/ConfigUtils.h"

void ATestActor::Test()
{
    FString ConfigValue = UConfigUtils::GetConfigValue(Filename, Section, Key, DefaultValue);
    FString GameConfigValue = UConfigUtils::GetGameConfigValue(Section, Key, DefaultValue);
}