Ability System Singleton
Inherits:
ObjectCentral authority for Tags.
Description
[AbilitySystem] is a singleton that manages the global registry of Tags for the project (v0.1.0 Stable).
Methods
| Return | Name |
|---|---|
StringName[] | get_all_registered_tags(
)
const |
Returns an array of all tags currently registered in the global system. This includes Name, Conditional, and Event tags from the project settings and runtime registrations. | |
ASComponent | get_component_from_node(
node: Node)
static |
Utility for retrieving an [ASComponent] from a node. Checks if the node is an ASC or if it has an ASC child. | |
StringName[] | get_registered_tags_of_type(
type: int)
const |
Returns all tags registered in the system of a specific type. | |
int | get_resource_name_owner(
name: String)
const |
Returns the instance ID of the resource that owns the given name. | |
int | get_tag_type(
tag: StringName)
const |
Returns the type classification of the given tag. | |
bool | is_tag_registered(
tag: StringName)
const |
Checks if a tag is registered. | |
bool | register_resource_name(
name: String, owner_id: int) |
Registers a unique name for a resource. | |
void | register_tag(
tag: StringName, type: int = 0, owner_id: int = 0) |
Registers a new tag globally with a specific type. | |
void | remove_tag_branch(
tag: StringName) |
Unregisters the specified tag and all its hierarchical sub-tags (e.g. removing “State” will also remove “State.Stunned”). | |
void | rename_tag(
old_tag: StringName, new_tag: StringName) |
Renames an existing tag and automatically updates all its hierarchical sub-tags to the new prefix. | |
ASComponent | resolve_component(
agent: Node, path: NodePath = NodePath(""))
static |
Advanced utility for locating an [ASComponent] from an agent node. Priority order:
| |
int | run_tests( ) |
Executes the internal unit test suite for the Ability System. Returns 0 on success or the number of failed test cases. This is primarily used for CI/CD validation and development integrity checks. | |
bool | tag_matches(
tag: StringName, match_against: StringName, exact: bool = false)
static |
Hierarchical tag comparison utility. Returns true if [param tag] matches [param match_against]. If [param exact] is true, it performs an exact string match. | |
void | unregister_resource_name(
name: String) |
Unregisters a resource name. | |
void | unregister_tag(
tag: StringName) |
Unregisters a tag. | |
Signals
- tags_changed(
)
Emitted when the registered tags are changed.
Constants
| Name | Value |
|---|---|
| ASTagType::NAME | 0 |
| ASTagType::CONDITIONAL | 1 |
| ASTagType::EVENT | 2 |