GameplayTagList

GameplayTagList

#Overview

name: GameplayTagList

The value of this variable can be defined or overridden in .ini config files. 210 .ini config files referencing this setting variable.

It is referenced in 13 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of GameplayTagList is to store and manage a list of gameplay tags within the Unreal Engine 5 gameplay tag system. Gameplay tags are used to label and categorize game objects, events, and behaviors in a flexible and extensible manner.

This variable is primarily used by the Gameplay Tags system, which is a core module of Unreal Engine 5. It is also heavily utilized by the GameplayTagsEditor plugin for managing and editing gameplay tags within the editor.

The value of this variable is typically set in configuration files (INI files) and can be modified through the Unreal Engine editor interface. It can also be programmatically modified at runtime.

GameplayTagList interacts with several other variables and functions within the gameplay tag system, such as RestrictedGameplayTagList for managing restricted tags, and various functions for adding, removing, and renaming tags.

Developers should be aware that:

  1. Changes to GameplayTagList can have wide-ranging effects throughout a project, as many systems may depend on specific tags.
  2. The list is sorted alphabetically for easier management.
  3. Tags in this list can be added, removed, or renamed through both editor interfaces and programmatically.

Best practices when using this variable include:

  1. Maintain a consistent naming convention for tags to improve readability and reduce errors.
  2. Use the provided functions for adding, removing, or modifying tags rather than directly manipulating the list.
  3. Be cautious when removing or renaming tags, as it may break existing gameplay logic that relies on those tags.
  4. Regularly review and clean up unused tags to keep the list manageable.
  5. Consider using restricted tags (RestrictedGameplayTagList) for tags that should have limited use or special permissions.

#Setting Variables

#References In INI files

<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:11, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:12, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:13, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:14, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:15, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:16, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:17, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:18, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:19, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:20, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:21, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:22, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:23, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:24, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:25, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:26, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:27, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:28, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:29, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:30, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:31, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:32, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:33, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:34, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:35, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:36, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:37, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:38, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:39, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:40, section: [/Script/GameplayTags.GameplayTagsSettings]
<Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:41, section: [/Script/GameplayTags.GameplayTagsSettings]


... omitting 180 locations ...

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsEditorModule.cpp:459

Scope (from outer to inner):

file
class        class FGameplayTagsEditorModule : public IGameplayTagsEditorModule
function     virtual bool AddNewGameplayTagToINI

Source code excerpt:

				UGameplayTagsList* TagList = TagSource->SourceTagList;
				TagListObj = TagList;
				TagList->GameplayTagList.AddUnique(FGameplayTagTableRow(FName(*NewTag), Comment));
				TagList->SortTags();
				ConfigFileName = TagList->ConfigFileName;
				bSuccess = true;
			}

			GameplayTagsUpdateSourceControl(ConfigFileName);

#Loc: <Workspace>/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsEditorModule.cpp:583

Scope (from outer to inner):

file
class        class FGameplayTagsEditorModule : public IGameplayTagsEditorModule
function     virtual bool DeleteTagFromINI

Source code excerpt:

		// Passed, delete and save
		const FString& ConfigFileName = bTagIsRestricted ? TagSource->SourceRestrictedTagList->ConfigFileName : TagSource->SourceTagList->ConfigFileName;
		int32 TagListSize = bTagIsRestricted ? TagSource->SourceRestrictedTagList->RestrictedGameplayTagList.Num() : TagSource->SourceTagList->GameplayTagList.Num();

		for (int32 i = 0; i < TagListSize; i++)
		{
			bool bRemoved = false;
			if (bTagIsRestricted)
			{

#Loc: <Workspace>/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsEditorModule.cpp:599

Scope (from outer to inner):

file
class        class FGameplayTagsEditorModule : public IGameplayTagsEditorModule
function     virtual bool DeleteTagFromINI

Source code excerpt:

			else
			{
				if (TagSource->SourceTagList->GameplayTagList[i].Tag == TagName)
				{
					TagSource->SourceTagList->GameplayTagList.RemoveAt(i);
					TagSource->SourceTagList->TryUpdateDefaultConfigFile(ConfigFileName);
					bRemoved = true;
				}
			}

			if (bRemoved)

#Loc: <Workspace>/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsEditorModule.cpp:739

Scope (from outer to inner):

file
class        class FGameplayTagsEditorModule : public IGameplayTagsEditorModule
function     virtual bool RenameTagInINI

Source code excerpt:

				UGameplayTagsList* TagList = OldTagSource->SourceTagList;

				for (int32 i = 0; i < TagList->GameplayTagList.Num(); i++)
				{
					if (TagList->GameplayTagList[i].Tag == OldTagName)
					{
						TagList->GameplayTagList.RemoveAt(i);

						TagList->TryUpdateDefaultConfigFile(TagList->ConfigFileName);
						GameplayTagsUpdateSourceControl(TagList->ConfigFileName);
						GConfig->LoadFile(TagList->ConfigFileName);

						break;

#Loc: <Workspace>/Engine/Plugins/Editor/GameplayTagsEditor/Source/GameplayTagsEditor/Private/GameplayTagsSettingsCustomization.cpp:33

Scope (from outer to inner):

file
function     void FGameplayTagsSettingsCustomization::CustomizeDetails

Source code excerpt:

		GameplayTagsCategory.GetDefaultProperties(GameplayTagsProperties, true, true);

		TSharedPtr<IPropertyHandle> TagListProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UGameplayTagsList, GameplayTagList), UGameplayTagsList::StaticClass());
		TagListProperty->MarkHiddenByCustomization();

		TSharedPtr<IPropertyHandle> NewTagSourceProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UGameplayTagsSettings, NewTagSource));
		NewTagSourceProperty->MarkHiddenByCustomization();

		for (TSharedPtr<IPropertyHandle> Property : GameplayTagsProperties)

