Skip to main content

Silk

Based on game build 714014 | Last updated: 2026-03-07

Overview

Silk is a light-weight inventory item used primarily in crafting and as a toy for spiders. It supports stacking and can be upgraded by players with the spiderwhisperer tag (e.g., Webber) to increase trust with spiders. The prefab integrates with multiple core components: stackable, upgrader, tradable, inspectable, and inventoryitem. It is network-aware and pristinely synchronized across clients.

Usage example

-- Spawn a single silk item
local silk = SpawnPrefab("silk")

-- Stack it to the maximum small-item stack size
silk.components.stackable:SetStackSize(TUNING.STACK_SIZE_SMALLITEM)

-- Check if it can be upgraded by a given actor
if silk.components.upgrader.canupgradefn(silk, nil, player) then
silk.components.upgrader:Upgrade(player)
end

Dependencies & tags

Components used: stackable, inspectable, inventoryitem, tradable, upgrader
Tags: Adds cattoy to the prefab.

Properties

PropertyTypeDefault ValueDescription
AnimStateAnimStateManages visual animation state (bank: "silk", build: "silk", default anim: "idle").
pickupsoundstring"cloth"Sound played when the item is picked up.
components.stackable.maxsizenumberTUNING.STACK_SIZE_SMALLITEMMaximum stack size for this item.
components.upgrader.canupgradefnfunctionCanUpgradeFunction that determines whether the item can be upgraded (requires spiderwhisperer tag on actor).
components.upgrader.upgradetypenumberUPGRADETYPES.SPIDERUpgrade category used for compatibility with spider-related upgrade logic.

Main functions

CanUpgrade(inst, target, doer)

  • Description: Static function assigned to upgrader.canupgradefn that determines if an actor can upgrade this item. This is part of the upgrade chain used to build spider trust.
  • Parameters:
    doer (Entity) — The entity attempting the upgrade; must have the "spiderwhisperer" tag.
  • Returns: true if doer:HasTag("spiderwhisperer"), otherwise false.

Events & listeners

None identified.