Wisecracker
Based on game build 722832 | Last updated: 2026-04-17
Overview
Wisecracker is a dialogue management component that listens to various game events and triggers appropriate character announcements. It handles food-related comments, environmental status changes, combat events, and special character interactions. The component integrates with talker to display dialogue and tracks buff states for food and fish effects.
Usage example
local inst = CreateEntity()
inst:AddComponent("wisecracker")
inst:AddComponent("talker")
-- Component automatically listens to events after being added
-- No manual initialization required
-- OnUpdate is called automatically via StartUpdatingComponent
-- Dialogue triggers based on game events like eating, taking damage, etc.
Dependencies & tags
External dependencies:
event_server_data-- loads Quagmire event listeners when game mode matches
Components used:
talker-- displays all character announcements via Say()edible-- checks food health/sanity values and spoilage degradationperishable-- checks food freshness state (fresh, stale, spoiled)eater-- checks strongstomach and healthabsorption propertiesfoodaffinity-- checks prefab affinity for food itemsfoodmemory-- tracks how many times food has been eateninventory-- checks if inventory is fullburnable-- checks if chair is on firesittable-- checks if entity is occupying a chaircookable-- checks if food can be cookedlightwatcher-- tracks time spent in light vs dark
Tags:
fresh-- checked via perishable componentstale-- checked via perishable componentspoiled-- checked via perishable componentmonstermeat-- checked for eater strongstomach exceptionmasterchef-- enables special cooking dialoguemasterfood-- enables tasty food dialoguepreparedfood-- enables prepared food dialogueplayerghost-- suppresses light/dark announcements when ghostsoulstealer-- enables soul-related dialogue (Wortox)dogrider-- enables Woby interaction dialogue (Wagstaff)cave-- world tag (commented out in source)
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
time_in_lightstate | number | 0 | Tracks time spent in current light state. |
inlight | boolean | true | Whether the entity is currently in light. |
foodbuffname | string/nil | nil | Name of the active food buff announcement. |
foodbuffpriority | number/nil | nil | Priority level of the active food buff. |
fishbuffname | string/nil | nil | Name of the active fish buff announcement. |
fishbuffpriority | number/nil | nil | Priority level of the active fish buff. |
Main functions
Wisecracker(inst)
- Description: Constructor that initializes the wisecracker component and registers all event listeners for dialogue triggers. Sets up listeners for eating, combat, environmental changes, and character-specific events.
- Parameters:
self-- the wisecracker component instanceinst-- the entity instance that owns this component
- Returns: Nothing
- Error states: None
OnUpdate(dt)
- Description: Periodic update function that checks light/dark transitions and processes pending food/fish buff announcements. Called automatically via
StartUpdatingComponent. Triggers enter light/dark dialogue and clears buff names after announcement. - Parameters:
dt-- delta time since last update
- Returns: Nothing
- Error states: Errors if entity lacks lightwatcher component (nil dereference on self.inst.LightWatcher — no guard present in source).
Events & listeners
Listens to:
oneat-- triggers food quality announcements (spoiled, painful, fresh, stale, same food repetition)itemranout-- announces when item runs outaccomplishment-- announces accomplishment startaccomplishment_done-- announces accomplishment completionattacked-- announces boomerang self-hitsnared-- announces being trappedrepelled-- announces being repelled (5 second cooldown)insufficientfertilizer-- announces insufficient fertilizerheargrue-- announces Charlie hearingattackedbygrue-- announces Charlie attackresistedgrue-- announces Charlie attack missedthorns-- announces thorns damageburnt-- announces burning damagehungerdelta-- announces hunger threshold crossedghostdelta-- announces ghost drain threshold crossedstartfreezing-- announces freezing startstartoverheating-- announces overheating startinventoryfull-- announces full inventorycoveredinbees-- announces bee attackwormholespit-- announces wormhole teleport (same spot or different)townportalteleport-- announces town portal teleporthuntlosttrail-- announces lost hunt trail (spring or normal)huntbeastnearby-- announces beast nearby during hunthuntstartfork-- announces hunt fork starthuntsuccessfulfork-- announces successful hunt forkhuntwrongfork-- announces wrong hunt forkhuntavoidfork-- announces avoided hunt forklightningdamageavoided-- announces lightning damage avoidedmountwounded-- announces mount low healthpickdiseasing-- announces disease warning on pickdigdiseasing-- announces disease warning on digonpresink-- announces boat sinkingonprefallinvoid-- announces falling into voidon_standing_on_new_leak-- announces boat leakencumberedwalking-- announces encumbered movementhungrybuild-- announces hungry fast buildingtooltooweak-- announces tool too weakweapontooweak-- announces weapon too weaksoulempty-- announces empty soul (Wortox, with inclination variants)soultoofew-- announces too few souls (Wortox, 30 second cooldown, with inclination variants)soultoomany-- announces too many souls (Wortox, 30 second cooldown, with inclination variants)souloverloadwarning-- announces soul overload warningsouloverloadavoided-- announces soul overload avoidedwortox_panflute_playing_active-- announces panflute buff activewortox_panflute_playing_used-- announces panflute buff usedwortox_reviver_failteleport-- announces Wortox reviver teleport failon_halloweenmoonpotion_failed-- announces moon potion failurefoodbuffattached-- tracks food buff name and priorityfoodbuffdetached-- tracks food buff name and priorityfishbuffattached-- tracks fish buff name and priorityfishbuffdetached-- tracks fish buff name and prioritysittableonfire-- announces chair on fire (0.5 second delay)otterboaterosion_begin-- announces otterboat erosion (deepwater or den broken)exit_gelblob-- announces exiting gelblob (1.6 second delay, cancellable)bit_by_shadowthrall_stealth-- announces shadow thrall stealth bite (10 second cooldown, 2+ random second delay)yoth_oncooldown-- announces Yoth on cooldown (10 second cooldown, 2+ random second delay)yoth_oncooldown_cancel-- cancels pending Yoth cooldown announcementtreatwoby-- announces Woby praise (Wagstaff, with cooldowns)praisewoby-- announces Woby praise (Wagstaff, with cooldowns)tellwobysit-- announces Woby sit command (Wagstaff)tellwobyfollow-- announces Woby follow command (Wagstaff)tellwobyforage-- announces Woby forage command (Wagstaff)tellwobywork-- announces Woby work command (Wagstaff)tellwobycourier-- announces Woby courier command (Wagstaff)callwoby-- announces Woby return call (Wagstaff, 0.7 second delay)vault_teleporter_does_nothing-- announces vault teleporter failuresee_lightsout_shadowhand-- announces lights out shadow hand (15 second cooldown)ms_maxclockworks-- announces max clockworks event
Pushes:
- None identified