Skip to content

Ability System Singleton

PT | EN
Inherits: Object

Central authority for Tags.

Description

[AbilitySystem] is a singleton that manages the global registry of Tags for the project (v0.1.0 Stable).

Methods

ReturnName
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.
ASComponentget_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.
intget_resource_name_owner( name: String) const
Returns the instance ID of the resource that owns the given name.
intget_tag_type( tag: StringName) const
Returns the type classification of the given tag.
boolis_tag_registered( tag: StringName) const
Checks if a tag is registered.
boolregister_resource_name( name: String, owner_id: int)
Registers a unique name for a resource.
voidregister_tag( tag: StringName, type: int = 0, owner_id: int = 0)
Registers a new tag globally with a specific type.
voidremove_tag_branch( tag: StringName)
Unregisters the specified tag and all its hierarchical sub-tags (e.g. removing “State” will also remove “State.Stunned”).
voidrename_tag( old_tag: StringName, new_tag: StringName)
Renames an existing tag and automatically updates all its hierarchical sub-tags to the new prefix.
ASComponentresolve_component( agent: Node, path: NodePath = NodePath("")) static

Advanced utility for locating an [ASComponent] from an agent node. Priority order:

  1. If [param path] is provided, attempts to resolve that specific path relative to the agent.
  2. If the agent node itself is an [ASComponent], returns it.
  3. Searches the immediate children of the agent for an [ASComponent].
  4. Searches the parent of the agent and its children.
  5. Searches the owner of the agent and its children.
intrun_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.
booltag_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.
voidunregister_resource_name( name: String)
Unregisters a resource name.
voidunregister_tag( tag: StringName)
Unregisters a tag.

Signals

  • tags_changed( )

    Emitted when the registered tags are changed.

Constants

NameValue
ASTagType::NAME0
ASTagType::CONDITIONAL1
ASTagType::EVENT2