ASCue
Inherits:
ResourceResource 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
| Type | Name | Default |
|---|---|---|
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). | ||
String | cue_name | "" |
Unique name for this cue resource. | ||
StringName | cue_tag | &"" |
Unique tag identifying this cue. | ||
int | event_type | 0 |
Defines when the cue is triggered (OnExecute, OnActive, or OnRemove). | ||
StringName | node_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
| Return | Name |
|---|---|
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
| Name | Value |
|---|---|
| ON_EXECUTE | 0 |
Triggered for instant effects (e.g., hit impact, explosion). | |
| ON_ACTIVE | 1 |
Triggered when an effect/ability becomes active. | |
| ON_REMOVE | 2 |
Triggered when an effect/ability ends. | |