#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Classes/GameplayTagsSettings.h:41

Scope (from outer to inner):

file
class        class UGameplayTagsList : public UObject

Source code excerpt:

	/** List of tags saved to this file */
	UPROPERTY(config, EditAnywhere, Category = GameplayTags)
	TArray<FGameplayTagTableRow> GameplayTagList;

	/** Sorts tags alphabetically */
	GAMEPLAYTAGS_API void SortTags();
};

/** Base class for storing a list of restricted gameplay tags as an ini list. This is used for both the central list and additional lists */

#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp:392

Scope (from outer to inner):

file
function     void UGameplayTagsManager::AddTagsFromAdditionalLooseIniFiles

Source code excerpt:

				for (const FString& Tag : Tags)
				{
					FoundSource->SourceTagList->GameplayTagList.AddUnique(FGameplayTagTableRow(FName(*Tag)));
				}
			}
			else
			{
				// Load from new ini
				FoundSource->SourceTagList->LoadConfig(UGameplayTagsList::StaticClass(), *IniFilePath);

#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp:408

Scope (from outer to inner):

file
function     void UGameplayTagsManager::AddTagsFromAdditionalLooseIniFiles

Source code excerpt:

#endif

			for (const FGameplayTagTableRow& TableRow : FoundSource->SourceTagList->GameplayTagList)
			{
				AddTagTableRow(TableRow, TagSource);
			}
		}
	}
}

#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp:489

Scope (from outer to inner):

file
function     void UGameplayTagsManager::ConstructGameplayTagTree

Source code excerpt:

			for (const FString& EngineConfigTag : EngineConfigTags)
			{
				MutableDefault->GameplayTagList.AddUnique(FGameplayTagTableRow(FName(*EngineConfigTag)));
			}

			// Copy from deprecated list in DefaultGamplayTags.ini
			EngineConfigTags.Empty();
			GConfig->GetArray(TEXT("/Script/GameplayTags.GameplayTagsSettings"), TEXT("+GameplayTags"), EngineConfigTags, MutableDefault->GetDefaultConfigFilename());

			for (const FString& EngineConfigTag : EngineConfigTags)
			{
				MutableDefault->GameplayTagList.AddUnique(FGameplayTagTableRow(FName(*EngineConfigTag)));
			}

#if WITH_EDITOR
			MutableDefault->SortTags();
#endif

#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp:508

Scope (from outer to inner):

file
function     void UGameplayTagsManager::ConstructGameplayTagTree

Source code excerpt:

			FGameplayTagSource* DefaultSource = FindOrAddTagSource(TagSource, EGameplayTagSourceType::DefaultTagList);

			for (const FGameplayTagTableRow& TableRow : MutableDefault->GameplayTagList)
			{
				AddTagTableRow(TableRow, TagSource);
			}

			// Make sure default config list is added
			FString DefaultPath = FPaths::ProjectConfigDir() / TEXT("Tags");

#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp:1882

Scope (from outer to inner):

file
function     void UGameplayTagsManager::FindTagsWithSource

Source code excerpt:

			if (Source.SourceTagList)
			{
				for (const FGameplayTagTableRow& Row : Source.SourceTagList->GameplayTagList)
				{
					OutTags.Add(FGameplayTag(Row.Tag));
				}
			}
		}
	}

#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp:2169

Scope (from outer to inner):

file
function     void UGameplayTagsManager::AddNativeGameplayTag

Source code excerpt:

{
	const FGameplayTagSource* NativeSource = FindOrAddTagSource(TagSource->GetModuleName(), EGameplayTagSourceType::Native);
	NativeSource->SourceTagList->GameplayTagList.Add(TagSource->GetGameplayTagTableRow());
	
	// This adds it to the temporary tree, but expects the caller to add it to FNativeGameplayTag::GetRegisteredNativeTags for later refreshes
	AddTagTableRow(TagSource->GetGameplayTagTableRow(), NativeSource->SourceName);

	HandleGameplayTagTreeChanged(false);
}

#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsSettings.cpp:15

Scope (from outer to inner):

file
function     void UGameplayTagsList::SortTags

Source code excerpt:

void UGameplayTagsList::SortTags()
{
	GameplayTagList.Sort();
}

URestrictedGameplayTagsList::URestrictedGameplayTagsList(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer)
{
	// No config filename, needs to be set at creation time