Hey!👋 ubyte.dev just recently launched. It's dedicated towards Unreal Engine 5.

Warning: Undefined array key "page" in /home/u831815985/domains/ubyte.dev/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(582) : eval()'d code on line 24
Portions of the materials used are trademarks and/or copyrighted works of Epic Games, Inc. All rights reserved by Epic. This material is not official and is not endorsed by Epic.
Documentation
Usage Example
Unreal Engine 5.0

Unreal Engine 5.0

title placeholder

What is a Gameplay Location Container?

A Gameplay Location Container is a structure that contains multiple gameplay tags and one weak pointer to an object implementing IGameplayLocationQuerier. It represents multiple ‘descriptions’ to a location that can dynamically be resolved (on-demand) on the context object it carries.

You would usually resort to using Gameplay Locations when just the idea of a location means more than the actual FVector coordinate itself.

Resolving a Gameplay Location Container

Whether instances of a class implementing IGameplayLocationQuerier resolve a certain tag is determined at compile-time. See UGameplayLocationSettings.

You can resolve all tags of FGameplayLocationContainer by calling Get(), which returns a TArray<FVector>.
Or you can call GetMap(), which returns a TMap<FGameplayTag, FVector>.

Refrain from caching the return value beyond its current scope, and always resolve this on-demand instead.

UPROPERTY

Unless you want serialization, it is not necessary to mark your FGameplayLocationContainer class member with UPROPERTY, as FGameplayLocation uses TWeakObjectPtr internally, which will always return nullptr if the object underneath is no longer valid.

Unreal Engine 5.0

Unreal Engine 5.0

Creating an FGameplayLocationContainer

// Simple example
TScriptInterface<IGameplayLocationQuerier> Querier = GetQuerierFromSomewhere();

FGameplayTagContainer GameplayTagContainer;
GameplayTagContainer.AddTag(UGameplayTagsManager::Get().RequestGameplayTag("Your.Tag.X"));
GameplayTagContainer.AddTag(UGameplayTagsManager::Get().RequestGameplayTag("Your.Tag.Y"));
GameplayTagContainer.AddTag(UGameplayTagsManager::Get().RequestGameplayTag("Your.Tag.Z"));

// This example assumes Querier resolves all descendants of "Your.Tag". The move is optional.
FGameplayLocationContainer GameplayLocationContainer{Querier, MoveTemp(GameplayTagContainer)};

Common operations

...
TArray<FVector> Locations = GameplayLocationContainer.Get();
TMap<FGameplayTag, FVector> Map = GameplayLocationContainer.GetMap();
cross linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram