Skinner
Based on game build 722832 | Last updated: 2026-04-22
Overview
Skinner manages all visual customization for character entities, including base skins, clothing items across four equipment slots (body, hand, legs, feet), and special states like monkey curse transformations. It coordinates with the AnimState to apply symbol overrides and build swaps, handles skin data loading from prefab definitions, and synchronizes appearance across the network. This component is essential for any player or skinnable NPC entity.
Usage example
local inst = CreateEntity()
inst:AddComponent("skinner")
-- Set base skin
inst.components.skinner:SetSkinName("wilson_default", false, false)
-- Equip clothing items
inst.components.skinner:SetClothing("winter_hat")
inst.components.skinner:SetClothing("winter_coat")
-- Check current appearance
local clothing = inst.components.skinner:GetClothing()
print(clothing.body) -- prints equipped body clothing name
-- Handle monkey curse transformation
inst.components.skinner:SetMonkeyCurse("MONKEY_CURSE_1")
Dependencies & tags
External dependencies:
CLOTHING-- global table containing clothing item definitions and symbol overridesSKIN_TYPES_THAT_RECEIVE_CLOTHING-- list of skin types that can wear clothingTheInventory:CheckClientOwnership()-- validates player ownership of skins/clothingPrefabs-- accesses skin prefab data for skin_data populationAwardPlayerAchievement()-- triggers achievements when equipping clothing
Components used:
beard-- applies matching beard skin whenSetSkinName()is called (ifis_skinnable)AnimState-- applies all skin and clothing symbol overrides viaSetSkinsOnAnim()Network-- replicates skin data to clients viaSetPlayerSkin()
Tags: None identified.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
skin_name | string | "" | The base skin prefab name for this entity. |
clothing | table | {body="", hand="", legs="", feet=""} | Table holding equipped clothing item names per slot. |
skintype | string | "normal_skin" | Current skin mode (e.g., normal_skin, ghost_skin, wimpy_skin). |
monkey_curse | string/nil | nil | Active monkey curse level (MONKEY_CURSE_1/2/3) or nil. |
skin_data | table | {} | Populated from skin prefab's skins table during SetSkinName(). |
base_change_cb | function/nil | nil | Callback fired when base skin changes via SetSkinMode(). |
Main functions
SetSkinsOnAnim(anim_state, prefab, base_skin, clothing_names, monkey_curse, skintype, default_build)
- Description: Static helper function that applies all skin and clothing visual overrides to an
AnimState. Handles symbol overrides, build swaps, cuff sizes, torso tucking, and special cases for Wolfgang forms, Wormwood stages, Wurt powerup, and Wanda age states. - Parameters:
anim_state-- AnimState component to modifyprefab-- string prefab name of the characterbase_skin-- string base skin build nameclothing_names-- table of clothing item names per slotmonkey_curse-- string curse level or nilskintype-- string skin mode identifierdefault_build-- string fallback build name
- Returns: None
- Error states: Errors if
anim_stateis nil or missing required methods (SetSkin,OverrideSkinSymbol, etc.).
HasSpinnableTail()
- Description: Determines if the current skin and clothing configuration supports a spinnable tail animation. Checks base skin (Wortox), clothing overrides, and symbol replacements.
- Parameters: None
- Returns:
trueif tail should spin,falseotherwise. - Error states: None
GetSkinMode()
- Description: Returns the current skin type/mode string.
- Parameters: None
- Returns: String skin mode (e.g.,
"normal_skin","ghost_skin"). - Error states: None
SetSkinMode(skintype, default_build)
- Description: Changes the skin mode and reapplies all visual overrides. Triggers
base_change_cbif set and updates network replication. If skin_data is nil, automatically initializes it by calling SetSkinName() with prefab_none skin. - Parameters:
skintype-- string skin mode (uses currentself.skintypeif nil)default_build-- string fallback build name (optional)
- Returns: None
- Error states: None
SetupNonPlayerData()
- Description: Configures this entity as a non-player character by setting
skin_nameto"NON_PLAYER"and skin mode to"NO_BASE". - Parameters: None
- Returns: None
- Error states: None
IsNonPlayer()
- Description: Checks if this entity is marked as a non-player via
SetupNonPlayerData(). - Parameters: None
- Returns:
trueifskin_name == "NON_PLAYER",falseotherwise. - Error states: None
SetSkinName(skin_name, skip_beard_setup, skip_skins_set)
- Description: Sets the base skin prefab name, populates
skin_datafrom prefab definition, optionally applies matching beard skin, and triggersSetSkinMode(). - Parameters:
skin_name-- string skin prefab name (usesprefab_noneif empty)skip_beard_setup-- boolean to skip beard component skin assignmentskip_skins_set-- boolean to skip callingSetSkinMode()
- Returns: None
- Error states: Prints error if
skin_data.normal_skinis nil after loading (indicates missing skin data).
SetMonkeyCurse(monkey_curse)
- Description: Sets the monkey curse level and reapplies skin mode to update visual overrides (monkey body parts).
- Parameters:
monkey_curse-- string curse level (MONKEY_CURSE_1/2/3) or nil - Returns: None
- Error states: None
GetMonkeyCurse()
- Description: Returns the current monkey curse level.
- Parameters: None
- Returns: String curse level or
nilif no curse active. - Error states: None
ClearMonkeyCurse()
- Description: Removes the monkey curse and reapplies skin mode.
- Parameters: None
- Returns: None
- Error states: None
SetClothing(name)
- Description: Equips a clothing item by determining its slot type from
CLOTHINGdefinition and calling internal setter. - Parameters:
name-- string clothing item prefab name - Returns: None
- Error states: Silently ignores invalid clothing names (fails
IsValidClothing()check).
GetClothing()
- Description: Returns a table containing the base skin name and all equipped clothing slots.
- Parameters: None
- Returns: Table with keys
base,body,hand,legs,feet. - Error states: None
HideAllClothing(anim_state)
- Description: Clears all clothing symbol overrides from the given
AnimStatewithout modifying internal clothing table. - Parameters:
anim_state-- AnimState component to modify - Returns: None
- Error states: Errors if
anim_stateis nil or missingClearOverrideSymbol()method.
ClearAllClothing()
- Description: Removes all equipped clothing items from all slots and reapplies skin mode.
- Parameters: None
- Returns: None
- Error states: None
ClearClothing(type)
- Description: Removes clothing from a specific slot and reapplies skin mode.
- Parameters:
type-- string slot name (body,hand,legs, orfeet) - Returns: None
- Error states: None
CopySkinsFromPlayer(player, nocurses)
- Description: Copies all skin and clothing data from another player entity, including monkey curse state. Used for character selection preview or skin transfer.
- Parameters:
player-- source player entity withskinnercomponentnocurses-- boolean to skip copying monkey curse (default copies curse)
- Returns: None
- Error states: Errors if
playerhas noskinnercomponent orplayer.useridis invalid forAssignItemSkins().
OnSave()
- Description: Returns save data table containing skin name, clothing, monkey curse, and skin mode for persistence.
- Parameters: None
- Returns: Table with keys
skin_name,clothing,monkey_curse,skin_mode. - Error states: None
OnLoad(data)
- Description: Restores skin and clothing data from save. Validates clothing ownership if in-game and user is logged in. Handles
NON_PLAYERskin name special case. - Parameters:
data-- table fromOnSave()containing skin/clothing data - Returns: None
- Error states: May clear clothing slots if
TheInventory:CheckClientOwnership()fails during load (items traded away).
Events & listeners
- Listens to: None identified.
- Pushes:
unequipskinneditem-- fired when clothing is removed from a slot (parameter: clothing name)equipskinneditem-- fired when clothing is equipped to a slot (parameter: clothing name)