WarnOnInvalidTags
WarnOnInvalidTags
#Overview
name: WarnOnInvalidTags
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of WarnOnInvalidTags is to control whether warnings are issued when the system encounters invalid gameplay tags during loading or runtime operations. This setting is part of the Gameplay Tags system in Unreal Engine 5.
The Gameplay Tags system, which is a core module in Unreal Engine, relies on this setting variable. It is primarily used within the GameplayTags module, as evidenced by its declaration in GameplayTagsSettings.h and its usage in GameplayTagsManager.cpp.
The value of this variable is set in the constructor of UGameplayTagsSettings in GameplayTagsSettings.cpp, where it is initialized to true. It can be modified through the project settings in the Unreal Editor, as it is declared as a config property with the UPROPERTY macro.
WarnOnInvalidTags interacts closely with another variable, ClearInvalidTags. While WarnOnInvalidTags controls whether warnings are issued, ClearInvalidTags determines whether invalid tags should be removed when encountered.
Developers must be aware that enabling this variable may result in warnings during development, which can be helpful for identifying and fixing issues with gameplay tag usage. However, it may also generate noise in the output log if there are many invalid tags.
Best practices when using this variable include:
- Keep it enabled during development to catch and fix invalid tag issues early.
- Consider disabling it for shipping builds to avoid unnecessary warnings in production.
- Use it in conjunction with ClearInvalidTags to decide how to handle invalid tags (warn only or warn and clear).
- Regularly review and address the warnings generated when this setting is enabled to maintain a clean and valid set of gameplay tags.
- Ensure that all team members understand the implications of this setting and agree on its configuration for different build types.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:3, section: [/Script/GameplayTags.GameplayTagsSettings]
- INI Section:
/Script/GameplayTags.GameplayTagsSettings
- Raw value:
True
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Classes/GameplayTagsSettings.h:106
Scope (from outer to inner):
file
class class UGameplayTagsSettings : public UGameplayTagsList
Source code excerpt:
/** If true, will give load warnings when reading in saved tag references that are not in the dictionary */
UPROPERTY(config, EditAnywhere, Category = GameplayTags, meta = (ConfigRestartRequired = true))
bool WarnOnInvalidTags;
/** If true, will clear any invalid tags when reading in saved tag references that are not in the dictionary */
UPROPERTY(config, EditAnywhere, Category = GameplayTags, meta = (ConfigRestartRequired = true))
bool ClearInvalidTags;
/** If true, will allow unloading of tags in the editor when plugins are removed */
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp:558
Scope (from outer to inner):
file
function void UGameplayTagsManager::ConstructGameplayTagTree
Source code excerpt:
bUseFastReplication = MutableDefault->FastReplication;
bShouldWarnOnInvalidTags = MutableDefault->WarnOnInvalidTags;
bShouldClearInvalidTags = MutableDefault->ClearInvalidTags;
NumBitsForContainerSize = MutableDefault->NumBitsForContainerSize;
NetIndexFirstBitSegment = MutableDefault->NetIndexFirstBitSegment;
#if WITH_EDITOR
if (GIsEditor)
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsSettings.cpp:62
Scope (from outer to inner):
file
function UGameplayTagsSettings::UGameplayTagsSettings
Source code excerpt:
ConfigFileName = GetDefaultConfigFilename();
ImportTagsFromConfig = true;
WarnOnInvalidTags = true;
ClearInvalidTags = false;
FastReplication = false;
AllowEditorTagUnloading = true;
AllowGameTagUnloading = false;
InvalidTagCharacters = ("\"',");
NumBitsForContainerSize = 6;