WeaponClassDefinition ​
Inherits: DatabaseResource < Resource
WeaponClassDefinition defines weapon classes and their properties. Handles both the mechanical aspects (grip, mesh slots) and combat properties.
Properties ​
int | weapon_type | |
int | animation_profile | 0 |
bool | is_ranged | false |
String | attack_tag | "" |
String | stance_tag | "" |
String | aim_tag | "" |
String | reload_tag | "" |
int | basic_attack_ability_id | 0 |
int | ammo_group | 0 |
Methods ​
WeaponTypeDefinition | get_weapon_type_definition() |
Array[EquipmentSlotDefinition] | get_blocked_equipment_slots() |
bool | has_valid_weapon_type() |
WeaponProfile | get_animation_profile() |
Dictionary | get_animation_tags( left_hand: bool = false ) |
String | get_attack_tag() |
String | get_stance_tag() |
String | get_aim_tag() |
String | get_reload_tag() |
String | get_animation_tag_for_category( category: String ) |
bool | is_valid() |
Array[Dictionary] | validate() |
bool | blocks_equipment_slot( slot: EquipmentSlotDefinition ) |
bool | has_slot_conflicts() |
String | get_weapon_type_name() |
Property descriptions ​
Weapon Mechanics
int weapon_type ​
Weapon type definition resource (handles hand requirements, mesh slots, blocking)
Animation Tags
int animation_profile = 0 ​
The Weapon Profile whose animations this weapon plays (Entity Assets > Weapon Profiles): its attack, stance, block, aim and reload clips. 0 = none: the old tags below are used
bool is_ranged = false ​
Whether this weapon is ranged (enables aim/reload tags). With a weapon profile the profile decides
String attack_tag = "" ​
Animation tag for weapon attacks (e.g., "dagger_stab", "sword_slash", "bow_shoot") The system will append _r or _l suffixes for hand-specific animations
String stance_tag = "" ​
Animation tag for stance/idle with this weapon (e.g., "sword_stance", "bow_stance")
String aim_tag = "" ​
Animation tag for aiming (ranged weapons only, e.g., "bow_aim")
String reload_tag = "" ​
Animation tag for reloading (ranged weapons only, e.g., "crossbow_reload")
Basic Attack
int basic_attack_ability_id = 0 ​
The ability this weapon makes the wielder's basic attack (a bow shoots, a wand zaps). 0 = the weapon does not change the basic attack
Ammo
int ammo_group = 0 ​
The ammo group this weapon shoots (the group of the arrows, bolts or bullets: see GroupDefinition). 0 = any ammo works, or the weapon needs none
Method descriptions ​
WeaponTypeDefinition get_weapon_type_definition() ​
Get the weapon type definition
Array[EquipmentSlotDefinition] get_blocked_equipment_slots() ​
Get blocked equipment slots from weapon type
bool has_valid_weapon_type() ​
Check if weapon type is valid
WeaponProfile get_animation_profile() ​
The Weapon Profile of this weapon class (null when it has none and uses the old tags)
Dictionary get_animation_tags( left_hand: bool = false ) ​
The animation tags of this weapon: the folder of its profile (and the left hand's attack when left_hand), else the old tags. A Dictionary with attack_tag, stance_tag, aim_tag, reload_tag and is_ranged.
String get_attack_tag() ​
Get the attack animation tag for this weapon class Returns empty string if not set
String get_stance_tag() ​
Get the stance animation tag for this weapon class Returns empty string if not set
String get_aim_tag() ​
Get the aim animation tag (only valid for ranged weapons) Returns empty string if not ranged or not set
String get_reload_tag() ​
Get the reload animation tag (only valid for ranged weapons) Returns empty string if not ranged or not set
String get_animation_tag_for_category( category: String ) ​
Get the appropriate animation tag for a given category category should be one of: "attack", "stance", "aim", "reload"
bool is_valid() ​
Is it free of errors?
Array[Dictionary] validate() ​
Checks the settings. Gives the problems found (empty when it is fine).
bool blocks_equipment_slot( slot: EquipmentSlotDefinition ) ​
Check if this weapon type blocks a specific equipment slot
bool has_slot_conflicts() ​
Check if this weapon type has any slot conflicts
String get_weapon_type_name() ​
The name of the weapon type of this class.