Skip to content

WeaponClassDefinition ​

Inherits: DatabaseResource < Resource

WeaponClassDefinition defines weapon classes and their properties. Handles both the mechanical aspects (grip, mesh slots) and combat properties.

Properties ​

intweapon_type
intanimation_profile0
boolis_rangedfalse
Stringattack_tag""
Stringstance_tag""
Stringaim_tag""
Stringreload_tag""
intbasic_attack_ability_id0
intammo_group0

Methods ​

WeaponTypeDefinitionget_weapon_type_definition()
Array[EquipmentSlotDefinition]get_blocked_equipment_slots()
boolhas_valid_weapon_type()
WeaponProfileget_animation_profile()
Dictionaryget_animation_tags( left_hand: bool = false )
Stringget_attack_tag()
Stringget_stance_tag()
Stringget_aim_tag()
Stringget_reload_tag()
Stringget_animation_tag_for_category( category: String )
boolis_valid()
Array[Dictionary]validate()
boolblocks_equipment_slot( slot: EquipmentSlotDefinition )
boolhas_slot_conflicts()
Stringget_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.