Skip to content

EquipmentSlotDefinition ​

Inherits: DatabaseResource < Resource

Enhanced EquipmentSlotDefinition with slot categories for better UI organization

Properties ​

SlotCategoryslot_categorySlotCategory.ARMOR
intsort_order0
Array[int]allowed_equipment_types[]
intslot_instances1
floatbudget_weight1.0
intmax_durability0
floatdurability_loss_multiplier1.0
DurabilityWeardurability_wears_onDurabilityWear.AUTOMATIC
boolis_weapon_slotfalse
GeneralSkeleton.WeaponSlotmesh_slotGeneralSkeleton.WeaponSlot.MAIN_HAND

Methods ​

boolwears_on_damage_dealt()
boolwears_on_damage_taken()
boolis_valid()
Array[Dictionary]validate()
Stringget_category_name()
boolis_category( category: SlotCategory )
boolis_armor_slot()
boolis_weapon_slot_category()
boolis_accessory_slot()
intget_id()
Texture2Dget_icon()
boolcan_accept_equipment_type( equipment_type: int )
boolcan_equip_item( item: ItemDefinitionEquipment )
boolhas_slot_conflicts()
Arrayget_slot_conflicts()
boolaffects_body_part( body_part: GeneralSkeleton.BodySlot )
boolaffects_attachment_point( attachment_point: GeneralSkeleton.AttachmentSlot )
boolis_multi_slot()
boolblocks_other_slots()
Array[SlotCategory]get_all_categories() static
Stringget_category_display_name( category: SlotCategory ) static

Enumerations ​

enum SlotCategory ​

The options of slot category: armor, weapon, accessory.

  • ARMOR = 0 - Protective equipment (helmet, chest, boots, etc.)
  • WEAPON = 1 - Weapons (main hand, off hand)
  • ACCESSORY = 2 - Accessories (rings, amulets, trinkets, etc.)

enum DurabilityWear ​

What makes the equipment of a slot wear (when the project uses durability). Automatic: a weapon slot wears when its owner deals damage, any other slot when its owner takes damage.

  • AUTOMATIC = 0 - A weapon slot wears when its owner deals damage, any other slot when its owner takes damage
  • DAMAGE_DEALT = 1 - When the owner deals damage
  • DAMAGE_TAKEN = 2 - When the owner takes damage (a shield in the off hand)
  • BOTH = 3 - Both

Property descriptions ​

Slot Organization

SlotCategory slot_category = SlotCategory.ARMOR ​

Category for UI organization

int sort_order = 0 ​

Order within category for UI sorting

Slot Requirements

Array[int] allowed_equipment_types = [] ​

Which equipment types can be equipped in this slot

int slot_instances = 1 ​

How many instances of this slot type should exist (e.g., 2 for ring slots)

Item Budget

float budget_weight = 1.0 ​

How much of the item budget an item in this slot gets compared with other slots (head 1, ring 0.5, a two-handed weapon slot 2). See ItemBudget

Durability

int max_durability = 0 ​

The durability of the items worn in this slot (0 = the slot never wears: its items have no durability). Used when the project uses durability (Gameplay Config > Durability)

float durability_loss_multiplier = 1.0 ​

How fast the items of this slot wear compared with the others (2 = twice as fast, a shield; 0.5 = half as fast)

DurabilityWear durability_wears_on = DurabilityWear.AUTOMATIC ​

What makes the items of this slot wear

Weapon Support

bool is_weapon_slot = false ​

Whether this slot is for weapons

GeneralSkeleton.WeaponSlot mesh_slot = GeneralSkeleton.WeaponSlot.MAIN_HAND ​

Equipment Type ID -> WeaponSlot mapping for contextual placement (e.g., {12345: MAIN_HAND, 67890: OFF_HAND})

Method descriptions ​

bool wears_on_damage_dealt() ​

Does an item in this slot wear when its owner deals damage?

bool wears_on_damage_taken() ​

Does an item in this slot wear when its owner takes damage?

bool is_valid() ​

Is it free of errors?

Array[Dictionary] validate() ​

Checks the settings. Gives the problems found (empty when it is fine).

String get_category_name() ​

Get the slot category as a string

bool is_category( category: SlotCategory ) ​

Check if this slot is in a specific category

bool is_armor_slot() ​

Check if this slot is armor

bool is_weapon_slot_category() ​

Check if this slot is weapon

bool is_accessory_slot() ​

Check if this slot is accessory

int get_id() ​

Get the unique identifier

Texture2D get_icon() ​

Get icon for this slot

bool can_accept_equipment_type( equipment_type: int ) ​

Check if an equipment type can be equipped to this slot

bool can_equip_item( item: ItemDefinitionEquipment ) ​

Check if a specific equipment item can be equipped to this slot

bool has_slot_conflicts() ​

Check if this slot has any complex conflicts defined

Array get_slot_conflicts() ​

Get all slot conflicts

bool affects_body_part( body_part: GeneralSkeleton.BodySlot ) ​

Does an item in this slot change this part of the body of the model?

bool affects_attachment_point( attachment_point: GeneralSkeleton.AttachmentSlot ) ​

Does an item in this slot use this attachment point of the model?

bool is_multi_slot() ​

Does the entity have more than one slot of this kind?

bool blocks_other_slots() ​

Does a weapon type of this slot block other slots (a two hand weapon blocks the off hand)?

Array[SlotCategory] get_all_categories() ​

Get all possible slot categories

String get_category_display_name( category: SlotCategory ) ​

Get category name from enum value