Prefab Skins Data
Version History
Build Version | Change Date | Change Type | Description |
---|---|---|---|
676312 | 2025-06-25 | modified | Added berrybush_waxed and dug_berrybush_waxed skin mappings |
676042 | 2025-06-21 | stable | Previous version |
Overview
The prefabskins
module contains the auto-generated PREFAB_SKINS
table that maps base prefab names to their available skin variations. This file is generated by export_accountitems.lua
and provides the complete database of skin relationships used by the game's cosmetic system.
Generated Content
PREFAB_SKINS
Type: table
Status: stable
Description: A lookup table mapping base prefab names to arrays of their available skin prefab names. The table is automatically generated and should not be manually edited.
Structure:
PREFAB_SKINS = {
[base_prefab_name] = {
"skin_prefab_name_1",
"skin_prefab_name_2",
-- ... additional skin variations
},
-- ... all skinnable prefabs
}
Example Usage:
-- Get all skins for a specific prefab
local wilson_skins = PREFAB_SKINS["wilson"]
if wilson_skins then
for i, skin_name in ipairs(wilson_skins) do
print("Wilson skin:", skin_name)
end
end
-- Check if a prefab has skins
local function HasSkins(prefab_name)
return PREFAB_SKINS[prefab_name] ~= nil
end
-- Count available skins
local function GetSkinCount(prefab_name)
local skins = PREFAB_SKINS[prefab_name]
return skins and #skins or 0
end
print("Backpack has", GetSkinCount("backpack"), "skin variations")
Skin Categories
The skin system covers various categories of game objects:
Character Skins
Character skins often include variations for both the character and their starting items:
-- Abigail (Wendy's ghost companion)
PREFAB_SKINS.abigail = {
"abigail_ancient",
"abigail_creepy",
"abigail_formal",
"abigail_funeral",
"abigail_gladiator",
"abigail_handmedown",
"abigail_ice",
"abigail_lunar",
"abigail_lureplant",
"abigail_magma",
"abigail_masquerade",
"abigail_nature",
"abigail_rose",
"abigail_shadow",
"abigail_survivor",
"abigail_victorian",
"abigail_yule",
}
-- Matching skins for Abigail's flower
PREFAB_SKINS.abigail_flower = {
"abigail_flower_ancient",
"abigail_flower_creepy",
-- ... (matching variations)
}
Equipment Skins
Tools, weapons, and armor have extensive skin collections:
-- Backpack variations
PREFAB_SKINS.backpack = {
"backpack_babybeef",
"backpack_basic_blue_catcoon",
"backpack_basic_green_olive",
"backpack_bat",
"backpack_beefalo",
"backpack_buckle_grey_pewter",
"backpack_buckle_navy_phthalo",
"backpack_buckle_red_rook",
"backpack_camping_green_viridian",
"backpack_camping_orange_carrot",
"backpack_camping_red_koalefant",
"backpack_carrat",
"backpack_catcoon",
"backpack_chester",
"backpack_crab",
"backpack_deerclops",
"backpack_dragonfly_fire",
-- ... additional variations
}
-- Weapon skins
PREFAB_SKINS.axe = {
"axe_feathered",
"axe_invisible",
"axe_northern",
"axe_victorian",
}
Structure Skins
Buildings and structures can have themed variations:
-- Chest variations
PREFAB_SKINS.treasurechest = {
"treasurechest_catcoon",
"treasurechest_garden",
"treasurechest_goodness",
"treasurechest_goth",
"treasurechest_kitchen",
"treasurechest_mystical",
-- ... more themes
}
-- Beehive themed skins
PREFAB_SKINS.beebox = {
"beebox_crystal",
"beebox_garden",
"beebox_house",
"beebox_victorian",
}
Special Item Skins
Unique items and consumables:
-- Books with alternate covers
PREFAB_SKINS.book_brimstone = {
"book_brimstone_gilded",
}
PREFAB_SKINS.book_sleep = {
"book_sleep_magazine",
}
-- Wrapped bundles with different patterns
PREFAB_SKINS.bundle = {
"bundle_cawnival",
"bundle_gothic",
"bundle_kitchen",
"bundle_mystical",
"bundle_vintage",
}
Skin Naming Conventions
Prefab-Based Naming
Most skins follow the pattern: {base_prefab}_{theme}
-- Base prefab: "backpack"
"backpack_chester" -- Chester-themed backpack
"backpack_royal" -- Royal-themed backpack
"backpack_pirate" -- Pirate-themed backpack
Item Variants
Some skins have additional suffixes for different states:
-- Boat skins with item variants
PREFAB_SKINS.boat = {
"boat_nautical",
"boat_pirate_skin",
"boat_wagstaff",
}
PREFAB_SKINS.boat_item = {
"boat_nautical_item",
"boat_pirate_skin_item",
"boat_wagstaff_item",
}
Character Equipment Sets
Character-specific items often share theme naming:
-- Bernie (Willow's teddy bear) in different states
PREFAB_SKINS.bernie_inactive = {
"bernie_cat",
"bernie_dog",
}
PREFAB_SKINS.bernie_active = {
"bernie_cat_active",
"bernie_dog_active",
}
PREFAB_SKINS.bernie_big = {
"bernie_cat_big",
"bernie_dog_big",
"bernie_cat_lunar_build",
"bernie_dog_lunar_build",
-- ... additional variations
}
Usage in Game Systems
Automatic Dependency Management
The prefab system automatically adds skin dependencies:
-- When creating a prefab, skins are automatically added as dependencies
local wilson_prefab = Prefab("wilson", wilson_fn, assets)
-- wilson_prefab.deps now includes all Wilson skins from PREFAB_SKINS["wilson"]
Skin Selection and Application
-- Get random skin for a prefab
local function GetRandomSkin(prefab_name)
local skins = PREFAB_SKINS[prefab_name]
if skins and #skins > 0 then
return skins[math.random(#skins)]
end
return nil
end
-- Apply random skin to an item
local function ApplyRandomSkin(inst)
local skin = GetRandomSkin(inst.prefab)
if skin and inst.SetSkin then
inst:SetSkin(skin)
end
end
Skin Validation
-- Check if a skin exists for a prefab
local function IsValidSkin(prefab_name, skin_name)
local skins = PREFAB_SKINS[prefab_name]
if not skins then
return false
end
for i, available_skin in ipairs(skins) do
if available_skin == skin_name then
return true
end
end
return false
end
-- Validate skin before applying
local function SafeSetSkin(inst, skin_name)
if IsValidSkin(inst.prefab, skin_name) then
inst:SetSkin(skin_name)
return true
end
return false
end
Development Tools
Skin Discovery
-- Find all prefabs with skins
local function GetSkinnablePrefabs()
local skinnable = {}
for prefab_name, skins in pairs(PREFAB_SKINS) do
table.insert(skinnable, {
prefab = prefab_name,
count = #skins
})
end
-- Sort by skin count
table.sort(skinnable, function(a, b)
return a.count > b.count
end)
return skinnable
end
-- Find skins matching a pattern
local function FindSkinsMatching(pattern)
local matches = {}
for prefab_name, skins in pairs(PREFAB_SKINS) do
for i, skin_name in ipairs(skins) do
if string.find(skin_name, pattern) then
table.insert(matches, {
prefab = prefab_name,
skin = skin_name
})
end
end
end
return matches
end
-- Find all Victorian-themed skins
local victorian_skins = FindSkinsMatching("victorian")
Statistics and Analysis
-- Count total skins in the game
local function CountTotalSkins()
local total = 0
for prefab_name, skins in pairs(PREFAB_SKINS) do
total = total + #skins
end
return total
end
-- Find most popular skin themes
local function GetSkinThemes()
local themes = {}
for prefab_name, skins in pairs(PREFAB_SKINS) do
for i, skin_name in ipairs(skins) do
-- Extract theme from skin name (after last underscore)
local theme = skin_name:match("_([^_]+)$")
if theme then
themes[theme] = (themes[theme] or 0) + 1
end
end
end
return themes
end
print("Total skins in game:", CountTotalSkins())
Current Statistics
Based on build version 676042:
- Skinnable Prefabs: 200+ different base prefabs
- Total Skins: 2,000+ individual skin variations
- Most Skinned Items: Backpacks, chests, weapons, and character accessories
- Popular Themes: Victorian, Gothic, Mystical, Garden, Pirate, Royal
Important Notes
Auto-Generated Content
- Do not manually edit - Changes will be overwritten
- Generated by:
export_accountitems.lua
script - Updates: Automatically with each game build and DLC releases
Skin Availability
- Not all skins may be available to all players
- Some skins are event-limited or require special unlocks
- The table shows all possible skins, not player inventory
Performance Considerations
- Large table loaded at startup
- Consider caching frequently accessed skin lists
- Use existence checks before attempting skin application
Related Modules
- Prefab Skin: Skin application and management system
- Skin Assets: Asset management for cosmetic items
- Prefabs: Core prefab system with automatic skin integration
- Account Items: Player skin unlocks and inventory