unreal.AbilitySystemLibrary
¶
- class unreal.AbilitySystemLibrary(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibrary
Blueprint library for ability system. Many of these functions are useful to call from native as well
C++ Source:
Plugin: GameplayAbilities
Module: GameplayAbilities
File: AbilitySystemBlueprintLibrary.h
- classmethod ability_target_data_from_actor(actor) GameplayAbilityTargetDataHandle ¶
Creates single actor target data
- Parameters:
actor (Actor) –
- Return type:
- classmethod ability_target_data_from_actor_array(actor_array, one_target_per_handle) GameplayAbilityTargetDataHandle ¶
Creates actor array target data
- Parameters:
- Return type:
- classmethod ability_target_data_from_hit_result(hit_result) GameplayAbilityTargetDataHandle ¶
Creates a target data with a single hit result
- Parameters:
hit_result (HitResult) –
- Return type:
- classmethod ability_target_data_from_locations(source_location, target_location) GameplayAbilityTargetDataHandle ¶
Creates a target data with a source and destination location
- Parameters:
source_location (GameplayAbilityTargetingLocationInfo) –
target_location (GameplayAbilityTargetingLocationInfo) –
- Return type:
- classmethod add_asset_tag(spec_handle, new_gameplay_tag) GameplayEffectSpecHandle ¶
Adds NewGameplayTag to this instance of the effect
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
new_gameplay_tag (GameplayTag) –
- Return type:
- classmethod add_asset_tags(spec_handle, new_gameplay_tags) GameplayEffectSpecHandle ¶
Adds NewGameplayTags to this instance of the effect
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
new_gameplay_tags (GameplayTagContainer) –
- Return type:
- classmethod add_granted_tag(spec_handle, new_gameplay_tag) GameplayEffectSpecHandle ¶
This instance of the effect will now grant NewGameplayTag to the object that this effect is applied to
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
new_gameplay_tag (GameplayTag) –
- Return type:
- classmethod add_granted_tags(spec_handle, new_gameplay_tags) GameplayEffectSpecHandle ¶
This instance of the effect will now grant NewGameplayTags to the object that this effect is applied to
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
new_gameplay_tags (GameplayTagContainer) –
- Return type:
- classmethod add_linked_gameplay_effect(spec_handle, linked_gameplay_effect) GameplayEffectSpecHandle ¶
Add Linked Gameplay Effect deprecated: Function ‘AddLinkedGameplayEffect’ is deprecated.
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
- Return type:
- classmethod add_linked_gameplay_effect_spec(spec_handle, linked_gameplay_effect_spec) GameplayEffectSpecHandle ¶
Add Linked Gameplay Effect Spec deprecated: Function ‘AddLinkedGameplayEffectSpec’ is deprecated.
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
linked_gameplay_effect_spec (GameplayEffectSpecHandle) –
- Return type:
- classmethod add_loose_gameplay_tags(actor, gameplay_tags, should_replicate=False) bool ¶
Manually adds a set of tags to a given actor, and optionally replicates them.
- Parameters:
actor (Actor) –
gameplay_tags (GameplayTagContainer) –
should_replicate (bool) –
- Return type:
- classmethod append_target_data_handle(target_handle, handle_to_add) GameplayAbilityTargetDataHandle ¶
Copies targets from HandleToAdd to TargetHandle
- Parameters:
target_handle (GameplayAbilityTargetDataHandle) –
handle_to_add (GameplayAbilityTargetDataHandle) –
- Return type:
- classmethod assign_set_by_caller_magnitude(spec_handle, data_name, magnitude) GameplayEffectSpecHandle ¶
Sets a raw name Set By Caller magnitude value, the tag version should normally be used
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
data_name (Name) –
magnitude (float) –
- Return type:
- classmethod assign_tag_set_by_caller_magnitude(spec_handle, data_tag, magnitude) GameplayEffectSpecHandle ¶
Sets a gameplay tag Set By Caller magnitude value
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
data_tag (GameplayTag) –
magnitude (float) –
- Return type:
- classmethod clone_spec_handle(new_instigator, effect_causer, gameplay_effect_spec_handle_clone) GameplayEffectSpecHandle ¶
Create a spec handle, cloning another
- Parameters:
new_instigator (Actor) –
effect_causer (Actor) –
gameplay_effect_spec_handle_clone (GameplayEffectSpecHandle) –
- Return type:
- classmethod does_gameplay_cue_meet_tag_requirements(parameters, source_tag_reqs, target_tag_reqs) bool ¶
Returns true if the aggregated source and target tags from the effect spec meets the tag requirements
- Parameters:
parameters (GameplayCueParameters) –
source_tag_reqs (GameplayTagRequirements) –
target_tag_reqs (GameplayTagRequirements) –
- Return type:
- classmethod does_target_data_contain_actor(target_data, index, actor) bool ¶
Returns true if the given TargetData has the actor passed in targeted
- Parameters:
target_data (GameplayAbilityTargetDataHandle) –
index (int32) –
actor (Actor) –
- Return type:
- classmethod effect_context_add_hit_result(effect_context, hit_result, reset) None ¶
Adds a hit result to the effect context
- Parameters:
effect_context (GameplayEffectContextHandle) –
hit_result (HitResult) –
reset (bool) –
- classmethod effect_context_get_effect_causer(effect_context) Actor ¶
Gets the physical actor that caused the effect, possibly a projectile or weapon
- Parameters:
effect_context (GameplayEffectContextHandle) –
- Return type:
- classmethod effect_context_get_hit_result(effect_context) HitResult ¶
Extracts a hit result from the effect context if it is set
- Parameters:
effect_context (GameplayEffectContextHandle) –
- Return type:
- classmethod effect_context_get_instigator_actor(effect_context) Actor ¶
Gets the instigating actor (that holds the ability system component) of the EffectContext
- Parameters:
effect_context (GameplayEffectContextHandle) –
- Return type:
- classmethod effect_context_get_origin(effect_context) Vector ¶
Gets the location the effect originated from
- Parameters:
effect_context (GameplayEffectContextHandle) –
- Return type:
- classmethod effect_context_get_original_instigator_actor(effect_context) Actor ¶
Gets the original instigator actor that started the chain of events to cause this effect
- Parameters:
effect_context (GameplayEffectContextHandle) –
- Return type:
- classmethod effect_context_get_source_object(effect_context) Object ¶
Gets the source object of the effect.
- Parameters:
effect_context (GameplayEffectContextHandle) –
- Return type:
- classmethod effect_context_has_hit_result(effect_context) bool ¶
Returns true if there is a valid hit result inside the effect context
- Parameters:
effect_context (GameplayEffectContextHandle) –
- Return type:
- classmethod effect_context_is_instigator_locally_controlled(effect_context) bool ¶
Returns true if the ability system component that instigated this is locally controlled
- Parameters:
effect_context (GameplayEffectContextHandle) –
- Return type:
- classmethod effect_context_is_valid(effect_context) bool ¶
Returns true if this context has ever been initialized
- Parameters:
effect_context (GameplayEffectContextHandle) –
- Return type:
- classmethod effect_context_set_origin(effect_context, origin) None ¶
Sets the location the effect originated from
- Parameters:
effect_context (GameplayEffectContextHandle) –
origin (Vector) –
- classmethod equal_equal_active_gameplay_effect_handle(a, b) bool ¶
Equality operator for two Active Gameplay Effect Handles
- Parameters:
- Return type:
- classmethod equal_equal_gameplay_ability_spec_handle(a, b) bool ¶
Equality operator for two Gameplay Ability Spec Handles
- Parameters:
- Return type:
- classmethod equal_equal_gameplay_attribute_gameplay_attribute(attribute_a, attribute_b) bool ¶
Simple equality operator for gameplay attributes
- Parameters:
attribute_a (GameplayAttribute) –
attribute_b (GameplayAttribute) –
- Return type:
- classmethod evaluate_attribute_value_with_tags(ability_system, attribute, source_tags, target_tags) -> (float, success=bool)¶
Returns the value of Attribute from the ability system component AbilitySystem after evaluating it with source and target tags. bSuccess indicates the success or failure of this operation.
- Parameters:
ability_system (AbilitySystemComponent) –
attribute (GameplayAttribute) –
source_tags (GameplayTagContainer) –
target_tags (GameplayTagContainer) –
- Returns:
success (bool):
- Return type:
- classmethod evaluate_attribute_value_with_tags_and_base(ability_system, attribute, source_tags, target_tags, base_value) -> (float, success=bool)¶
Returns the value of Attribute from the ability system component AbilitySystem after evaluating it with source and target tags using the passed in base value instead of the real base value. bSuccess indicates the success or failure of this operation.
- Parameters:
ability_system (AbilitySystemComponent) –
attribute (GameplayAttribute) –
source_tags (GameplayTagContainer) –
target_tags (GameplayTagContainer) –
base_value (float) –
- Returns:
success (bool):
- Return type:
- classmethod filter_target_data(target_data_handle, actor_filter_class) GameplayAbilityTargetDataHandle ¶
Create a new target data handle with filtration performed on the data
- Parameters:
target_data_handle (GameplayAbilityTargetDataHandle) –
actor_filter_class (GameplayTargetDataFilterHandle) –
- Return type:
- classmethod forward_gameplay_cue_to_target(target_cue_interface, event_type, parameters) None ¶
Forwards the gameplay cue to another gameplay cue interface object
- Parameters:
target_cue_interface (GameplayCueInterface) –
event_type (GameplayCueEvent) –
parameters (GameplayCueParameters) –
- classmethod get_ability_system_component(actor) AbilitySystemComponent ¶
Tries to find an ability system component on the actor, will use AbilitySystemInterface or fall back to a component search
- Parameters:
actor (Actor) –
- Return type:
- classmethod get_active_gameplay_effect_debug_string(active_handle) str ¶
Returns a debug string for display
- Parameters:
active_handle (ActiveGameplayEffectHandle) –
- Return type:
- classmethod get_active_gameplay_effect_expected_end_time(active_handle) float ¶
Returns the expected end time (when we think the GE will expire) for a given GameplayEffect (note someone could remove or change it before that happens!)
- Parameters:
active_handle (ActiveGameplayEffectHandle) –
- Return type:
- classmethod get_active_gameplay_effect_remaining_duration(world_context_object, active_handle) float ¶
Returns the total duration for a given GameplayEffect, basically ExpectedEndTime - Current Time
- Parameters:
world_context_object (Object) –
active_handle (ActiveGameplayEffectHandle) –
- Return type:
- classmethod get_active_gameplay_effect_stack_count(active_handle) int32 ¶
Returns current stack count of an active Gameplay Effect. Will return 0 if the GameplayEffect is no longer valid.
- Parameters:
active_handle (ActiveGameplayEffectHandle) –
- Return type:
int32
- classmethod get_active_gameplay_effect_stack_limit_count(active_handle) int32 ¶
Returns stack limit count of an active Gameplay Effect. Will return 0 if the GameplayEffect is no longer valid.
- Parameters:
active_handle (ActiveGameplayEffectHandle) –
- Return type:
int32
- classmethod get_active_gameplay_effect_start_time(active_handle) float ¶
Returns the start time (time which the GE was added) for a given GameplayEffect
- Parameters:
active_handle (ActiveGameplayEffectHandle) –
- Return type:
- classmethod get_active_gameplay_effect_total_duration(active_handle) float ¶
Returns the total duration for a given GameplayEffect
- Parameters:
active_handle (ActiveGameplayEffectHandle) –
- Return type:
- classmethod get_actor_by_index(parameters, index) Actor ¶
Returns actor stored in the Effect Context used by this cue
- Parameters:
parameters (GameplayCueParameters) –
index (int32) –
- Return type:
- classmethod get_actor_count(parameters) int32 ¶
Returns number of actors stored in the Effect Context used by this cue
- Parameters:
parameters (GameplayCueParameters) –
- Return type:
int32
- classmethod get_actors_from_target_data(target_data, index) Array[Actor] ¶
Returns all actors targeted, for a given index
- Parameters:
target_data (GameplayAbilityTargetDataHandle) –
index (int32) –
- Return type:
- classmethod get_all_actors_from_target_data(target_data) Array[Actor] ¶
Returns all actors targeted
- Parameters:
target_data (GameplayAbilityTargetDataHandle) –
- Return type:
- classmethod get_all_linked_gameplay_effect_spec_handles(spec_handle) Array[GameplayEffectSpecHandle] ¶
Get All Linked Gameplay Effect Spec Handles deprecated: Function ‘GetAllLinkedGameplayEffectSpecHandles’ is deprecated.
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
- Return type:
- classmethod get_data_count_from_target_data(target_data) int32 ¶
Returns number of target data objects, not necessarily number of distinct targets
- Parameters:
target_data (GameplayAbilityTargetDataHandle) –
- Return type:
int32
- classmethod get_debug_string_from_gameplay_attribute(attribute) str ¶
Returns FString representation of a gameplay attribute’s set class and name, in the form of AttrSetName.AttrName (or just AttrName if not part of a set).
- Parameters:
attribute (GameplayAttribute) –
- Return type:
- classmethod get_effect_context(spec_handle) GameplayEffectContextHandle ¶
Gets the GameplayEffectSpec’s effect context handle
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
- Return type:
- classmethod get_float_attribute(actor, attribute) -> (float, successfully_found_attribute=bool)¶
Returns the value of Attribute from the ability system component belonging to Actor.
- Parameters:
actor (Actor) –
attribute (GameplayAttribute) –
- Returns:
successfully_found_attribute (bool):
- Return type:
- classmethod get_float_attribute_base(actor, attribute) -> (float, successfully_found_attribute=bool)¶
Returns the base value of Attribute from the ability system component belonging to Actor.
- Parameters:
actor (Actor) –
attribute (GameplayAttribute) –
- Returns:
successfully_found_attribute (bool):
- Return type:
- classmethod get_float_attribute_base_from_ability_system_component(ability_system_component, attribute) -> (float, successfully_found_attribute=bool)¶
Returns the base value of Attribute from the ability system component AbilitySystemComponent.
- Parameters:
ability_system_component (AbilitySystemComponent) –
attribute (GameplayAttribute) –
- Returns:
successfully_found_attribute (bool):
- Return type:
- classmethod get_float_attribute_from_ability_system_component(ability_system, attribute) -> (float, successfully_found_attribute=bool)¶
Returns the value of Attribute from the ability system component AbilitySystem.
- Parameters:
ability_system (AbilitySystemComponent) –
attribute (GameplayAttribute) –
- Returns:
successfully_found_attribute (bool):
- Return type:
- classmethod get_gameplay_ability_from_spec_handle(ability_system, ability_spec_handle) -> (GameplayAbility, is_instance=bool)¶
Provides the Gameplay Ability object associated with an Ability Spec Handle This can be either an instanced ability, or in the case of shared abilities, the Class Default Object
- Parameters:
ability_system (AbilitySystemComponent) –
ability_spec_handle (GameplayAbilitySpecHandle) –
- Returns:
Pointer to the Gameplay Ability object
is_instance (bool): Set to true if this is an instanced ability instead of a shared CDO
- Return type:
- classmethod get_gameplay_cue_direction(target_actor, parameters) Vector or None ¶
Gets the best normalized effect direction for this gameplay cue. This is useful for effects that require the direction of an enemy attack. Returns true if a valid direction could be calculated.
- Parameters:
target_actor (Actor) –
parameters (GameplayCueParameters) –
- Returns:
direction (Vector):
- Return type:
Vector or None
- classmethod get_gameplay_cue_end_location_and_normal(target_actor, parameters) (location=Vector, normal=Vector) or None ¶
Gets the best end location and normal for this gameplay cue. If there is hit result data, it will return this. Otherwise it will return the target actor’s location/rotation. If none of this is available, it will return false.
- Parameters:
target_actor (Actor) –
parameters (GameplayCueParameters) –
- Returns:
location (Vector):
normal (Vector):
- Return type:
tuple or None
- classmethod get_gameplay_effect_from_active_effect_handle(active_handle) GameplayEffect ¶
Returns the Gameplay Effect CDO from an active handle. This reference should be considered read only, but you can use it to read additional Gameplay Effect info, such as icon, description, etc.
- Parameters:
active_handle (ActiveGameplayEffectHandle) –
- Return type:
- classmethod get_gameplay_effect_ui_data(effect_class, data_type) GameplayEffectUIData ¶
Returns the UI data for a gameplay effect class (if any)
- Parameters:
- Return type:
- classmethod get_hit_result(parameters) HitResult ¶
Returns a hit result stored in the effect context if valid
- Parameters:
parameters (GameplayCueParameters) –
- Return type:
- classmethod get_hit_result_from_target_data(hit_result, index) HitResult ¶
Returns the hit result for a given index if it exists
- Parameters:
hit_result (GameplayAbilityTargetDataHandle) –
index (int32) –
- Return type:
- classmethod get_instigator_actor(parameters) Actor ¶
Gets the instigating actor (that holds the ability system component) of the GameplayCue
- Parameters:
parameters (GameplayCueParameters) –
- Return type:
- classmethod get_instigator_transform(parameters) Transform ¶
Gets instigating world location
- Parameters:
parameters (GameplayCueParameters) –
- Return type:
- classmethod get_modified_attribute_magnitude(spec_handle, attribute) float ¶
Gets the magnitude of change for an attribute on an APPLIED GameplayEffectSpec.
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
attribute (GameplayAttribute) –
- Return type:
- classmethod get_origin(parameters) Vector ¶
Gets instigating world location
- Parameters:
parameters (GameplayCueParameters) –
- Return type:
- classmethod get_target_data_end_point(target_data, index) Vector ¶
Returns the end point for a given index if it exists
- Parameters:
target_data (GameplayAbilityTargetDataHandle) –
index (int32) –
- Return type:
- classmethod get_target_data_end_point_transform(target_data, index) Transform ¶
Returns the end point transform for a given index if it exists
- Parameters:
target_data (GameplayAbilityTargetDataHandle) –
index (int32) –
- Return type:
- classmethod get_target_data_origin(target_data, index) Transform ¶
Returns the origin for a given index if it exists
- Parameters:
target_data (GameplayAbilityTargetDataHandle) –
index (int32) –
- Return type:
- classmethod has_hit_result(parameters) bool ¶
Checks if the effect context has a hit reslt stored inside
- Parameters:
parameters (GameplayCueParameters) –
- Return type:
- classmethod is_instigator_locally_controlled(parameters) bool ¶
Returns true if the ability system component that spawned this cue is locally controlled
- Parameters:
parameters (GameplayCueParameters) –
- Return type:
- classmethod is_instigator_locally_controlled_player(parameters) bool ¶
Returns true if the ability system component that spawned this cue is locally controlled and a player
- Parameters:
parameters (GameplayCueParameters) –
- Return type:
- classmethod is_valid(attribute) bool ¶
Returns true if the attribute actually exists
- Parameters:
attribute (GameplayAttribute) –
- Return type:
- classmethod make_filter_handle(filter, filter_actor) GameplayTargetDataFilterHandle ¶
Create a handle for filtering target data, filling out all fields
- Parameters:
filter (GameplayTargetDataFilter) –
filter_actor (Actor) –
- Return type:
- classmethod make_spec_handle(gameplay_effect, instigator, effect_causer, level=1.000000) GameplayEffectSpecHandle ¶
Create a spec handle, filling out all fields
- Parameters:
gameplay_effect (GameplayEffect) –
instigator (Actor) –
effect_causer (Actor) –
level (float) –
- Return type:
- classmethod not_equal_active_gameplay_effect_handle(a, b) bool ¶
Inequality operator for two Active Gameplay Effect Handles
- Parameters:
- Return type:
- classmethod not_equal_gameplay_ability_spec_handle(a, b) bool ¶
Inequality operator for two Gameplay Ability Spec Handles
- Parameters:
- Return type:
- classmethod not_equal_gameplay_attribute_gameplay_attribute(attribute_a, attribute_b) bool ¶
Simple inequality operator for gameplay attributes
- Parameters:
attribute_a (GameplayAttribute) –
attribute_b (GameplayAttribute) –
- Return type:
- classmethod remove_loose_gameplay_tags(actor, gameplay_tags, should_replicate=False) bool ¶
Manually removes a set of tags from a given actor, with optional replication.
- Parameters:
actor (Actor) –
gameplay_tags (GameplayTagContainer) –
should_replicate (bool) –
- Return type:
- classmethod send_gameplay_event_to_actor(actor, event_tag, payload) None ¶
This function can be used to trigger an ability on the actor in question with useful payload data.
- Parameters:
actor (Actor) –
event_tag (GameplayTag) –
payload (GameplayEventData) –
- classmethod set_duration(spec_handle, duration) GameplayEffectSpecHandle ¶
Manually sets the duration on a specific effect
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
duration (float) –
- Return type:
- classmethod set_stack_count(spec_handle, stack_count) GameplayEffectSpecHandle ¶
Sets the GameplayEffectSpec’s StackCount to the specified amount (prior to applying)
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
stack_count (int32) –
- Return type:
- classmethod set_stack_count_to_max(spec_handle) GameplayEffectSpecHandle ¶
Sets the GameplayEffectSpec’s StackCount to the max stack count defined in the GameplayEffect definition
- Parameters:
spec_handle (GameplayEffectSpecHandle) –
- Return type:
- classmethod target_data_has_actor(target_data, index) bool ¶
Returns true if the given TargetData has at least 1 actor targeted
- Parameters:
target_data (GameplayAbilityTargetDataHandle) –
index (int32) –
- Return type:
- classmethod target_data_has_end_point(target_data, index) bool ¶
Returns true if the target data has an end point
- Parameters:
target_data (GameplayAbilityTargetDataHandle) –
index (int32) –
- Return type:
- classmethod target_data_has_hit_result(hit_result, index) bool ¶
Returns true if the target data has a hit result
- Parameters:
hit_result (GameplayAbilityTargetDataHandle) –
index (int32) –
- Return type:
- classmethod target_data_has_origin(target_data, index) bool ¶
Returns true if the target data has an origin
- Parameters:
target_data (GameplayAbilityTargetDataHandle) –
index (int32) –
- Return type: