Hermitcrab
Based on game build 718694 | Last updated: 2026-04-04
Overview
This module defines configuration data and resources for Pearl, a non-player character who lives on a small island and interacts with players through a friendship progression system. The module exports static tables including assets (animation and sound resources), prefabs (related prefab names), SHOP_LEVELS (shop tier identifiers), and TASKS (enumerated task IDs for friendship quests). External systems access this data by importing the module via require().
Players can increase their friendship level by completing tasks such as decorating the island, planting flowers, building furniture, and removing unwanted structures. As friendship levels increase, players unlock shop tiers with new recipes, receive reward bundles containing shells and seasonal items, and gain access to special crafting stations. Actual gameplay logic for task evaluation, state management, and NPC interactions is implemented in separate component and entity scripts.
Usage example
-- Check if Hermit Crab should accept an offered item
local should_accept = inst.components.trader.test(inst, player, item)
-- Complete a friendship task when player builds a chair
inst:PushEvent("CHEVO_makechair", { doer = player })
-- Get current friend level for dialogue selection
local friend_level = inst.components.friendlevels:GetLevel()
local level_string = getgeneralfriendlevel(inst)
-- Enable shop tier when friend level increases
EnableShop(inst, 3)
-- Register Hermit Crab with world message bottle manager
RegisterToBottleManager(inst)
Dependencies & tags
External dependencies:
STRINGS-- Accesses localization strings (HERMITCRAB dialogue, NAMES)TUNING-- Accesses game balance constants (HERMITCRAB timings, insulation thresholds, speeds)TheWorld-- Accesses world state and components (wagpunk_arena_manager, messagebottlemanager, worldmeteorshower)Vector3-- Defines talker colors and offsetsEQUIPSLOTS-- Checks equipment slots (BODY, HANDS)SEASONS-- Checks insulation type (WINTER)SHOP_LEVELS-- Used to index prototyper trees based on shop levelSPECIAL_EVENTS-- Event constant for WINTERS_FEASTIsSpecialEventActive-- Checks if specific event is activeTASKS-- Used as keys for friendlytasks table and reward logicFOODTYPE-- Checks for MEAT foodtypeSpawnPrefab-- Spawns reward items and fishing bobbersCHATPRIORITIES-- Sets chat priority for commentsGetRandomIndexFromString-- Selects random chat indexTALKER_COLOR_LOW-- Used for talker color settingTALKER_COLOR_MED-- Used for talker color settingTALKER_COLOR_HIGH-- Used for talker color settingTALKINGFONT_HERMIT-- Used for talker font settingFOODGROUP-- Used for diet configuration (OMNI)
Components used:
timer-- Methods:TimerExists,SetTimeLeft,StartTimer,GetTimeLeft,StopTimertalker-- Properties:colour,offset,name_colour,chaticon,lineduration,fontsize,font,ontalk; Methods:MakeChatterinventory-- Methods:EquipHasTag,HasItemWithTag,GetEquippedItem,FindItem,GiveItem,DropItem,Equip,Unequip,GetItemSlot,GetItemInSlotlootdropper-- Methods:FlingItemnpc_talker-- Properties:default_chatpriority; Methods:Chatter,resetqueuefriendlevels-- Properties:level,friendlytasks,queuedrewards,specifictaskreward; Methods:CompleteTask,DoRewards,GetLevel,GetMaxLevel,SetDefaultRewards,SetLevelRewards,SetFriendlyTaskscraftingstation-- Methods:LearnItem,KnowsItemprototyper-- Properties:onactivate,onturnon,treesentitytracker-- Methods:TrackEntity,GetEntityweighable(on items) -- Methods:GetWeightPercent,GetWeightinsulator(on items) -- Methods:GetInsulation,GetTypeequippable(on items) -- Properties:equipslot,isequippededible(on items) -- Properties:foodtypecontainer-- Methods:GetItemInSlot,GiveItemhomeseeker-- Properties:homepearldecorationscore(on home) -- Properties:instunwrappable-- Methods:WrapItemsdryingrack-- Methods:GetContainerdryer-- Properties:productpickable-- Methods:IsBarrenlocomotor-- Properties:runspeed,walkspeed; Methods:Clearstuckdetection-- Methods:Reset,SetTimeToStuckoceanfishingrod(on items) -- Checked via component existencehealth-- Methods:IsDeadinventoryitem-- Methods:IsHeldBybuilder-- Methods:KnowsRecipepointofinterest-- Methods:SetHeighteater-- Methods:SetDiet,SetCanEatHorrible,SetCanEatRaw,SetStrongStomachtrader-- Methods:SetAcceptTest,SetOnAccept; Properties:onrefuse,deleteitemonacceptteleportedoverride-- Methods:SetDestPositionFninspectable-- Properties:getstatusleader-- Methods:SetForceLeashpetleash-- Methods:SetMaxPetssg-- Methods:HasStateTag
Tags:
highfriendlevel-- add/checkoceanfish-- checkumbrella-- checkmapscroll-- checkuncomfortable_chair-- checkirreplaceable-- removehermitcrab_lure_marker-- addplanted-- checkcharacter-- addtrader-- addhermitcrab-- addNOBLOCK-- addNOCLICK-- addhermitcrab_marker-- addignorewalkableplatforms-- addignorewalkableplatformdrowning-- addhermitcrab_marker_fishing-- add
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
| None | No properties are defined. |
Main functions
Events & listeners
Listens to:
home_upgraded-- Triggers friendship task completion when the house is upgradedCHEVO_growfrombutterfly-- Checks for flower planting task completionCHEVO_makechair-- Checks for chair crafting task completion and gives blueprintsCHEVO_starteddrying-- Checks for meat rack drying task completionCHEVO_fertilized-- Checks for berry bush planting task completionCHEVO_heavyobject_winched-- Checks for junk removal task completionCHEVO_lureplantdied-- Checks for lureplant removal task completionfriend_level_changed-- Updates world meteor shower odds based on friend levelpearldecorationscore_evaluatescores-- Triggers decoration comments based on score evaluationms_hermitcrab_relocated-- Resets decoration comment tracking on relocationtimerdone-- Stops fishing when the fishing timer completesnewfishingtarget-- Sets hookfish flag when a fish is targetedtalkercolordirty-- Updates talker color on clientfriend_task_complete-- Handles friend task completionenterlimbo-- Stops timers and resets stateexitlimbo-- Restarts timers and talker queueonsatinchair-- Completes chair making taskdancingplayer-- Handles player dancing event from worldmoonfissurevent-- Handles moon fissure event from worldonremove-- Clears marker reference when marker is removedclocksegschanged-- Updates clock segments datateleport_move-- Removes comment datateleported-- Removes comment dataadopted_critter-- Triggers OnAdoptCrittercritter_doemote-- Triggers OnCritterEmotenewstate-- Triggers OnNewState
Pushes:
use_pocket_scale-- Pushed when a fish is weighed in OnAcceptItemeat_food-- Pushed when food is eaten in OnAcceptItemdance-- Pushed when a player dances nearby and friendship is highenter_teashop-- Pushed when the Hermit Crab enters the tea shopms_register_hermitcrab-- Registers hermit crab instance with worldms_register_pearl_entity-- Registers pearl entity with worldms_register_hermitcrab_marker-- Registers hermit crab marker with world