Saltar al contenido
Multimedia 1 para anuncio Typed Gameplay Tags

Descripción

This plugin allows to create custom typed gameplay tags. When variable of such type is used in BP only child tags will be allowed. Typed tags will be automatically added as native tags.

Typed tags can be defined by inheriting FGameplayTag or other typed tag:

USTRUCT(meta = (GameplayTagFilter = "Action", PresentAsType = "GameplayTag"))

struct FActionTag : public FGameplayTag

{

GENERATED_BODY()

END_TYPED_TAG_DECL(FActionTag, TEXT("Action"))

};

USTRUCT(meta = (GameplayTagFilter = "Action.Melee", PresentAsType = "GameplayTag"))

struct FMeleeTag : public FActionTag

{

GENERATED_BODY()

END_TYPED_TAG_DECL(FMeleeTag, TEXT("Action.Melee"))

};

  • GameplayTagFilter is responsible for indicating parent tag for filtering in TagPicker widget.

  • PresentAsType is responsible for setting type customization the same as for FGameplayTag (otherwise you need to register you own IPropertyTypeCustomization, but 99% you will want to use customization for FGameplayTag)

  • END_TYPED_TAG_DECL register parent tag in TagManager, provides a bunch of useful functions to add tags (such as AddNativeTag)

Specific typed tags can be added from C++ using set of macros or by FGameplayTagNativeAdder, which allows to use such tags anywhere else in C++ code.

  • DECLARE_TYPED_GAMEPLAY_TAG_EXTERN - header macro to allow using typed tag in different files.

  • DEFINE_TYPED_GAMEPLAY_TAG - cpp marco to define previously declared typed tag.

  • DEFINE_TYPED_GAMEPLAY_TAG_COMMENT - same as above, but also allows to specify comment.

  • DEFINE_TYPED_GAMEPLAY_TAG_STATIC - cpp macro to define typed tag, that can be used only in the same cpp file.

  • DEFINE_TYPED_GAMEPLAY_TAG_STATIC_COMMENT - same as above, but also allows to specify comment.

Full source code is available on GitHub: Typed Gameplay Tags

This plugin is inspired by and based on FUITag implementation in UITag.h in CommonUI plugin.

Formatos incluidos