EquipmentSlotDefinition ​
Inherits: DatabaseResource < Resource
Enhanced EquipmentSlotDefinition with slot categories for better UI organization
Properties ​
SlotCategory | slot_category | SlotCategory.ARMOR |
int | sort_order | 0 |
Array[int] | allowed_equipment_types | [] |
int | slot_instances | 1 |
float | budget_weight | 1.0 |
int | max_durability | 0 |
float | durability_loss_multiplier | 1.0 |
DurabilityWear | durability_wears_on | DurabilityWear.AUTOMATIC |
bool | is_weapon_slot | false |
GeneralSkeleton.WeaponSlot | mesh_slot | GeneralSkeleton.WeaponSlot.MAIN_HAND |
Methods ​
bool | wears_on_damage_dealt() |
bool | wears_on_damage_taken() |
bool | is_valid() |
Array[Dictionary] | validate() |
String | get_category_name() |
bool | is_category( category: SlotCategory ) |
bool | is_armor_slot() |
bool | is_weapon_slot_category() |
bool | is_accessory_slot() |
int | get_id() |
Texture2D | get_icon() |
bool | can_accept_equipment_type( equipment_type: int ) |
bool | can_equip_item( item: ItemDefinitionEquipment ) |
bool | has_slot_conflicts() |
Array | get_slot_conflicts() |
bool | affects_body_part( body_part: GeneralSkeleton.BodySlot ) |
bool | affects_attachment_point( attachment_point: GeneralSkeleton.AttachmentSlot ) |
bool | is_multi_slot() |
bool | blocks_other_slots() |
Array[SlotCategory] | get_all_categories() static |
String | get_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