Native class
UGBAAttributeSetBlueprintBase#
Defines the set of all GameplayAttributes for your game.
Games should subclass this and add FGameplayAttributeData properties to represent attributes like health, damage, etc
AttributeSets are added to the actors as subobjects, and then registered with the AbilitySystemComponent It is often desired to have several sets per project that inherit from each other You could make a base health set, then have a player set that inherits from it and adds more attributes
Methods#
-
publicvirtual voidBeginDestroy()
-
UFUNCTION(BlueprintCallable)
virtual voidClampAttributeValue(const FGameplayAttribute Attribute,
float MinValue,
float MaxValueClamps the Attribute from MinValue to MaxValue
-
floatGetAttributeBaseValue(const FGameplayAttribute& Attribute,
bool& bSuccessfullyFoundAttribute -
TMap<FString, TSharedPtr<FAttributeMetaData>>GetAttributesMetaData() const
Getter to return current state of AttributesMetaData map
-
floatGetAttributeValue(const FGameplayAttribute& Attribute,
bool& bSuccessfullyFoundAttribute -
virtual voidGetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps
-
voidHandleRepNotifyForGameplayAttribute(FName InPropertyName
Internal implementation of Blueprint rep notifies GAMEPLAYATTRIBUTE_REPNOTIFY equivalent
-
UFUNCTION(BlueprintCallable)
voidHandleRepNotifyForGameplayAttributeData(const FGameplayAttributeData& InAttributeTo be called from Blueprint rep notifies for a given Gameplay Attribute Data member variable.
-
UFUNCTION(BlueprintCallable)
voidHandleRepNotifyForGameplayClampedAttributeData(const FGBAGameplayClampedAttributeData& InAttributeTo be called from Blueprint rep notifies for a given (Clamped) Gameplay Attribute Data member variable.
-
virtual voidInitFromMetaDataTable(const UDataTable* DataTable
Initializes attribute data from a meta DataTable.
-
static boolIsGameplayAttributeDataClampedProperty(const FProperty* Property
Returns true if the variable associated with Property is of type FGBAGameplayClampedAttributeData or one of its subclasses
-
Returns the Owner's Ability System Component cached data about the owning actor that abilities will need to frequently access (movement component, mesh component, anim instance, etc)
-
UFUNCTION(BlueprintPure)
floatK2_GetAttributeBaseValue(FGameplayAttribute Attribute,
bool& bSuccessfullyFoundAttributeReturns the base (as opposed to current) value of an Attribute.
-
UFUNCTION(BlueprintPure)
floatK2_GetAttributeValue(FGameplayAttribute Attribute,
bool& bSuccessfullyFoundAttributeReturns the current (as opposed to base) value of an Attribute.
-
Returns the Ability System Component of the Owning Actor
-
Gets information about owning actor
-
UFUNCTION(BlueprintImplementableEvent)
voidK2_PostAttributeBaseChange(const FGameplayAttribute& InAttribute,
float OldValue,
float NewValueCalled just after any modification happens to an attribute's base value right after aggregation (when an attribute aggregator exists).
-
UFUNCTION(BlueprintImplementableEvent)
voidK2_PostAttributeChange(const FGameplayAttribute& Attribute,
float OldValue,
float NewValueCalled just after any modification happens to an attribute.
-
UFUNCTION(BlueprintImplementableEvent)
voidK2_PostGameplayEffectExecute(const FGameplayAttribute& Attribute,
const FGBAAttributeSetExecutionData& DataCalled just after a GameplayEffect is executed to modify the base value of an attribute. No more changes can be made.
-
UFUNCTION(BlueprintImplementableEvent)
voidK2_PreAttributeBaseChange(const FGameplayAttribute& InAttribute,
float InValue,
float& OutValueThis is called just before any modification happens to an attribute's base value when an attribute aggregator exists. This function should enforce clamping (presuming you wish to clamp the base value along with the final value in PreAttributeChange) This function should NOT invoke gameplay related events or callbacks. Do those in PreAttributeChange() which will be called prior to the final value of the attribute actually changing.
-
UFUNCTION(BlueprintImplementableEvent)
voidK2_PreAttributeChange(const FGameplayAttribute& InAttribute,
float InValue,
float& OutValueCalled just before any modification happens to an attribute. This is lower level than PreAttributeModify/PostAttribute modify.
-
UFUNCTION(BlueprintNativeEvent)
boolK2_PreGameplayEffectExecute(const FGameplayAttribute& InAttribute,
const FGBAAttributeSetExecutionData& InDataCalled just before modifying the value of an attribute. AttributeSet can make additional modifications here.
-
UFUNCTION(BlueprintCallable)
voidK2_SetAttributeValue(FGameplayAttribute Attribute,
float NewValueSets the base (as opposed to current) value of an Attribute.
-
virtual voidOnAttributeAggregatorCreated(const FGameplayAttribute& Attribute,
FAggregator* NewAggregatorCallback for when an FAggregator is created for an attribute in this set. Allows custom setup of FAggregator::EvaluationMetaData
-
virtual voidPostAttributeBaseChange(const FGameplayAttribute& Attribute,
float OldValue,
float NewValue -
virtual voidPostAttributeChange(const FGameplayAttribute& Attribute,
float OldValue,
float NewValue -
virtual voidPostGameplayEffectExecute(const FGameplayEffectModCallbackData& Data
-
virtual voidPreAttributeBaseChange(const FGameplayAttribute& Attribute,
float& OutValue -
virtual voidPreAttributeChange(const FGameplayAttribute& Attribute,
float& OutValue -
virtual boolPreGameplayEffectExecute(FGameplayEffectModCallbackData& Data
-
virtual void
-
virtual voidPrintDebug()
Print debug information to the log (only called at the end of InitFromMetaDataTable)
-
voidSetAttributeValue(const FGameplayAttribute& Attribute,
float NewValue -
protectedvoidGetAllBlueprintReplicatedProps(TArray<FProperty*>& OutProperties,
EPropertyFlags InCheckFlag = CPF_NetReturns all Blueprint member variables marked as replicated for this class
-
voidGetAllBlueprintReplicatedProps(UClass* InClass,
TArray<FProperty*>& OutProperties,
EPropertyFlags InCheckFlag = CPF_NetEquivalent of UBlueprintGeneratedClass::GetLifetimeBlueprintReplicationList() but returns a list of FProperty instead.
-
boolGetAttributeDataPropertyName(const FGameplayAttributeData& InAttributeData,
FString& OutPropertyNameReturns the property name of a given FGameplayAttributeData (or one of its child struct)
-
floatGetClampedValueForClampedProperty(const FGameplayAttribute& Attribute,
float InValueReturns the new value for an attribute after clamping via FGBAGameplayClampedAttributeData defaults Min / Max values
-
floatGetClampedValueForMetaData(const FGameplayAttribute& Attribute,
float InValueReturns the new value for an attribute after clamping via stored MetaData (from DataTable)
-
boolHasClampedMetaData(const FGameplayAttribute& Attribute
Returns whether given Attribute has stored MetaData, and if it has valid clamping values
-
boolIsValidClampedProperty(const FGameplayAttribute& Attribute
Returns whether given Attribute is defined using a FGBAGameplayClampedAttributeData property, and if it has valid clamping values
Fields#
-
protectedTMap<FString, TSharedPtr<FGameplayAttributeData>> AttributeDataRepMap
Stores cached values of FGameplayAttributeData during a PostNetReceive() for use later on within rep notifies
-
TMap<FString, TSharedPtr<FAttributeMetaData>> AttributesMetaData
Stores cached values of FAttributeMetaData that was read from an initialization data table during InitFromMetaDataTable()
-
static TMap<FString, FString> RepNotifierHandlerNames
List of valid rep notify handler for GameplayAttributes (HandleRepNotify...). Key is the CPP type, Value is the function name.