Skip to content

AnimationSelectionAbility ​

Inherits: AnimationSelection < Resource

Enhanced animation selection for abilities with per-library animation mappings Now supports data-driven weapon animation tags from WeaponClassDefinition

Properties ​

AbilityCategorycategoryAbilityCategory.CASTING
Dictionarylibrary_animations{}
Stringfallback_animation""
WeaponAnimationModeweapon_modeWeaponAnimationMode.AUTO_FROM_EQUIPPED
Stringspecific_weapon_type"" # Only used if weapon_mode == SPECIFIC_WEAPON
HandPreferencehand_preferenceHandPreference.AUTO
Stringreference_library""

Methods ​

Stringget_animation_name( context: String = "" )
Stringget_category_name()
boolis_weapon_category()
Stringget_category_display_name()
Stringget_hand_preference_display_name()
Stringget_description()
boolis_valid()
Dictionaryget_animation_path_components()
voidset_library_animation( library_name: String, animation_name: String )
Stringget_library_animation( library_name: String )
boolhas_library_animation( library_name: String )
Array[String]get_mapped_libraries()
AnimationSelectionAbilitycreate_from_category_string( category_string: String ) static
AbilityCategoryget_category_enum_from_string( category_string: String ) static
HandPreferenceget_hand_preference_enum_from_string( hand_string: String ) static
Array[String]get_all_category_names() static
Array[String]get_all_category_display_names() static

Enumerations ​

enum AbilityCategory ​

The options of ability category: casting, spell cast, weapon, aim, reload, special attack.

  • CASTING = 0
  • SPELL_CAST = 1
  • WEAPON = 2
  • AIM = 3
  • RELOAD = 4

enum WeaponAnimationMode ​

The options of weapon animation mode: auto from equipped, specific weapon.

  • AUTO_FROM_EQUIPPED = 0

enum HandPreference ​

The options of hand preference: auto, left hand, right hand, random, alternate.

  • AUTO = 0
  • LEFT_HAND = 1
  • RIGHT_HAND = 2
  • RANDOM = 3

Property descriptions ​

AbilityCategory category = AbilityCategory.CASTING ​

Which kind of animation of the ability (casting, attack ...).

Dictionary library_animations = ​

Per-library animation mappings for non-weapon categories Format: {"LibraryName": "AnimationName", "HumanoidMale": "fire_bolt", "HumanoidFemale": "fire_bolt_f"}

String fallback_animation = "" ​

Fallback animation name when library is not found in dictionary

WeaponAnimationMode weapon_mode = WeaponAnimationMode.AUTO_FROM_EQUIPPED ​

Weapon-specific properties (only used for WEAPON, AIM, RELOAD categories)

String specific_weapon_type = "" # Only used if weapon_mode == SPECIFIC_WEAPON ​

Plays the animation of this weapon type instead of the one in hand (empty = the weapon in hand).

HandPreference hand_preference = HandPreference.AUTO ​

Which hand the animation is played with (auto, right, left).

String reference_library = "" ​

Reference library used in editor (for previewing/template)

Method descriptions ​

String get_animation_name( context: String = "" ) ​

Get animation name - context is entity_library_name for non-weapon, weapon_tag for weapon categories For weapon categories with AUTO_FROM_EQUIPPED, the weapon_tag comes from UseStrategy.get_weapon_animation_tag() which reads from WeaponClassDefinition.attack_tag (already includes hand suffix like "_r" or "_l")

String get_category_name() ​

Get category name as string that matches database structure

bool is_weapon_category() ​

Check if this is a weapon-based category (weapon, aim, reload)

String get_category_display_name() ​

Get display name for category (user-friendly)

String get_hand_preference_display_name() ​

Get display name for hand preference (for UI)

String get_description() ​

Get description for display purposes

bool is_valid() ​

Validate that the selection has all required properties set

Dictionary get_animation_path_components() ​

Get appropriate animation path for DatabaseAnimation calls

void set_library_animation( library_name: String, animation_name: String ) ​

Set animation for a specific library

String get_library_animation( library_name: String ) ​

Get animation for a specific library (or empty string if not set)

bool has_library_animation( library_name: String ) ​

Check if a library has an animation mapped

Array[String] get_mapped_libraries() ​

Get all libraries that have animations mapped

AnimationSelectionAbility create_from_category_string( category_string: String ) ​

Static method to create from category string (for dialog)

AbilityCategory get_category_enum_from_string( category_string: String ) ​

Get category enum from string (for dialog use)

HandPreference get_hand_preference_enum_from_string( hand_string: String ) ​

Get hand preference enum from string (for dialog use)

Array[String] get_all_category_names() ​

Get all category names (for UI population)

Array[String] get_all_category_display_names() ​

Get all category display names (for UI population)