Skip to content

ASCue

PT | EN
Inherits: Resource

Resource for event activation and synchronization within the Ability System.

Description

[ASCue] is the base class for resources that handle high-level event activation and synchronization, such as playing animations or sounds in response to effects and ability triggers.

For most use cases, use the specialized cue classes:

  • [ASCueAnimation] - For synchronizing animations.
  • [ASCueAudio] - For synchronizing audio effects.

You can extend this base class in GDScript or C# for completely custom cue behavior:


extends ASCue

func _on_execute(spec: ASCueSpec):
# Custom logic here
print("Custom cue triggered!")

using Godot;

public partial class MyCue : ASCue
{
    public override void _OnExecute(ASCueSpec spec)
    {
        // Custom logic here
        GD.Print("Custom cue triggered!");
    }
}

Properties

TypeNameDefault
StringName[]activation_blocked_all_tags[]
Cue cannot execute if owner has all of these tags simultaneously (AND logic).
StringName[]activation_blocked_any_tags[]
Cue cannot execute if owner has any of these tags (OR logic).
StringName[]activation_required_all_tags[]
Owner must have all of these tags for the cue to execute (AND logic).
StringName[]activation_required_any_tags[]
Owner must have at least one of these tags for the cue to execute (OR logic).
Stringcue_name""
Unique name for this cue resource.
StringNamecue_tag&""
Unique tag identifying this cue.
intevent_type0
Defines when the cue is triggered (OnExecute, OnActive, or OnRemove).
StringNamenode_name&""
Optional name of a node registered in the [ASComponent] via [method ASComponent.register_node]. If set, the cue will target that specific node; otherwise, it will use the component’s default nodes.

Methods

ReturnName
void_on_active( spec: ASCueSpec) virtual
Virtual method called when the cue becomes active.
void_on_execute( spec: ASCueSpec) virtual
Virtual method called when the cue is executed instantly.
void_on_remove( spec: ASCueSpec) virtual
Virtual method called when the cue is removed.

Constants

NameValue
ON_EXECUTE0
Triggered for instant effects (e.g., hit impact, explosion).
ON_ACTIVE1
Triggered when an effect/ability becomes active.
ON_REMOVE2
Triggered when an effect/ability ends.