Equipment Definitions: how they are built ​
The Equipment Definitions chapter explains the editors. In code each is a DatabaseResource in res://src/data/items/<folder>/. Equipment items and the characters hold their ids.
| Label | Class | Database type | Referenced as |
|---|---|---|---|
| Equipment type | EquipmentTypeDefinition | equipment_type | ItemDefinitionEquipment.equipment_type, EquipmentSlotDefinition.allowed_equipment_types |
| Weapon type | WeaponTypeDefinition (extends the equipment type) | weapon_type (a registry of its own) | WeaponClassDefinition.weapon_type, and in equipment_type of a weapon |
| Equipment slot | EquipmentSlotDefinition | equipment_slot | PlayerClassDefinition.locked_equipment_slots, WeaponTypeDefinition.blocks_equipment_slots |
| Armor class | ArmorClassDefinition | armor_class | ItemDefinitionEquipment.armor_class, ProficiencyDefinition.armor_classes |
| Weapon class | WeaponClassDefinition | weapon_class | ItemDefinitionEquipmentWeapon.weapon_class, ProficiencyDefinition.weapon_classes |
| Quality | Quality | quality | ItemDefinition.quality_id |
| Set bonus | SetBonusDefinition | set_bonus | ItemDefinitionEquipment.set_bonus_definition |
| Socket | SocketDefinition | socket | ItemDefinitionEquipment.socket_definitions, ItemDefinitionSocketable.allowed_sockets |
Database.get_equipment_type_resource(id) finds a type in either registry, because a weapon item's equipment_type can be a weapon type.
How a slot takes an item ​
EquipmentSlotDefinition.can_equip_item(item) is true when item.equipment_type is in allowed_equipment_types. An EquipmentSlotInstance (one per slot_instances, locked or not) answers can_accept_item(item_instance), which also needs the item to be equipment. EquipmentInventoryComponent then chooses the slot and handles blocked slots: see Items: how they are built.
Weapons ​
- A weapon class points to a weapon type (
get_weapon_type_definition());get_blocked_equipment_slots()returns the slots of that type'sblocks_equipment_slots.ItemDefinitionEquipmentWeapon.get_weapon_hand_requirement()is2when there are any, else1. - A weapon type has
body_parts_affectedandattachment_points_used(fromEquipmentTypeDefinition) and amesh_slot(GeneralSkeleton.WeaponSlot:MAIN_HANDorOFF_HAND) used to draw the weapon. WeaponClassDefinition.get_animation_tag_for_category("attack"|"stance"|"aim"|"reload")gives the tag; the entity rig appends_ror_l.basic_attack_ability_idreplaces the wielder's basic attack while the weapon is held (EquipmentInventoryComponent._refresh_weapon_basic_attack).ammo_groupis matched against thegroupsof the ammo items.- A class has no requirements of its own. Gating a class by a trained level is a proficiency:
ProficiencyDefinition.requirements_for_item(item)(see Proficiencies).
Sets ​
SetBonusDefinition.set_bonus_effects maps a piece count to an effect id. The items are linked both ways: set_item_ids here and set_bonus_definition on the item (add_set_item links both sides; validate_and_fix_relationships repairs a half link). count_equipped_set_pieces(entity) counts the worn items that name the set. When a piece is equipped or removed, EquipmentInventoryComponent._check_set_bonus_changes compares the count before and after for every piece count of the set and applies or removes exactly the effects whose state changed.
The classes ​
| Class | What it is |
|---|---|
| ArmorClassBonus | One bonus of an armor class, in the way of a set bonus: the effects its wearer gets once enough of the pieces they wear are of the class. |
| ArmorClassDefinition | ArmorClassDefinition defines the kinds of armor (plate, leather, cloth): a name and a color. |
| EquipmentSlotDefinition | Enhanced EquipmentSlotDefinition with slot categories for better UI organization |
| EquipmentTypeDefinition | EquipmentTypeDefinition defines a category of equipment and what mesh slots it affects. |
| Quality | Defines item quality/rarity with display properties Create instances as .tres files for each quality tier |
| QualityRule | A custom rule of a Quality, for what its fields do not cover: "a legendary always has a socket", "an epic gets +1 ability rank". |
| SetBonusDefinition | Clean set bonus system with ID-based lazy loading to prevent circular dependencies |
| SocketDefinition | Custom border colour for ItemSlotUI |
| WeaponClassDefinition | WeaponClassDefinition defines weapon classes and their properties. |
| WeaponTypeDefinition | WeaponTypeDefinition extends EquipmentTypeDefinition to define weapon-specific properties. |