Unreal Engine 5.0
Unreal Engine 4.27
Unreal Engine 5.0
Unreal Engine 4.27
FWorldActivityCognitionTag
is a type of FGameplayTag
that only allows tags mapped to the "WorldActivityCognition" base category.
Tags (or even other categories) mapped to "WorldActivityCognition" encapsulate anything from knowledge, reasoning, to memory for world activity worker specifically. FWorldActivityCognitionTag
just denotes this in a more type-safe way, which is understood by the editor when used as property or function argument.
You can use this structure instead of constantly typing out UPROPERTY
of UFUNCTION
metadata specifiers responsible for filtering your gameplay tag.
Functions that take FGameplayTagContainer
and expect only tags mapped to "AgentActivityCognition" might benefit from helper macros that ensure
/check
whether this requirement is met. Below is an example:
/** Give this world activity worker some cognition tags that are automatically removed when the current world activity ends */
FORCEINLINE void AddScopedWorldActivityCognition(const FGameplayTagContainer& WorldActivityCognitionTags)
{
TTS_VLOG_TAG_CATEGORY(GetVLogOwner(), LogWorldActivityWorker, Warning, TEXT("WorldActivityCognition"), WorldActivityCognitionTags);
AddScopedWorldActivityCognitionImpl(WorldActivityCognitionTags);
PostWorldActivityCognitionAdded(WorldActivityCognitionTags);
}
TTS_VLOG_TAG_CATEGORY
is declared inside TypedTagStaticImpl
, a (temporary) plugin included with GenericActivityFramework.