Don't Starve Together

Don't Starve Together

Cosmetic Slots
 This topic has been pinned, so it's probably important
Kyno  [developer] 17 Sep @ 6:41pm
🔧Extra Equip Slots Mod Support
Cosmetic Slots supports other mods that adds new equip slots!

By default the mod only knows about the respective equip slots:
HANDS, BODY, HEAD.

The mod also knows common equip slots from Extra Equip Slots Mod:
AMULET, BACK, BELLY, CROWN, NECK

If your mod adds new equip slots for equippable items that are not listed in here, they will fallback to EQUIPSLOTS.BODY

⚙️ How to add support for your equip slot

Add the following code to your modmain file:
local function MakeVanityItem(inst) local equippable = inst.replica.equippable if equippable ~= nil then local eslot = equippable:EquipSlot() if eslot == EQUIPSLOTS.SLOT then inst:AddTag(TAG) end inst:AddTag("vanity_item") end end AddPrefabPostInitAny(MakeVanityItem) TUNING.EQUIPSLOTS_VANITYSLOTS_INDEX = TUNING.EQUIPSLOTS_VANITYSLOTS_INDEX or {} TUNING.EQUIPSLOTS_VANITYSLOTS_INDEX[SLOT] = SLOTNUMBER

📝 Parameters

TAG (string)
  • The tag will assign your item to their respective slot.
  • Valid tags: vanity_hand | vanity_body | vanity_head

SLOT (EQUIPSLOTS)
  • The name of the equip slot you want to add.

SLOTNUMBER (number)
  • The slot number on the Cosmetic Slots your equip slot will refer to.
  • Valid numbers: 1 = Hands | 2 = Body | 3 = Head

📚 Examples
  • Equip slot for Pillows:
local function MakeVanityItem(inst) local equippable = inst.replica.equippable if equippable ~= nil then local eslot = equippable:EquipSlot() if eslot == EQUIPSLOTS.PILLOW then inst:AddTag("vanity_hand") end inst:AddTag("vanity_item") end end AddPrefabPostInitAny(MakeVanityItem) TUNING.EQUIPSLOTS_VANITYSLOTS_INDEX = TUNING.EQUIPSLOTS_VANITYSLOTS_INDEX or {} TUNING.EQUIPSLOTS_VANITYSLOTS_INDEX[EQUIPSLOTS.PILLOW] = 1
  • Equip slot for Scarfs:
local function MakeVanityItem(inst) local equippable = inst.replica.equippable if equippable ~= nil then local eslot = equippable:EquipSlot() if eslot == EQUIPSLOTS.SCARF then inst:AddTag("vanity_body") end inst:AddTag("vanity_item") end end AddPrefabPostInitAny(MakeVanityItem) TUNING.EQUIPSLOTS_VANITYSLOTS_INDEX = TUNING.EQUIPSLOTS_VANITYSLOTS_INDEX or {} TUNING.EQUIPSLOTS_VANITYSLOTS_INDEX[EQUIPSLOTS.SCARF] = 2
  • Equip slot for Goggles:
local function MakeVanityItem(inst) local equippable = inst.replica.equippable if equippable ~= nil then local eslot = equippable:EquipSlot() if eslot == EQUIPSLOTS.GOGGLES then inst:AddTag("vanity_head") end inst:AddTag("vanity_item") end end AddPrefabPostInitAny(MakeVanityItem) TUNING.EQUIPSLOTS_VANITYSLOTS_INDEX = TUNING.EQUIPSLOTS_VANITYSLOTS_INDEX or {} TUNING.EQUIPSLOTS_VANITYSLOTS_INDEX[EQUIPSLOTS.GOGGLES] = 3

Let me know if you have any questions. Happy modding!
Last edited by Kyno; 17 Sep @ 7:09pm